:root {
  --ink: #12211e;
  --ink-soft: #52605d;
  --paper: #f3f6f3;
  --surface: #ffffff;
  --surface-2: #f8faf8;
  --line: #dfe6e1;
  --brand: #116b57;
  --brand-dark: #0b4c3e;
  --brand-soft: #dff3eb;
  --amber: #9a5a06;
  --amber-soft: #fff1d7;
  --red: #a33a32;
  --red-soft: #fde8e6;
  --shadow: 0 18px 50px rgba(21, 53, 45, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  color: white;
  background: #152443 url('/assets/meadow-sunflower-login-v3.jpg') center / cover no-repeat;
  font-family: "Avenir Next", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
.login-screen::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,24,35,.6) 0%, rgba(15,29,52,.3) 50%, rgba(8,18,39,.62) 100%), linear-gradient(180deg, rgba(8,17,36,.34) 0%, transparent 45%, rgba(8,17,36,.64) 100%); }
.login-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 17% 48%, rgba(255,204,117,.15), transparent 32%), radial-gradient(circle at 65% 52%, rgba(181,199,255,.09), transparent 30%); mix-blend-mode: screen; }
.login-shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 64px)); min-height: 100vh; margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto; padding: 38px 0 28px; }
.login-topbar { display: flex; align-items: center; justify-content: space-between; }
.login-brand-lockup { display: flex; align-items: center; gap: 13px; }
.login-brand-lockup strong, .login-brand-lockup span { display: block; }
.login-brand-lockup strong { font-size: 15px; font-weight: 600; letter-spacing: .18em; }
.login-brand-lockup span { margin-top: 3px; color: rgba(255,255,255,.56); font-size: 8px; font-weight: 600; letter-spacing: .2em; }
.login-brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 14px; color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.16); backdrop-filter: blur(12px); font-size: 12px; font-weight: 650; letter-spacing: .08em; }
.login-security { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.64); font-size: 9px; font-weight: 600; letter-spacing: .18em; }
.login-security i { width: 6px; height: 6px; border-radius: 50%; background: #ffd486; box-shadow: 0 0 12px rgba(255,205,116,.9); }
.login-layout { display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: clamp(48px,8vw,128px); align-items: center; padding: 54px 0 44px; }
.login-hero { align-self: end; padding-bottom: 54px; text-shadow: 0 2px 24px rgba(4,13,31,.24); }
.login-hero > p { margin: 0 0 18px; color: rgba(255,255,255,.64); font-size: 10px; font-weight: 600; letter-spacing: .25em; }
.login-hero h1 { margin: 0; font-weight: 300; letter-spacing: -.055em; line-height: .96; }
.login-hero h1 span, .login-hero h1 strong { display: block; }
.login-hero h1 span { font-size: clamp(54px,6.6vw,92px); font-weight: 300; }
.login-hero h1 strong { margin-top: 14px; font-size: clamp(28px,3.2vw,44px); font-weight: 420; letter-spacing: .04em; }
.login-hero-line { width: 92px; height: 1px; margin-top: 28px; background: linear-gradient(90deg, rgba(255,255,255,.8), transparent); }
.login-card { width: 100%; padding: 38px; border: 1px solid rgba(255,255,255,.18); border-radius: 28px; color: white; background: linear-gradient(145deg, rgba(20,33,67,.5), rgba(23,31,59,.3)); box-shadow: 0 30px 80px rgba(3,10,28,.3), inset 0 1px 0 rgba(255,255,255,.09); backdrop-filter: blur(28px) saturate(125%); }
.login-card-head { margin-bottom: 30px; }
.login-card-head p { margin: 0 0 8px; color: rgba(255,255,255,.52); font-size: 9px; font-weight: 600; letter-spacing: .24em; }
.login-card-head h2 { margin: 0; font-size: 25px; font-weight: 450; letter-spacing: -.02em; }
.login-footer { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.4); font-size: 8px; font-weight: 600; letter-spacing: .2em; }
.brand-mark { width: 62px; height: 62px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 18px; color: white; background: linear-gradient(145deg, #137a63, #0b5b49); font-weight: 800; font-size: 17px; letter-spacing: .08em; box-shadow: 0 12px 26px rgba(17,107,87,.22); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 12px; box-shadow: none; }
.eyebrow { margin: 0; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.muted { color: var(--ink-soft); }

.app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px 22px; color: #eaf4f0; background: #102f29; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px; }
.brand strong, .brand span { display: block; }
.brand strong { color: white; font-size: 17px; }
.brand span { margin-top: 2px; color: #9ec0b7; font-size: 11px; }
nav { display: grid; gap: 6px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 0; border-radius: 11px; color: #b9d0ca; background: transparent; text-align: left; }
.nav-item span { width: 21px; text-align: center; font-size: 18px; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.1); }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.readonly-note { display: flex; align-items: center; gap: 8px; color: #b9d0ca; font-size: 12px; }
.text-button { margin-top: 14px; padding: 0; border: 0; color: #8eaaa3; background: transparent; font-size: 12px; }

.main { min-width: 0; padding: 34px 44px 70px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar h1 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.fleet-status { color: var(--ink-soft); font-size: 13px; }
.button { min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: 13px; }
.button.primary { color: white; background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button.secondary:hover { border-color: #b9c8c0; }
.button.danger { color: var(--red); background: var(--red-soft); }
.button.small { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.wide { width: 100%; }

.warning-banner { margin-top: 22px; padding: 13px 16px; border: 1px solid #e9ca8e; border-radius: 12px; color: #724304; background: var(--amber-soft); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 26px 0; }
.stat-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 25px rgba(22, 48, 42, .035); }
.stat-label { color: var(--ink-soft); font-size: 12px; }
.stat-value { display: block; margin-top: 7px; font-size: 27px; font-weight: 800; letter-spacing: -.04em; }
.stat-detail { margin-top: 5px; color: var(--ink-soft); font-size: 11px; }
.stat-button { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.stat-button:hover { border-color: #9eb9ad; box-shadow: 0 10px 30px rgba(17,107,87,.1); }
.stat-button .stat-detail::after { content: '  ›'; color: var(--brand); font-weight: 800; }

.view { display: none; }
.view.active-view { display: block; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.toolbar-panel { display: flex; gap: 12px; padding: 12px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cfd9d3; border-radius: 9px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(17,107,87,.1); }
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: #344440; font-size: 12px; font-weight: 700; }
.login-card label { gap: 9px; margin-bottom: 18px; color: rgba(255,255,255,.78); font-size: 11px; font-weight: 550; letter-spacing: .05em; }
.login-card input { min-height: 50px; padding-inline: 15px; border-color: rgba(255,255,255,.17); border-radius: 13px; color: white; background: rgba(255,255,255,.08); caret-color: white; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.login-card input::placeholder { color: rgba(255,255,255,.38); }
.login-card input:focus { border-color: rgba(199,215,255,.72); background: rgba(255,255,255,.12); box-shadow: 0 0 0 3px rgba(175,197,255,.12); }
.login-card .button.wide { min-height: 50px; border-radius: 13px; box-shadow: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.login-card .button.primary { color: #273040; background: linear-gradient(105deg, rgba(255,250,238,.97), rgba(249,222,168,.92)); }
.login-card .button.primary:hover { transform: translateY(-1px); background: linear-gradient(105deg, #fffdf7, #ffe6b2); box-shadow: 0 12px 28px rgba(7,14,35,.2); }
.login-card .button.secondary { color: white; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.1); }
.login-card .button.secondary:hover { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.15); }
.login-card .form-error { color: #ffd2dc; }
.login-switch { width: 100%; margin-top: 18px; color: rgba(255,255,255,.58); text-align: center; }
.login-switch:hover { color: white; }
.current-user { display: grid; gap: 2px; margin-bottom: 16px; }
.current-user strong { color: white; font-size: 12px; }
.current-user span { color: #8eaaa3; font-size: 10px; }

.message-list { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.message-row { display: grid; grid-template-columns: 190px minmax(240px,1fr) 190px 115px; gap: 18px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.message-row:last-child { border-bottom: 0; }
.message-row:hover { background: #fbfcfb; }
.message-from strong, .message-target strong { display: block; font-size: 13px; }
.message-from span, .message-target span, .message-time { color: var(--ink-soft); font-size: 11px; }
.message-body { min-width: 0; }
.message-body p { margin: 0; overflow: hidden; color: #344440; font-size: 13px; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.message-body p.otp-code { display: flex; align-items: baseline; gap: 9px; color: var(--brand-dark); font-size: 22px; font-weight: 800; letter-spacing: .08em; }
.message-body p.otp-code span { color: var(--ink-soft); font-size: 10px; font-weight: 700; letter-spacing: 0; }
.message-body .binding-mini { margin-top: 5px; color: var(--brand); font-size: 11px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { margin: 0 0 5px; font-size: 19px; }
.section-heading p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.line-grid, .device-grid, .user-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.line-card, .device-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 7px 28px rgba(22,48,42,.035); }
.line-card.changed { border-color: #e2b9b5; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; }
.card-head h3 { margin: 3px 0 2px; font-size: 18px; }
.card-head p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.sim-badge { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 6px; color: var(--brand-dark); background: var(--brand-soft); font-size: 10px; font-weight: 800; }
.balance-box { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 18px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.balance-box span { display: block; color: var(--ink-soft); font-size: 11px; }
.balance-box strong { display: block; margin-top: 3px; font-size: 23px; }
.binding-list { display: grid; gap: 8px; padding: 16px 18px; }
.binding-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; }
.binding-item strong { display: block; font-size: 12px; }
.binding-item span { color: var(--ink-soft); font-size: 10px; }
.binding-item button { border: 0; color: #9a504a; background: transparent; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: #fbfcfb; }
.empty-inline { padding: 8px 0; color: var(--ink-soft); font-size: 11px; }

.user-card { display: grid; grid-template-columns: minmax(160px,.8fr) minmax(220px,1.2fr) auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.user-list { grid-template-columns: 1fr; }
.user-card.disabled { opacity: .62; }
.user-card h3 { margin: 7px 0 2px; font-size: 17px; }
.user-card p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.user-access { display: grid; gap: 5px; }
.user-access span { color: var(--ink-soft); font-size: 10px; }
.user-access strong { font-size: 12px; line-height: 1.55; }
.permission-fieldset { margin: 18px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.permission-fieldset legend { padding: 0 6px; color: #344440; font-size: 12px; font-weight: 700; }
.permission-fieldset:disabled { opacity: .55; }
.permission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.permission-option { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.permission-option input { width: 16px; min-height: 16px; }
.permission-option span, .permission-option strong, .permission-option small { display: block; }
.permission-option small { margin-top: 2px; color: var(--ink-soft); font-weight: 400; }

.device-summary { display: flex; align-items: center; gap: 13px; padding: 18px; }
.phone-icon { width: 42px; height: 55px; display: grid; place-items: center; border: 2px solid #6b7c77; border-radius: 8px; color: #6b7c77; font-size: 18px; }
.device-summary h3 { margin: 0 0 4px; }
.device-summary p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.device-state { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 11px; }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #8b9894; }
.status-dot.online, .status-dot.safe { background: #45c38a; box-shadow: 0 0 0 4px rgba(69,195,138,.12); }
.status-dot.offline { background: #c55d52; }
.device-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 0 18px 17px; }
.device-meta div { padding: 10px; border-radius: 9px; background: var(--surface-2); }
.device-meta span, .device-meta strong { display: block; }
.device-meta span { color: var(--ink-soft); font-size: 10px; }
.device-meta strong { margin-top: 3px; font-size: 12px; }
.device-sims { padding: 0 18px 17px; }
.device-sim-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 11px; }

.setup-layout { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); gap: 18px; }
.setup-card { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.setup-card h2, .setup-card h3 { margin-top: 0; }
.setup-card p, .setup-card li { color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.setup-card ol { padding-left: 20px; }
.code-box { display: flex; gap: 9px; align-items: center; padding: 12px; border: 1px dashed #b7c9c0; border-radius: 10px; background: #f4faf7; }
.code-box code { flex: 1; overflow-wrap: anywhere; color: var(--brand-dark); font-size: 11px; }
.setup-credential-list { display: grid; gap: 12px; }
.setup-credential-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.setup-credential-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.setup-credential-head strong { font-size: 13px; }
.credential-state { color: var(--amber); font-size: 10px; }
.credential-state.ready { color: var(--brand); }
.credential-field { display: grid; gap: 5px; margin-top: 9px; }
.credential-field > span { color: var(--ink-soft); font-size: 10px; }
.credential-field .code-box { padding: 9px 10px; background: white; }
.download-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0 12px; padding: 14px; border: 1px solid #e9ca8e; border-radius: 11px; background: var(--amber-soft); }
.download-box strong, .download-box span { display: block; }
.download-box strong { font-size: 13px; }
.download-box span { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.download-box .button { flex: 0 0 auto; color: white; text-decoration: none; }
.rom-list { display: grid; gap: 10px; }
.rom-item { padding: 12px; border-radius: 10px; background: var(--surface-2); }
.rom-item strong { font-size: 12px; }
.rom-item p { margin: 4px 0 0; font-size: 11px; }

.dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 0; border-radius: 20px; color: var(--ink); box-shadow: 0 30px 100px rgba(13,35,29,.28); }
.dialog::backdrop { background: rgba(8,30,24,.48); backdrop-filter: blur(3px); }
.dialog form, .message-dialog { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dialog-head h2 { margin: 5px 0 0; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-soft); background: white; font-size: 20px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.span-two { grid-column: span 2; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; line-height: 1.5; }
.check-row input { width: 16px; min-height: 16px; margin-top: 2px; }
.form-hint { margin: 9px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.form-error { min-height: 17px; margin: 10px 0 0; color: var(--red); font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.sensitive-warning { padding: 11px 12px; border-radius: 9px; color: var(--amber); background: var(--amber-soft); font-size: 12px; }
.message-dialog pre { min-height: 120px; padding: 16px; overflow-wrap: anywhere; white-space: pre-wrap; border-radius: 11px; background: #f4f7f5; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.low-balance-list { display: grid; gap: 9px; margin-top: 16px; }
.low-balance-row { display: grid; grid-template-columns: minmax(150px,.8fr) minmax(200px,1.2fr); gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.low-balance-row div:last-child { text-align: right; }
.low-balance-row strong, .low-balance-row span { display: block; }
.low-balance-row strong { font-size: 13px; }
.low-balance-row span { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 16px; transform: translateY(30px); border-radius: 10px; color: white; background: #173d34; opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: var(--shadow); font-size: 12px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #913e38; }
.empty-state { padding: 55px 24px; text-align: center; color: var(--ink-soft); }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); }

@media (max-width: 980px) {
  .app { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .brand > div:last-child, .nav-item:not(.active) { }
  .brand strong, .brand span, .nav-item { font-size: 0; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item span { font-size: 18px; }
  .sidebar-foot { display: none; }
  .main { padding-inline: 25px; }
  .message-row { grid-template-columns: 150px minmax(200px,1fr) 120px; }
  .message-time { display: none; }
}

@media (max-width: 720px) {
  .login-screen { background-position: 36% center; }
  .login-shell { width: min(100% - 32px, 460px); padding: 22px 0 18px; }
  .login-topbar { align-items: flex-start; }
  .login-security { margin-top: 15px; font-size: 7px; }
  .login-layout { display: flex; flex-direction: column; justify-content: flex-end; gap: 26px; padding: 42px 0 22px; }
  .login-hero { width: 100%; align-self: auto; padding: 0; }
  .login-hero > p, .login-hero-line { display: none; }
  .login-hero h1 span { font-size: clamp(40px,14vw,58px); }
  .login-hero h1 strong { margin-top: 8px; font-size: 25px; }
  .login-card { padding: 30px 26px; border-radius: 24px; background: linear-gradient(145deg, rgba(17,29,59,.65), rgba(18,25,49,.48)); backdrop-filter: blur(24px) saturate(120%); }
  .login-card-head { margin-bottom: 24px; }
  .login-footer { display: none; }
  .app { display: block; }
  .sidebar { position: fixed; z-index: 20; top: auto; bottom: 0; width: 100%; height: 68px; padding: 8px 10px; }
  .sidebar .brand, .sidebar-foot { display: none; }
  nav { display: grid; grid-template-columns: repeat(auto-fit,minmax(56px,1fr)); }
  .nav-item, .nav-item.active { display: grid; justify-items: center; gap: 1px; padding: 5px; font-size: 9px; }
  .nav-item span { font-size: 17px; }
  .main { padding: 22px 15px 92px; }
  .topbar h1 { font-size: 24px; }
  .fleet-status { display: none; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .toolbar-panel { display: grid; }
  .message-row { grid-template-columns: 1fr auto; gap: 8px; }
  .message-body { grid-column: 1 / -1; grid-row: 2; }
  .message-target { display: none; }
  .line-grid, .device-grid, .setup-layout, .user-list, .permission-grid { grid-template-columns: 1fr; }
  .user-card { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .dialog form, .message-dialog { padding: 20px; }
  .low-balance-row { grid-template-columns: 1fr; }
  .low-balance-row div:last-child { text-align: left; }
  .download-box { align-items: stretch; flex-direction: column; }
  .download-box .button { text-align: center; }
}

@media (max-width: 520px) {
  .login-brand-lockup span, .login-security { display: none; }
  .login-layout { padding-top: 32px; }
  .login-card { padding: 28px 22px; }
}

@media (max-width: 360px) {
  .login-shell { width: min(100% - 24px, 460px); }
  .login-layout { gap: 20px; padding-top: 24px; }
  .login-hero h1 span { font-size: 38px; }
  .login-hero h1 strong { font-size: 22px; }
  .login-card { padding: 24px 20px; border-radius: 21px; }
  .login-card-head { margin-bottom: 20px; }
}
