:root {
  --bg: #0D1117; --bar: #0F141B; --card: #151B23; --inset: #0F141B; --line: #262E38; --line2: #3A4554;
  --text: #E6EDF3; --soft: #C9D2DC; --muted: #A9B4C2; --dim: #8B97A6;
  --gold: #E8B547; --gold2: #F5CD73; --goldbg: #2A2312;
  --up: #5CCB95; --upbg: #0F1F18; --upline: #1F3A2E;
  --down: #F08A4B; --downbg: #2A1B12;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.up { color: var(--up); } .down { color: var(--down); } .gold { color: var(--gold); } .dim { color: var(--dim); } .muted { color: var(--muted); }
[hidden] { display: none !important; }

/* üst bar */
.topbar { border-bottom: 1px solid var(--line); background: var(--bar); position: sticky; top: 0; z-index: 10; }
.topbar .in { max-width: 1280px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; color: var(--text); }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--gold); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.tag { padding: 4px 10px; border-radius: 999px; background: var(--goldbg); color: var(--gold2); font-size: 12px; font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 10px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.nav a.on { background: #1C232D; color: var(--text); }
.nav a:hover { color: var(--text); }
.badge { background: var(--down); color: var(--bg); border-radius: 999px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.userchip { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 4px; font-size: 14px; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2A3442; display: flex; align-items: center; justify-content: center; font-size: 13px; }

/* sayfa */
main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.eyebrow { font-size: 13px; color: var(--dim); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
h1 { margin: 6px 0 0; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 18px; font-weight: 700; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pill { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.pill.ok { border-color: var(--upline); background: var(--upbg); color: var(--up); }
.pill.warn { border-color: #3A3220; background: #1E1A10; color: var(--gold); }
.pill.bad { border-color: #4A2A18; background: var(--downbg); color: var(--down); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card.tight { padding: 20px; gap: 8px; }
.card .label { font-size: 13px; color: var(--dim); font-weight: 600; }
.card .big { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; word-break: break-all; }
.card .sub { font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row > .wide { flex: 999 1 560px; min-width: 0; }
.row > .side { flex: 1 1 340px; min-width: 0; }
.cardhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.note { font-size: 12px; color: var(--dim); line-height: 1.6; margin: 0; }

/* tablo */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: var(--dim); font-size: 12px; font-weight: 600; text-align: left; padding: 8px 8px 8px 0; white-space: nowrap; }
td { padding: 12px 8px 12px 0; border-top: 1px solid var(--line); vertical-align: middle; }
td.n, th.n { text-align: right; font-family: var(--mono); white-space: nowrap; }
th.n { font-family: var(--sans); }
tr.total td { border-top: 1px solid var(--line2); font-weight: 700; }
.sub2 { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.empty { color: var(--dim); font-size: 14px; padding: 16px 0; }

/* form */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .flabel { font-size: 13px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--dim); }
input[type=text], input[type=password], input[type=number], select, textarea {
  background: var(--inset); border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; min-height: 44px; width: 100%; font-size: 15px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 181, 71, 0.15); }
input.big { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2); background: transparent; color: var(--soft); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 800; }
.btn.primary:hover { background: var(--gold2); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: var(--down); border-color: #4A2A18; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--line); color: var(--text); }
.chips { display: grid; gap: 8px; }
.chip { min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--inset); color: var(--soft); font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; }
.chip.on { border-color: var(--gold); background: var(--goldbg); color: var(--gold2); }
.chip small { display: block; font-family: var(--mono); font-size: 12px; margin-top: 4px; opacity: 0.85; font-weight: 500; }
.callout { border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.6; border: 1px solid var(--line); background: var(--inset); color: var(--muted); }
.callout.ok { background: var(--upbg); border-color: var(--upline); }
.callout.warn { background: #1E1A10; border-color: #3A3220; }
.callout.bad { background: var(--downbg); border-color: #4A2A18; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-family: var(--mono); text-align: right; }
.kv.total { border-top-color: var(--line2); font-weight: 700; font-size: 15px; }
.kv.total span:first-child { color: var(--text); }

.status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; display: inline-block; }
.status.ok { background: var(--upbg); color: var(--up); }
.status.wait { background: var(--goldbg); color: var(--gold2); }
.status.bad { background: var(--downbg); color: #F5A877; }
.status.off { background: #1C232D; color: var(--muted); }

/* grafikler */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 11px; fill: var(--dim); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; border-bottom: 1px solid var(--line2); padding-top: 24px; }
.bars .b { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .b i { display: block; width: 100%; max-width: 56px; border-radius: 6px 6px 0 0; }
.bars .b span { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.barlabels { display: flex; gap: 6px; }
.barlabels span { flex: 1 1 0; text-align: center; font-size: 12px; color: var(--dim); min-width: 0; }

/* bildirim */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1C232D; border: 1px solid var(--line2); color: var(--text); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 100; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.toast.err { border-color: #4A2A18; color: #F5A877; }
.modalbg { position: fixed; inset: 0; background: rgba(5, 8, 12, 0.7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border: 1px solid var(--line2); border-radius: 16px; padding: 24px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.loading { color: var(--dim); padding: 48px 0; text-align: center; }
.srow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.srow .t { font-weight: 700; font-size: 15px; }
.srow .s { font-size: 13px; color: var(--dim); margin-top: 2px; }

@media (max-width: 640px) {
  .topbar { position: static; }
  .nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; order: 3; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
  .chart text { font-size: 15px; }
  main { padding: 24px 16px 48px; }
  .topbar .in { padding: 12px 16px; }
  h1 { font-size: 26px; }
  .card { padding: 18px; }
  .card .big { font-size: 26px; }
  .two { grid-template-columns: minmax(0, 1fr); }
}
