body { background: var(--bg); }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; padding: 18px 12px; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand img { height: 24px; width: auto; max-width: 200px; display: block; }
.brand .brand-sub { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 6px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav a svg { flex: none; opacity: .85; }
.nav .count[hidden] { display: none; }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 6px; }
.side-foot { margin-top: auto; display: grid; gap: 6px; padding: 10px; border-top: 1px solid var(--border); font-size: 13px; }
.side-foot .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar h1 { font-size: 20px; letter-spacing: -.02em; margin: 0; font-weight: 700; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 8px 28px 48px; display: grid; gap: 20px; max-width: 1360px; width: 100%; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar .spacer { display: none; }
  .topbar #pactions:not(:empty) { width: 100%; }
  .topbar #pactions .seg { width: 100%; justify-content: space-between; }
  .topbar #pactions .seg button { flex: 1; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 14px; }
  .d-foot .btn { flex: 1; }
  .content { padding: 4px 16px 40px; }
}

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; flex-wrap: wrap; }
.panel-h h2 { margin: 0; font-size: 15px; font-weight: 650; }
.panel-h .sub { font-size: 13px; color: var(--muted); }
.panel-b { padding: 16px 18px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g-main { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g2, .g3 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .k-val { font-size: clamp(18px, 5vw, 26px); font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.15; white-space: nowrap; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .input { width: auto; height: 36px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); gap: 2px; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 550; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--accent); color: #fff; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 550; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.t td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--surface-2); }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t .nowrap { white-space: nowrap; }
.t .ell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-wrap { overflow-x: auto; }
@media (max-width: 720px) {
  .t.resp thead { display: none; }
  .t.resp, .t.resp tbody, .t.resp tr, .t.resp td { display: block; width: 100%; }
  .t.resp tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .t.resp tr:last-child { border-bottom: 0; }
  .t.resp td { border: 0; padding: 4px 14px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .t.resp td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  .t.resp td.num { text-align: right; }
  .t.resp td > .tv { min-width: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
  .t.resp td[data-l=""]::before { display: none; }
  .t .ell { max-width: 60vw; }
}
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

.cell-main { font-weight: 550; }
.cell-sub { font-size: 12px; color: var(--muted); }
.coin-cell { display: flex; align-items: center; gap: 8px; }
.copyable { cursor: copy; border-bottom: 1px dashed var(--border-strong); }

/* Drawer & modal */
.overlay { position: fixed; inset: 0; background: rgba(10,10,12,.4); z-index: 80; display: flex; justify-content: flex-end; animation: fade .15s; }
.overlay.center { justify-content: center; align-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(640px, 100vw); height: 100dvh; background: var(--surface); overflow-y: auto; border-left: 1px solid var(--border); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.d-head { position: sticky; top: 0; background: var(--surface); z-index: 2; display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.d-head h3 { margin: 0; font-size: 16px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-body { padding: 20px; display: grid; gap: 20px; }
.d-foot { position: sticky; bottom: 0; z-index: 3; background: var(--surface); display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.sec h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: none; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 14px; position: relative; font-size: 13.5px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl .tl-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); background: var(--border-strong); margin-top: 3px; position: relative; z-index: 1; }
.tl .tl-time { font-size: 12px; color: var(--muted); }
.form { display: grid; gap: 14px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form .row { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 8px; border-radius: 12px; border: 1px solid var(--border-strong); cursor: pointer; font-size: 14px; font-weight: 550; user-select: none; }
.chip input { display: none; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.chip:not(:has(input:checked)) { opacity: .55; }
pre.json { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font: 12.5px/1.55 var(--mono); overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 360px; }
.secret { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.secret code { flex: 1; font: 13px var(--mono); word-break: break-all; }
.callout { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.callout.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.callout.err { background: var(--err-bg); border-color: transparent; color: var(--err); }
.alerts { display: grid; gap: 8px; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-size: 14px; }
.alert-row:hover { border-color: var(--border-strong); }
.alert-row .go { margin-left: auto; color: var(--muted); }
.share { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.share i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

/* Chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart .bar { fill: var(--brand); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart g:hover .bar { opacity: .8; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-t { fill: var(--muted); font-size: 11px; }
.tip { position: absolute; pointer-events: none; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.4; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow); z-index: 5; }
.tip b { font-size: 13px; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.login h1 { font-size: 22px; margin: 18px 0 4px; letter-spacing: -.02em; }
.login p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.err-text { color: var(--err); font-size: 13px; min-height: 18px; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.site-card { padding: 18px; display: grid; gap: 14px; cursor: pointer; transition: border-color .15s; }
.site-card:hover { border-color: var(--border-strong); }
.site-card .sc-top { display: flex; align-items: center; gap: 12px; }
.site-card .sc-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; }
.site-card .sc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.site-card .sc-stats b { display: block; font-size: 16px; font-weight: 650; }

/* Sistem sağlığı */
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.health .h-card { padding: 16px 18px; display: grid; gap: 8px; }
.health .h-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.health .h-name { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.health dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.health dt { color: var(--muted); }
.health dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(47,199,127,.6); animation: pulse 2s infinite; flex: none; }
.pulse.bad { background: var(--err); box-shadow: 0 0 0 0 rgba(255,90,110,.6); }
.pulse.idle { background: var(--muted); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }
.alert-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 14px; }
.alert-item:first-child { border-top: 0; }
.alert-item .ai-body { flex: 1; min-width: 0; word-break: break-word; }
.alert-item .ai-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login .logo { height: 26px; width: auto; display: block; }
