/* ═══════════════════════════════════════════════════════════════════════════
   POLIPEDIA ATM — ORTAK TASARIM
   Eski tek dosyalik panelin (polipedia_acente_takip.html) gorunumu, aynen.
   Renkler, olculer ve sinif adlari birebir korunmustur; boylece sayfalar
   yavas yavas bu ortak siniflara tasinabilir.
   Bootstrap KULLANILMIYOR — App.razor'dan cikarildi.
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
    /* Polipedia kurumsal palet — mor + lacivert agirlikli, teal/turuncu/pembe vurgu */
    --bg: #f4f2f7;
    --card: #fff;
    --border: #e7e2ee;
    --text: #212a35;
    --muted: #6b6478;
    --light: #a59fb0;
    --primary: #6a2473;
    --primary-light: #f3eaf6;
    --navy: #212a35;
    --success: #2f8f85;
    --success-light: #e7f4f2;
    --warning: #c97d1c;
    --warning-light: #faf0e1;
    --danger: #cf3f63;
    --danger-light: #fbeaf0;
    --orange: #e9617b;
    --orange-light: #fdedf1;
    --brand-teal: #34a49a;
    --brand-darkteal: #2c5055;
    --brand-orange: #f5a150;
    --brand-pink: #e9617b;
    --brand-purple: #6a2473;
    --brand-grad: linear-gradient(90deg,#34a49a,#2c5055,#6a2473,#e9617b,#f5a150);
    --sidebar-w: 220px;
    --radius: 10px;
    --radius-card: 18px;
    --shadow: 0 2px 12px rgba(33,42,53,.05),0 1px 3px rgba(33,42,53,.03);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}

a { color: var(--primary); }

/* ── UYGULAMA KABUGU ───────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

/* ── Ortam seridi ────────────────────────────────────────────
   Yalnizca ayarlarda "Ortam:Ad" tanimliysa cizilir (bkz. MainLayout).
   Canlida bu anahtar yoktur, dolayisiyla serit de yoktur.
   Ekranin en ustunde sabit durur; sayfa kaydirilsa da gorunur kalir ki
   "hangi veritabanindayim" sorusu her an cevapli olsun. */
.ortam-serit {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    display: flex; align-items: center; gap: 10px;
    height: 34px; padding: 0 16px;
    background: repeating-linear-gradient(135deg, #fde68a 0 14px, #fcd34d 14px 28px);
    border-bottom: 1px solid #d9a441;
    color: #6b4708; font-size: 12.5px; letter-spacing: .04em;
}
.ortam-serit strong { font-weight: 800; }
.ortam-nokta {
    width: 9px; height: 9px; border-radius: 50%;
    background: #b45309; box-shadow: 0 0 0 3px rgba(180,83,9,.22);
}
.ortam-not { color: #7c5310; letter-spacing: 0; }

/* Serit varken icerik altina kaysin, menuyu ve basligi ortmesin.
   Sol menu "position: fixed" oldugu icin onu ayrica asagi almak gerekiyor;
   yalnizca .shell'e bosluk vermek ona islemez. */
.shell.ortam-var { padding-top: 34px; }
.shell.ortam-var aside { top: 34px; }

@media print { .ortam-serit { display: none; } }

/* ── SOL MENU ──────────────────────────────────────────────────────────── */
aside {
    width: var(--sidebar-w);
    background: linear-gradient(180deg,#212a35 0%,#251f33 60%,#2a1f3a 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    border-right: 1px solid rgba(106,36,115,.25);
}

aside::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--brand-grad);
    z-index: 2;
}

.s-logo { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.06); position: relative; }

.s-logo::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 2px;
    background: var(--brand-grad);
    opacity: .85;
}

.s-logo img { max-width: 100%; height: auto; }
.s-logo img.brand-full { display: block; width: 100%; max-width: 172px; }
.s-logo img.brand-mark { display: none; width: 34px; height: 34px; margin: 0 auto; }

.s-date { font-size: 10px; color: #475569; padding: 10px 18px; border-bottom: 1px solid rgba(255,255,255,.04); }

.s-user {
    padding: 10px 18px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    display: flex;
    align-items: center;
    gap: 8px;
}

.s-user .av {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg,#6a2473,#34a49a);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}

.s-user .u-wrap { flex: 1; overflow: hidden; min-width: 0; }
.s-user .uname { font-size: 11px; font-weight: 600; color: #cbd5e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-user .umail { font-size: 9px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.s-user form { display: flex; }

.s-user .logout-btn {
    background: none; border: none; cursor: pointer;
    color: #475569; font-size: 14px; padding: 2px;
    border-radius: 4px; transition: color .15s;
    font-family: inherit; line-height: 1;
}

.s-user .logout-btn:hover { color: #f87171; }

nav { padding: 12px 10px; flex: 1; display: flex; flex-direction: column; gap: 2px; }

nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: 7px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px; font-weight: 500;
    transition: all .15s;
    border: none; background: none;
    width: 100%; text-align: left;
    text-decoration: none;
}

nav a:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
nav a.active { background: linear-gradient(90deg,#6a2473,#7d2a87); color: #fff; box-shadow: 0 2px 8px rgba(106,36,115,.4); }
nav a .icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.s-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.05); font-size: 10px; color: #334155; }

/* ── ANA ALAN ──────────────────────────────────────────────────────────── */
main {
    margin-left: var(--sidebar-w);
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    min-height: 100vh;
}

.page-hdr {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 54px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}

.page-hdr h1 { font-size: 15px; font-weight: 600; }
.page-hdr .bc { font-size: 11px; color: var(--muted); margin-top: 1px; }
.content { padding: 22px 24px; flex: 1; min-width: 0; max-width: 100%; }

/* ── KPI KUTULARI ──────────────────────────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }

.kpi {
    background: #fff;
    border-radius: var(--radius-card);
    padding: 16px 18px 16px 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}

.kpi::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; }
.kpi.blue::after { background: var(--primary); }
.kpi.green::after { background: var(--success); }
.kpi.yellow::after { background: var(--warning); }
.kpi.red::after { background: var(--danger); }
.kpi.orange::after { background: var(--orange); }
.kpi-row.k5 { grid-template-columns: repeat(5,1fr); }
.kpi-row.k3 { grid-template-columns: repeat(3,1fr); }
.kpi-row.k2 { grid-template-columns: repeat(2,1fr); }
.kpi .kl { font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.kpi .kv { font-size: 30px; font-weight: 700; line-height: 1; }
.kpi .kv.para { font-size: 20px; }
.kpi .kv.metin { font-size: 14px; line-height: 1.35; font-weight: 600; }
.kpi.blue .kv { color: var(--primary); }
.kpi.green .kv { color: var(--success); }
.kpi.yellow .kv { color: var(--warning); }
.kpi.red .kv { color: var(--danger); }
.kpi.orange .kv { color: var(--orange); }
.kpi .ks { font-size: 10px; color: var(--light); margin-top: 6px; }

.prog { height: 4px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.prog-fill { height: 100%; border-radius: 4px; background: #16a34a; }
.prog-fill.turuncu { background: var(--orange); }

/* ── DIKEY CUBUK GRAFIK (Aylik / Son 10 gun) ───────────────────────────── */
.barchart { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding: 8px 0 0; }
.bc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.bc-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bc-bar { width: 70%; max-width: 40px; background: linear-gradient(180deg,#8a3a93,#6a2473); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; transition: opacity .15s; }
.bc-bar.eksi { background: linear-gradient(180deg,#e0708c,#cf3f63); }
.bc-bar:hover { opacity: .8; }
.bc-bar .bc-val { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.bc-lbl { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; }
.bc-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--light); font-size: 12px; }

/* ── YATAY CUBUK GRAFIK (Uretim analizi > Cubuk) ───────────────────────── */
.hbar-wrap { padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 130px; align-items: center; gap: 10px; }
.hbar-label { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: #eef0f4; border-radius: 5px; height: 18px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 5px; min-width: 2px; background: linear-gradient(90deg,#6a2473,#8a3a93); transition: width .3s; }
.hbar-fill.eksi { background: var(--danger); }
.hbar-val { font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

/* ── PASTA GRAFIK (Uretim analizi > Pasta) ─────────────────────────────── */
.pie-wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; padding: 18px 16px; }
.pie {
    width: 190px; height: 190px; border-radius: 50%; flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(33,42,53,.06);
    display: flex; align-items: center; justify-content: center;
}
.pie-orta {
    width: 92px; height: 92px; border-radius: 50%;
    background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; text-align: center;
    box-shadow: 0 1px 4px rgba(33,42,53,.10);
}
.pie-orta small { font-size: 10px; color: var(--muted); }
.pie-orta b { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.pie-legend { display: flex; flex-direction: column; gap: 7px; min-width: 240px; flex: 1; }
.pie-item { display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 9px; font-size: 11px; }
.pie-dot { width: 10px; height: 10px; border-radius: 3px; }
.pie-ad { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pie-tutar { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pie-pay { color: var(--light); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 48px; text-align: right; }

/* ── KARTLAR ───────────────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card + .card { margin-top: 16px; }

.card-hdr {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
}

.card-hdr h3 { font-size: 13px; font-weight: 600; }
.card-body { padding: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }

.sep { display: flex; align-items: center; gap: 8px; margin: 18px 0 14px; }
.sep span { font-size: 12px; font-weight: 600; white-space: nowrap; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── TABLOLAR ──────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead tr { background: linear-gradient(180deg,#f6f2fa 0%,#efe8f5 100%); }

th {
    padding: 11px 12px;
    text-align: left;
    font-size: 10px; font-weight: 700;
    color: #6a2473;
    text-transform: uppercase;
    letter-spacing: .7px;
    border-bottom: 2px solid #e2d6ee;
    white-space: nowrap;
}

td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
/* Dogrudan cocuk (>) secici: bir satirin icinde acilan detay tablosu
   varken dis satirin hover'i ic tablonun butun hucrelerini de boyuyordu. */
tbody tr:hover > td { background: #f8fafc; }

th.r, td.r { text-align: right; }
th.c, td.c { text-align: center; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--primary); }
th.sortable .sort-ind { display: inline-block; margin-left: 3px; font-size: 9px; color: #b9a7c4; letter-spacing: 0; }
th.sort-active, th.sort-active .sort-ind { color: var(--primary); }

.copyable { cursor: pointer; transition: color .12s; }
.copyable:hover { color: var(--primary); text-decoration: underline; }

/* ── ROZETLER ──────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 20px;
    font-size: 10px; font-weight: 600; white-space: nowrap;
}

.b-green { background: var(--success-light); color: var(--success); }
.b-blue { background: var(--primary-light); color: var(--primary); }
.b-yellow { background: var(--warning-light); color: var(--warning); }
.b-red { background: var(--danger-light); color: var(--danger); }
.b-orange { background: var(--orange-light); color: var(--orange); }
.b-gray { background: #f1f5f9; color: var(--muted); }

/* ── KONTROLLER ────────────────────────────────────────────────────────── */
.controls { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }

.srch {
    flex: 1; min-width: 180px;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12px; font-family: inherit;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 10px center;
    outline: none; color: var(--text);
}

.sel {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12px; font-family: inherit;
    background: #fff; color: var(--text);
    outline: none; cursor: pointer;
}

.srch:focus, .sel:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(106,36,115,.1); }

.btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 12px; font-weight: 600; font-family: inherit;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all .15s; white-space: nowrap;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(106,36,115,.22); }
.btn-primary:hover { background: #561d5e; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b23353; }
.btn-sm { padding: 5px 12px; font-size: 11px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.chip { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; font-size: 11px; color: var(--muted); font-weight: 500; }

/* ── SUZGEC SATIRI (Ay kutusu + Bolge cipleri) ─────────────────────────── */
.suzgec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.suzgec-etiket { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.suzgec .sel { max-width: 190px; }
.cip-grup { display: flex; gap: 6px; flex-wrap: wrap; }
.cip-dugme {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    font-size: 11px; font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
}
.cip-dugme:hover { border-color: var(--primary); color: var(--primary); }
.cip-dugme.secili { background: var(--primary); border-color: var(--primary); color: #fff; }
.cip-dugme.secili:hover { color: #fff; }

/* ── KURAL / BILGI SATIRI ──────────────────────────────────────────────── */
.rule { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); margin-bottom: 6px; font-size: 12px; line-height: 1.5; }
.rule:last-child { margin-bottom: 0; }
.rule .ri { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ── AVATAR ────────────────────────────────────────────────────────────── */
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.av-b { background: var(--primary-light); color: var(--primary); }
.av-g { background: var(--success-light); color: var(--success); }

/* ── KAYIT GERI BILDIRIMI ──────────────────────────────────────────────── */
@keyframes savedFlash {
    0% { box-shadow: 0 0 0 3px rgba(47,143,133,.45); }
    100% { box-shadow: 0 0 0 0 rgba(47,143,133,0); }
}

.saved-flash { animation: savedFlash .7s ease-out; }

/* ── PENCERE (modal) ───────────────────────────────────────────────────── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: 18px; width: 680px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(33,42,53,.22); }
.modal-h { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-h h3 { font-size: 15px; font-weight: 600; }
.modal-x { width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--border); background: none; cursor: pointer; color: var(--muted); font-size: 14px; display: flex; align-items: center; justify-content: center; }
.modal-x:hover { background: var(--bg); }
.modal-b { padding: 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── FORM ──────────────────────────────────────────────────────────────── */
.fg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg.full { grid-column: span 2; }
.fg label { font-size: 11px; font-weight: 600; color: var(--muted); }

.fg input, .fg select, .fg textarea,
input.alan, select.alan, textarea.alan {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12px; font-family: inherit;
    color: var(--text); background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.fg input:focus, .fg select:focus, .fg textarea:focus,
input.alan:focus, select.alan:focus, textarea.alan:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(106,36,115,.1);
}

.fg textarea { resize: vertical; min-height: 64px; }

/* ── YUKLENIYOR ────────────────────────────────────────────────────────── */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row td { text-align: center; padding: 32px; color: var(--muted); }

/* ── BOS DURUM ─────────────────────────────────────────────────────────── */
.empty-s { text-align: center; padding: 40px 20px; color: var(--light); }
.empty-s .big { font-size: 32px; margin-bottom: 8px; }
.empty-s p { font-size: 12px; }

/* ── ALT SEKMELER ──────────────────────────────────────────────────────── */
.usub-tabs { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 4px; }
.usub { padding: 6px 14px; border: none; background: none; border-radius: 6px; font-size: 12px; font-weight: 600; font-family: inherit; color: var(--muted); cursor: pointer; transition: all .15s; }
.usub:hover { background: var(--bg); color: var(--text); }
.usub.active { background: var(--primary); color: #fff; }

.seg-kutu { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-toggle { display: inline-flex; gap: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.seg { padding: 5px 11px; border: none; background: none; border-radius: 6px; font-size: 11px; font-weight: 600; font-family: inherit; color: var(--muted); cursor: pointer; transition: all .15s; white-space: nowrap; }
.seg:hover { color: var(--text); }
.seg.active { background: var(--primary); color: #fff; }

/* ── ACILIR SATIR (drill-down) ─────────────────────────────────────────── */
.exp-row { cursor: pointer; }
.exp-row:hover td { background: #f1f5f9; }
.exp-caret { display: inline-block; transition: transform .15s; color: var(--light); margin-right: 6px; font-size: 9px; }
.exp-caret.open { transform: rotate(90deg); color: var(--primary); }
.detay-cell { padding: 0 !important; background: #fafbfc; border-bottom: 2px solid var(--border) !important; }
.detay-inner { padding: 10px 16px 12px 34px; }
.detay-inner table { font-size: 11px; border: 1px solid #ece5f2; border-radius: 8px; overflow: hidden; }
.detay-inner thead tr { background: #efe9f4; }
.detay-inner th { font-size: 9px; padding: 7px 10px; letter-spacing: .5px; border-bottom: 1px solid #e2d6ee; }
.detay-inner td { padding: 7px 10px; }

/* ── DIP TOPLAM SATIRI ─────────────────────────────────────────────────── */
tfoot td { font-weight: 700; background: #2a1f3a; color: #fff; padding: 10px 12px; border-bottom: none; }

/* ── GIRIS EKRANI ──────────────────────────────────────────────────────── */
.giris-ekran {
    position: fixed; inset: 0; z-index: 1000;
    background: linear-gradient(135deg,#212a35 0%,#3a2350 55%,#6a2473 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.login-box {
    position: relative; overflow: hidden;
    background: #fff; border-radius: 18px;
    padding: 40px 36px;
    width: 380px; max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--brand-grad); }
.login-mark { display: block; width: 54px; height: 54px; margin: 0 auto 14px; }
.login-brand { display: block; width: 100%; max-width: 210px; height: auto; margin: 0 auto 14px; }
.login-logo { font-family: 'Fredoka','Inter',sans-serif; font-size: 30px; font-weight: 600; color: var(--navy); margin-bottom: 2px; letter-spacing: .3px; line-height: 1; text-align: center; }
.login-logo span { color: var(--primary); }
.login-atm { font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 2px; letter-spacing: .2px; text-align: center; }
.login-sub { font-size: 12px; color: var(--muted); margin-bottom: 24px; text-align: center; }

.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }

.login-field input {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 10px;
    font-size: 13px; font-family: inherit; outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(106,36,115,.12); }

.login-remember { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.login-remember input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.login-remember span { line-height: 1; }

.login-btn {
    width: 100%; padding: 11px;
    background: var(--primary); color: #fff;
    border: none; border-radius: 8px;
    font-size: 13px; font-weight: 600; font-family: inherit;
    cursor: pointer; margin-top: 6px;
    transition: background .15s;
}

.login-btn:hover { background: #561d5e; }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }

.login-error {
    background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
    border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 12px;
}

.login-foot { margin: 18px 0 0; font-size: 11px; color: var(--light); text-align: center; }

/* ── DOGRULAMA MESAJLARI ───────────────────────────────────────────────── */
.validation-message { display: block; color: var(--danger); font-size: 11px; margin-top: 4px; }
.validation-errors { list-style: none; color: var(--danger); font-size: 11px; }

/* ── BLAZOR HATA CUBUGU ────────────────────────────────────────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd; color: #664d03;
    bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: 10px 14px; position: fixed;
    width: 100%; z-index: 1500; font-size: 12px;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }

.blazor-error-boundary {
    background: var(--danger-light); color: var(--danger);
    padding: 14px 16px; border-radius: 10px; margin: 14px 0;
    font-size: 12px;
}

/* ── KAYDIRMA CUBUGU ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SAYFA GOVDELERI — Acenteler / Barem / Muhasebe / Rapor Yukle /
                     Kullanicilar / Kurallar sayfalarinin ortak parcalari.
   (Eskiden her sayfanin kendi <style> blogu veya satir-ici stilleri vardi.)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── SAYFA GIRIS PARAGRAFI ─────────────────────────────────────────────── */
p.giris {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
    max-width: 880px;
    margin-bottom: 12px;
}

p.giris strong { color: var(--text); font-weight: 600; }

/* SQL ipucu / kucuk dipnot */
.ipucu { font-size: 11px; color: var(--light); margin-top: 14px; line-height: 1.9; }
.detay-not { font-size: 11px; color: var(--light); margin-top: 8px; line-height: 1.6; }
.tablo-alt-not { font-size: 10px; color: var(--light); padding: 8px 16px; margin: 0; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 5px;
    color: var(--primary);
}

/* ── UYARI KUTULARI ────────────────────────────────────────────────────── */
.uyari {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.uyari-basari { background: var(--success-light); border-color: #c4e5e0; color: #256e66; }
.uyari-hata { background: var(--danger-light); border-color: #f2c9d5; color: #a8304f; }
.uyari-dikkat { background: var(--warning-light); border-color: #eddfc0; color: #a3620f; }
.uyari-bilgi { background: var(--primary-light); border-color: #e0cdea; color: var(--primary); }

/* ── KART (kullanicilar / kurallar sayfalari) ──────────────────────────── */
.kart {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 18px;
}

.kart-baslik { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.kart-baslik h2 { font-size: 13px; font-weight: 600; margin: 0; }
.kart-not { font-size: 11px; color: var(--muted); }

.tablo { width: 100%; }
.tablo-dar { width: auto; }

/* Basliktan siralama: tiklanabilir baslik hucresi. */
.th-sec {
    cursor: pointer; user-select: none; white-space: nowrap;
    transition: color .12s;
}
.th-sec:hover { color: var(--primary); }
.th-sec-acik { color: var(--primary); }
.satir { cursor: pointer; }
.acik-satir > td { background: #fafbfc; border-bottom: 2px solid var(--border); }
.pasif td { opacity: .5; }
.soluk { color: var(--light); font-size: 11px; }
.oran { font-weight: 700; color: var(--success); }
.duzen-blok { display: flex; gap: 36px; flex-wrap: wrap; }

.alt-baslik {
    font-size: 10px; font-weight: 700;
    color: var(--primary);
    text-transform: uppercase; letter-spacing: .7px;
    margin-bottom: 7px;
}

.sira { font-size: 12px; color: var(--text); line-height: 1.95; margin: 0 0 10px; padding-left: 20px; }

/* ── ETIKET (kucuk rozet) ──────────────────────────────────────────────── */
.etiket {
    display: inline-block;
    background: #f1f5f9; color: var(--muted);
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 10px; font-weight: 600;
    margin-right: 5px;
}

.etiket-mavi { background: var(--primary-light); color: var(--primary); }
.etiket-yesil { background: var(--success-light); color: var(--success); }
.etiket-gri { background: #f1f5f9; color: var(--muted); }

/* ── FORM PARCALARI ────────────────────────────────────────────────────── */
.alan { min-width: 150px; }
.alan-genis { min-width: 280px; }
.alan-dar { min-width: 0; width: 130px; }
.alan-mini { padding: 5px 8px; font-size: 11px; }

/* Kurallar > net prim araligi: "alt sinir – ust sinir" iki kutu yan yana.
   Soldaki salt okunur; bir onceki araligin bittigi yerden kendiliginden dolar. */
.aralik-kutu { display: flex; align-items: center; gap: 8px; }
.aralik-tire { color: var(--light); font-weight: 600; }
.aralik-alt  { background: var(--bg); color: var(--muted); cursor: default; }
.alan-sag { text-align: right; }
.alan-kutu { display: flex; flex-direction: column; gap: 4px; }
.etiket-metin { font-size: 11px; color: var(--muted); font-weight: 600; }
.form-satir { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; align-items: flex-end; }

.not-kutu {
    font-size: 11px; color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    max-width: 620px;
    line-height: 1.6;
}

.ayar-kutu {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

input[type=checkbox] { accent-color: var(--primary); cursor: pointer; }

.onay {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--muted);
    cursor: pointer; user-select: none; white-space: nowrap;
}

.kutucuklar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }

.kutucuk {
    display: flex; align-items: flex-start; gap: 7px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 12px; cursor: pointer;
    min-width: 190px;
    transition: border-color .15s;
}

.kutucuk:hover { border-color: var(--primary); }
.kutucuk small { display: block; color: var(--light); font-size: 10px; margin-top: 2px; }

/* Kucuk bolum kutucugu (rol yetki panelinde) */
.kutucuk.kutucuk-mini { min-width: 0; padding: 4px 9px; border-radius: 8px; font-size: 11px; align-items: center; }

/* ── ROL YETKI PANELI (Kullanicilar sayfasi) ──────────────────────────── */
.yetki-satir {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
}
.yetki-satir:last-of-type { border-bottom: none; }
.yetki-sayfa { min-width: 220px; display: flex; flex-direction: column; gap: 1px; }
.yetki-sayfa small { color: var(--muted); font-size: 10px; }
.yetki-bolumler { display: flex; flex-wrap: wrap; gap: 6px; }
.yetki-not { margin: 10px 0 12px; font-size: 11px; }
.w150 { width: 150px; min-width: 0; }

/* ── DUGME (.btn ile ayni dil, sayfa ici kisa hali) ────────────────────── */
.dugme {
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff; color: var(--text);
    font-size: 11px; font-weight: 600; font-family: inherit;
    cursor: pointer; margin-right: 6px;
    transition: all .15s; white-space: nowrap;
}

.dugme:hover { background: var(--bg); }
.dugme:disabled { opacity: .55; cursor: not-allowed; }
.dugme-mavi { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(106,36,115,.22); }
.dugme-mavi:hover { background: #561d5e; }
.dugme-kirmizi { color: var(--danger); border-color: #f2c9d5; background: #fff; }
.dugme-kirmizi:hover { background: var(--danger-light); }

/* ── SATIR ICI BAGLANTI DUGMESI (acilir satir basligi) ─────────────────── */
.link-btn {
    background: none; border: none; padding: 0;
    font: inherit; font-weight: 700;
    color: var(--primary);
    cursor: pointer; text-align: left;
}

.link-btn.ince { font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* ── TUTAR RENKLERI ────────────────────────────────────────────────────── */
.tut-yesil { color: var(--success); font-weight: 700; }
.tut-mor { color: var(--primary); font-weight: 700; }
.tut-kirmizi { color: var(--danger); font-weight: 700; }
.tut-turuncu { color: var(--warning); }

/* Dip toplam satiri koyu zeminli oldugu icin renkler acik tonda */
tfoot td.yesil { color: #7fd3c8; }
tfoot td.mor { color: #d9b8e3; }
tfoot td.kirmizi { color: #ff9db4; }

/* Elle sabitlenmis deger (turuncu cerceve) */
.elle { border-color: var(--warning) !important; background: #fffdf7; }

/* Ortalanmis kisa bilgi ekrani (yetki yok / kontrol ediliyor) */
.orta-bilgi { padding: 48px 24px; text-align: center; color: var(--muted); }
.orta-bilgi h1 { font-size: 18px; margin: 0 0 8px; color: var(--text); }
.orta-bilgi p { margin: 0 auto; font-size: 12px; max-width: 420px; line-height: 1.7; }

/* ── KUCUK YARDIMCILAR ─────────────────────────────────────────────────── */
.ml6 { margin-left: 6px; }
.ml14 { margin-left: 14px; }
/* Muhasebe aylik dokumunde odeme kutusu + "Tumu" kisayolu yan yana. */
.odeme-hucre { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.odeme-hucre .link-btn { font-size: 10px; white-space: nowrap; }
.mt14 { margin-top: 14px; }
.mb14 { margin-bottom: 14px; }
.sag-yasla { margin-left: auto; }

/* ── ACENTE LISTESI (kod, ok, detay satiri) ───────────────────────────── */
.kod-metin { font-size: 11px; font-family: ui-monospace, monospace; color: #64748b; }

/* Detay acma dugmesi: kucuk ve silik degil — belirgin, tiklamasi kolay bir kutu. */
.acente-arw {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 7px;
    background: var(--primary-light); color: var(--primary);
    font-size: 13px; line-height: 1; font-weight: 700;
    font-family: inherit; padding: 0;
    transition: transform .15s, color .15s, background .15s, border-color .15s;
}
.acente-arw:hover {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.acente-arw.open {
    transform: rotate(90deg);
    background: var(--primary); color: #fff; border-color: var(--primary);
}

.adetay-grid {
    display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 8px 24px; padding: 4px 8px 4px 22px;
}
.adg-lbl { display: block; font-size: 10px; font-weight: 600; color: var(--light); text-transform: uppercase; letter-spacing: .4px; }
.adg-val { display: block; font-size: 12px; color: var(--text); margin-top: 1px; word-break: break-word; }

/* ── PENCERE (acente karti) ───────────────────────────────────────────── */
.kaplama {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(33, 42, 53, .45);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 4vh 16px; overflow-y: auto;
}
.pencere {
    background: #fff; border-radius: var(--radius-card);
    width: 100%; max-width: 720px;
    box-shadow: 0 18px 50px rgba(33, 42, 53, .28);
    display: flex; flex-direction: column;
    max-height: 92vh;
}
.pencere-baslik {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.pencere-baslik h3 { margin: 0; font-size: 15px; font-family: 'Fredoka', sans-serif; color: var(--text); }
.pencere-kapat {
    border: none; background: none; cursor: pointer;
    font-size: 14px; color: var(--muted); padding: 4px 8px; border-radius: 6px;
}
.pencere-kapat:hover { background: var(--bg); color: var(--text); }
.pencere-govde { padding: 16px 20px; overflow-y: auto; }
.pencere-alt {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 20px; border-top: 1px solid var(--border);
}

.f-izgara { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.f-izgara .f-tam { grid-column: 1 / -1; }
.f-izgara textarea.alan { min-height: 56px; resize: vertical; }

.sistem-kutu { display: flex; gap: 14px; flex-wrap: wrap; padding: 6px 2px; }

.adet-kutu { display: flex; align-items: center; gap: 8px; }
.adet-kutu .dugme { margin-right: 0; padding: 4px 12px; font-size: 14px; line-height: 1; }
.adet-deger { min-width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.teknik-kutu {
    border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 12px; margin-top: 8px; background: #fafafa;
}
.teknik-baslik { font-size: 11px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }

/* Genis pencere (muhasebe acente detayi) */
.pencere.pencere-genis { max-width: 1120px; }
.pencere-tablo { max-height: 380px; overflow: auto; margin-bottom: 12px; }

.iban-serit {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: 9px;
    background: var(--primary-light);
    font-size: 12px; color: var(--text);
}
.iban-etiket {
    font-size: 10px; font-weight: 700; color: var(--primary);
    text-transform: uppercase; letter-spacing: .5px;
}

.ayar-kutu.not-sari { background: #fffdf5; }

/* Eksik bilgi hatirlatmasi penceresi */
.eksik-kart {
    border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 12px;
}
.eksik-ust {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 4px;
}
.eksik-ust > div:first-child > div { font-size: 11px; }
.eksik-sag { display: flex; align-items: center; gap: 8px; }
.eksik-satir {
    padding: 5px 0; border-top: 1px solid var(--border); font-size: 12px;
}
.eksik-alanlar { color: var(--danger); }
.eksik-mail-yok { color: var(--danger); font-size: 11px; }
.not-baslik-satir {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.not-baslik-satir .alt-baslik { margin: 0; }

@media (max-width: 700px) {
    .f-izgara { grid-template-columns: 1fr; }
    .adetay-grid { grid-template-columns: 1fr 1fr; }
}
.secilen-dosya { margin: 12px 0; font-size: 12px; }
.w60 { width: 60px; min-width: 0; }
.w70 { width: 70px; min-width: 0; }
.w80 { width: 80px; min-width: 0; }
.w90 { width: 90px; min-width: 0; }
.w100 { width: 100px; min-width: 0; }
.w110 { width: 110px; min-width: 0; }
.w130 { width: 130px; min-width: 0; }
.w200 { width: 200px; min-width: 0; }
.wfull { width: 100%; min-width: 0; }

/* ── DAR EKRAN ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    :root { --sidebar-w: 60px; }
    nav a span:not(.icon) { display: none; }
    .s-logo { padding: 14px 8px; }
    .s-logo img.brand-full { display: none; }
    .s-logo img.brand-mark { display: block; }
    .s-user .uname, .s-user .umail { display: none; }
    .s-date, .s-foot { display: none; }
    .kpi-row, .kpi-row.k5, .kpi-row.k3, .kpi-row.k2 { grid-template-columns: 1fr 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .duzen-blok { gap: 18px; }
    .fg-grid { grid-template-columns: 1fr; }
    .fg.full { grid-column: span 1; }
    .content { padding: 16px 12px; }
    .page-hdr { padding: 0 14px; }
    .usub-tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .usub-tabs::-webkit-scrollbar { display: none; }
    .usub { flex: 0 0 auto; }
}

@media (max-width: 600px) {
    .kpi-row, .kpi-row.k5, .kpi-row.k3, .kpi-row.k2 { grid-template-columns: 1fr; }
}

/* Kural karti icindeki net prim dilimleri — tablo yerine sade satirlar. */
.dilim-satir {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 7px 12px; margin-bottom: 6px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    font-size: 12px; max-width: 420px;
}

/* Sayfa degisince Blazor ust basligi odakliyor (FocusOnNavigate — ekran
   okuyucular icin gerekli, kalmali). Tarayici bu programatik odagi klavye
   odagi sanip basligin etrafina siyah cerceve ciziyordu; :focus-visible
   ayrimi Chrome'da ise yaramadi, o yuzden cerceveyi tumden kapatiyoruz.
   Odak yine calisir — yalnizca gorunmez olur. Blazor'un kendi sablonu da
   bunu boyle yapar. Form alanlarinin odak cercevesi etkilenmez. */
h1:focus,
h1:focus-visible,
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none !important; box-shadow: none !important; }

/* Baslik satirinin sagindaki dugme/kutu obegi (aylik dokum basim araclari). */
.baslik-arac { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.baslik-arac .sel { max-width: 230px; }

/* ═══════════════════════════════════════════════════════════════════════════
   BASKI VE SUNUM SAYFALARI  (/sunum ve /muhasebe/baski)
   Bu sayfalar BaskiDuzen ile acilir: menu, ust baslik ve arka plan yoktur.
   Ekranda kagit gibi gorunur, yazdirmada (veya "PDF olarak kaydet") aynen
   o sayfa dokulur. Renkler kagida da bassin diye print-color-adjust:exact.
   ═══════════════════════════════════════════════════════════════════════════ */

.baski-govde { background: #eceaf0; min-height: 100vh; padding: 18px 12px 30px; }

/* Ust seritteki dugmeler — yalnizca ekranda gorunur, kagida basilmaz. */
.baski-arac {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    max-width: 297mm; margin: 0 auto 16px;
    padding: 10px 14px; background: #fff;
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.baski-arac-ad { font-family: Fredoka, Inter, sans-serif; font-weight: 600; color: var(--primary); }
.baski-ipucu { font-size: 11px; color: var(--muted); }

/* ── Sunum slaytlari (A4 yatay) ─────────────────────────────────────────── */
.sn-slayt {
    width: 297mm; height: 210mm; margin: 0 auto 18px;
    background: #fff; position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 8px 28px rgba(33,42,53,.18);
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

.sn-bas { padding: 16mm 16mm 0; position: relative; }
.sn-serit { height: 5px; width: 96px; border-radius: 3px; background: var(--brand-grad); margin-bottom: 10px; }
.sn-bas h2 {
    margin: 0; font-family: Fredoka, Inter, sans-serif; font-weight: 600;
    font-size: 30px; color: var(--primary); letter-spacing: -.3px;
}
.sn-bas-donem {
    position: absolute; right: 16mm; top: 16mm;
    font-size: 12px; color: var(--muted); font-weight: 600;
}

.sn-govde { flex: 1; padding: 10mm 16mm 0; display: flex; flex-direction: column; gap: 8mm; }

.sn-alt {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 16mm 10mm; font-size: 10px; color: var(--light);
}

/* Kapak ve kapanis */
.sn-kapak, .sn-kapanis {
    background: linear-gradient(135deg, #2c5055 0%, #6a2473 55%, #e9617b 100%);
    color: #fff; justify-content: center; align-items: flex-start;
}
.sn-kapak-ic, .sn-kapanis-ic { padding: 0 24mm; }
.sn-marka { font-size: 12px; letter-spacing: 3px; opacity: .8; margin-bottom: 14px; }
.sn-kapak-baslik {
    margin: 0; font-family: Fredoka, Inter, sans-serif; font-weight: 700;
    font-size: 66px; line-height: 1.05; letter-spacing: -1px;
}
.sn-kapak-donem { margin-top: 12px; font-size: 26px; font-weight: 600; opacity: .95; }
.sn-kapak-alt { margin-top: 26px; font-size: 13px; opacity: .8; }
.sn-nokta { margin: 0 8px; }
.sn-kapak-serit { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--brand-grad); }

.sn-kapanis-buyuk {
    font-family: Fredoka, Inter, sans-serif; font-weight: 700;
    font-size: 58px; letter-spacing: -1px;
}
.sn-kapanis-alt { font-size: 15px; opacity: .85; margin-top: 4px; }
.sn-kapanis-satir { display: flex; gap: 40px; margin-top: 30px; }
.sn-kapanis-satir > div { display: flex; flex-direction: column; gap: 4px; }
.sn-kapanis-ad { font-size: 11px; letter-spacing: 1px; opacity: .75; }
.sn-kapanis-deger { font-size: 20px; font-weight: 700; }
.sn-kapanis-not { margin-top: 34px; font-size: 11px; opacity: .7; }

/* Sunum KPI kutulari */
.sn-kpi-satir { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6mm; }
.sn-kpi-satir.sn-uc { grid-template-columns: repeat(3, 1fr); }
.sn-kpi {
    border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 16px; background: #fff; border-top: 4px solid var(--primary);
}
.sn-kpi.mor     { border-top-color: #6a2473; }
.sn-kpi.yesil   { border-top-color: #2f8f85; }
.sn-kpi.turuncu { border-top-color: #f5a150; }
.sn-kpi.kirmizi { border-top-color: #cf3f63; }
.sn-kpi-ad { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.sn-kpi-deger {
    margin-top: 8px; font-family: Fredoka, Inter, sans-serif; font-weight: 600;
    font-size: 26px; color: var(--navy); line-height: 1.15;
}
.sn-kpi-deger.sn-metin { font-size: 18px; }
.sn-kpi-not { margin-top: 6px; font-size: 11px; color: var(--light); }

/* Komisyon paylasim cubugu */
.sn-pay { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.sn-pay-baslik { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.sn-pay-cubuk { display: flex; height: 46px; border-radius: 10px; overflow: hidden; background: #2f8f85; }
.sn-pay-tali { background: #f5a150; display: flex; align-items: center; justify-content: center; }
.sn-pay-biz  { flex: 1; display: flex; align-items: center; justify-content: center; }
.sn-pay-cubuk span { color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; padding: 0 8px; }
.sn-pay-not { margin-top: 10px; font-size: 11px; color: var(--light); }

/* Aylik net prim grafigi */
.sn-grafik { flex: 1; display: flex; align-items: flex-end; gap: 10px; min-height: 90mm; }
.sn-sutun { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.sn-sutun-yer { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.sn-cubuk {
    width: 100%; max-width: 54px; border-radius: 8px 8px 0 0; position: relative;
    background: linear-gradient(180deg, #8a3a93, #6a2473);
}
.sn-cubuk.eksi { background: linear-gradient(180deg, #e9617b, #cf3f63); }
.sn-sutun-deger {
    position: absolute; top: -18px; left: 0; right: 0; text-align: center;
    font-size: 10px; font-weight: 700; color: var(--navy);
}
.sn-sutun-ad { font-size: 10px; color: var(--muted); white-space: nowrap; }
.sn-grafik-not { font-size: 11px; color: var(--light); }
.sn-bos { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--light); }

/* Sunum tablolari */
.sn-tablo { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sn-tablo.sn-tablo-sik { font-size: 11.5px; }
.sn-tablo th {
    text-align: left; padding: 9px 10px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
    border-bottom: 2px solid var(--primary-light);
}
.sn-tablo td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.sn-tablo tbody tr:nth-child(even) { background: #faf8fb; }
.sn-tablo .r { text-align: right; font-variant-numeric: tabular-nums; }
.sn-tablo .c { text-align: center; font-variant-numeric: tabular-nums; }
.sn-tablo .sn-sira { width: 26px; color: var(--light); text-align: center; }

/* ── Muhasebe basimi (A4 dikey) ─────────────────────────────────────────── */
.bs-sayfa {
    width: 210mm; min-height: 297mm; margin: 0 auto 18px;
    background: #fff; display: flex; flex-direction: column;
    box-shadow: 0 8px 28px rgba(33,42,53,.18);
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.bs-bas { padding: 14mm 14mm 0; }
.bs-serit { height: 5px; border-radius: 3px; background: var(--brand-grad); margin-bottom: 12px; }
.bs-bas-ic { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.bs-marka { font-size: 10px; letter-spacing: 2.5px; color: var(--muted); }
.bs-bas h2 {
    margin: 4px 0 0; font-family: Fredoka, Inter, sans-serif; font-weight: 600;
    font-size: 24px; color: var(--primary);
}
.bs-bas-sag { text-align: right; }
.bs-donem { font-size: 15px; font-weight: 700; color: var(--navy); }
.bs-tarih { font-size: 10px; color: var(--light); margin-top: 2px; }

.bs-govde { flex: 1; padding: 8mm 14mm 0; }
.bs-alt {
    display: flex; justify-content: space-between; align-items: center;
    margin: 8mm 14mm 0; padding: 4mm 0 10mm;
    font-size: 10px; color: var(--light);
    border-top: 1px solid var(--border);
}

.bs-ozet { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8mm; }
.bs-ozet-kutu {
    border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
    display: flex; flex-direction: column; gap: 4px; background: #fff;
}
.bs-ozet-ad { font-size: 9.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.bs-ozet-deger { font-size: 15px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.bs-ozet-kutu.yesil .bs-ozet-deger { color: #2f8f85; }
.bs-ozet-kutu.mor   .bs-ozet-deger { color: #6a2473; }

.bs-alt-baslik {
    font-family: Fredoka, Inter, sans-serif; font-weight: 600; font-size: 14px;
    color: var(--primary); margin-bottom: 8px;
}
.bs-tablo { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.bs-tablo th {
    text-align: left; padding: 7px 8px; font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
    border-bottom: 2px solid var(--primary-light);
}
.bs-tablo td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.bs-tablo tbody tr:nth-child(even) { background: #faf8fb; }
.bs-tablo tfoot td { font-weight: 700; border-top: 2px solid var(--primary-light); border-bottom: none; }
.bs-tablo .r { text-align: right; font-variant-numeric: tabular-nums; }
.bs-tablo .yesil { color: #2f8f85; }
.bs-tablo .mor { color: #6a2473; }
.bs-not { margin-top: 10px; font-size: 10px; color: var(--light); }
.bs-bos { padding: 24px; text-align: center; color: var(--light); font-size: 12px; }

/* ── Yazdirma ───────────────────────────────────────────────────────────── */
@media print {
    @page { margin: 0; }
    @page sunum-yatay  { size: A4 landscape; }
    @page dokum-dikey  { size: A4 portrait; }

    html, body { background: #fff !important; }
    .baski-govde { background: #fff; padding: 0; min-height: 0; }
    .baski-arac { display: none !important; }

    .sn-slayt {
        page: sunum-yatay;
        margin: 0; box-shadow: none; break-after: page; page-break-after: always;
    }
    .sn-slayt:last-child { break-after: auto; page-break-after: auto; }

    .bs-sayfa {
        page: dokum-dikey;
        margin: 0; box-shadow: none; break-after: page; page-break-after: always;
    }
    .bs-sayfa:last-child { break-after: auto; page-break-after: auto; }

    .bs-tablo thead { display: table-header-group; }
    .bs-tablo tr { break-inside: avoid; page-break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AYLIK NET PRIM GRAFIGI  (Ana Sayfa)
   Olcek cizgileri soldan, sutunlar ustlerinde rakamla, en yuksek ay teal
   renkle ayrilir; altta aylar ve yil ayraci vardir.
   ═══════════════════════════════════════════════════════════════════════════ */
.gc-yer { position: relative; height: 250px; padding-left: 52px; }

.gc-kilavuz { position: absolute; left: 52px; right: 0; border-top: 1px dashed var(--border); }
.gc-kilavuz span {
    position: absolute; left: -52px; top: -7px; width: 46px;
    text-align: right; font-size: 10px; color: var(--light);
}

.gc-sutunlar { position: absolute; inset: 0 0 0 52px; display: flex; align-items: flex-end; gap: 8px; }
.gc-sutun { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }

.gc-cubuk {
    width: 100%; max-width: 44px; border-radius: 7px 7px 0 0; position: relative;
    background: linear-gradient(180deg, #8a3a93, #6a2473);
}
.gc-cubuk.enb  { background: linear-gradient(180deg, #34a49a, #2c5055); }
.gc-cubuk.eksi { background: linear-gradient(180deg, #e9617b, #cf3f63); }

.gc-deger {
    position: absolute; top: -17px; left: 50%; transform: translateX(-50%);
    font-size: 10px; font-weight: 700; color: var(--navy); white-space: nowrap;
}

.gc-adlar { display: flex; gap: 8px; padding-left: 52px; margin-top: 6px; }
.gc-adlar span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }

.gc-yil { display: flex; gap: 8px; padding-left: 52px; margin-top: 2px; }
.gc-yil div {
    text-align: center; font-size: 10px; font-weight: 700; color: var(--light);
    border-top: 2px solid #eae6f0; padding-top: 3px;
}

@media (max-width: 700px) {
    .gc-yer { height: 190px; }
    .gc-deger { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MUHASEBE KURALLARI KARTLARI  (acente muhasebe penceresi)
   Iki kural, iki kart. Anahtar kapaliysa kart soluklasir ve alanlar kilitlenir.
   ═══════════════════════════════════════════════════════════════════════════ */
.mk-satir { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.mk-kart { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: #fff; }
.mk-kart.kapali { background: #fbfafc; }

.mk-kart-bas { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mk-kart-ad { font-weight: 700; font-size: 13px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.mk-ikon {
    width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
    background: var(--primary-light); color: var(--primary); font-size: 13px;
}
.mk-kart.kapali .mk-ikon { background: #f0eef3; color: var(--light); }

.mk-alanlar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mk-kart.kapali .mk-alanlar { opacity: .45; }

.mk-alan { display: flex; flex-direction: column; gap: 4px; }
.mk-alan > span { font-size: 11px; color: var(--muted); font-weight: 600; }
.mk-kur { margin-top: 14px; max-width: 260px; }

.mk-kart-not { margin-top: 10px; font-size: 11px; color: var(--light); }

/* aç/kapa anahtarı */
.anahtar { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.anahtar input { display: none; }
.anahtar i { position: absolute; inset: 0; background: #d8d2e0; border-radius: 20px; transition: background .15s; }
.anahtar i::after {
    content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.anahtar input:checked + i { background: var(--success); }
.anahtar input:checked + i::after { transform: translateX(18px); }
.anahtar input:disabled + i { opacity: .5; cursor: not-allowed; }

.mk-ozet {
    margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 11px 14px; border-radius: 12px; background: var(--primary-light);
}
.mk-ozet-ad { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; }
.mk-ozet-deger { font-size: 18px; font-weight: 700; color: var(--primary); }
.mk-ozet-parca { font-size: 11px; color: var(--muted); }

@media (max-width: 760px) {
    .mk-satir { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   YENI ACENTE SIHIRBAZI  (acente penceresi — yalnizca yeni kayitta)
   ═══════════════════════════════════════════════════════════════════════════ */
.ad-serit { display: flex; gap: 6px; margin-bottom: 16px; }
.ad-adim { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ad-cizgi { height: 4px; border-radius: 3px; background: #eae6f0; }
.ad-ad { font-size: 11px; font-weight: 600; color: var(--light); }

.ad-adim.aktif .ad-cizgi { background: var(--primary); }
.ad-adim.aktif .ad-ad    { color: var(--primary); }
.ad-adim.tamam .ad-cizgi { background: var(--success); }
.ad-adim.tamam .ad-ad    { color: var(--success); }

.ad-secim { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 0 4px; }
.ad-kart {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    text-align: left; padding: 20px; border-radius: 16px; cursor: pointer;
    border: 1px solid var(--border); background: #fff;
    font-family: inherit; color: var(--text);
    transition: border-color .12s, box-shadow .12s, transform .12s;
}
.ad-kart:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(106,36,115,.12);
    transform: translateY(-2px);
}
.ad-kart-ikon {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: var(--primary-light); font-size: 19px;
}
.ad-kart-ad { font-family: Fredoka, Inter, sans-serif; font-weight: 600; font-size: 16px; color: var(--primary); }
.ad-kart-not { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

@media (max-width: 700px) {
    .ad-secim { grid-template-columns: 1fr; }
    .ad-ad { font-size: 10px; }
}

/* "Veri yok" kutusu artik grafik cercevesi icinde degil, dogrudan
   kart govdesinde duruyor; kendi yuksekligini kendisi versin. */
.card-body > .bc-empty { height: 120px; }

/* ── Muhasebe: kural oranindan sapan satirlar ────────────────────────────
   "Kom. Oranı" sutunu artik kuralin orani. Ay icinde farkli oranla
   hesaplanmis satir varsa ortalamaya karistirilmaz; yandaki rozetle
   sayisi yazilir ve rozete basildikca o satirlara sirayla kaydirilir. */
/* Ay dokumunde oran hucresi: rakam ustte, rozet altinda.
   Rozet rakamin yanina konunca sutun asiri genisliyordu. */
.ay-oran-hucre {
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.ay-oran-hucre > span { font-variant-numeric: tabular-nums; }

.sapma-rozet {
    padding: 2px 8px;
    border: 1px solid #f0d6b0; border-radius: 20px;
    background: #fdf4e7; color: #c97d1c;
    font-size: 10px; font-weight: 700; font-family: inherit;
    cursor: pointer; white-space: nowrap;
}
.sapma-rozet:hover { background: #f9e8d2; border-color: #e0bd8a; }

/* Farkli oranla hesaplanan satirlar, ustteki aciklama kutusu ve rozetle
   AYNI sari tonda boyanir; listede tek bakista ayirt edilsinler.
   Fare ustune gelince de rengini korur (yoksa hover beyaza cekiyordu). */
tbody tr.sapan-satir > td,
tbody tr.sapan-satir:hover > td { background: #fdf4e7; }
tbody tr.sapan-satir > td { border-bottom-color: #f0e0c8; }
tbody tr.sapan-satir > td:first-child { box-shadow: inset 3px 0 0 #e0a44a; }

/* Ayin ustundeki aciklama kutusu: "bu ayda ne oldu" duz Turkce yazar. */
.oran-bilgi {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin: 10px 0 12px; padding: 11px 14px;
    background: #fdf7ef; border: 1px solid #f0e0c8; border-radius: 12px;
}
.oran-bilgi-ic { flex: 1 1 320px; }
.oran-bilgi-baslik { font-size: 12.5px; color: var(--navy); margin-bottom: 3px; }
.oran-bilgi-metin  { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* Oran hucresi: yuzde ustte, gerekcesi altinda kucuk yaziyla. */
.oran-hucre { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.oran-deger { font-variant-numeric: tabular-nums; font-weight: 600; }
.oran-deger.farkli { color: #c97d1c; }
.oran-neden {
    font-size: 10px; color: var(--light); white-space: nowrap; line-height: 1.3;
}

/* Rozete basilinca hedef satir kisa sureligine parlar. */
@keyframes vurgu-parla {
    0%   { background: #f3cf95; }
    100% { background: #fdf4e7; }
}
tbody tr.vurgu-atla > td { animation: vurgu-parla 1.2s ease-out 1; }
.vurgu-atla { animation: vurgu-parla 1.2s ease-out 1; }

/* Muhasebe ay dokumunde acilan police detayi: satirin hemen altinda,
   tablo icinde. Pencere genisligini asmasin diye kendi kaydirmasi var. */
.pencere-tablo .detay-cell { padding: 0; background: var(--bg); }
.pencere-tablo .detay-cell .detay-inner { padding: 12px 14px 14px; }
.pencere-tablo .detay-cell .tbl-wrap { max-height: 420px; overflow: auto; background: #fff;
    border: 1px solid var(--border); border-radius: 10px; }
.pencere-tablo .detay-cell .oran-bilgi { margin-top: 0; }

/* ── Mutabakat ay seçimi ─────────────────────────────────────────────────
   "Mutabakat Al" düğmesi hangi ayın indirileceğini sorar. Aylar tıklanabilir
   satırlar hâlinde listelenir; tıklanınca Excel doğrudan iner. */
.pencere.pencere-dar { max-width: 460px; }

.mutabakat-aylar { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.mutabakat-ay {
    display: flex; flex-direction: column; gap: 2px;
    padding: 11px 14px; text-decoration: none;
    border: 1px solid var(--border); border-radius: 12px; background: #fff;
    transition: border-color .12s, background .12s;
}
.mutabakat-ay:hover { border-color: var(--primary); background: var(--primary-light); }
.mutabakat-ay-ad  { font-weight: 700; font-size: 13px; color: var(--primary); }
.mutabakat-ay-not { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Aylik oran: elle sabitlenmis aylarin etiketi.
   Kutunun kendisi zaten .elle ile sari cerceve aliyor; bu etiket
   "bu rakam kuraldan gelmedi" bilgisini yazili olarak da veriyor. */
.oran-elle-etiket {
  font-size: 10px;
  font-weight: 700;
  color: #7c5310;
  background: #fff6da;
  border: 1px solid #e8d6a8;
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.ay-oran-hucre > span.oran-elle { color: #7c5310; font-weight: 700; }
