/* =====================================================================
   Dynaside OMS — tasarım sistemi (D yönü)
   Marka (data-brand) + tema (data-theme) + yoğunluk (data-density) + yazı boyutu (data-fs)
   ===================================================================== */

:root {
  --font-ui: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;
  --fs: 13px;
  --pad-y: 8px;
  --radius: 10px;
  --radius-lg: 12px;
}
:root[data-fs="s"] { --fs: 12px; }
:root[data-fs="l"] { --fs: 14.5px; }
:root[data-density="compact"] { --pad-y: 5px; }

/* ---------- Nevandora: siyah-beyaz, serif başlık ---------- */
:root[data-brand="nevandora"] { --font-head: 'Young Serif', Georgia, serif; --head-weight: 400; --mark-radius: 50%; }
:root[data-brand="nevandora"][data-theme="light"] {
  --bg: #F6F5F2; --surface: #FFFFFF; --surface2: #FAF9F6; --border: #E4E1DA; --border-strong: #CFCBC2;
  --text: #141414; --muted: #5F5B54; --accent: #141414; --accent-text: #FFFFFF; --accent-soft: #EDEBE5;
  --mark-bg: #141414; --mark-text: #FFFFFF; --row-sel: #F1EFE9; --bar2: #B9B3A7; --bar3: #DAD5CB;
}
:root[data-brand="nevandora"][data-theme="dark"] {
  --bg: #0F0F0E; --surface: #181816; --surface2: #1E1E1B; --border: #2C2B28; --border-strong: #3A3935;
  --text: #EDEBE6; --muted: #A39F97; --accent: #F2EFE8; --accent-text: #121212; --accent-soft: #26251F;
  --mark-bg: #F2EFE8; --mark-text: #121212; --row-sel: #24231F; --bar2: #6A665E; --bar3: #45423C;
}

/* ---------- Zuzu: lacivert-pembe, yuvarlak başlık ---------- */
:root[data-brand="zuzu"] { --font-head: 'Fredoka', 'Geist', sans-serif; --head-weight: 600; --mark-radius: 11px; }
:root[data-brand="zuzu"][data-theme="light"] {
  --bg: #F6F6FA; --surface: #FFFFFF; --surface2: #F9F9FC; --border: #E3E3EE; --border-strong: #CACBE0;
  --text: #1E2046; --muted: #5A5C7A; --accent: #2F3366; --accent-text: #FFFFFF; --accent-soft: #ECEDF7;
  --mark-bg: #F08CA6; --mark-text: #2F3366; --row-sel: #EEEFF8; --bar2: #EE8FA8; --bar3: #A9ACD6;
}
:root[data-brand="zuzu"][data-theme="dark"] {
  --bg: #0F1020; --surface: #171933; --surface2: #1C1F3D; --border: #2A2D52; --border-strong: #3A3E6A;
  --text: #ECEDF7; --muted: #A5A8C8; --accent: #A9AEF5; --accent-text: #0F1020; --accent-soft: #232647;
  --mark-bg: #F19AB2; --mark-text: #1E2046; --row-sel: #22254A; --bar2: #C76B86; --bar3: #5D6299;
}

/* ---------- Durum renkleri (iki markada ortak) ---------- */
:root[data-theme="light"] {
  --warn-bg: #FFF2DC; --warn-soft: #FFF9EE; --warn-line: #F0C98A; --warn-ink: #8A4B00;
  --ok-bg: #E6F2EA; --ok-ink: #1F6B3E; --info-bg: #EAF0FA; --info-ink: #2D4E8A;
  --err-bg: #FDE7E7; --err-ink: #9F1F1F; color-scheme: light;
}
:root[data-theme="dark"] {
  --warn-bg: #2E2110; --warn-soft: #211A10; --warn-line: #5A4120; --warn-ink: #F2B562;
  --ok-bg: #14261B; --ok-ink: #7FCB98; --info-bg: #172235; --info-ink: #9DB8EA;
  --err-bg: #3A1616; --err-ink: #F5A3A3; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-ui); font-size: var(--fs); line-height: 1.45; color: var(--text); background: var(--bg); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.head { font-family: var(--font-head); font-weight: var(--head-weight); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Üst bar ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brandmark { display: flex; align-items: center; gap: 10px; }
.brandmark .mark { width: 32px; height: 32px; border-radius: var(--mark-radius); display: grid; place-items: center; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 17px; background: var(--mark-bg); color: var(--mark-text); }
.brandmark .name { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 19px; }
.brandmark .tag { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; padding: 3px 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); }
.spacer { flex: 1 1 10px; }

.search { position: relative; flex: 1 1 260px; max-width: 460px; }
.search label { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; z-index: 40; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); }
.search-results button { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; }
.search-results button:hover, .search-results button:focus-visible { background: var(--row-sel); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 0; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.err { background: var(--err-bg); color: var(--err-ink); }
.pill.idle { background: var(--accent-soft); color: var(--muted); }

.nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.nav a { padding: 12px 10px 10px; color: var(--muted); border-bottom: 2px solid transparent; }
.nav a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.nav a:hover { text-decoration: none; color: var(--text); }
.nav .count { margin-left: 4px; font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Sayfa ---------- */
.page { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1680px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head .crumb { font-size: 12px; color: var(--muted); }
.page-head h1 { margin: 2px 0 0; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 26px; line-height: 1.15; }
.page-head .sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Butonlar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface2); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.lg { height: 42px; padding: 0 20px; }
.btn.icon { width: 36px; padding: 0; }
.linkbtn { border: 0; background: transparent; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--accent-soft); gap: 2px; flex-wrap: wrap; }
.seg button, .seg a { padding: 6px 13px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"], .seg a.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg a:hover { text-decoration: none; color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; }
.chip .n { font-family: var(--font-mono); font-size: 11px; opacity: .8; }
.chip[aria-selected="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag.info { background: var(--info-bg); color: var(--info-ink); }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag.err { background: var(--err-bg); color: var(--err-ink); }

/* ---------- Kart ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card.pad { padding: 18px 20px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card.warnline { border-color: var(--warn-line); }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } .topbar, .page { padding-left: 16px; padding-right: 16px; } }
.big { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 40px; line-height: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.list > * + * { border-top: 1px solid var(--border); }
.list-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; align-items: baseline; }

/* ---------- Durum çubuğu ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.steps li { padding: 11px 16px; display: flex; flex-direction: column; gap: 2px; }
.steps li + li { border-left: 1px solid var(--border); }
.steps .k { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.steps .v { font-size: 15px; font-weight: 600; }
.steps .s { font-size: 12px; color: var(--muted); }
.steps li.done .k { color: var(--ok-ink); }
.steps li.warn { background: var(--warn-soft); }
.steps li.warn .k { color: var(--warn-ink); }
.steps li.ok { background: var(--ok-bg); }
.steps li.ok .k { color: var(--ok-ink); }
@media (max-width: 720px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps li:nth-child(3) { border-left: 0; } }

/* ---------- Çalışma alanı ---------- */
.work { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.work-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.work-side { flex: 1 1 320px; max-width: 400px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.tablebox { overflow: auto; max-height: 70vh; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: calc(var(--fs) - .5px); }
table.data th { position: sticky; top: 0; z-index: 2; text-align: left; font-size: 10.5px; letter-spacing: .04em; color: var(--muted); background: var(--surface2); font-weight: 600; padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid var(--border); }
table.data td { padding: var(--pad-y) 10px; white-space: nowrap; border-top: 1px solid var(--border); }
table.data tr.sel td { background: var(--row-sel); }
table.data tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--text); }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover td { background: var(--row-sel); }
table.data td.wrap { white-space: normal; max-width: 240px; }
table.data td.clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
table.data td.strong { font-weight: 600; }
table.data .sep { border-right: 2px solid var(--border); }
.rowname { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; font-weight: 500; text-align: left; }
.rowname .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok-ink); flex: 0 0 auto; }
.rowname .dot.warn { background: var(--warn-ink); }
.rowname .dot.info { background: var(--info-ink); }
.rowname .dot.err { background: var(--err-ink); }

.detail { display: flex; flex-direction: column; }
.detail .hd { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.detail .who { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 21px; }
.detail .box { margin: 12px 16px 0; padding: 11px 13px; border-radius: 9px; background: var(--warn-bg); color: var(--warn-ink); display: flex; flex-direction: column; gap: 4px; }
.detail .box b { font-weight: 700; }
.detail .box span { font-size: 12.5px; line-height: 1.5; }
.detail .sect { padding: 12px 16px 4px; }
.detail .sect-t { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--muted); padding-bottom: 6px; }
.map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.map .l { font-size: 10.5px; color: var(--muted); }
.map .raw { font-family: var(--font-mono); font-size: 11.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.map .out { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail .ft { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; }

.actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border); }

/* ---------- Yükleme ---------- */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 20px; border-radius: var(--radius-lg); border: 1.5px dashed var(--border-strong); background: var(--surface); text-align: center; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop.sm { padding: 18px 12px; }
.drop strong { font-size: 15px; }
.progress { height: 6px; border-radius: 6px; background: var(--accent-soft); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .25s ease; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12px; font-weight: 600; }
.input, textarea.input, select.input { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; font-family: var(--font-mono); font-size: 12px; }
.help { font-size: 12px; color: var(--muted); }
.setting { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; padding: 16px 0; align-items: center; }
.setting + .setting { border-top: 1px solid var(--border); }
@media (max-width: 720px) { .setting { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

/* ---------- Grafik ---------- */
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; align-items: end; height: 190px; }
.bars .col { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .stack { display: flex; flex-direction: column; gap: 2px; }
.bars .n, .bars .d { font-size: 11px; text-align: center; color: var(--muted); }
.bars .d.today { color: var(--text); font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Marka seçimi ---------- */
.chooser { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #F6F5F2; color: #141414; font-family: var(--font-ui); }
.chooser h1 { font-family: 'Young Serif', serif; font-weight: 400; font-size: 34px; margin: 0 0 6px; text-align: center; }
.chooser p { text-align: center; color: #5F5B54; margin: 0 0 28px; }
.chooser .opts { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 18px; }
.chooser button { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 34px 20px; border-radius: 16px; border: 1px solid #E4E1DA; background: #fff; transition: transform .15s, box-shadow .15s; }
.chooser button:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.chooser .m { width: 64px; height: 64px; display: grid; place-items: center; font-size: 30px; }
.chooser .nev .m { border-radius: 50%; background: #141414; color: #fff; font-family: 'Young Serif', serif; }
.chooser .zuzu .m { border-radius: 18px; background: #F08CA6; color: #2F3366; font-family: 'Fredoka', sans-serif; font-weight: 600; }
.chooser .nev span { font-family: 'Young Serif', serif; font-size: 22px; }
.chooser .zuzu span { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 22px; color: #2F3366; }
@media (max-width: 600px) { .chooser .opts { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Bildirim ---------- */
.toasts { position: fixed; right: 20px; top: 72px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 240px; max-width: 420px; padding: 11px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.toast.err { background: var(--err-ink); color: #fff; }

.empty { padding: 28px; text-align: center; color: var(--muted); }
pre.report { margin: 0; padding: 12px; border-radius: 10px; background: var(--surface2); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; white-space: pre-wrap; max-height: 340px; overflow: auto; }
table.data.static tbody tr { cursor: default; }
table.data.static tbody tr:hover td { background: transparent; }

.detail textarea, .detail label.sect-t { display: block; width: 100%; }
.setting > .seg, .setting > div > .btn { justify-self: start; }
