:root {
  --paper: #f6f9fe;
  --surface: #ffffff;
  --surface-soft: #edf4ff;
  --surface-blue: #e2edff;
  --ink: #17324d;
  --ink-strong: #0e2740;
  --muted: #697d93;
  --line: #dce7f4;
  --line-strong: #c6d8ed;
  --blue: #2563eb;
  --blue-strong: #1748b6;
  --cyan: #139bb5;
  --cyan-soft: #dcf7fb;
  --success: #14866d;
  --success-soft: #dcf6ee;
  --warning: #b56a12;
  --warning-soft: #fff1d9;
  --danger: #c33c4c;
  --danger-soft: #ffeaed;
  --shadow-sm: 0 8px 24px rgba(31, 76, 134, 0.08);
  --shadow-lg: 0 24px 72px rgba(31, 76, 134, 0.14);
  --radius: 18px;
  --sidebar: 244px;
  --font-display: "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  --font-body: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --font-data: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  border-radius: 13px 13px 13px 4px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
  font-family: var(--font-data);
  font-size: 17px;
  font-weight: 800;
}

.brand-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  right: -3px;
  top: -3px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--cyan);
}

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-name { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.brand-caption { margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fff; background: var(--blue); box-shadow: 0 10px 22px rgba(37, 99, 235, .2); }
.btn-primary:hover { background: var(--blue-strong); }
.btn-secondary { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.btn-secondary:hover { border-color: #9bb7d8; background: #f9fbff; }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--surface-soft); }
.btn-danger { color: var(--danger); border-color: #f1bdc4; background: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .52; pointer-events: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }

.field { display: grid; gap: 8px; }
.field + .field { margin-top: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.label { color: var(--ink-strong); font-size: 13px; font-weight: 700; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: #fbfdff;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.input, .select { height: 44px; padding: 0 13px; }
.textarea { min-height: 110px; padding: 12px 13px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: #7da7ec;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}
.input::placeholder, .textarea::placeholder { color: #9aacbe; }

.badge, .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-blue { color: var(--blue-strong); background: var(--surface-blue); }
.badge-cyan { color: #087489; background: var(--cyan-soft); }
.badge-neutral { color: var(--muted); background: #eef2f7; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-success { color: var(--success); background: var(--success-soft); }
.status-warning { color: var(--warning); background: var(--warning-soft); }
.status-danger { color: var(--danger); background: var(--danger-soft); }
.status-neutral { color: var(--muted); background: #eef2f7; }
.status-info { color: var(--blue); background: var(--surface-blue); }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, .94fr) minmax(520px, 1.06fr);
  background: #fff;
}

.auth-story {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  padding: 44px clamp(36px, 6vw, 86px);
  color: #fff;
  background: #153a68;
}

.auth-story::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .32;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.auth-story > * { position: relative; z-index: 1; }
.auth-story .brand-caption { color: rgba(255,255,255,.62); }
.auth-story-copy { max-width: 590px; padding: 70px 0 48px; }
.auth-eyebrow { color: #8fe4f1; font-family: var(--font-data); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.auth-story h1 { max-width: 610px; margin: 20px 0 22px; font-family: var(--font-display); font-size: clamp(40px, 5vw, 70px); line-height: 1.08; letter-spacing: -.055em; }
.auth-story h1 span { color: #9fe8f3; }
.auth-story p { max-width: 520px; margin: 0; color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.9; }

.signal-map { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; gap: 10px; margin-top: 54px; }
.signal-node { display: grid; place-items: center; min-width: 0; }
.signal-dot { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.32); border-radius: 14px; background: rgba(255,255,255,.09); backdrop-filter: blur(8px); font-family: var(--font-data); font-size: 12px; font-weight: 800; }
.signal-label { margin-top: 10px; color: rgba(255,255,255,.64); font-size: 12px; white-space: nowrap; }
.signal-line { height: 1px; position: relative; background: rgba(255,255,255,.2); }
.signal-line::after { content: ""; width: 8px; height: 8px; position: absolute; top: -3px; left: 0; border-radius: 50%; background: #7fe2ef; box-shadow: 0 0 16px #7fe2ef; animation: signalMove 2.4s infinite ease-in-out; }
.auth-foot { color: rgba(255,255,255,.45); font-size: 12px; }

.auth-panel { display: grid; place-items: center; padding: 36px clamp(28px, 7vw, 90px); background: var(--paper); }
.auth-box { width: min(440px, 100%); }
.auth-box h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 30px; letter-spacing: -.035em; }
.auth-box > p { margin: 0 0 32px; color: var(--muted); line-height: 1.7; }
.auth-switch { margin-top: 24px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--blue); font-weight: 700; }
.auth-role-label { width: fit-content; margin-bottom: 14px; padding: 6px 9px; border: 1px solid #b9d1f3; border-radius: 7px; color: var(--blue-strong); background: var(--surface-blue); font-family: var(--font-data); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.auth-role-label.admin { color: #075f70; border-color: #a9dce4; background: var(--cyan-soft); }
.auth-admin-link { display: block; width: fit-content; margin: 22px auto 0; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.auth-admin-link:hover { color: var(--blue); }
.admin-auth-story { background: #113b62; }
.admin-mark { background: var(--cyan); box-shadow: 0 10px 24px rgba(19, 155, 181, .22); }
.admin-scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 42px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.16); }
.admin-scope-grid > div { padding: 15px; background: rgba(17,59,98,.72); }
.admin-scope-grid strong { display: block; color: #a6edf5; font-family: var(--font-data); font-size: 11px; }
.admin-scope-grid span { display: block; margin-top: 6px; color: rgba(255,255,255,.64); font-size: 12px; }
.auth-note { display: flex; gap: 10px; margin-top: 20px; padding: 13px; border-left: 3px solid var(--cyan); color: var(--muted); background: var(--cyan-soft); font-size: 12px; line-height: 1.6; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 72px; }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 0; color: var(--blue); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }

.install-shell { min-height: 100vh; display: grid; grid-template-columns: 300px 1fr; background: var(--paper); }
.install-aside { min-height: 100vh; padding: 36px 28px; color: #fff; background: #173d6d; }
.install-aside .brand-lockup { margin-bottom: 56px; }
.install-steps { display: grid; gap: 6px; }
.install-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; position: relative; padding: 13px 10px; color: rgba(255,255,255,.55); border-radius: 12px; }
.install-step.active { color: #fff; background: rgba(255,255,255,.09); }
.install-step.done { color: #9fe8f3; }
.install-number { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; font-family: var(--font-data); font-size: 11px; }
.install-step strong { display: block; font-size: 13px; }
.install-step small { display: block; margin-top: 3px; opacity: .68; }
.install-main { padding: 48px clamp(28px, 7vw, 100px); }
.install-content { width: min(820px, 100%); margin: 0 auto; }
.install-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 30px; }
.install-header h1 { margin: 0 0 9px; font-family: var(--font-display); font-size: 32px; letter-spacing: -.04em; }
.install-header p { margin: 0; color: var(--muted); line-height: 1.7; }
.install-card { padding: 26px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.check-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.check-row { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 14px 16px; background: #fff; }
.check-label { font-weight: 700; }
.check-value { margin-top: 3px; color: var(--muted); font-family: var(--font-data); font-size: 11px; }
.install-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.install-pane { display: none; }
.install-pane.active { display: block; animation: paneIn .28s ease; }
.driver-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.driver-tab { padding: 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; }
.driver-tab.active { border-color: var(--blue); background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.driver-tab strong { display: block; margin-bottom: 4px; }
.driver-tab small { color: var(--muted); }

.app-shell { min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  height: 100vh;
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
}
.sidebar-brand { padding: 0 8px; margin-bottom: 30px; }
.nav-section { margin: 18px 10px 8px; color: #93a4b6; font-family: var(--font-data); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-item { min-height: 45px; display: flex; align-items: center; gap: 12px; position: relative; padding: 0 12px; border-radius: 11px; color: var(--muted); font-weight: 650; }
.nav-item svg { width: 19px; height: 19px; stroke-width: 1.8; }
.nav-item:hover { color: var(--ink); background: #f4f8fd; }
.nav-item.active { color: var(--blue-strong); background: var(--surface-soft); }
.nav-item.active::before { content: ""; width: 3px; height: 19px; position: absolute; left: -16px; border-radius: 0 4px 4px 0; background: var(--blue); }
.nav-item .count { margin-left: auto; min-width: 21px; height: 21px; display: grid; place-items: center; padding: 0 6px; border-radius: 7px; color: var(--blue); background: #dbe9ff; font-family: var(--font-data); font-size: 10px; }
.sidebar-foot { margin-top: auto; }
.account-card { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 12px 10px; border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: #24558d; font-weight: 800; }
.account-meta { min-width: 0; }
.account-meta strong, .account-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta strong { font-size: 13px; }
.account-meta span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.main-wrap { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; z-index: 20; top: 0; padding: 0 30px; border-bottom: 1px solid rgba(220,231,244,.85); background: rgba(246,249,254,.9); backdrop-filter: blur(18px); }
.topbar-title h1 { margin: 0; font-family: var(--font-display); font-size: 20px; letter-spacing: -.025em; }
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.mobile-menu { display: none; }
.page-content { width: min(1480px, 100%); margin: 0 auto; padding: 28px 30px 52px; }

.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 22px; }
.page-heading h2 { margin: 0 0 7px; font-family: var(--font-display); font-size: 26px; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.7; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 21px 22px 0; }
.card-title { margin: 0; font-family: var(--font-display); font-size: 16px; letter-spacing: -.02em; }
.card-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.card-body { padding: 22px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { min-height: 134px; position: relative; overflow: hidden; padding: 20px; border: 1px solid var(--line); background: #fff; }
.stat-card::after { content: ""; width: 70px; height: 70px; position: absolute; right: -24px; top: -24px; border-radius: 50%; background: var(--surface-blue); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 14px; font-family: var(--font-data); font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.stat-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.stat-foot strong { color: var(--success); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 18px; }
.stack { display: grid; gap: 18px; }

.capture-route { position: relative; overflow: hidden; color: #fff; border: 0; background: #173e6f; box-shadow: 0 20px 55px rgba(23,62,111,.2); }
.capture-route::after { content: ""; position: absolute; inset: 0; opacity: .28; background-image: radial-gradient(circle at 80% 20%, #58d1e4 0, transparent 26%), linear-gradient(120deg, transparent 42%, rgba(255,255,255,.08) 42%, rgba(255,255,255,.08) 43%, transparent 43%); pointer-events: none; }
.capture-route .card-header, .capture-route .card-body { position: relative; z-index: 1; }
.capture-route .card-subtitle { color: rgba(255,255,255,.6); }
.route-strip { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 10px; margin-top: 20px; }
.route-station { min-width: 76px; }
.route-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 13px; background: rgba(255,255,255,.08); font-family: var(--font-data); font-size: 11px; font-weight: 800; }
.route-icon.live { color: #0d4f5b; border: 0; background: #8de7f1; box-shadow: 0 0 28px rgba(141,231,241,.4); }
.route-label { margin-top: 8px; color: rgba(255,255,255,.7); font-size: 11px; }
.route-track { height: 1px; position: relative; background: rgba(255,255,255,.2); }
.route-track.active::after { content: ""; width: 8px; height: 8px; position: absolute; top: -3px; border-radius: 50%; background: #8de7f1; box-shadow: 0 0 14px #8de7f1; animation: routePulse 2s infinite ease-in-out; }
.route-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.route-footer span { color: rgba(255,255,255,.62); font-size: 12px; }

.quota-ring { width: 116px; height: 116px; display: grid; place-items: center; position: relative; margin: 6px auto 18px; border-radius: 50%; background: conic-gradient(var(--blue) var(--quota, 0%), #eaf1fa 0); }
.quota-ring::before { content: ""; width: 88px; height: 88px; position: absolute; border-radius: 50%; background: #fff; }
.quota-ring strong, .quota-ring span { position: relative; z-index: 1; display: block; text-align: center; }
.quota-ring strong { font-family: var(--font-data); font-size: 22px; }
.quota-ring span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.plan-summary { text-align: center; }
.plan-summary h3 { margin: 0 0 6px; font-size: 16px; }
.plan-summary p { margin: 0; color: var(--muted); font-size: 12px; }

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 13px 18px; color: #8295a8; border-bottom: 1px solid var(--line); background: #f9fbfe; font-size: 11px; font-weight: 700; white-space: nowrap; }
.data-table td { padding: 15px 18px; border-bottom: 1px solid #edf2f8; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table .primary { display: block; color: var(--ink-strong); font-weight: 700; }
.data-table .secondary { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.data-code { font-family: var(--font-data); font-size: 12px; }
.table-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.empty-state { display: grid; place-items: center; min-height: 260px; padding: 40px; text-align: center; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; border: 1px dashed #9eb7d3; border-radius: 18px; color: var(--blue); background: var(--surface-soft); font-family: var(--font-data); font-weight: 800; }
.empty-state h3 { margin: 18px 0 8px; }
.empty-state p { max-width: 360px; margin: 0 0 18px; color: var(--muted); line-height: 1.7; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fbfdff; }
.filter-bar .input { width: min(260px, 100%); height: 38px; }
.filter-bar .select { width: auto; min-width: 130px; height: 38px; }

.progress { width: 120px; height: 6px; overflow: hidden; border-radius: 8px; background: #e8eff8; }
.progress span { display: block; width: var(--progress, 0%); height: 100%; border-radius: inherit; background: var(--blue); }

.device-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.device-card { padding: 20px; border: 1px solid var(--line); background: #fff; }
.device-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.device-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: var(--blue); background: var(--surface-soft); font-family: var(--font-data); font-size: 11px; font-weight: 800; }
.device-card h3 { margin: 16px 0 5px; font-size: 15px; }
.device-card p { margin: 0; color: var(--muted); font-size: 12px; }
.device-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.device-meta span { display: block; color: var(--muted); font-size: 10px; }
.device-meta strong { display: block; margin-top: 5px; font-family: var(--font-data); font-size: 11px; }

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.plan-card { position: relative; overflow: hidden; padding: 24px; border: 1px solid var(--line); background: #fff; }
.plan-card.featured { border-color: #8eb1ed; box-shadow: 0 20px 48px rgba(37,99,235,.12); }
.plan-ribbon { position: absolute; right: -34px; top: 17px; width: 126px; padding: 5px 0; color: #fff; background: var(--blue); transform: rotate(38deg); text-align: center; font-size: 10px; font-weight: 800; }
.plan-card h3 { margin: 0 0 8px; font-size: 18px; }
.plan-card > p { min-height: 42px; margin: 0; color: var(--muted); line-height: 1.6; }
.plan-price { margin: 24px 0 20px; }
.plan-price strong { font-family: var(--font-data); font-size: 36px; letter-spacing: -.05em; }
.plan-price span { color: var(--muted); }
.plan-features { display: grid; gap: 12px; margin: 0 0 24px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); list-style: none; }
.plan-features li { display: flex; gap: 9px; align-items: flex-start; color: #4d647b; font-size: 12px; }
.plan-features li::before { content: "✓"; color: var(--success); font-weight: 900; }

.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 18px; }
.setting-section + .setting-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.setting-section h3 { margin: 0 0 6px; font-size: 15px; }
.setting-section > p { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.retention-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.option-tile { position: relative; padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.option-tile:has(input:checked) { border-color: var(--blue); background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.option-tile input { position: absolute; opacity: 0; }
.option-tile strong { display: block; }
.option-tile span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.admin-banner { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 18px; padding: 22px 24px; border: 1px solid #c9d9ed; color: #fff; background: #173e6f; }
.admin-banner h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 22px; }
.admin-banner p { margin: 0; color: rgba(255,255,255,.65); }
.admin-banner .badge { color: #0c5a67; background: #91e9f2; }

.upgrade-drop { display: grid; place-items: center; min-height: 230px; padding: 28px; border: 1px dashed #8eaed0; background: #f9fcff; text-align: center; }
.upgrade-drop.dragging { border-color: var(--blue); background: var(--surface-soft); }
.upgrade-drop-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 18px; color: var(--blue); background: var(--surface-blue); font-family: var(--font-data); font-weight: 800; }
.upgrade-drop h3 { margin: 0 0 7px; }
.upgrade-drop p { margin: 0 0 18px; color: var(--muted); }
.upgrade-notes { display: grid; gap: 12px; }
.note-row { display: grid; grid-template-columns: 32px 1fr; gap: 11px; align-items: start; }
.note-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: var(--surface-blue); font-family: var(--font-data); font-size: 10px; font-weight: 800; }
.note-row strong { display: block; font-size: 12px; }
.note-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.modal-backdrop { display: none; position: fixed; z-index: 100; inset: 0; padding: 24px; background: rgba(12,35,59,.46); backdrop-filter: blur(4px); }
.modal-backdrop.open { display: grid; place-items: center; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); animation: modalIn .22s ease; }
.modal-wide { width: min(720px, 100%); }
.modal-header { display: flex; justify-content: space-between; gap: 20px; padding: 22px 24px 16px; }
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 4px 24px 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; }
.form-divider { height: 1px; margin: 24px 0; background: var(--line); }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.endpoint-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.endpoint-row:last-child { border-bottom: 0; }
.endpoint-row span { color: var(--muted); }
.endpoint-row code { color: var(--blue-strong); font-family: var(--font-data); font-size: 12px; }

.toast-stack { width: min(380px, calc(100% - 32px)); position: fixed; z-index: 200; right: 20px; top: 20px; display: grid; gap: 10px; }
.toast { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: start; padding: 14px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-lg); animation: toastIn .28s ease; }
.toast-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--success); }
.toast.error .toast-dot { background: var(--danger); }
.toast strong { display: block; font-size: 13px; }
.toast span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.toast button { border: 0; color: var(--muted); background: transparent; cursor: pointer; }

.mobile-nav { display: none; }
.sidebar-scrim { display: none; }

@keyframes signalMove { 0% { left: 0; opacity: .2; } 50% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: .2; } }
@keyframes routePulse { from { left: 0; opacity: .25; } to { left: calc(100% - 8px); opacity: 1; } }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .device-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card > p { min-height: 0; }
}

@media (max-width: 900px) {
  :root { --sidebar: 224px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 420px; padding: 30px; }
  .auth-story-copy { padding: 58px 0 20px; }
  .auth-story h1 { font-size: 42px; }
  .auth-foot { display: none; }
  .install-shell { grid-template-columns: 1fr; }
  .install-aside { min-height: auto; padding: 22px; }
  .install-aside .brand-lockup { margin-bottom: 20px; }
  .install-steps { grid-template-columns: repeat(4, 1fr); }
  .install-step { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 8px 4px; }
  .install-step small { display: none; }
  .install-main { padding: 30px 22px; }
  .sidebar { transform: translateX(-105%); transition: transform .24s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim.open { display: block; position: fixed; z-index: 29; inset: 0; background: rgba(12,35,59,.34); }
  .main-wrap { margin-left: 0; }
  .mobile-menu { display: grid; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { padding-bottom: 70px; }
  .auth-story { min-height: 350px; }
  .auth-story h1 { font-size: 36px; }
  .auth-story p { font-size: 14px; }
  .signal-map { margin-top: 34px; }
  .signal-dot { width: 38px; height: 38px; }
  .signal-label { font-size: 10px; }
  .auth-panel { padding: 32px 22px; }
  .auth-box h2 { font-size: 27px; }
  .field-row { grid-template-columns: 1fr; }
  .field-row.three { grid-template-columns: 1fr; }
  .install-main { padding: 26px 16px; }
  .install-header { display: block; }
  .install-header .badge { margin-top: 14px; }
  .install-card { padding: 18px; }
  .check-row { grid-template-columns: 1fr; gap: 8px; }
  .driver-tabs { grid-template-columns: 1fr; }
  .topbar { height: 64px; padding: 0 16px; }
  .topbar-title p { display: none; }
  .topbar-actions .desktop-only { display: none; }
  .page-content { padding: 20px 14px 30px; }
  .page-heading { display: block; }
  .page-actions { margin-top: 16px; }
  .page-actions .btn { flex: 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 112px; padding: 16px; }
  .stat-value { font-size: 23px; }
  .dashboard-grid { gap: 12px; }
  .route-strip { grid-template-columns: repeat(4,1fr); }
  .route-track { display: none; }
  .route-station { min-width: 0; }
  .route-icon { margin: 0 auto; }
  .route-label { text-align: center; }
  .route-footer { align-items: flex-start; flex-direction: column; }
  .device-grid { grid-template-columns: 1fr; }
  .retention-options { grid-template-columns: 1fr; }
  .table-wrap { overflow: visible; }
  .data-table, .data-table tbody { display: block; }
  .data-table thead { display: none; }
  .data-table tr { display: grid; gap: 11px; padding: 16px; border-bottom: 1px solid var(--line); }
  .data-table td { display: flex; justify-content: space-between; gap: 16px; padding: 0; border: 0; text-align: right; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; text-align: left; }
  .data-table .table-actions { justify-content: flex-end; }
  .filter-bar .input, .filter-bar .select { width: 100%; }
  .modal-backdrop { padding: 12px; }
  .mobile-nav { height: 64px; display: grid; grid-template-columns: repeat(5,1fr); position: fixed; z-index: 40; inset: auto 0 0; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); }
  .mobile-nav a { display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 10px; }
  .mobile-nav a.active { color: var(--blue); font-weight: 800; }
  .mobile-nav svg { width: 18px; height: 18px; }
  .admin-banner { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
