[hidden] { display: none !important; }
:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --fg: #1f2328;
  --muted: #6b7280;
  --line: #e4e4e0;
  --soft: #f1f1ee;
  --accent: #2f5d8a;
  --warn: #8a5a00;
  --warn-bg: #fdf4e0;
  --crit: #b42318;
  --crit-bg: #fbe9e7;
  --ok: #1a7f37;
  --ok-bg: #e8f4ea;
  --bar: #9fb6cc;
}
:root[data-tema="koyu"] {
  --bg: #141618;
  --panel: #1b1e21;
  --fg: #e4e6e9;
  --muted: #98a0aa;
  --line: #2b2f34;
  --soft: #22262a;
  --accent: #8fb4d8;
  --warn: #e0b04a;
  --warn-bg: #2a2314;
  --crit: #f0766c;
  --crit-bg: #2d1a18;
  --ok: #5fb064;
  --ok-bg: #17261a;
  --bar: #46637f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="acik"]) {
    --bg: #141618;
    --panel: #1b1e21;
    --fg: #e4e6e9;
    --muted: #98a0aa;
    --line: #2b2f34;
    --soft: #22262a;
    --accent: #8fb4d8;
    --warn: #e0b04a;
    --warn-bg: #2a2314;
    --crit: #f0766c;
    --crit-bg: #2d1a18;
    --ok: #5fb064;
    --ok-bg: #17261a;
    --bar: #46637f;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
a { color: var(--accent); }
h1 { font-size: 18px; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 13px; margin: 0 0 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
h3 { font-size: 14px; margin: 16px 0 6px; }

.layout { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
nav { border-right: 1px solid var(--line); background: var(--panel); padding: 16px 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
nav .brand { padding: 0 16px 16px; font-weight: 600; }
nav a { display: flex; justify-content: space-between; padding: 7px 16px; color: var(--fg); text-decoration: none; border-left: 3px solid transparent; }
nav a:hover { background: var(--soft); }
nav a.aktif { border-left-color: var(--accent); background: var(--soft); font-weight: 600; }
nav .count { font-size: 12px; color: var(--crit); font-weight: 600; }
nav .bottom { margin-top: auto; padding: 12px 16px; display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
main { padding: 20px 24px 40px; max-width: 1400px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 2fr 1fr; }
.grid.kpi { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-bottom: 16px; }
.kpi .card { margin: 0; }
.kpi .val { font-size: 24px; font-weight: 600; }
.kpi .lbl { color: var(--muted); font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; background: var(--soft); color: var(--fg); white-space: nowrap; }
.tag.uyari { background: var(--warn-bg); color: var(--warn); }
.tag.kritik { background: var(--crit-bg); color: var(--crit); }
.tag.iyi { background: var(--ok-bg); color: var(--ok); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.warnText { color: var(--warn); font-weight: 600; }
.critText { color: var(--crit); font-weight: 600; }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { padding: 8px 10px; border-left: 3px solid var(--line); background: var(--soft); border-radius: 4px; margin-bottom: 8px; }
.alerts li.uyari { border-left-color: var(--warn); }
.alerts li.kritik { border-left-color: var(--crit); }
.alerts li.seen { opacity: .55; }
.alerts .head { display: flex; justify-content: space-between; gap: 8px; }
.alerts .msg { white-space: pre-wrap; margin-top: 2px; }
.alerts .meta { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 10px; align-items: center; }

button, select, input, textarea {
  font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 5px 9px;
}
button { cursor: pointer; background: var(--soft); }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--panel); border-color: var(--accent); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
textarea { width: 100%; min-height: 110px; }
input[type="number"] { width: 80px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

.bars { display: grid; gap: 4px; }
.bars .bar { display: grid; grid-template-columns: 140px 1fr 50px; gap: 8px; align-items: center; }
.bars .fill { height: 14px; background: var(--bar); border-radius: 2px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 140px; }
.hours div { background: var(--bar); border-radius: 2px 2px 0 0; min-height: 1px; position: relative; }
.hourLabels { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; font-size: 10px; color: var(--muted); text-align: center; }

.drawer { position: fixed; top: 0; right: 0; width: min(760px, 100%); height: 100vh; background: var(--panel); border-left: 1px solid var(--line); overflow: auto; padding: 20px 24px; box-shadow: -4px 0 16px rgba(0,0,0,.08); }
.drawer .close { float: right; }
.transcript { display: grid; gap: 6px; margin-top: 8px; }
.transcript .m { padding: 6px 10px; border-radius: 4px; background: var(--soft); max-width: 85%; white-space: pre-wrap; }
.transcript .m.agent { justify-self: end; background: var(--ok-bg); }
.transcript .m.system { justify-self: center; background: none; color: var(--muted); font-size: 12px; }
.transcript .who { font-size: 11px; color: var(--muted); }

.login { max-width: 340px; margin: 15vh auto; }
.login input { width: 100%; margin: 8px 0 12px; }
.err { color: var(--crit); }
.copy { display: flex; gap: 6px; align-items: center; }
.copy code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--soft); padding: 3px 6px; border-radius: 4px; font-size: 12px; }
pre { background: var(--soft); padding: 10px; border-radius: 4px; overflow: auto; max-height: 320px; font-size: 12px; }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.empty { color: var(--muted); padding: 12px 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 8px; }
  nav .brand, nav .bottom { display: none; }
  .grid.two { grid-template-columns: 1fr; }
}

/* Bağlantı anahtarları formu */
.keys { display: grid; gap: 12px; max-width: 560px; }
.keys label { display: grid; gap: 4px; font-weight: 600; }
.keys label .muted { font-weight: 400; }
.keys input { width: 100%; }
.keys .row { display: flex; gap: 6px; }
.keys .row input { flex: 1; }
.keys h3 { margin: 8px 0 0; font-size: 14px; }
.keys .choices button { margin: 0 6px 6px 0; }

/* Yapay zekâ sayfası */
.phase { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.phase:last-of-type { border-bottom: 0; }
.phase input { margin-top: 3px; }
#pilot { margin: 8px 0; }
#pilot input { width: 100%; margin-top: 4px; }
.pair { border-top: 1px solid var(--line); padding: 10px 0; display: grid; gap: 4px; }
.pairRow { display: grid; grid-template-columns: 80px 1fr; gap: 8px; }
.pairRow .lbl { color: var(--muted); font-size: 12px; }
.example { border-top: 1px solid var(--line); padding: 10px 0; display: grid; gap: 6px; }
.example label { display: grid; gap: 2px; }
.example textarea { min-height: 0; }
.newExample { margin: 8px 0; }
.newExample summary { cursor: pointer; color: var(--accent); }
.pair .link { justify-self: start; }
