/* ============================================================
   Servis Yöneticisi & Monitör — Design System
   ============================================================ */
:root {
  /* Surfaces */
  --bg: #0a0c10;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, #141a26 0%, #0a0c10 55%);
  --panel: #11141b;
  --panel-2: #161a22;
  --elevated: #1b2029;
  --hover: #1f2531;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);

  /* Text */
  --text: #e6eaf2;
  --text-dim: #aab3c2;
  --muted: #6b7585;

  /* Brand / status */
  --accent: #5b8cff;
  --accent-2: #6f5bff;
  --accent-grad: linear-gradient(135deg, #5b8cff, #6f5bff);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.14);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.14);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.15);
  --cyan: #22d3ee;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.65);
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(91, 140, 255, 0.3); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a313d; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #39414f; background-clip: padding-box; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.right { margin-left: auto; }
.flex { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent-grad);
}
.login-card h1 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.login-card input, .login-card button { padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.login-card input { background: var(--bg); border: 1px solid var(--border-strong); color: var(--text); transition: border-color .15s; }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button { background: var(--accent-grad); color: #fff; border: none; cursor: pointer; font-weight: 600; transition: transform .1s, filter .15s; }
.login-card button:hover { filter: brightness(1.08); }
.login-card button:active { transform: translateY(1px); }
.error-msg { color: var(--red); font-size: 13px; min-height: 18px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar {
  background: rgba(13, 16, 22, 0.7);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-grad);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px -3px rgba(91, 140, 255, 0.5);
  flex: 0 0 auto;
}
.brand .logo svg { width: 19px; height: 19px; color: #fff; }
.brand .title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.brand .subtitle { font-size: 11px; color: var(--muted); }

.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 14px 12px 6px; font-weight: 600; }
.tab {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  cursor: pointer; color: var(--text-dim); font-weight: 500;
  transition: background .14s, color .14s;
  user-select: none;
}
.tab svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .85; }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active { background: rgba(91, 140, 255, 0.13); color: #cfe0ff; }
.tab.active svg { color: var(--accent); opacity: 1; }
.tab .badge { margin-left: auto; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.stat-chips { display: flex; gap: 10px; }
.chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 13px; font-size: 13px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .dot.green { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.chip .dot.cyan { background: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.14); }
.chip .dot.muted { background: var(--muted); }
.chip b { font-variant-numeric: tabular-nums; }

.content { padding: 24px 26px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.view-head h2 { font-size: 16px; margin: 0; font-weight: 650; }
.view-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* ============================================================
   BUTTONS
   ============================================================ */
button.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--elevated); color: var(--text);
  cursor: pointer; font-size: 13px; font-weight: 550;
  transition: background .14s, border-color .14s, transform .1s, filter .14s;
  white-space: nowrap;
}
button.btn:hover { background: var(--hover); border-color: var(--border-strong); }
button.btn:active { transform: translateY(1px); }
button.btn svg { width: 16px; height: 16px; }
button.btn.primary { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px -5px rgba(91,140,255,.6); }
button.btn.primary:hover { filter: brightness(1.08); background: var(--accent-grad); }
button.btn.green { background: linear-gradient(135deg, #34d399, #10b981); border-color: transparent; color: #04130c; font-weight: 650; box-shadow: 0 4px 16px -5px rgba(52,211,153,.55); }
button.btn.green:hover { filter: brightness(1.06); }
button.btn.red { background: transparent; border-color: rgba(248,113,113,.4); color: var(--red); }
button.btn.red:hover { background: var(--red-dim); }
button.btn.small { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
button.btn:disabled { opacity: .4; cursor: not-allowed; }
button.btn.ghost { background: transparent; border-color: var(--border); }
button.btn.ghost:hover { background: var(--hover); }

/* Icon buttons */
button.icon {
  display: grid; place-items: center;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: 8px; width: 33px; height: 31px; cursor: pointer; color: var(--text-dim);
  transition: background .14s, border-color .14s, color .14s;
}
button.icon svg { width: 15px; height: 15px; }
button.icon:hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
button.icon.go:hover:not(:disabled) { color: var(--green); border-color: rgba(52,211,153,.4); }
button.icon.stop:hover:not(:disabled) { color: var(--red); border-color: rgba(248,113,113,.4); }
button.icon:disabled { opacity: .28; cursor: not-allowed; }

/* ============================================================
   CARDS / GRID
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--muted); opacity: .5; transition: background .2s; }
.card.running::before { background: var(--green); opacity: 1; box-shadow: 0 0 12px var(--green); }
.card.stopped::before { background: #39414f; }
.card.unreachable::before { background: var(--yellow); opacity: 1; }

.card-head { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.card-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 14px 0 4px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.metrics.m2 { grid-template-columns: repeat(2, 1fr); }
.metric { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; background: var(--panel); }
.metric .v { font-family: var(--mono); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric .l { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.card-actions { display: flex; gap: 6px; margin-top: 12px; align-items: center; }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  border: 1px solid transparent;
}
.badge .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-dim); color: #4ade80; border-color: rgba(52,211,153,.25); }
.badge.red { background: var(--red-dim); color: #fb7185; border-color: rgba(248,113,113,.25); }
.badge.gray { background: rgba(255,255,255,.05); color: var(--text-dim); border-color: var(--border); }
.badge.yellow { background: var(--yellow-dim); color: #fcd34d; border-color: rgba(251,191,36,.25); }
.badge.blue { background: rgba(91,140,255,.14); color: #93b4ff; border-color: rgba(91,140,255,.25); }
.badge.live .led { animation: blink 1.4s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  background: rgba(255,255,255,.02); border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody tr:last-child td { border-bottom: none; }
td.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   TOOLBAR / FORMS
   ============================================================ */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input.txt { padding-left: 38px; width: 100%; }
input.txt, select.txt, textarea.txt {
  background: var(--bg); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; font-family: var(--sans);
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
input.txt:focus, select.txt:focus, textarea.txt:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.15); }
textarea.txt { font-family: var(--mono); resize: vertical; }
select.txt { cursor: pointer; }

.section-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 20px 0 9px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-bg.open { display: flex; animation: fade .18s ease; }
.modal {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-strong); border-radius: 18px;
  width: min(840px, 96vw); max-height: 88vh; overflow: auto; padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 18px; font-size: 18px; letter-spacing: -0.01em; }
.modal .row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.modal .row label { font-size: 12px; color: var(--text-dim); font-weight: 550; }
.modal .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.check { flex-direction: row !important; align-items: center; gap: 7px !important; cursor: pointer; font-size: 13px; color: var(--text-dim); }
.checks { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   LOG VIEWER
   ============================================================ */
.logbox {
  background: #07090d; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all; max-height: 60vh; overflow: auto;
  color: #c8d0dc;
}
.logbox .err { color: #fca5a5; }
.logbox:empty::after { content: "(boş)"; color: var(--muted); }

/* ============================================================
   AUTOSTART PROGRESS
   ============================================================ */
.autostart-panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.autostart-panel .ap-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.autostart-panel .ap-head strong { font-size: 14px; }
.progress-track { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-fill { height: 100%; background: var(--accent-grad); border-radius: 999px; transition: width .4s ease; width: 0; }
.step-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: none; }
.step-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; position: relative; }
.step-dot.done { background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); }
.step-dot.failed { background: var(--red); box-shadow: 0 0 0 4px var(--red-dim); }
.step-dot.waiting, .step-dot.starting { background: var(--yellow); box-shadow: 0 0 0 4px var(--yellow-dim); animation: pulse 1s infinite; }
.step-dot.skipped { background: #2a313d; }
.step-row .s-name { font-weight: 550; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ============================================================
   MISC
   ============================================================ */
.empty {
  color: var(--muted); padding: 56px 20px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: rgba(255,255,255,.012);
}
.empty svg { width: 38px; height: 38px; opacity: .4; margin-bottom: 10px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; padding: 13px 18px; border-radius: 12px;
  z-index: 200; color: #fff; font-weight: 550; font-size: 13.5px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px;
  animation: toastIn .25s cubic-bezier(.2,.9,.3,1.2);
  border: 1px solid rgba(255,255,255,.12);
}
.toast.ok { background: linear-gradient(135deg, #1a3a2c, #14241d); }
.toast.err { background: linear-gradient(135deg, #3a1d1d, #271414); }
.toast .led { width: 9px; height: 9px; border-radius: 50%; }
.toast.ok .led { background: var(--green); }
.toast.err .led { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Purple badge (oto-restart) */
.badge.purple { background: rgba(111,91,255,.16); color: #b3a4ff; border-color: rgba(111,91,255,.3); }

/* Form alan ipucu */
.field-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============ AYARLAR ============ */
.settings-wrap { display: grid; gap: 18px; max-width: 760px; }
.settings-group { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); border-radius: 14px; padding: 6px 18px 10px; }
.settings-group-title {
  font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase;
  letter-spacing: .07em; padding: 14px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.settings-field {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.settings-group .settings-field:last-child { border-bottom: none; }
.settings-field.toggle { flex-direction: row-reverse; justify-content: flex-end; }
.settings-field > div { flex: 1 1 auto; min-width: 0; }
.sf-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sf-help { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; max-width: 520px; }
input.sf-input { width: 130px; flex: 0 0 130px; text-align: right; }
.settings-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; max-width: 760px; }
.settings-actions .muted { font-size: 11.5px; }

/* ============ GENEL BAKIŞ (DASHBOARD) ============ */
.ov-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tile {
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; position: relative; overflow: hidden;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-grad); }
.tile.danger::before { background: var(--red); }
.tile.warn::before { background: #fcd34d; }
.tile .t-val { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile .t-tot { font-size: 16px; color: var(--muted); font-weight: 600; }
.tile .t-lbl { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; }
.tile.danger .t-val { color: #fb7185; }
.ov-section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 10px; }
.alarm-banner {
  background: var(--red-dim); border: 1px solid rgba(248,113,113,.3); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.alarm-banner strong { color: #fb7185; }
.alarm-pill { background: rgba(248,113,113,.16); color: #fda4af; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; }
.card.mini { padding: 14px 16px; }
.spark-row { display: flex; gap: 14px; margin-top: 10px; }
.spark-wrap { flex: 1; min-width: 0; }
.spark { width: 100%; height: 28px; display: block; }
.spark-l { font-size: 10.5px; color: var(--muted); display: block; margin-top: 2px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .ov-tiles { grid-template-columns: repeat(2, 1fr); } }

/* ============ BİLDİRİMLER ============ */
.notify-ico { display: inline-flex; width: 17px; height: 17px; vertical-align: -3px; margin-right: 2px; }
.notify-ico.telegram { color: #2aabee; }
.notify-ico.discord { color: #5865f2; }
.ev-all {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px;
  background: rgba(91,140,255,.08); border: 1px solid rgba(91,140,255,.2); font-size: 13px; cursor: pointer;
}
.ev-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-top: 12px; }
.ev-group-title { font-size: 10.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin: 6px 0 4px; }
.ev-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); padding: 3px 0; cursor: pointer; }
.ev-item input { flex: 0 0 auto; }
.ev-item span:first-of-type { flex: 1; }
.sev { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.sev-info { background: var(--accent); }
.sev-warning { background: #fcd34d; }
.sev-critical { background: var(--red); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 999px; transition: background .18s, border-color .18s;
}
.switch .track::before {
  content: ""; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .18s, background .18s;
}
.switch input:checked + .track { background: var(--accent-grad); border-color: transparent; }
.switch input:checked + .track::before { transform: translate(18px, -50%); background: #fff; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .stat-chips { display: none; }
  .settings-field { flex-direction: column; align-items: flex-start; }
  .settings-field.toggle { flex-direction: row-reverse; align-items: center; }
  .sf-input { width: 100%; text-align: left; }
}
