/* ============================================================
   B2BStore – Kurumsal B2B Panel Stilleri
   Bootstrap 5 üzerine özelleştirilmiş
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Değişkenler ─────────────────────────────────────────── */
:root {
    --primary:       #b91c1c;
    --primary-dark:  #7f1d1d;
    --primary-light: #dc2626;
    --accent:        #334155;
    --accent-dark:   #1e293b;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --info:          #3b82f6;
    --bg:            #f0f2f7;
    --card-bg:       #ffffff;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --sidebar-w:     260px;
}

/* ── Genel ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background:  var(--bg);
    color:       var(--text);
    margin:      0;
    font-size:   14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

/* ── Sidebar Layout ──────────────────────────────────────── */
.b2b-sidebar {
    position:   fixed;
    left:       0; top: 0; bottom: 0;
    width:      var(--sidebar-w);
    background: var(--primary);
    display:    flex;
    flex-direction: column;
    z-index:    1000;
    overflow-y: auto;
}

.b2b-sidebar .sidebar-brand {
    padding:     1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.b2b-sidebar .sidebar-brand h4 {
    color:       #fff;
    font-weight: 700;
    margin:      0;
    font-size:   1.1rem;
    letter-spacing: .5px;
}

.b2b-sidebar .sidebar-brand small {
    color:     rgba(255,255,255,0.5);
    font-size: .75rem;
}

.b2b-sidebar .sidebar-user {
    padding:    1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.b2b-sidebar .sidebar-user .avatar {
    width:           38px; height: 38px;
    border-radius:   50%;
    background:      var(--accent);
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    font-weight:     700;
    color:           #fff;
    font-size:       .85rem;
    margin-right:    .6rem;
    flex-shrink: 0;
}

.b2b-sidebar .sidebar-user span {
    color:       rgba(255,255,255,0.85);
    font-size:   .85rem;
    font-weight: 500;
}

.b2b-sidebar nav { flex: 1; padding: .75rem 0; }

.b2b-sidebar nav .nav-section {
    padding:    .4rem 1.25rem .2rem;
    font-size:  .7rem;
    font-weight:600;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:      rgba(255,255,255,0.35);
    margin-top: .5rem;
}

.b2b-sidebar nav a {
    display:    flex;
    align-items:center;
    gap:        .65rem;
    padding:    .6rem 1.25rem;
    color:      rgba(255,255,255,0.75);
    font-size:  .875rem;
    transition: all .15s;
    border-left:3px solid transparent;
}

.b2b-sidebar nav a:hover,
.b2b-sidebar nav a.active {
    color:        #fff;
    background:   rgba(255,255,255,0.08);
    border-color: var(--accent);
}

.b2b-sidebar nav a i { font-size:.95rem; width:18px; text-align:center; }

.b2b-sidebar .sidebar-footer {
    padding:      1rem 1.25rem;
    border-top:   1px solid rgba(255,255,255,0.1);
}

.b2b-sidebar .sidebar-footer a {
    color:      rgba(255,255,255,0.5);
    font-size:  .8rem;
    display:    flex;
    align-items:center;
    gap:        .5rem;
}

.b2b-sidebar .sidebar-footer a:hover { color:#fff; }

/* ── Ana içerik alanı ────────────────────────────────────── */
.b2b-main {
    margin-left: var(--sidebar-w);
    min-height:  100vh;
    display:     flex;
    flex-direction: column;
}

.b2b-topbar {
    background:   var(--card-bg);
    border-bottom:1px solid var(--border);
    padding:      .75rem 1.5rem;
    display:      flex;
    align-items:  center;
    justify-content:space-between;
    position:     sticky;
    top:          0;
    z-index:      900;
}

.b2b-topbar .page-title {
    font-size:  1rem;
    font-weight:600;
    color:      var(--text);
    margin:     0;
}

.b2b-content { padding: 1.5rem; flex: 1; }

/* ── Kartlar ─────────────────────────────────────────────── */
.b2b-card {
    background:    var(--card-bg);
    border:        1px solid var(--border);
    border-radius: 10px;
    box-shadow:    0 1px 3px rgba(0,0,0,.06);
    padding:       1.25rem;
    margin-bottom: 1.25rem;
}

.b2b-card .card-header-row {
    display:       flex;
    align-items:   center;
    justify-content:space-between;
    margin-bottom: 1rem;
    padding-bottom:.75rem;
    border-bottom: 1px solid var(--border);
}

.b2b-card .card-header-row h5 {
    margin:      0;
    font-size:   .9rem;
    font-weight: 600;
}

/* ── Stat kartları ───────────────────────────────────────── */
.stat-card {
    background:    var(--card-bg);
    border:        1px solid var(--border);
    border-radius: 10px;
    padding:       1.25rem;
    display:       flex;
    align-items:   center;
    gap:           1rem;
    box-shadow:    0 1px 3px rgba(0,0,0,.05);
    transition:    transform .15s, box-shadow .15s;
    margin-bottom: 1rem;
}

.stat-card:hover {
    transform:  translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.stat-icon {
    width:           50px; height: 50px;
    border-radius:   10px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       1.4rem;
    flex-shrink:     0;
}

.stat-icon.bg-primary-soft { background: rgba(26,43,74,.12); color: var(--primary); }
.stat-icon.bg-accent-soft  { background: rgba(249,115,22,.12);color: var(--accent); }
.stat-icon.bg-success-soft { background: rgba(16,185,129,.12); color: var(--success);}
.stat-icon.bg-warning-soft { background: rgba(245,158,11,.12); color: var(--warning);}
.stat-icon.bg-info-soft    { background: rgba(59,130,246,.12); color: var(--info);   }

.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top:.15rem; }

/* ── Tablo ───────────────────────────────────────────────── */
.b2b-table { width: 100%; border-collapse: collapse; }
.b2b-table th {
    background:   #f8fafc;
    border-bottom:2px solid var(--border);
    padding:      .7rem .9rem;
    font-size:    .78rem;
    font-weight:  600;
    text-transform:uppercase;
    letter-spacing:.05em;
    color:        var(--text-muted);
    white-space:  nowrap;
}
.b2b-table td {
    padding:      .75rem .9rem;
    border-bottom:1px solid var(--border);
    font-size:    .875rem;
    vertical-align:middle;
}
.b2b-table tr:hover td { background: #fafbfd; }
.b2b-table tr:last-child td { border-bottom: none; }

/* ── Badge ───────────────────────────────────────────────── */
.badge {
    display:       inline-flex;
    align-items:   center;
    gap:           .3rem;
    padding:       .25em .7em;
    font-size:     .75rem;
    font-weight:   600;
    border-radius: 20px;
}
.badge-warning   { background:#fef3c7; color:#92400e; }
.badge-success   { background:#d1fae5; color:#065f46; }
.badge-danger    { background:#fee2e2; color:#991b1b; }
.badge-info      { background:#dbeafe; color:#1e40af; }
.badge-secondary { background:#f1f5f9; color:#64748b; }

/* ── Butonlar ────────────────────────────────────────────── */
.btn-b2b {
    display:     inline-flex;
    align-items: center;
    gap:         .4rem;
    padding:     .45rem .9rem;
    border:      none;
    border-radius:6px;
    font-size:   .85rem;
    font-weight: 500;
    cursor:      pointer;
    transition:  all .15s;
    text-decoration:none;
}
.btn-b2b:hover { opacity: .9; }
.btn-primary-b2b { background:var(--primary); color:#fff; }
.btn-accent-b2b  { background:var(--accent);  color:#fff; }
.btn-success-b2b { background:var(--success); color:#fff; }
.btn-danger-b2b  { background:var(--danger);  color:#fff; }
.btn-light-b2b   { background:#f1f5f9; color:var(--text); }

/* ── Login sayfası ───────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    display:    flex;
    align-items:center;
    justify-content:center;
}
.login-card {
    background:    #fff;
    border-radius: 14px;
    padding:       2.5rem;
    width:         100%;
    max-width:     420px;
    box-shadow:    0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align:center; margin-bottom:2rem; }
.login-logo h2 { color:var(--primary); font-weight:700; }
.login-logo small { color:var(--text-muted); }

/* ── Login form kontrolleri ──────────────────────────────── */
.form-label-b2b { font-size:.8rem; font-weight:600; color:var(--text-muted); margin-bottom:.35rem; display:block; }
.form-control-b2b {
    width:       100%;
    padding:     .7rem .95rem;
    border:      1px solid var(--border);
    border-radius:8px;
    font-size:   .9rem;
    background:  #f8fafc;
    transition:  all .2s ease;
    outline:     none;
    color:       var(--text);
}
.form-control-b2b:focus { border-color: var(--primary); background:#fff; box-shadow:0 0 0 3px rgba(185,28,28,.1); }

/* ── Ürün kartları ───────────────────────────────────────── */
.product-card {
    background:    #fff;
    border:        1px solid var(--border);
    border-radius: 12px;
    overflow:      hidden;
    transition:    transform .15s, box-shadow .15s;
    height:        100%;
    display:       flex;
    flex-direction:column;
}
.product-card:hover {
    transform:  translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.product-card .product-img {
    height:     180px;
    background: #f8f9fa;
    display:    flex;
    align-items:center;
    justify-content:center;
    overflow:   hidden;
}
.product-card .product-img img   { width:100%; height:100%; object-fit:cover; }
.product-card .product-img .no-img { color:#ccc; font-size:3rem; }
.product-card .product-body { padding:1rem; flex:1; display:flex; flex-direction:column; }
.product-card .product-name { font-weight:600; font-size:.9rem; margin-bottom:.4rem; color:var(--text); }
.product-card .product-code { font-size:.75rem; color:var(--text-muted); }
.product-card .product-price { font-size:1.1rem; font-weight:700; color:var(--accent); margin:.5rem 0; }
.product-card .product-stock { font-size:.78rem; color:var(--success); }
.product-card .product-stock.low { color:var(--danger); }
.product-card .product-footer { padding:.75rem 1rem; border-top:1px solid var(--border); }

/* ── Alert mesajları ─────────────────────────────────────── */
.b2b-alert {
    padding:       .85rem 1.1rem;
    border-radius: 8px;
    font-size:     .875rem;
    display:       flex;
    align-items:   center;
    gap:           .6rem;
    margin-bottom: 1rem;
}
.b2b-alert-success { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.b2b-alert-error   { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.b2b-alert-warning { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }
.b2b-alert-info    { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }

/* ── Ekstre ──────────────────────────────────────────────── */
.statement-debit  { color: var(--danger);  font-weight:500; }
.statement-credit { color: var(--success); font-weight:500; }
.statement-balance{ font-weight:600; }
.statement-balance.negative { color:var(--danger); }
.statement-balance.positive { color:var(--success); }

/* ── Siparis durumu renkleri ─────────────────────────────── */
.status-pending      { color: var(--warning); }
.status-approved     { color: var(--success); }
.status-rejected     { color: var(--danger);  }
.status-transferred  { color: var(--info);    }
.status-transfererror{ color: var(--danger);  }

/* ── Responsive & Mobile ─────────────────────────────────── */

/* Hamburger & Overlay */
.sidebar-toggle {
    display:      none;
    background:   none;
    border:       none;
    font-size:    1.3rem;
    color:        var(--text);
    cursor:       pointer;
    padding:      .3rem .5rem;
    border-radius:6px;
    line-height:  1;
}
.sidebar-overlay {
    display:    none;
    position:   fixed;
    inset:      0;
    background: rgba(0,0,0,.45);
    z-index:    999;
}
.sidebar-overlay.active { display: block; }

/* Buton outline varyantı */
.btn-outline-b2b {
    background:  transparent;
    border:      1px solid var(--border);
    color:       var(--text);
}
.btn-outline-b2b:hover { background: #f1f5f9; }

/* ── Tablet (≤992px) ─────────────────────────────────────── */
@media (max-width: 992px) {
    .stat-value { font-size: 1.3rem; }
}

/* ── Mobil (≤768px) ──────────────────────────────────────── */
@media (max-width: 768px) {

    /* Sidebar gizli, Bottom Nav kullanılacak */
    .b2b-sidebar {
        display: none !important;
    }
    .b2b-sidebar.open { display: none !important; }
    .b2b-main { margin-left: 0; padding-bottom: 75px; } /* Bottom Nav boşluğu */
    .sidebar-toggle { display: none !important; }

    /* Topbar */
    .b2b-topbar { padding: .6rem 1rem; }

    /* İçerik alanı */
    .b2b-content { padding: 1rem .75rem; }

    /* Kartlar */
    .b2b-card { padding: 1rem; }
    .b2b-card .card-header-row { flex-wrap: wrap; gap: .5rem; }

    /* Stat kartları — 2 sütun */
    .stat-card { padding: .85rem 1rem; }
    .stat-value { font-size: 1.2rem; }
    .stat-icon  { width: 42px; height: 42px; font-size: 1.1rem; }

    /* Tablo — yatay kaydırma */
    .table-responsive-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .b2b-table th, .b2b-table td { padding: .55rem .65rem; font-size: .8rem; }

    /* Form kontrolleri */
    .form-control-b2b { font-size: .875rem; padding: .55rem .75rem; }

    /* Butonlar */
    .btn-b2b { font-size: .8rem; padding: .4rem .75rem; }
    .btn-b2b.w-100 { width: 100%; justify-content: center; }

    /* Ürün grid — 2 sütun mobil */
    .col-xl-3, .col-lg-4 { flex: 0 0 50%; max-width: 50%; }
    .product-card .product-img { height: 130px; }
    .product-card .product-price { font-size: .95rem; }

    /* Sipariş detay — kartlar alt alta */
    .order-detail-grid { flex-direction: column; }

    /* Row gap'leri */
    .row.g-3 { --bs-gutter-x: .75rem; }

    /* Login */
    .login-card { padding: 1.75rem 1.25rem; margin: 1rem; }

    /* Ekstre tablo — kritik sütunlar */
    .statement-hide-mobile { display: none; }

    /* Page header */
    .page-header { flex-wrap: wrap; }
}

/* ── Küçük Mobil (≤480px) ────────────────────────────────── */
@media (max-width: 480px) {
    /* Ürün grid — 1 sütun */
    .col-xl-3, .col-lg-4, .col-sm-6 { flex: 0 0 100%; max-width: 100%; }
    .stat-value { font-size: 1.1rem; }
}

/* ── MOBİL ALT MENÜ (BOTTOM NAVBAR) ─────────────────────── */
.b2b-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    z-index: 2000;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
    padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 768px) {
    .b2b-bottom-nav { display: block; }
}
.b2b-bottom-nav .bn-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    padding: 0 0.5rem;
    margin: 0;
    list-style: none;
}
.b2b-bottom-nav .bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    width: 20%;
    gap: 0.2rem;
    transition: all 0.2s;
}
.b2b-bottom-nav .bn-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}
.b2b-bottom-nav .bn-item.active {
    color: var(--primary);
}
.b2b-bottom-nav .bn-item:hover { color: var(--primary); }
.b2b-bottom-nav .bn-center-item-wrapper {
    width: 20%;
    display: flex;
    justify-content: center;
}
.b2b-bottom-nav .bn-center-item {
    position: relative;
    top: -20px;
    width: 58px;
    height: 58px;
    background: var(--primary);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.4);
    font-size: 1.4rem;
    text-decoration: none;
}
.b2b-bottom-nav .bn-center-item:hover { transform: scale(1.05); color:#fff; }
.b2b-bottom-nav .bn-center-item-wrapper span {
    position: absolute;
    bottom: 5px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── TOPLINE (Kurlar & Duyurular) ────────────────────────── */
.b2b-topline {
    background: var(--accent-dark);
    color:      #fff;
    height:     34px;
    display:    flex;
    align-items:center;
    overflow:   hidden;
    position:   fixed;
    top:        0;
    left:       0;
    right:      0;
    z-index:    2100;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.topline-marquee {
    white-space: nowrap;
    display:    inline-block;
    padding-left: 100%;
    animation:  marquee-topline 25s linear infinite;
    font-size:  .85rem;
}

.topline-marquee:hover {
    animation-play-state: paused;
}

@keyframes marquee-topline {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Sadece topline varsa kaydırma yap */
body.with-topline .b2b-sidebar { top: 34px !important; }
body.with-topline .b2b-topbar  { top: 34px !important; }
body.with-topline .b2b-main    { margin-top: 34px; }
body.with-topline .shop-header { top: 34px !important; }

@media (max-width: 768px) {
    body.with-topline .b2b-main { margin-top: 34px; }
}

