/* ─── ECO ERP — Ana Stil ────────────────────────────────────────────────────── */

:root {
    --navy:       #1B2380;
    --navy-dark:  #141a63;
    --navy-light: #2a3499;
    --cyan:       #00AEEF;
    --cyan-dark:  #0090c8;
    --cyan-light: #e8f7fd;
    --bg:         #f0f2f7;
    --card-bg:    #ffffff;
    --sidebar-w:  240px;
    --topbar-h:   60px;
    --text:       #1e2535;
    --muted:      #6b7280;
    --border:     #e5e7eb;
    --success:    #16a34a;
    --warning:    #d97706;
    --danger:     #dc2626;
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.layout-wrapper { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width .25s ease;
    z-index: 100;
}

.sidebar.collapsed { width: 62px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-footer { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .brand-logo { margin: 0 auto; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    min-height: 70px;
}

.brand-logo {
    width: 36px; height: 36px;
    background: var(--cyan);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 11px; color: var(--navy);
    flex-shrink: 0;
    letter-spacing: -.5px;
}

.brand-title { color: #fff; font-size: 15px; font-weight: 700; line-height: 1.2; }
.brand-sub { color: rgba(255,255,255,.5); font-size: 10px; }

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
}

.nav-label {
    color: rgba(255,255,255,.35);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    padding: 14px 16px 4px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav li .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.sidebar-nav li .nav-link i { width: 18px; text-align: center; flex-shrink: 0; font-size: 15px; }
.sidebar-nav li .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav li .nav-link.active {
    background: var(--cyan);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 4px 0 0 rgba(255,255,255,.5);
}

.sidebar-footer {
    padding: 14px 16px;
    color: rgba(255,255,255,.3);
    font-size: 11px;
    border-top: 1px solid rgba(255,255,255,.1);
    white-space: nowrap;
    overflow: hidden;
}

/* ─── Main Area ──────────────────────────────────────────────────────────────── */
.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-area.expanded { margin-left: 0; }

/* ─── Topbar ─────────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.btn-toggle-sidebar {
    background: none; border: none;
    color: var(--navy); font-size: 18px;
    cursor: pointer; padding: 6px;
    border-radius: 6px;
    transition: background .15s;
}
.btn-toggle-sidebar:hover { background: var(--bg); }

.topbar-title h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.topbar-right { margin-left: auto; }

.date-badge {
    background: var(--cyan-light);
    color: var(--cyan-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ─── Flash ──────────────────────────────────────────────────────────────────── */
.flash-area { padding: 12px 24px 0; }

.eco-alert {
    border-radius: 10px;
    border: none;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

/* ─── Page Content ───────────────────────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ─── Eco Card ───────────────────────────────────────────────────────────────── */
.eco-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    overflow: hidden;
}

.eco-card__header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    color: var(--navy);
    background: #fafbfc;
    display: flex;
    align-items: center;
}

.eco-card__body { padding: 20px; }

/* ─── Stat Cards ─────────────────────────────────────────────────────────────── */
.stat-card {
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: none;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
}

.stat-card__icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-card__value { font-size: 20px; font-weight: 700; line-height: 1.1; }
.stat-card__label { font-size: 12px; opacity: .85; margin-top: 2px; }

.stat-card--blue   { background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-dark) 100%); }
.stat-card--green  { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.stat-card--orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-card--navy   { background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-dark) 100%); }
.stat-card--red    { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn-eco {
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 20px;
    transition: background .15s;
}
.btn-eco:hover { background: var(--navy-dark); color: #fff; }

.btn-eco-green {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 20px;
}
.btn-eco-green:hover { background: #15803d; color: #fff; }

.btn-eco-outline {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--navy);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 20px;
    transition: all .15s;
}
.btn-eco-outline:hover { background: var(--navy); color: #fff; }

.btn-eco-excel {
    background: #1a7340;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 20px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background .15s;
}
.btn-eco-excel:hover { background: #145e33; color: #fff; }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.eco-table { font-size: 13.5px; }
.eco-table thead { background: #f5f7fb; }
.eco-table thead th {
    color: var(--navy);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--border);
    padding: 10px 14px;
    white-space: nowrap;
}
.eco-table tbody tr { transition: background .1s; }
.eco-table tbody tr:hover { background: #f8faff; }
.eco-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.eco-table tbody tr:last-child td { border-bottom: none; }

.table-navy-footer { background: #f0f3ff !important; }
.table-navy-footer td { color: var(--navy); font-weight: 600; border-top: 2px solid var(--navy) !important; }

.row-warning { background: #fffbeb !important; }

.yil-separator td { height: 4px; background: var(--border); padding: 0 !important; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge-amount {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.badge-amount--green { background: #dcfce7; color: #15803d; }
.badge-amount--orange { background: #fef3c7; color: #b45309; }

.donem-badge {
    background: var(--cyan-light);
    color: var(--cyan-dark);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.yil-badge {
    background: var(--navy);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.currency-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}
.currency-badge--eur { background: #eff6ff; color: #1d4ed8; }
.currency-badge--usd { background: #f0fdf4; color: #15803d; }
.currency-badge--gbp { background: #fdf4ff; color: #7e22ce; }
.currency-badge--chf { background: #fff1f2; color: #be123c; }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.eco-modal-header {
    background: var(--navy);
    color: #fff;
    border-radius: 0;
}
.eco-modal-header .modal-title { color: #fff; font-size: 15px; }

/* ─── Big Number ─────────────────────────────────────────────────────────────── */
.big-number { font-size: 28px; font-weight: 800; }

/* ─── Misc ───────────────────────────────────────────────────────────────────── */
.text-navy { color: var(--navy) !important; }
.text-cyan  { color: var(--cyan) !important; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}
.empty-state i { font-size: 48px; opacity: .3; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 14px; margin: 0; }

.empty-state-sm {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
}

.alert-info-eco {
    background: var(--cyan-light);
    border: 1px solid #b3e4f8;
    border-radius: 8px;
    color: #0369a1;
    font-size: 13px;
    padding: 10px 14px;
}

.yil-check-label {
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
}

/* ─── Nav Tabs (Rapor sayfası) ───────────────────────────────────────────────── */
.eco-card__header .nav-tabs {
    border-bottom: none;
    gap: 4px;
}
.eco-card__header .nav-tabs .nav-link {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    background: transparent;
}
.eco-card__header .nav-tabs .nav-link:hover { background: #f0f2f7; color: var(--navy); }
.eco-card__header .nav-tabs .nav-link.active {
    background: var(--navy);
    color: #fff;
}

/* ─── Firma Tip Badges ───────────────────────────────────────────────────────── */
.badge-tip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.badge-tip--musteri   { background: #dcfce7; color: #15803d; }
.badge-tip--tedarikci { background: #fef3c7; color: #b45309; }

/* ─── Hedefler Sayfası ───────────────────────────────────────────────────────── */
.hedef-ring-wrap { display: flex; justify-content: center; align-items: center; }

.hedef-mini-card {
    border-radius: 10px;
    padding: 14px 16px;
    color: #fff;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.hedef-mini-label { font-size: 11px; opacity: .85; margin-bottom: 4px; }
.hedef-mini-val   { font-size: 18px; font-weight: 800; line-height: 1.1; }
.hedef-mini-sub   { font-size: 11px; opacity: .7; margin-top: 3px; }

.hedef-mini-card--navy   { background: linear-gradient(135deg, var(--navy-light), var(--navy-dark)); }
.hedef-mini-card--cyan   { background: linear-gradient(135deg, var(--cyan), var(--cyan-dark)); }
.hedef-mini-card--green  { background: linear-gradient(135deg, #22c55e, #15803d); }
.hedef-mini-card--orange { background: linear-gradient(135deg, #f59e0b, #d97706); }

.ay-progress-card {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

/* ─── Ürün Sistemi ───────────────────────────────────────────────────────────── */
.urun-satir { transition: background .15s; }
.urun-satir:hover { background: #f8f9fa; }
.urun-satir:last-child { border-bottom: none !important; }

/* CSS custom properties için eco renk sınıfları */
:root {
    --eco-navy: #1B2380;
    --eco-cyan: #00AEEF;
}

.bg-eco-subtle        { background-color: #e8eaf6; }
.text-eco-emphasis    { color: #1B2380; }

/* Fiyat geçmişi paneli */
#fiyatGecmisiKart .table th { font-size: 11px; text-transform: uppercase; color: var(--muted); }
#fiyatGecmisiKart .table td { vertical-align: middle; }

/* Fatura detay toplam satırı */
tfoot tr.fw-bold td { border-top: 2px solid var(--border); background: #f8f9fa; }

/* ─── Stok Uyarı Renkleri ────────────────────────────────────────────────────── */
.stok-kritik  { background: #fef2f2; border-left: 3px solid #dc2626; }
.stok-dusuk   { background: #fffbeb; border-left: 3px solid #d97706; }
.stok-normal  { background: #f0fdf4; }
.stok-badge-kritik  { background:#fecaca; color:#991b1b; }
.stok-badge-dusuk   { background:#fed7aa; color:#92400e; }
.stok-badge-normal  { background:#bbf7d0; color:#14532d; }
.stok-badge-sifir   { background:#fee2e2; color:#7f1d1d; }

/* ─── Teklif Durum Renkleri ──────────────────────────────────────────────────── */
.badge.bg-dark { color: #fff !important; }

/* ─── Print Stilleri ─────────────────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .btn, .flash-area,
    #fiyatGecmisiKart, form[id], .eco-card__header .d-flex > a,
    .eco-card__header .d-flex > button { display: none !important; }
    .main-area  { margin-left: 0 !important; }
    .page-content { padding: 10px !important; }
    .eco-card   { box-shadow: none !important; border: 1px solid #ccc !important; page-break-inside: avoid; }
    body        { background: white !important; font-size: 13px; }
    .eco-card__header { background: #1B2380 !important; color: white !important; print-color-adjust: exact; }
    tfoot tr.fw-bold { border-top: 2px solid #333 !important; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .page-content { padding: 14px; }
    .stat-card__value { font-size: 16px; }
    .sidebar { position: fixed; left: -var(--sidebar-w); }
    .sidebar.collapsed { width: var(--sidebar-w); left: 0; }
}
