/* =====================================================================
   BESS Analiz — tasarım sistemi
   Sade · sakin · tek vurgu. İnce çizgiler, bol boşluk, mürekkep birincil düğme.
   ===================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Yüzeyler */
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f3f3f0;
  --surface-3: #ebebe7;
  /* Mürekkep */
  --text: #16181d;
  --text-2: #3b3f46;
  --muted: #6e737b;
  --faint: #9a9fa6;
  /* Çizgiler */
  --border: #e8e7e2;
  --border-strong: #d9d8d2;
  /* Vurgu */
  --primary: #16181d;           /* birincil düğme: mürekkep */
  --primary-ink: #ffffff;
  --accent: #2a5bd7;            /* bağlantı, odak, seçili */
  --accent-soft: #edf2fd;
  /* Durum (yalnızca anlam taşır; daima ikon + metinle) */
  --success: #13803b; --success-soft: #eaf6ee;
  --warning: #a86a00; --warning-soft: #fdf4e3;
  --danger: #c53030;  --danger-soft: #fcecec;
  --neutral-soft: #f0f0ed;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(17, 20, 26, .04), 0 1px 1px rgba(17, 20, 26, .02);
  --shadow-lg: 0 10px 30px -12px rgba(17, 20, 26, .16);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Görselleştirme (dataviz doğrulaması: açık/koyu ALL PASS). Renk kalemi izler:
     1 arbitraj · 2 TTK · 3 jeneratör · 4 kesinti · 5 YAL · 6 YAT · 7 diğer */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
  --pos: #2a78d6; --pos-rgb: 42, 120, 214;
  --neg: #e34948; --neg-rgb: 227, 73, 72;
  --chg: #eb6834; --chg-rgb: 235, 104, 52;
  --seq-rgb: 42, 120, 214;
  --ctx: #b4b8be;
  --grid: #efeeea; --axis: #d9d8d2;
  --good: #13803b; --warn: #b77f00; --bad: #c53030;
  --good-soft: #eaf6ee; --warn-soft: #fdf4e3; --bad-soft: #fcecec;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e10; --surface: #15171a; --surface-2: #1b1e22; --surface-3: #23262b;
    --text: #eceef1; --text-2: #c9ccd2; --muted: #979ca5; --faint: #6c717a;
    --border: #25282d; --border-strong: #31353b;
    --primary: #eceef1; --primary-ink: #15171a;
    --accent: #7ea4ff; --accent-soft: #1a2440;
    --success: #4cc275; --success-soft: #13261a;
    --warning: #e9b44c; --warning-soft: #2b2312;
    --danger: #f07a7a; --danger-soft: #331a1a;
    --neutral-soft: #1f2226;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 16px 40px -16px rgba(0, 0, 0, .6);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9;
    --pos: #3987e5; --pos-rgb: 57, 135, 229; --neg: #e66767; --neg-rgb: 230, 103, 103;
    --chg: #d95926; --chg-rgb: 217, 89, 38; --seq-rgb: 57, 135, 229;
    --ctx: #4f555d; --grid: #1f2226; --axis: #31353b;
    --good: #4cc275; --warn: #e9b44c; --bad: #f07a7a;
    --good-soft: #13261a; --warn-soft: #2b2312; --bad-soft: #331a1a;
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- temel */
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01"; letter-spacing: -0.003em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.022em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- üst bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 58px; display: flex; align-items: center; gap: 28px; }
.brand { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--text); color: var(--bg);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: 0; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); }
.user { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.user form { margin: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { color: var(--text); font-weight: 500; }
.user-meta span { font-size: 12px; }

.container { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }

/* ---------------------------------------------------------------- kart */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.card + .card { margin-top: 16px; }
.cols > .card + .card, .cols-2 > .card + .card, .grid-3 > .card + .card, .grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h2 { margin: 0; }
.card-h .sub, .section-title .muted { color: var(--muted); font-size: 12.5px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }

/* Proje listesi istatistikleri: tek kart, ayraçlı */
.stat { padding: 18px 22px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; margin-top: 4px; }
.statbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.statbar > * + * { border-left: 1px solid var(--border); }
@media (max-width: 900px) { .statbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .statbar > :nth-child(3) { border-left: 0; } }

/* ---------------------------------------------------------------- düğmeler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius-sm);
  font: 500 13.5px var(--font); cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-link { border: none; background: none; color: var(--muted); padding: 0; cursor: pointer; font: inherit; }
.btn-link:hover { color: var(--text); }

/* ---------------------------------------------------------------- form */
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background-color: var(--surface); color: var(--text); font: 400 14px var(--font); transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e737b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--text); cursor: pointer; vertical-align: -3px; }
input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
.form { max-width: 720px; }
.form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px 6px; margin: 0 0 16px; background: var(--surface); box-shadow: var(--shadow); }
.form legend { font-weight: 600; padding: 0 6px; font-size: 13px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--danger); font-size: 12.5px; }
.form-actions { display: flex; gap: 8px; align-items: center; }
.or-sep { text-align: center; color: var(--faint); font-size: 12px; margin: -6px 0 10px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }
.unit { color: var(--muted); margin-left: 8px; font-size: 12.5px; white-space: nowrap; }
.inline-input { display: flex; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; margin-top: 20px; padding: 14px 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent); }

/* ---------------------------------------------------------------- uyarılar */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 13.5px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert-error, .alert-danger { background: var(--danger-soft); color: var(--danger); }
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 16px;
  border-radius: var(--radius-sm); margin-bottom: 16px; flex-wrap: wrap; font-size: 13.5px; }
.banner form { margin: 0; }
.banner-warn { background: var(--warning-soft); color: var(--warning); }
.banner-info { background: var(--accent-soft); color: var(--accent); }
.banner-error { background: var(--danger-soft); color: var(--danger); }
.help-box { font-size: 13px; color: var(--muted); padding: 0 2px; margin: -4px 0 18px; max-width: 900px; line-height: 1.6; }
.help-box strong { color: var(--text-2); font-weight: 500; }

/* ---------------------------------------------------------------- tablo */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 500; background: none; border-bottom-color: var(--border-strong); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
td.title a { font-weight: 500; color: var(--text); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
table.num td, table.num th { text-align: right; font-variant-numeric: tabular-nums; }
table.num td:first-child, table.num th:first-child { text-align: left; }
table.compact th, table.compact td { padding: 9px 12px; }
td.neg { color: var(--danger); }
tr.total td { font-weight: 600; border-top: 1px solid var(--border-strong); background: var(--surface-2); }
tr.selected td, tr.current td { background: var(--accent-soft); }

/* ---------------------------------------------------------------- rozetler */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 500; background: var(--neutral-soft); color: var(--muted); line-height: 1.7; letter-spacing: 0; }
h1 .badge { font-size: 12px; }
.badge-pre_feas, .badge-audit { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-2); }
.badge-ok, .badge-results, .badge-reported { background: var(--success-soft); color: var(--success); }
.badge-off { background: var(--neutral-soft); color: var(--muted); }
.badge-manual, .badge-awaiting_data, .badge-data_check { background: var(--warning-soft); color: var(--warning); }
.badge-ready, .badge-calculating { background: var(--accent-soft); color: var(--accent); }
/* Durum noktası (liste) */
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status-results::before, .status-reported::before { background: var(--success); }
.status-ready::before, .status-calculating::before { background: var(--accent); }
.status-awaiting_data::before, .status-data_check::before { background: var(--warning); }

/* ---------------------------------------------------------------- liste */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters input[name=q] { flex: 1; min-width: 260px; max-width: 420px; padding-left: 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'%3E%3Ccircle cx='6' cy='6' r='4.75' stroke='%239a9fa6' stroke-width='1.5'/%3E%3Cpath d='M9.5 9.5L13 13' stroke='%239a9fa6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 13px center; }
.filters select { width: auto; min-width: 160px; }
.list-card { padding: 0; overflow: hidden; }
.list-card table th:first-child, .list-card table td:first-child { padding-left: 22px; }
.list-card table th:last-child, .list-card table td:last-child { padding-right: 22px; }
.list-card td .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---------------------------------------------------------------- proje detay */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: center; }
.steps li:last-child { border-bottom: none; }
.step-num { counter-increment: step; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.step-num::before { content: counter(step); }
.step-body { flex: 1; }
.step-title { font-weight: 500; }
.step-title a { color: var(--text); }
.history { list-style: none; padding: 0; margin: 0; font-size: 12.5px; color: var(--muted); }
.history li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.history li:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- giriş */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--surface) 0%, var(--bg) 60%); }
.auth .card { width: 100%; max-width: 380px; padding: 36px 32px; box-shadow: var(--shadow-lg); }
.auth .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; margin-bottom: 20px; }
.auth h1 { font-size: 22px; margin-bottom: 6px; }
.auth p { margin: 0 0 24px; }
.auth .btn { width: 100%; height: 40px; margin-top: 4px; }

/* =====================================================================
   Analiz ekranları
   ===================================================================== */
.an-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.an-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.an-title { min-width: 0; flex: 1 1 520px; }
.an-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.an-actions form { margin: 0; }
.scenario-switch select { width: auto; min-width: 240px; font-weight: 500; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 10px; color: var(--muted); font-size: 13px; }
.fact { display: inline-flex; align-items: center; }
.fact + .fact::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); margin: 0 10px; }
.fact b { color: var(--text-2); font-weight: 500; margin-left: 5px; }
.an-note { color: var(--faint); font-size: 12.5px; margin-top: 6px; max-width: 760px; }

.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin: 24px 0 22px; overflow-x: auto; }
.tabs a { padding: 12px 0; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--text); }
.tabs .spacer { flex: 1; }
.tabs a.ext { font-weight: 400; }

/* Bağlam bandı: seçimler + karar */
.context { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.selbar { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); margin: 0; }
.selbar .sel { display: flex; align-items: center; gap: 8px; }
.selbar .sel > span { color: var(--muted); font-size: 12.5px; }
.selbar select { width: auto; height: 32px; min-width: 0; padding-left: 10px; border-color: transparent; background-color: var(--surface-2); font-weight: 500; font-size: 13px; }
.selbar select:hover { border-color: var(--border-strong); }
.selbar .grow { flex: 1; }
.selbar .hint { color: var(--faint); font-size: 12px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--radius-sm); }
.seg label, .seg button, .seg a { position: relative; display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 6px; border: 0;
  background: transparent; color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; }
.seg a:hover, .seg label:hover, .seg button:hover { text-decoration: none; color: var(--text); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked), .seg button.on, .seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg.sm button { height: 24px; font-size: 12px; }

.verdict { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; padding: 16px 18px; }
.verdict-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; grid-row: span 2; }
.verdict-good .verdict-icon { background: var(--good-soft); color: var(--good); }
.verdict-warn .verdict-icon { background: var(--warn-soft); color: var(--warn); }
.verdict-bad .verdict-icon { background: var(--bad-soft); color: var(--bad); }
.verdict-label { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.verdict-text { color: var(--muted); font-size: 13px; }
.checks { grid-column: 1 / -1; list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--muted); }
.checks li { display: inline-flex; gap: 7px; align-items: baseline; }
.checks .ci { font-weight: 700; font-size: 12px; }
.checks li.ok .ci { color: var(--good); }
.checks li.fail .ci { color: var(--bad); }
.checks b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* Alt sekmeler */
.subtabs { display: flex; gap: 4px; margin: 0 0 20px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.subtabs button { border: 0; background: none; color: var(--muted); font: 500 13.5px var(--font); padding: 10px 12px; cursor: pointer;
  white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs button:first-child { padding-left: 0; }
.subtabs button:hover { color: var(--text); }
.subtabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.subtabs .count { font-weight: 400; color: var(--faint); margin-left: 6px; font-size: 12px; }
.panel[hidden] { display: none; }

/* Ana göstergeler */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi .v { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; line-height: 1.15; }
.kpi .u { color: var(--faint); font-size: 12px; margin-top: 4px; }
.kpi .flag-line { font-size: 12px; margin-top: 10px; display: flex; gap: 6px; align-items: center; font-weight: 500; }
.kpi .flag-line.bad { color: var(--bad); }
.kpi .flag-line.good { color: var(--good); }
.kpi[title] { cursor: help; }

/* İkincil göstergeler: tek şerit */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.metrics .m { padding: 14px 20px; border-left: 1px solid var(--border); border-top: 1px solid var(--border); cursor: help; }
.metrics .m:nth-child(4n + 1) { border-left: 0; }
.metrics .m:nth-child(-n + 4) { border-top: 0; }
.metrics .m .l { color: var(--muted); font-size: 12px; }
.metrics .m .v { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.metrics .m .ic { font-size: 11px; margin-right: 5px; }
.metrics .m.bad .v { color: var(--bad); }
.metrics .m.good .v { color: var(--good); }
.metrics .m .u { color: var(--faint); font-size: 11.5px; }
@media (max-width: 900px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metrics .m { border-left: 0 !important; border-top: 1px solid var(--border) !important; } }

.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin: 16px 0; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
@media (max-width: 980px) { .cols, .cols-2, .grid-3 { grid-template-columns: 1fr; } }
.cols > *, .cols-2 > *, .grid-3 > *, .kpis > *, .stats > *, .metrics > * { min-width: 0; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 330px; }
.chart-box.mid { height: 260px; }
.chart-box.low, .chart-box.short { height: 190px; }
details.tableview { margin-top: 14px; }
details.tableview summary { cursor: pointer; color: var(--faint); font-size: 12.5px; list-style: none; width: max-content; }
details.tableview summary::-webkit-details-marker { display: none; }
details.tableview summary::before { content: "▸ "; }
details.tableview[open] summary::before { content: "▾ "; }
details.tableview summary:hover { color: var(--text); }
details.tableview[open] summary { margin-bottom: 10px; }
.axis-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* Gelir kalemleri listesi */
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.bar-row:first-of-type { padding-top: 4px; }
.bar-row:last-child { border-bottom: none; }
.bar-row strong { font-weight: 500; }
.bar-track { grid-column: 1 / -1; height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.bar-fill { height: 100%; border-radius: 2px; }
.bar-row.off { color: var(--muted); }
.reason { font-size: 12.5px; color: var(--muted); }
.impact { font-size: 12px; color: var(--faint); margin-top: 3px; }
.impact b { color: var(--text-2); font-weight: 500; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.closed-items { padding: 12px 0 4px; font-size: 12.5px; color: var(--faint); border-bottom: 1px solid var(--border); }
.soft-box { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.flag { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; font-weight: 500; }
.flag.ok { color: var(--good); }
.flag.fail { color: var(--bad); }

/* Stat şeridi (arbitraj) */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.stats > * + * { border-left: 1px solid var(--border); }
@media (max-width: 980px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats > * { border-left: 0 !important; border-top: 1px solid var(--border); } }
.stat2 { padding: 16px 20px; }
.stat2 .l { font-size: 12px; color: var(--muted); }
.stat2 .v { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; margin-top: 4px; }
.stat2 .u { font-size: 12px; color: var(--faint); }

/* Isı haritası */
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 10px; table-layout: fixed; }
.heat th { color: var(--faint); font-weight: 400; padding: 2px; text-align: center; border: 0; font-size: 10px; }
.heat th.rowh, .heat thead th:first-child { width: 64px; text-align: right; padding-right: 8px; white-space: nowrap; }
.heat td { padding: 0; height: 20px; border: 0; border-radius: 3px; }
.heat tbody tr:hover { background: none; }
.heat td:hover { outline: 2px solid var(--text); outline-offset: -1px; }
.heat-scale { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--faint); margin-top: 10px; }
.heat-scale .bar { flex: 0 0 140px; height: 6px; border-radius: 3px; }

/* Duyarlılık tablosu */
table.sgrid { border-collapse: separate; border-spacing: 4px; width: auto; }
table.sgrid th { text-align: center; padding: 4px 10px; border: 0; font-size: 12px; }
table.sgrid td { text-align: center; padding: 10px 12px; border: 0; border-radius: 8px; font-variant-numeric: tabular-nums; min-width: 84px; font-size: 13px; }
table.sgrid tbody tr:hover { background: none; }
table.sgrid td.base { box-shadow: inset 0 0 0 1.5px var(--text); font-weight: 600; }

/* Başa baş kartları */
.be { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.be .l { font-size: 12.5px; color: var(--muted); }
.be .v { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; margin: 6px 0 4px; }
.be .cmp { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meter { height: 4px; border-radius: 2px; background: rgba(var(--pos-rgb), .14); margin-top: 14px; position: relative; overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; background: var(--pos); border-radius: 2px; }
.meter.bad { background: rgba(var(--neg-rgb), .14); }
.meter.bad > span { background: var(--neg); }

/* Parametre / gelir / finansman formları */
.param-table td { vertical-align: middle; white-space: normal; }
.param-table tbody tr:hover { background: none; }
.param-table input { max-width: 170px; }
.param-group { font-size: 12px; color: var(--muted); font-weight: 500; margin: 26px 0 4px; }
.param-group:first-of-type { margin-top: 4px; }
.rev-table td { vertical-align: top; white-space: normal; }
.rev-table tbody tr:hover { background: none; }
.rev-table input[type=number] { width: 140px; }
.rev-table select { width: auto; }
.rev-table input[type=text] { min-width: 150px; }
.fin-card legend { font-weight: 600; }
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state h2 { font-size: 17px; margin-bottom: 8px; }
.empty-state p { max-width: 520px; margin: 0 auto 18px; }
.legend-inline { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Seçim çubuğu (pano bağlamı) */
.selbar { gap: 10px 0; padding: 10px 12px; }
.selbar .ctl { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.selbar .ctl + .ctl { border-left: 1px solid var(--border); }
.selbar .ctl:first-child { padding-left: 4px; }
.selbar .grow + .ctl { border-left: 0; }
.ctl-l { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ctl-v { font-weight: 500; font-size: 13px; }
.ctl-u { color: var(--faint); font-size: 12px; }
.ctl-edit { font-size: 12px; color: var(--faint); }
.ctl-edit:hover { color: var(--text); }
.ctl-reports { gap: 6px; padding-right: 2px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.selbar .seg label { min-width: 30px; justify-content: center; font-variant-numeric: tabular-nums; }
.selbar .seg label:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 1100px) { .selbar .ctl { padding: 4px 10px; } .selbar .ctl + .ctl { border-left: 0; } .selbar .grow { display: none; } }

/* Yöntem ve terimler */
.gl { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 900px) { .gl { grid-template-columns: 1fr; } .gl-toc { display: none; } }
.gl-toc { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.gl-toc a { color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.gl-toc a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.gl-search input { width: 340px; max-width: 100%; }
.gl-sec { margin-bottom: 40px; scroll-margin-top: 80px; }
.gl-sec > h2 { font-size: 18px; margin-bottom: 6px; }
.gl-intro { color: var(--muted); margin: 0 0 14px; max-width: 760px; }
.gl-card { padding: 4px 24px; }
.gl-item { padding: 18px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; transition: background .6s; }
.gl-item:last-child { border-bottom: 0; }
.gl-item.gl-hit { background: var(--accent-soft); margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
.gl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gl-head h3 { font-size: 14.5px; font-weight: 600; }
.gl-anchor { color: var(--text); }
.gl-aka { color: var(--muted); font-size: 12.5px; }
.gl-desc { margin: 6px 0 0; color: var(--text-2); max-width: 820px; }
.gl-formula { margin: 10px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); overflow-x: auto;
  font: 12.5px/1.65 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text); white-space: pre; }
.gl-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.gl-param { font-size: 12px; color: var(--muted); padding: 2px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border-strong); }
.gl-param b { color: var(--text); font-weight: 600; }
.gl-fn { font: 11.5px ui-monospace, "SF Mono", Menlo, monospace; color: var(--faint); background: none; }
/* Gösterge kartlarında tanım bağlantısı */
.help { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font-size: 10px; font-weight: 600;
  color: var(--faint); box-shadow: inset 0 0 0 1px var(--border-strong); vertical-align: 1px; margin-left: 3px; }
.help:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--text); text-decoration: none; }
