:root {
  --ink: #0b1b2b;
  --ink-2: #33475b;
  --muted: #6b7c8f;
  --line: #e3e8ee;
  --bg: #f5f7fa;
  --card: #ffffff;
  --brand: #0f4c81;
  --brand-2: #1565c0;
  --ok: #18794e;
  --ok-bg: #e7f6ee;
  --warn: #a15c00;
  --warn-bg: #fff4e0;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --idle: #5b6b7c;
  --idle-bg: #eef1f5;
  --radius: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* Panel iskeleti */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #c9d4df; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; padding: 4px 8px 18px; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #1e88e5, #0f4c81); display: grid; place-items: center; font-size: 13px; }
.brand small { display: block; font-weight: 500; color: #8aa0b5; font-size: 11px; }
.nav a { display: block; color: #c9d4df; padding: 8px 10px; border-radius: 7px; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6f879d; margin: 16px 10px 6px; }
.side .me { margin-top: auto; font-size: 12px; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.side .me button { background: none; border: 0; color: #8aa0b5; padding: 0; cursor: pointer; font: inherit; }
.main { padding: 24px 28px 48px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-ok { color: var(--ok); background: var(--ok-bg); }
.p-warn { color: var(--warn); background: var(--warn-bg); }
.p-bad { color: var(--bad); background: var(--bad-bg); }
.p-idle { color: var(--idle); background: var(--idle-bg); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: #c8d1db; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 4px; color: var(--ink-2); }
input, select, textarea { width: 100%; border: 1px solid #cfd8e2; border-radius: 8px; padding: 9px 11px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9d4f1; border-color: var(--brand-2); }
input[type=checkbox] { width: auto; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.errors { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.errors ul { margin: 0; padding-left: 18px; }
.alert-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }

.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { margin: 0; min-width: 150px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a.on { color: var(--ink); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* Giriş */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #0b1b2b 0%, #0f4c81 100%); }
.auth .box { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth .brand { color: var(--ink); padding: 0 0 18px; }

/* Telefon ekranı */
.m-wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; }
.m-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 16px; }
.m-top .brand { color: var(--ink); padding: 0; }
.big { font-size: 17px; padding: 15px 18px; width: 100%; border-radius: 12px; }
.scan-state { text-align: center; padding: 28px 16px; }
.scan-state .icon { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; font-size: 40px; font-weight: 700; }
.scan-state .icon.wait { background: var(--idle-bg); color: var(--idle); }
.scan-state .icon.ok { background: var(--ok-bg); color: var(--ok); }
.scan-state .icon.bad { background: var(--bad-bg); color: var(--bad); }
.scan-state h2 { font-size: 20px; }
.spinner { width: 38px; height: 38px; border: 4px solid #d4dce5; border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#cam { width: 100%; border-radius: 12px; background: #000; display: none; margin-top: 12px; aspect-ratio: 1; object-fit: cover; }

/* QR çıktı */
.qr-sheet { max-width: 420px; margin: 30px auto; text-align: center; border: 2px solid var(--ink); border-radius: 16px; padding: 24px; background: #fff; }
.qr-sheet svg { width: 100%; height: auto; }
.qr-sheet .plate { font-size: 30px; font-weight: 800; letter-spacing: .04em; margin-top: 8px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
