/* ==========================================================================
   WebDev Control Center v3.1 — "Soft Midnight"
   Eye-friendly dark design: soft contrasts (no pure white on black), calm
   accents, generous spacing, rounded surfaces. WCAG AA for all text.
   ========================================================================== */

:root {
  --bg: #0e1320;
  --bg-2: #0b101b;
  --surface: #151b2b;
  --surface-2: #1a2134;
  --surface-3: #212a40;
  --line: rgba(148, 163, 184, 0.10);
  --line-2: rgba(148, 163, 184, 0.18);

  --text: #dde3ee;
  --text-2: #a9b3c6;
  --text-3: #7e899f;

  --accent: #7cb8f7;
  --accent-2: #9aa5f8;
  --accent-bg: rgba(124, 184, 247, 0.12);
  --accent-line: rgba(124, 184, 247, 0.32);

  --ok: #74d3a0;
  --ok-bg: rgba(116, 211, 160, 0.12);
  --warn: #f1c878;
  --warn-bg: rgba(241, 200, 120, 0.12);
  --danger: #ee9a9a;
  --danger-bg: rgba(238, 154, 154, 0.12);

  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset, 0 10px 30px rgba(3, 6, 15, 0.28);

  --sidebar-w: 256px;
  --topbar-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 14.5px/1.6 var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 0% -10%, rgba(124, 140, 247, 0.07), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(124, 184, 247, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #a3cdfa; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: rgba(148, 163, 184, 0.08); padding: 1px 7px; border-radius: 6px; color: #c3d6f2; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.005em; color: var(--text); }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: 6px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #111726 0%, #0d1220 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform 0.25s ease;
}
.brand { height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, #5d8fe8, #8b8ff3);
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(93, 143, 232, 0.25);
}
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px 24px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); padding: 0 12px 6px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 1px 0; border-radius: 10px;
  color: var(--text-2); font-size: 13.8px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: rgba(148, 163, 184, 0.07); color: var(--text); }
.nav-link.active { background: var(--accent-bg); color: #cfe3fb; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link .icon { opacity: 0.85; }
.nav-tag { margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: rgba(148, 163, 184, 0.10); color: var(--text-3); }

.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 28px;
  background: rgba(14, 19, 32, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.pill b { color: var(--text); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(116, 211, 160, 0.14); flex-shrink: 0; }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(241, 200, 120, 0.14); }
.dot.danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(238, 154, 154, 0.14); }
.dot.off { background: var(--text-3); box-shadow: none; }

.content { padding: 28px; width: 100%; max-width: 1480px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 600; }
.page-sub { margin-top: 4px; color: var(--text-2); font-size: 13.8px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Layout helpers ---------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(26, 33, 52, 0.75), rgba(21, 27, 43, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}
.card-flat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-title { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-title .icon { color: var(--accent); }
.card-sub { margin-top: 3px; font-size: 12.8px; color: var(--text-3); }
.card-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.icon-tile {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--accent-bg); color: var(--accent); font-size: 19px;
}
.icon-tile.ok { background: var(--ok-bg); color: var(--ok); }
.icon-tile.warn { background: var(--warn-bg); color: var(--warn); }
.icon-tile.danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Server panel (dashboard) ---------- */
.server-head { display: flex; align-items: center; gap: 14px; }
.server-name { font-size: 16.5px; font-weight: 600; }
.server-meta { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.gauges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0 8px; }
.gauge { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: var(--radius); background: rgba(11, 16, 27, 0.35); border: 1px solid var(--line); }
.gauge svg { width: 78px; height: 78px; transform: rotate(-90deg); }
.gauge .track { stroke: rgba(148, 163, 184, 0.12); }
.gauge .val { stroke: var(--accent); transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease; }
.gauge .val.ok { stroke: var(--ok); }
.gauge .val.warn { stroke: var(--warn); }
.gauge .val.danger { stroke: var(--danger); }
.gauge-wrap { position: relative; width: 78px; height: 78px; }
.gauge-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 600; color: var(--text); }
.gauge-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.gauge-detail { font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.35; }

.chart-box { margin-top: 14px; padding: 14px 14px 8px; border-radius: var(--radius); background: rgba(11, 16, 27, 0.35); border: 1px solid var(--line); }
.chart-box canvas { width: 100%; height: 92px; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.kv { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(11, 16, 27, 0.35); border: 1px solid var(--line); min-width: 0; }
.kv-k { font-size: 11.5px; color: var(--text-3); }
.kv-v { font-size: 13.8px; font-weight: 600; color: var(--text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-size: 13.8px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 12px; color: var(--text-3); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: rgba(148, 163, 184, 0.10); color: var(--text-2); border: 1px solid transparent;
}
.badge-ok { background: var(--ok-bg); color: #a5e4c2; }
.badge-warn { background: var(--warn-bg); color: #f5d9a2; }
.badge-danger { background: var(--danger-bg); color: #f4bcbc; }
.badge-accent { background: var(--accent-bg); color: #b9d8fb; }
.badge .dot { width: 6px; height: 6px; box-shadow: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  font: 500 13.5px/1 var(--font); color: var(--text);
  background: var(--surface-3); border: 1px solid var(--line-2);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: #283250; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: linear-gradient(180deg, #5f93ea, #4f7fd9); border-color: rgba(124, 184, 247, 0.45); color: #fff; }
.btn-primary:hover { background: linear-gradient(180deg, #6a9cf0, #5888e0); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.08); color: var(--text); }
.btn-ok { background: var(--ok-bg); border-color: rgba(116, 211, 160, 0.3); color: #a5e4c2; }
.btn-ok:hover { background: rgba(116, 211, 160, 0.2); color: #c3eed6; }
.btn-warn { background: var(--warn-bg); border-color: rgba(241, 200, 120, 0.3); color: #f5d9a2; }
.btn-warn:hover { background: rgba(241, 200, 120, 0.2); color: #f9e6c2; }
.btn-danger { background: var(--danger-bg); border-color: rgba(238, 154, 154, 0.3); color: #f4bcbc; }
.btn-danger:hover { background: rgba(238, 154, 154, 0.2); color: #f9d4d4; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.8px; border-radius: 9px; }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }

/* ---------- Forms (never white) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label, .label { font-size: 12.8px; font-weight: 500; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); }

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="url"], input[type="search"], input[type="file"], select, textarea {
  width: 100%; min-height: 40px;
  padding: 9px 12px; border-radius: 10px;
  background: #0f1525; color: var(--text);
  border: 1px solid var(--line-2);
  font: 14px/1.4 var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: #75809a; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(124, 184, 247, 0.14); background: #111829; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select option { background: #151b2b; color: var(--text); }
input[type="file"] { padding: 7px; cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 12px; height: 28px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); font: 500 12.5px var(--font); cursor: pointer; }
textarea { min-height: 110px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: #6a9cf0; margin: 0; }
.input-group { display: flex; gap: 8px; }
.input-group > input { flex: 1; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background 0.2s ease; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c5cede; transition: transform 0.2s ease, background 0.2s ease; }
.switch input:checked + .switch-track { background: rgba(116, 211, 160, 0.35); border-color: rgba(116, 211, 160, 0.45); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: #e9fbf1; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: middle; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover td { background: rgba(148, 163, 184, 0.035); }
tbody tr:last-child td { border-bottom: 0; }
td .list-sub { margin-top: 1px; }
.td-actions { text-align: right; white-space: nowrap; }

/* ---------- Alerts / Toasts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius); font-size: 13.8px; border: 1px solid; margin-bottom: 18px; }
.alert .icon { margin-top: 1px; }
.alert-ok { background: rgba(116, 211, 160, 0.08); border-color: rgba(116, 211, 160, 0.25); color: #bfead2; }
.alert-danger { background: rgba(238, 154, 154, 0.08); border-color: rgba(238, 154, 154, 0.25); color: #f6cccc; }
.alert-info { background: rgba(124, 184, 247, 0.08); border-color: rgba(124, 184, 247, 0.25); color: #c8dffb; }
.alert-warn { background: rgba(241, 200, 120, 0.08); border-color: rgba(241, 200, 120, 0.25); color: #f6e0b4; }
.secret { margin-top: 6px; font-family: var(--mono); background: rgba(11, 16, 27, 0.55); padding: 6px 10px; border-radius: 8px; display: inline-flex; gap: 10px; align-items: center; word-break: break-all; }

/* ---------- Project tiles ---------- */
.tile { display: flex; flex-direction: column; gap: 14px; }
.tile-head { display: flex; gap: 14px; align-items: flex-start; }
.tile-emoji { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: rgba(148, 163, 184, 0.08); border: 1px solid var(--line); flex-shrink: 0; }
.tile-title { font-size: 15.5px; font-weight: 600; }
.tile-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tile-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Tabs / Segments ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tab { height: 32px; padding: 0 14px; border-radius: 9px; display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; border: 0; background: transparent; }
.tab.active, .tab:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Dialog ---------- */
dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  background: #161d2e; color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
dialog.wide { width: min(820px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 8, 16, 0.62); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlg-title { font-size: 16px; font-weight: 600; }
.dlg-body { padding: 20px 22px; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(11, 16, 27, 0.25); }

/* ---------- File manager / editor ---------- */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13.5px; }
.crumbs a { padding: 4px 8px; border-radius: 7px; color: var(--text-2); }
.crumbs a:hover { background: rgba(148, 163, 184, 0.08); color: var(--text); }
.crumbs .sep { color: var(--text-3); }
.file-name { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.file-name .icon { color: var(--text-3); }
.file-name.dir .icon { color: var(--accent); }
.editor {
  width: 100%; min-height: 62vh; resize: vertical;
  font: 13px/1.6 var(--mono); tab-size: 4;
  background: #0b101b; color: #d5dceb;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px; white-space: pre; overflow: auto;
}

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--text-3); }
.empty .icon { width: 30px; height: 30px; margin-bottom: 10px; color: var(--text-3); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

/* ---------- Backdrop for drawer ---------- */
.backdrop { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(5, 8, 16, 0.6); }
.backdrop.open { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 60px rgba(0, 0, 0, 0.45); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .g-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 760px) {
  .content { padding: 18px 14px; }
  .topbar { padding: 0 14px; }
  .g-3, .g-4, .form-grid { grid-template-columns: 1fr; }
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill.hide-sm, .hide-sm { display: none !important; }
  .page-title { font-size: 19px; }
  .card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
