/* base.css — reset, layout, sidebar, topbar, cards (flat/square style) */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5f7;
  --sidebar-bg: #1b2430;
  --sidebar-text: #b7c0cc;
  --sidebar-active-bg: #2a3648;
  --sidebar-active-text: #ffffff;
  --accent: #2f6fed;
  --accent-hover: #2559c4;
  --danger: #d6423a;
  --danger-hover: #b3352e;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e2e5ea;
  --card-bg: #ffffff;
  --radius: 3px;
}

/* ── Dark mode ─────────────────────────────────────────────────────
   Toggled via [data-theme="dark"] on <html> (see /js/sidebar.js),
   persisted in localStorage, applied pre-paint by an inline script in
   layout.ejs's <head> so there is no light-mode flash on load. Sidebar
   stays the same near-black across both themes — only body chrome
   (bg/card/border/text) and a few status colors swap. */
:root[data-theme="dark"] {
  --bg: #12161c;
  --sidebar-bg: #0d1117;
  --sidebar-active-bg: #1b2430;
  --text: #e7eaee;
  --muted: #8b95a3;
  --border: #2a2f3a;
  --card-bg: #1a1f28;
  --accent: #5b8cff;
  --accent-hover: #7ea0ff;
  --danger: #ef5f57;
  --danger-hover: #f47b74;
}

/* Theme-crossfade effect: color/background/border-color animate smoothly
   instead of snapping, on every themed element. Scoped (not *) so it never
   fights layout/transform transitions elsewhere (tabs, modals, etc). */
body, .sidebar, .sidebar-nav a, .topbar, .card, .btn, .data-table td,
.data-table th, input, select, .modal, .badge, .alert, .code-block,
.theme-toggle {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }

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

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 20px 16px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
}
.sidebar-logo-img { display: block; max-width: 100%; max-height: 32px; object-fit: contain; flex-shrink: 0; }
/* Animated gradient "shimmer" on the text logo — used when there's no
   uploaded image logo (see layout.ejs), and reused (smaller) alongside an
   uploaded logo via .sidebar-logo-text-paired below. background-clip: text
   paints the gradient inside the glyph shapes; sliding its position via the
   keyframe is what reads as the color continuously running across the
   text. Cyan → blue → violet "circuit" palette + a soft glow for a techy,
   slightly futuristic feel rather than a generic rainbow shimmer. */
.sidebar-logo-text {
  display: inline-block;
  background: linear-gradient(100deg, #00e5ff, #2f6fed, #7c3aed, #00e5ff);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: sidebar-logo-shimmer 5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(47, 111, 237, 0.45));
  letter-spacing: 0.02em;
}
/* When paired next to an uploaded logo image, the site name keeps the same
   shimmer effect as the logo-less wordmark — just sized down a bit so it
   sits comfortably next to the image instead of competing with it. */
.sidebar-logo-text-paired {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes sidebar-logo-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-logo-text, .login-logo-text { animation: none; }
}

.sidebar-nav { display: flex; flex-direction: column; padding: 8px 0; }
.sidebar-nav a {
  padding: 12px 16px;
  color: var(--sidebar-text);
  border-left: 3px solid transparent;
  font-size: 13.5px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--accent);
}

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar-title { font-weight: 600; text-transform: capitalize; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-admin { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.topbar-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent, #3b82f6); color: #fff;
  font-size: 12px; font-weight: 600; flex: none; line-height: 1;
  overflow: hidden;
}
.topbar-avatar svg { width: 17px; height: 17px; }

/* Mute toggle for the sale chime (see UIToast.sale() / toast.js).
   Small icon-only button in the topbar, next to the theme toggle. */
.sound-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); color: var(--muted); cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.sound-toggle-btn:hover {
  color: var(--text); background: var(--bg);
  transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16, 24, 40, 0.08);
}
.sound-toggle-btn:active { transform: translateY(0) scale(0.92); box-shadow: none; }
.sound-toggle-btn svg { width: 15px; height: 15px; }
.sound-toggle-btn .icon-sound-off { display: none; }
.sound-toggle-btn.is-muted { color: var(--muted); }
.sound-toggle-btn.is-muted .icon-sound-on { display: none; }
.sound-toggle-btn.is-muted .icon-sound-off { display: block; }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); color: var(--muted); cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.theme-toggle:hover {
  color: var(--text); background: var(--bg);
  transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16, 24, 40, 0.08);
}
.theme-toggle:active { transform: translateY(0) scale(0.92); box-shadow: none; }
.theme-toggle svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.theme-toggle:hover svg { transform: rotate(20deg); }
/* Only one icon shows at a time: sun in light mode (click to go dark),
   moon in dark mode (click to go light). */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.page-content { padding: 24px; }

/* ── Page header ───────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.page-header h1 { font-size: 20px; font-weight: 600; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  /* Resting-state shadow bumped up from the old barely-there 1-2px blur so
     the card reads as a raised surface even before any hover/interaction —
     the previous values were so faint they rendered as flat on most
     displays. Still a soft/short shadow (not a hover state), just visible. */
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.07), 0 4px 10px rgba(16, 24, 40, 0.08);
  /* lets a wide table scroll sideways inside the card on small screens
     instead of breaking the page layout */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Superset of the shared theme-crossfade transition above (same
     properties, same timing) plus the hover motion below — written out in
     full here so this one rule wins outright for .card instead of the two
     declarations fighting over which "transition" shorthand applies. */
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.2s ease,
              box-shadow 0.2s ease, transform 0.2s ease;
}
/* Same lift-on-hover language already used by .btn/.theme-toggle in this
   file, just scaled up for a bigger surface — depth cue on an otherwise
   flat, square design instead of a foreign motion style. */
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.08), 0 14px 30px rgba(16, 24, 40, 0.14);
  transform: translateY(-3px);
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: background-color 0.25s ease, color 0.25s ease, border-color 0.2s ease; }
  .card:hover { transform: none; }
}
.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--card-bg);
  transition: background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16, 24, 40, 0.08); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled {
  cursor: not-allowed; opacity: 0.55;
  transform: none; box-shadow: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-small { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
/* Loading state — label stays in the DOM (so layout/width doesn't jump)
   but is hidden, and a small spinner is centered over the button. Toggled
   by adding/removing .is-loading via JS on submit (see login.ejs). */
.btn.is-loading { position: relative; cursor: default; }
.btn.is-loading:hover { transform: none; box-shadow: none; }
.btn.is-loading .btn-label { visibility: hidden; }
.btn-spinner {
  display: none;
  position: absolute; top: 50%; left: 50%;
  width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spinner-spin 0.6s linear infinite;
}
.btn.is-loading .btn-spinner { display: block; }
/* Ghost/outline buttons have dark text on a light/transparent background,
   so the spinner needs a dark ring instead of the white one used on
   solid-fill buttons like .btn-primary. */
.btn-ghost .btn-spinner {
  border-color: rgba(16, 24, 40, 0.25);
  border-top-color: var(--text);
}
@keyframes btn-spinner-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 1.2s; }
}
/* Icon-only button (e.g. row-level delete action) — square, no label,
   same hover/press feel as .btn but sized to just fit the icon. */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon:hover { transform: none; box-shadow: none; }
.btn-icon.btn-icon-danger:hover { background: var(--danger); color: #fff; }
.inline-form { display: inline; }

/* ── Tables (compact, spreadsheet-style rows) ─────────────────────── */
.data-table { width: 100%; min-width: max-content; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 6px 10px; border-bottom: 2px solid var(--border);
  color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px;
  white-space: nowrap;
}
.data-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: rgba(16, 24, 40, 0.015); }
.row-link { cursor: pointer; }
.row-link:hover { background: var(--bg); }
.empty-row { color: var(--muted); text-align: center; padding: 24px !important; }

.code-block {
  background: #111827; color: #d1d5db; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12.5px; line-height: 1.5; overflow-x: auto; white-space: pre;
}
.log-block { max-height: 320px; overflow-y: auto; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 8px; border-radius: var(--radius);
  font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.badge-accepted { background: #e5f5ea; color: #1c7c3f; }
.badge-pending, .badge-awaiting_chip_id { background: #fff4e0; color: #b3720b; }
.badge-rejected { background: #fde8e7; color: var(--danger); }
/* Online/Offline — connectivity (heartbeat-based), separate from the
   accepted/pending/rejected admin-acceptance status above. See
   Device.findById()'s computed `online` column. */
.badge-online { background: #1c7c3f; color: #ffffff; }
.badge-offline { background: #eceef1; color: var(--muted); }
/* Machine build type — reuses the accent blue already used for the wifi
   summary-icon chip on the dashboard, and a separate purple for lan so the
   two builds are never confused with the status badges above. */
.badge-wifi { background: #1c7c3f; color: #ffffff; }
.badge-lan  { background: #1c7c3f; color: #ffffff; }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  padding: 10px 16px; cursor: pointer; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.hidden { display: none; }

/* ── Forms ─────────────────────────────────────────────────── */
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; margin-bottom: 14px;
  background: var(--card-bg); color: var(--text);
}
.settings-form { display: flex; flex-direction: column; max-width: 420px; }
.form-actions { display: flex; align-items: center; gap: 10px; }
.filter-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.filter-form label { margin-bottom: 0; min-width: 160px; }
.filter-form input, .filter-form select { margin-bottom: 0; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }
.alert-error { background: #fde8e7; color: var(--danger); }
.alert-success { background: #e5f5ea; color: #1c7c3f; }

.muted { color: var(--muted); }

/* ── Modals ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(16, 24, 40, 0.08), 0 10px 25px rgba(16, 24, 40, 0.12);
  width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 20px;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.modal-header h2 { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none; border: none; font-size: 20px; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 2px 6px; border-radius: var(--radius);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal .settings-form { max-width: none; }
.modal-wide { max-width: 760px; }

/* ── UI Dialog (replaces native alert()/confirm()) ────────────
   Same overlay+backdrop idea as .modal-overlay above, but anchored to the
   top of the viewport and sliding down into place instead of appearing
   centered — a native alert()/confirm() can't be restyled at all, so this
   swaps in a real DOM dialog with the same look as the rest of the app. */
.ui-dialog-overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.ui-dialog-overlay.hidden { display: none; }
.ui-dialog-overlay.open { opacity: 1; pointer-events: auto; }
.ui-dialog {
  background: var(--card-bg); border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.18);
  width: 100%; max-width: 440px;
  padding: 20px 22px;
  /* Nudged down from the very top edge so it doesn't feel glued to the
     browser chrome, but capped well short of vertical-center so it still
     reads as "sliding from the top" rather than a centered modal. */
  margin-top: clamp(48px, 12vh, 140px);
  /* Fully off-screen above the viewport until .open, then eased down —
     this + the overlay fade above is the whole "slides in from the top"
     effect, no keyframes needed. Combined with the theme-crossfade colors
     here (rather than joining the shared selector list above) so this one
     declaration wins outright instead of two same-specificity rules
     fighting over which "transition" shorthand applies. */
  transform: translateY(-100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.ui-dialog-overlay.open .ui-dialog { transform: translateY(0); }
.ui-dialog-message { font-size: 14px; line-height: 1.6; margin-bottom: 18px; white-space: pre-line; }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (prefers-reduced-motion: reduce) {
  .ui-dialog-overlay, .ui-dialog { transition: opacity 0.01ms; transform: none; }
}

/* ── Toast notifications (non-blocking, no backdrop/modal) ────────
   Used for "Save Changes" results and Test Connection / API results —
   anything that shouldn't block interaction with the rest of the page
   the way .ui-dialog / .modal-overlay do. Stacks in the top-right,
   auto-dismisses. See /js/toast.js. */
.toast-stack {
  position: fixed; top: 16px; right: 16px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 340px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(16, 24, 40, 0.12), 0 4px 6px rgba(16, 24, 40, 0.08);
  padding: 12px 14px;
  font-size: 13px; line-height: 1.5;
  opacity: 0; transform: translateX(16px);
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.25s ease,
              color 0.25s ease, border-color 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.leaving { opacity: 0; transform: translateX(16px); }
.toast-success { border-left-color: #1c7c3f; }
.toast-error { border-left-color: var(--danger); }
/* Sale toasts (new transaction announcements, see dashboard.js) get their
   own amber/cash color so they read as "money coming in" and don't blend
   in with a plain "Saved." success toast. */
.toast-sale { border-left-color: #b3720b; }
.toast-icon { flex: none; margin-top: 1px; }
.toast-success .toast-icon { color: #1c7c3f; }
.toast-error .toast-icon { color: var(--danger); }
.toast-sale .toast-icon { color: #b3720b; }
.toast-body { flex: 1; word-break: break-word; }
.toast-close {
  flex: none; background: none; border: none; color: var(--muted);
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 0 0 4px;
}
.toast-close:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 0.01ms; transform: none; }
}
.card-toolbar-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-toolbar-between h2 { margin-bottom: 0; }
.vlan-range-generator { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0 4px; }
.vlan-range-generator label { margin-bottom: 0; }
.vlan-range-generator input { width: 120px; }
.vlan-mode-toggle { display: flex; gap: 8px; margin: 8px 0 14px; }
#vlan-range-summary { font-size: 13px; padding: 8px 10px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.vlan-network-preview { font-size: 12.5px; white-space: nowrap; }

/* ── Login page ────────────────────────────────────────────── */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  /* Dark navy → blue → violet mesh — static, no grid lines and no moving
     shapes, just soft gradient depth behind the card. */
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 229, 255, 0.14), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(124, 58, 237, 0.18), transparent 45%),
    linear-gradient(160deg, #060b16 0%, #0b1530 55%, #0a0f1e 100%);
}
.login-card {
  /* Was a hardcoded #fff — always rendered as a light card even when the
     rest of the app was in dark mode. Now follows --card-bg/--text, which
     resolve to the dark palette since data-theme="dark" is forced above. */
  background: var(--card-bg); color: var(--text);
  padding: 32px; border-radius: var(--radius); width: 340px;
  position: relative;
  /* Static cyan → blue → violet gradient border via border-image — no
     oversized/rotating pseudo-elements this time (the previous
     conic-gradient "spinning ring" trick wasn't properly contained and
     bled out as a giant diamond behind the card). This is a single,
     ordinary border: nothing to overflow or clip wrong. */
  border: 1.5px solid transparent;
  border-image: linear-gradient(135deg, #00e5ff, #2f6fed, #7c3aed) 1;
  box-shadow: 0 0 40px rgba(47, 111, 237, 0.25), 0 20px 40px rgba(0, 0, 0, 0.35);
}
.login-logo {
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-logo-img { display: block; max-width: 100%; max-height: 48px; object-fit: contain; }
/* Same cyan → blue → violet shimmer as the sidebar wordmark (see
   .sidebar-logo-text above) — shares the sidebar-logo-shimmer keyframe so
   the login screen and the app shell read as one consistent brand. */
.login-logo-text {
  display: inline-block;
  background: linear-gradient(100deg, #00e5ff, #2f6fed, #7c3aed, #00e5ff);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: sidebar-logo-shimmer 5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(47, 111, 237, 0.45));
  letter-spacing: 0.02em;
}
.login-logo-text-paired { font-size: 16px; }
.login-card h1 { font-size: 16px; margin-bottom: 18px; font-weight: 600; }
.login-form { display: flex; flex-direction: column; }
.login-form input:focus {
  outline: none;
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.25);
}

/* ── Mobile / small screens ───────────────────────────────────────── */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; min-height: 100dvh; }

  /* sidebar becomes a horizontally-scrollable top bar instead of a
     fixed-width side column that eats half the phone screen */
  .sidebar { width: 100%; flex-direction: row; align-items: stretch; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sidebar-logo { padding: 10px 14px; border-bottom: none; border-right: 1px solid rgba(255,255,255,0.08); white-space: nowrap; display: flex; align-items: center; }
  .sidebar-nav { flex-direction: row; padding: 0; overflow-x: auto; }
  .sidebar-nav a {
    padding: 12px 14px; border-left: none; border-bottom: 3px solid transparent;
    white-space: nowrap; flex-shrink: 0;
  }
  .sidebar-nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }

  .topbar { height: auto; min-height: 48px; padding: 8px 14px; flex-wrap: wrap; row-gap: 6px; }
  .page-content { padding: 12px; }
  .page-header { flex-wrap: wrap; row-gap: 8px; }
  .card { padding: 12px; }

  .summary-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .summary-value { font-size: 20px; }

  .filter-form { flex-direction: column; align-items: stretch; }
  .filter-form label { min-width: 0; width: 100%; }
  .settings-form { max-width: none; }

  .login-body { padding: 16px; }
  .login-card { width: 100%; max-width: 360px; padding: 24px; }
}
