/* Generated by scripts/build-pages.mjs — edit source files under styles/. */

/* Inlined from styles/01-theme.css */
/* --- 1. DESIGN TOKENS & VARIABLES --- */
:root {
  /* Color Palette */
  --bg-dark: #050811;
  --bg-darker: #020409;
  --bg-sheet: rgba(10, 16, 28, 0.85);
  --bg-card: rgba(18, 30, 54, 0.5);
  --bg-input: rgba(13, 23, 42, 0.7);

  --border-glow: rgba(0, 212, 255, 0.25);
  --border-glow-active: rgba(0, 212, 255, 0.75);
  --border-light: rgba(255, 255, 255, 0.06);

  /* Status Colors */
  --color-green: #00ff9d;
  --color-green-raw: 0, 255, 157;
  --color-yellow: #ffb800;
  --color-yellow-raw: 255, 184, 0;
  --color-red: #ff3d3d;
  --color-red-raw: 255, 61, 61;
  --color-gray: #78909c;
  --color-gray-raw: 120, 144, 156;
  --color-cyan: #00d4ff;
  --color-cyan-raw: 0, 212, 255;

  /* Typography Colors */
  --text-primary: #e6f1ff;
  --text-secondary: #8ea3c0;
  --text-muted: #536b8e;

  /* Effects */
  --glass-blur: blur(20px) saturate(180%);
  --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  --glow-shadow-cyan: 0 0 15px rgba(0, 212, 255, 0.4);

  /* History chart */
  --history-panel-bg: rgba(7, 12, 24, 0.98);
  --history-control-bg: rgba(15, 23, 42, 0.76);
  --history-control-bg-active: rgba(122, 162, 247, 0.12);
  --history-chart-card-bg: rgba(10, 17, 31, 0.82);
  --history-chart-line: #7aa2f7;
  --history-chart-line-strong: #dbeafe;
  --history-chart-grid: rgba(148, 163, 184, 0.16);
  --history-chart-axis: #64748b;
  --history-chart-focus: rgba(219, 234, 254, 0.44);
  --history-chart-point-hover: rgba(122, 162, 247, 0.2);
  --history-chart-safe-band: rgba(74, 222, 128, 0.1);
  --history-threshold-alarm: #ff3d3d;
  --history-threshold-prealarm: #ffb800;

  /* Typography — iOS-style Vietnamese font stack
     On real iPhones: -apple-system resolves to SF Pro (perfect Vietnamese support)
     On Android/Windows: Be Vietnam Pro — designed specifically for Vietnamese */
  --font-ui: -apple-system, BlinkMacSystemFont, "Be Vietnam Pro", "Segoe UI", Roboto, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Be Vietnam Pro", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, "Cascadia Code", Consolas, Menlo, monospace;
}

/* --- 1b. LIGHT MODE VARIABLES --- */
body.light-mode {
  --bg-dark: #f0f4f8;
  --bg-darker: #e2e8f0;
  --bg-sheet: rgba(255, 255, 255, 0.95);
  --bg-card: rgba(240, 244, 248, 0.85);
  --bg-input: rgba(226, 232, 240, 0.8);

  --border-glow: rgba(0, 150, 200, 0.3);
  --border-glow-active: rgba(0, 150, 200, 0.8);
  --border-light: rgba(0, 0, 0, 0.08);

  /* Status Colors Overrides for Light Mode */
  --color-green: #097631;
  --color-green-raw: 9, 118, 49;

  /* Typography Colors */
  --text-primary: #1a2a3a;
  --text-secondary: #4a6080;
  --text-muted: #7a95b0;

  /* Effects */
  --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
  --glow-shadow-cyan: 0 0 12px rgba(0, 150, 200, 0.35);

  /* History chart */
  --history-panel-bg: rgba(255, 255, 255, 0.98);
  --history-control-bg: rgba(226, 232, 240, 0.82);
  --history-control-bg-active: rgba(0, 122, 181, 0.1);
  --history-chart-card-bg: rgba(255, 255, 255, 0.88);
  --history-chart-line: #007ab5;
  --history-chart-line-strong: #0f3d5c;
  --history-chart-grid: rgba(74, 96, 128, 0.18);
  --history-chart-axis: #4a6080;
  --history-chart-focus: rgba(0, 122, 181, 0.38);
  --history-chart-point-hover: rgba(0, 122, 181, 0.12);
  --history-chart-safe-band: rgba(34, 197, 94, 0.14);
  --history-threshold-alarm: #c62828;
  --history-threshold-prealarm: #a85d00;
}

/* Light mode: body & html background */
body.light-mode,
body.light-mode html {
  background-color: var(--bg-dark);
  color: var(--text-primary);
}

/* Light mode: Header */
body.light-mode .app-header {
  background: rgba(255, 255, 255, 0.45) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

body.light-mode .app-header::before,
body.light-mode .app-header::after {
  opacity: 0.1;
  mix-blend-mode: normal;
}

body.light-mode .logo {
  color: #1a2a3a;
  text-shadow: none;
}

body.light-mode .logo-accent {
  color: #007ab5;
  text-shadow: 0 0 10px rgba(0, 150, 200, 0.25);
}

body.light-mode .attech-a {
  color: #d32f2f;
  text-shadow: none;
}

body.light-mode .attech-ttech {
  color: #0055d4;
  text-shadow: none;
}

body.light-mode .attech-subtext {
  color: #4a6080;
}

/* Light mode: Status pill in header */
body.light-mode .status-counters-pill {
  background: rgba(0, 150, 200, 0.08);
  border-color: rgba(0, 150, 200, 0.25);
  box-shadow: inset 0 0 8px rgba(0, 150, 200, 0.06);
}

body.light-mode .status-counters-pill:active {
  background: rgba(0, 150, 200, 0.15);
}

/* Light mode: Header icon buttons */
body.light-mode .header-icon-btn {
  background: rgba(0, 150, 200, 0.08);
  border-color: rgba(0, 150, 200, 0.25);
  color: #007ab5;
}

body.light-mode .header-icon-btn:active {
  background: rgba(0, 150, 200, 0.18);
}

/* Light mode: Auth button states */
body.light-mode .auth-btn.unauthenticated {
  background: rgba(194, 120, 0, 0.08);
  border-color: #c27800;
  color: #c27800;
}

body.light-mode .auth-btn.authenticated {
  background: rgba(0, 160, 80, 0.08);
  border-color: #00a050;
  color: #00a050;
}

body.light-mode .auth-btn.demo-mode {
  background: rgba(0, 150, 200, 0.08);
  border-color: #007ab5;
  color: #007ab5;
}



/* Light mode: Bottom Navigation Tabs */
body.light-mode .app-bottom-tabs {
  background: rgba(255, 255, 255, 0.45) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
}

body.light-mode .app-bottom-tabs::before,
body.light-mode .app-bottom-tabs::after {
  opacity: 0.1;
  mix-blend-mode: normal;
}

body.light-mode .bottom-tab-link {
  color: var(--text-secondary);
}

body.light-mode .bottom-tab-link.active {
  color: #007ab5;
  background: rgba(0, 150, 200, 0.08);
  border-color: rgba(0, 150, 200, 0.25);
}

/* Light mode: CNS Pages & Cards */
body.light-mode .cns-page {
  background: radial-gradient(circle at top right, rgba(0, 150, 200, 0.05), transparent 34%), #f0f4f8;
}

body.light-mode .cns-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

body.light-mode .cns-menu-button {
  border-color: rgba(0, 150, 200, 0.25);
  background: rgba(0, 150, 200, 0.06);
  color: #007ab5;
}

body.light-mode .cns-sync-status {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
}

body.light-mode .cns-sync-status.status-fresh {
  color: #097631;
  border-color: rgba(9, 118, 49, 0.25);
  background: rgba(9, 118, 49, 0.06);
}

body.light-mode .cns-sync-status.status-loading {
  color: #007ab5;
  border-color: rgba(0, 150, 200, 0.25);
  background: rgba(0, 150, 200, 0.05);
}

body.light-mode .cns-sync-status.status-error {
  color: #b25e00;
  border-color: rgba(178, 94, 0, 0.25);
  background: rgba(178, 94, 0, 0.06);
}

body.light-mode .production-ring-bg {
  stroke: rgba(0, 0, 0, 0.08);
}

body.light-mode .production-ring-value {
  filter: none; /* remove glow drop shadow in light mode for readability */
}

body.light-mode .cns-detail-cell {
  border-color: rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.015);
}

body.light-mode .alos-status-pill {
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .alos-card.status-good .alos-status-pill {
  color: #097631;
  border-color: rgba(9, 118, 49, 0.25);
  background: rgba(9, 118, 49, 0.06);
}

body.light-mode .alos-card.status-warning .alos-status-pill {
  color: #b25e00;
  border-color: rgba(178, 94, 0, 0.25);
  background: rgba(178, 94, 0, 0.06);
}

body.light-mode .alos-card.status-bad .alos-status-pill {
  color: #d32f2f;
  border-color: rgba(211, 47, 47, 0.25);
  background: rgba(211, 47, 47, 0.06);
}

body.light-mode .alos-metric-row {
  border-color: rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.01);
}

body.light-mode .alos-metric-bar {
  background: rgba(0, 0, 0, 0.08);
}

body.light-mode .alos-metric-row.status-good .alos-metric-bar span {
  background: #097631;
  box-shadow: none;
}

body.light-mode .alos-metric-row.status-warning .alos-metric-bar span {
  background: #b25e00;
  box-shadow: none;
}

body.light-mode .alos-metric-row.status-bad .alos-metric-bar span {
  background: #d32f2f;
  box-shadow: none;
}

/* Light mode: Map container */
body.light-mode #map-container {
  background-color: var(--bg-darker);
}

body.light-mode #map {
  background: #a8c8e8 !important;
}

/* Light mode: Leaflet controls */
body.light-mode .leaflet-bar {
  border: 1px solid rgba(0, 150, 200, 0.3) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12) !important;
}

body.light-mode .leaflet-bar a {
  background-color: rgba(255, 255, 255, 0.92) !important;
  color: #007ab5 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .leaflet-bar a:hover,
body.light-mode .leaflet-bar a:active {
  background-color: rgba(0, 150, 200, 0.12) !important;
  color: #005a8a !important;
}

body.light-mode .leaflet-bar a.leaflet-disabled {
  background-color: rgba(240, 244, 248, 0.8) !important;
  color: var(--text-muted) !important;
}

/* Light mode: Marker labels */
body.light-mode .marker-label {
  background: rgba(255, 255, 255, 0.92);
  color: #1a2a3a;
  border-color: rgba(0, 150, 200, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Light mode: selected marker label */
body.light-mode .map-marker.selected .marker-label {
  background: #ffffff;
  border-color: currentColor;
  color: #1a2a3a;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
}

/* Light mode: Bottom sheets / Drawers */
body.light-mode .sheet-content {
  background: rgba(255, 255, 255, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
}

body.light-mode .sheet-content::before,
body.light-mode .sheet-content::after {
  opacity: 0.1;
  mix-blend-mode: normal;
}

body.light-mode .sheet-backdrop {
  background: rgba(20, 40, 60, 0.35);
}

body.light-mode .sheet-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .sheet-title {
  color: #1a2a3a;
  text-shadow: none;
}

body.light-mode .sheet-close-btn {
  color: var(--text-secondary);
}

body.light-mode .sheet-close-btn:active {
  background: rgba(0, 0, 0, 0.06);
  color: #1a2a3a;
}

body.light-mode .sheet-handle {
  background-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .bottom-sheet.open .sheet-handle {
  background-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .bottom-sheet.peek .sheet-handle {
  background-color: #007ab5;
  box-shadow: 0 0 8px rgba(0, 150, 200, 0.5);
}

/* Light mode: Meta cards in drawer */
body.light-mode .meta-card {
  background: rgba(255, 255, 255, 0.5) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .meta-label {
  color: var(--text-muted);
}

body.light-mode .meta-value {
  color: var(--text-primary);
}

/* Light mode: Device tabs */
body.light-mode .device-tab-btn {
  color: var(--text-secondary);
}

body.light-mode .device-tab-btn.active {
  color: #007ab5;
}

body.light-mode .device-tab-btn.active::after {
  background-color: #007ab5;
  box-shadow: 0 0 8px rgba(0, 150, 200, 0.3);
}

/* Light mode: Parameters table */
body.light-mode .parameters-container {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .parameters-table th {
  background: rgba(200, 218, 235, 0.5);
  color: var(--text-secondary);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .parameters-table td {
  color: var(--text-primary);
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .device-status-banner {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .tab-scroller-container {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Light mode: Form inputs */
body.light-mode .form-group input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 150, 200, 0.3);
  color: #1a2a3a;
}

body.light-mode .form-group input:focus {
  border-color: rgba(0, 150, 200, 0.7);
  box-shadow: 0 0 10px rgba(0, 150, 200, 0.15);
}

body.light-mode .form-group label {
  color: var(--text-secondary);
}

body.light-mode .form-toggle-group {
  background: rgba(0, 150, 200, 0.05);
  border-color: rgba(0, 150, 200, 0.25);
}

body.light-mode .toggle-slider {
  background-color: rgba(200, 215, 230, 0.8);
  border-color: rgba(0, 150, 200, 0.25);
}

body.light-mode .toggle-slider:before {
  background-color: #7a95b0;
}

body.light-mode .toggle-switch input:checked+.toggle-slider {
  background-color: rgba(0, 150, 200, 0.15);
  border-color: #007ab5;
}

body.light-mode .toggle-switch input:checked+.toggle-slider:before {
  background-color: #007ab5;
  box-shadow: 0 0 8px rgba(0, 150, 200, 0.4);
}

body.light-mode .toggle-title {
  color: #007ab5;
}

body.light-mode .submit-btn {
  background: rgba(0, 150, 200, 0.1);
  border-color: #007ab5;
  color: #007ab5;
}

body.light-mode .submit-btn:active {
  background: rgba(0, 150, 200, 0.2);
}

/* Light mode: User profile panel */
body.light-mode .user-profile {
  background: rgba(220, 235, 248, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .profile-name {
  color: #1a2a3a;
}

body.light-mode .profile-dept {
  color: var(--text-secondary);
}

body.light-mode .user-avatar {
  background: transparent;
  border-color: rgba(0, 150, 200, 0.3);
}

/* Light mode: Settings drawer */
body.light-mode .settings-instructions {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
}

body.light-mode .settings-tabs-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .settings-tab-btn {
  color: var(--text-secondary);
}

body.light-mode .settings-tab-btn.active {
  color: #007ab5;
}

body.light-mode .settings-tab-btn.active::after {
  background-color: #007ab5;
  box-shadow: 0 0 8px rgba(0, 150, 200, 0.3);
}

body.light-mode .settings-row {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .setting-input-wrapper input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 150, 200, 0.3);
  color: #1a2a3a;
}

body.light-mode .setting-input-wrapper input:focus {
  border-color: rgba(0, 150, 200, 0.7);
}

body.light-mode .reset-btn {
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
}

body.light-mode .reset-btn:active {
  background: rgba(0, 0, 0, 0.05);
}

/* Light mode: Modals */
body.light-mode .modal-overlay {
  background: rgba(10, 20, 40, 0.45);
}

body.light-mode .modal-content {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 150, 200, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .modal-title {
  color: #1a2a3a;
  text-shadow: none;
}

body.light-mode .modal-close-btn {
  color: var(--text-secondary);
}

body.light-mode .modal-close-btn:hover {
  color: #1a2a3a;
  background: rgba(0, 0, 0, 0.06);
}

body.light-mode .modal-body {
  background: transparent;
}

/* Light mode: Scrollbar */
body.light-mode ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode ::-webkit-scrollbar-thumb {
  background: rgba(0, 150, 200, 0.25);
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: #007ab5;
}

/* Light mode: Report form */
body.light-mode .report-device-remark input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

body.light-mode .report-device-remark input:focus {
  border-color: rgba(0, 150, 200, 0.4);
  color: #1a2a3a;
}

/* Light mode: Toast notifications remain dark for contrast */
body.light-mode .toast {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

body.light-mode .toast.success,
body.light-mode .toast.warning {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #000000;
  font-weight: 500;
}

body.light-mode .toast.error {
  background: rgba(var(--color-red-raw), 0.06);
  border-color: rgba(var(--color-red-raw), 0.25);
  color: var(--color-red);
}

/* =========================================
   IPHONE-STYLE THEME SWITCH
   ========================================= */
.theme-toggle-btn {
  position: relative;
  width: 54px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid rgba(104, 137, 190, 0.42);
  border-radius: 999px;
  background: #17243a !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.42), 0 4px 15px rgba(0, 0, 0, 0.3) !important;
  cursor: pointer;
  display: block;
  padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--border-glow-active);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.42), 0 0 14px rgba(0, 212, 255, 0.2) !important;
}

.theme-toggle-btn:focus-within {
  outline: 2px solid rgba(0, 212, 255, 0.65);
  outline-offset: 3px;
}

.theme-switch-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.theme-switch-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 1;
  display: block;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: #0a1222;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(0, 212, 255, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bfd4f6;
  opacity: 1;
  transform: rotate(0deg) scale(1);
  transition: opacity 0.25s ease, transform 0.3s ease, color 0.3s ease;
}

.theme-icon svg {
  width: 14px;
  height: 14px;
}

.theme-icon-light {
  color: #f5b83d;
  opacity: 0;
  transform: rotate(90deg) scale(0.55);
}

body.light-mode .theme-toggle-btn {
  border-color: rgba(0, 150, 200, 0.42);
  background: #dbe6f2 !important;
  box-shadow: inset 0 1px 2px rgba(19, 58, 91, 0.16), 0 4px 15px rgba(29, 71, 104, 0.16) !important;
}

body.light-mode .theme-toggle-btn:hover {
  border-color: rgba(0, 150, 200, 0.7);
  box-shadow: inset 0 1px 2px rgba(19, 58, 91, 0.16), 0 0 14px rgba(0, 150, 200, 0.2) !important;
}

body.light-mode .theme-switch-thumb {
  border-color: rgba(255, 255, 255, 0.8);
  background: #fff;
  box-shadow: 0 2px 6px rgba(29, 71, 104, 0.24), 0 0 0 1px rgba(0, 150, 200, 0.12);
  transform: translateX(24px);
}

body.light-mode .theme-icon-dark {
  color: #7890ad;
  opacity: 0;
  transform: rotate(-90deg) scale(0.55);
}

body.light-mode .theme-icon-light {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ==========================================================================
   ANDROID PERFORMANCE FALLBACK
   --------------------------------------------------------------------------
   Trên Android, GPU tầm trung/thấp xử lý backdrop-filter và box-shadow
   animation bằng software rendering (không có hardware acceleration như iOS).
   Các CSS rules dưới đây TẮT các hiệu ứng nặng trên Android, thay bằng
   background đục (opaque) và animation GPU-friendly (transform + opacity).
   → iPhone và PC KHÔNG bị ảnh hưởng.
   ========================================================================== */

/* --- A. Tắt toàn bộ backdrop-filter trên Android (Dark Mode) --- */
body.android-device .app-header {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: rgba(6, 10, 19, 0.97) !important;
}

body.android-device .sheet-backdrop {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(2, 4, 8, 0.80) !important;
}

body.android-device .sheet-content {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(10, 16, 28, 0.97) !important;
}

body.android-device .modal-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(2, 4, 9, 0.88) !important;
}

body.android-device .modal-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(8, 14, 28, 0.98) !important;
}

body.android-device .app-bottom-tabs {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(5, 10, 20, 0.97) !important;
}

body.android-device .theme-toggle-btn {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.android-device .leaflet-bar a {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.android-device .monitor-data-loading {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.android-device .glass-panel {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(8, 14, 28, 0.97) !important;
}

body.android-device .login-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(8, 14, 28, 0.97) !important;
}

/* Desktop sidebar (cũng tắt trên Android tablet nếu có) */
body.android-device .desktop-sidebar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* --- A2. Tắt backdrop-filter trên Android (Light Mode) --- */
body.android-device.light-mode .app-header {
  background-color: rgba(255, 255, 255, 0.97) !important;
}

body.android-device.light-mode .sheet-backdrop {
  background: rgba(20, 40, 60, 0.45) !important;
}

body.android-device.light-mode .sheet-content {
  background: rgba(255, 255, 255, 0.98) !important;
}

body.android-device.light-mode .modal-overlay {
  background: rgba(10, 20, 40, 0.55) !important;
}

body.android-device.light-mode .modal-card,
body.android-device.light-mode .modal-content {
  background: rgba(255, 255, 255, 0.99) !important;
}

body.android-device.light-mode .app-bottom-tabs {
  background: rgba(255, 255, 255, 0.97) !important;
}



body.android-device.light-mode .glass-panel {
  background: rgba(255, 255, 255, 0.97) !important;
}

body.android-device.light-mode .login-card {
  background: rgba(255, 255, 255, 0.97) !important;
}

/* --- B. Marker animations: dot-ping đã sử dụng transform + opacity (GPU-friendly) nên chạy bình thường trên Android --- */

/* Tắt các animation box-shadow infinite khác trên Android */
body.android-device .status-indicator-dot.warn {
  animation: none !important;
}

body.android-device .status-indicator-dot.danger {
  animation: none !important;
}

body.android-device .pulse-indicator.offline {
  animation: none !important;
}

body.android-device .auth-notif-badge {
  animation: none !important;
  box-shadow: 0 0 8px var(--color-red) !important;
}

body.android-device .new-station-alert {
  animation: none !important;
}

/* --- C. Thêm will-change cho phần tử quan trọng trên Android --- */
body.android-device .modal-overlay {
  will-change: opacity;
}

body.android-device .modal-card {
  will-change: transform;
}

/* --- D. Tối ưu transition: thay 'all' bằng specific properties trên Android --- */
body.android-device .dot-core {
  transition: transform 0.25s !important;
}

body.android-device .form-group input {
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

body.android-device .modal-close-btn,
body.android-device .modal-save-btn,
body.android-device .modal-skip-btn {
  transition: background-color 0.2s, color 0.2s !important;
}

body.android-device .header-icon-btn {
  transition: background-color 0.2s, transform 0.2s !important;
}

body.android-device .bottom-tab-link {
  transition: color 0.2s, background-color 0.2s !important;
}

/* Inlined from styles/02-shell-map.css */
/* --- 2. BASE STYLES & RESET --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  /* Remove touch highlight in mobile */
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

/* Fix iOS PWA white gap: in standalone mode, 100vh covers the entire physical screen perfectly */
@media (display-mode: standalone) {
  html, body {
    height: 100vh;
  }
}



/* --- 3. LAYOUT STRUCTURE --- */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* --- 4. HEADER NAVIGATION --- */
.app-header {
  height: calc(52px + max(0px, env(safe-area-inset-top, 0px) - 10px));
  position: relative;
  /* Fixed z-index clickability */
  background: rgba(6, 10, 19, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0px, env(safe-area-inset-top, 0px) - 10px) 16px 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  overflow: hidden;
}

.header-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.logo-accent {
  color: var(--color-cyan);
  text-shadow: var(--glow-shadow-cyan);
}

/* ATTECH Logo styling */
.attech-logo-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  line-height: 1;
  font-family: var(--font-heading);
  flex-shrink: 0;
  margin-right: 6px;
}

.attech-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: baseline;
  line-height: 1;
}

.attech-a {
  color: #ff3d3d;
  text-shadow: 0 0 8px rgba(255, 61, 61, 0.45);
}

.attech-ttech {
  color: #007aff;
  text-shadow: 0 0 8px rgba(0, 122, 255, 0.45);
}

.attech-subtext {
  font-size: 7px;
  font-weight: 600;
  text-transform: none;
  color: var(--text-secondary);
  letter-spacing: 0.25px;
  margin-top: 2px;
  line-height: 1;
}

.attech-slogan {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  margin-top: 4px;
  font-family: var(--font-ui);
}

/* Status counters pill in Header center */
.status-counters-pill {
  background: rgba(18, 30, 54, 0.7);
  border: 1px solid var(--border-glow);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.1);
}

.status-counters-pill:active {
  transform: scale(0.95);
  background: rgba(0, 212, 255, 0.1);
}

.count-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
}

.bullet {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.bg-green {
  background-color: var(--color-green);
  box-shadow: 0 0 5px var(--color-green);
}

.bg-yellow {
  background-color: var(--color-yellow);
  box-shadow: 0 0 5px var(--color-yellow);
}

.bg-red {
  background-color: var(--color-red);
  box-shadow: 0 0 5px var(--color-red);
}

.bg-gray {
  background-color: var(--color-gray);
  box-shadow: 0 0 5px var(--color-gray);
}

.text-green {
  color: var(--color-green);
}

.text-yellow {
  color: var(--color-yellow);
}

.text-red {
  color: var(--color-red);
}

.text-gray {
  color: var(--color-gray);
}

.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-icon-btn {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--color-cyan);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.header-icon-btn:active {
  background: rgba(0, 212, 255, 0.2);
  transform: scale(0.95);
}

/* Authentication Badge Button */
.auth-btn {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

/* User icon styling */
.user-btn-icon {
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-btn.unauthenticated {
  background: rgba(255, 184, 0, 0.08);
  border: 1px solid var(--color-yellow);
  color: var(--color-yellow);
}

.auth-btn.authenticated {
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid var(--color-green);
  color: var(--color-green);
}

.auth-btn.demo-mode {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--color-cyan);
  color: var(--color-cyan);
}

.auth-btn:active {
  transform: scale(0.92);
}

/* --- 5. FULLSCREEN MAP --- */
#map-container {
  flex: 1;
  width: 100%;
  position: relative;
  background-color: var(--bg-darker);
  min-height: 0;
  /* Force core flex basis calculations on iOS Safari */
  display: flex;
  flex-direction: column;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: #040812 !important;
}

/* Desktop: map-container becomes flex row for sidebar + map layout */
@media (min-width: 1024px) {
  #map-container {
    display: flex;
    flex-direction: row;
  }

  #map {
    position: relative;
    flex: 1;
    min-width: 0;
  }
}

/* Map Zoom Control Customization (Leaflet override) */
.leaflet-bar {
  border: 1px solid var(--border-glow) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-bar a {
  background-color: rgba(10, 16, 28, 0.85) !important;
  color: var(--color-cyan) !important;
  border-bottom: 1px solid var(--border-light) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: background-color 0.2s;
}

.leaflet-bar a:hover,
.leaflet-bar a:active {
  background-color: rgba(0, 212, 255, 0.15) !important;
  color: #fff !important;
}

.leaflet-bar a.leaflet-disabled {
  background-color: rgba(10, 16, 28, 0.5) !important;
  color: var(--text-muted) !important;
}

/* --- 6. GLOWING CUSTOM MARKERS (DOT STYLE) --- */
.map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 24px;
  height: 24px;
}

/* Center dot container */
.marker-dot {
  width: 12px;
  height: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

/* Central core circle showing status color */
.dot-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 2;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.marker-dot.green .dot-core {
  background: var(--color-green);
  box-shadow: 0 0 8px var(--color-green);
}

.marker-dot.warn .dot-core {
  background: var(--color-yellow);
  box-shadow: 0 0 8px var(--color-yellow);
}

.marker-dot.danger .dot-core {
  background: var(--color-red);
  box-shadow: 0 0 8px var(--color-red);
}

.marker-dot.gray .dot-core {
  background: var(--color-gray);
  box-shadow: 0 0 4px var(--color-gray);
  opacity: 0.85;
}

/* Concentric expanding wave rings */
.dot-ping {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  margin-left: -5px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transform: scale(1);
}

/* Apply infinite animation on green, warn, and danger markers */
.marker-dot.green .dot-ping,
.marker-dot.warn .dot-ping,
.marker-dot.danger .dot-ping {
  animation: dot-ping-pulse 7s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

/* Stagger concentric rings relative to each other and using --marker-delay for station stagger */
.dot-ping.ring-1 {
  animation-delay: var(--marker-delay) !important;
}

.dot-ping.ring-2 {
  animation-delay: calc(var(--marker-delay) - 2.33s) !important;
}

.dot-ping.ring-3 {
  animation-delay: calc(var(--marker-delay) - 4.67s) !important;
}

/* Giảm số layer animation trên màn hình nhỏ; hai vòng vẫn giữ tín hiệu trạng thái. */
@media (max-width: 767px) {
  .dot-ping.ring-3 {
    display: none;
  }
}

/* Android thường có GPU yếu hơn khi phải duy trì nhiều animation đồng thời. */
body.android-device .dot-ping.ring-3 {
  display: none;
}

/* Tôn trọng cài đặt giảm chuyển động của hệ điều hành. */
@media (prefers-reduced-motion: reduce) {
  .dot-ping {
    display: none;
    animation: none !important;
  }

  .dot-core,
  .marker-label {
    transition: none !important;
  }
}

@keyframes dot-ping-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.25;
  }

  100% {
    transform: scale(3.8);
    opacity: 0;
  }
}

/* Station label positioned absolutely below the dot to avoid shifting core coordinates */
.marker-label {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(4, 8, 18, 0.85);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  border: 1px solid var(--border-glow);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 3;
  transition: border-color 0.25s, box-shadow 0.25s;
}

/* Highlight Selected Marker state */
.map-marker.selected .dot-core {
  transform: scale(1.4);
  box-shadow: 0 0 16px currentColor, 0 0 0 2px #fff !important;
}

.map-marker.selected .marker-label {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
  background: rgba(10, 20, 40, 0.95);
}

/* --- 7. FOOTER STATUS BAR --- */

/* Inlined from styles/03-sheets-details.css */
/* --- 8. SLIDING DRAWERS (BOTTOM SHEETS) --- */

.parameter-row.is-history {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.parameter-row.is-history:hover,
.parameter-row.is-history:focus-visible {
  background: rgba(122, 162, 247, 0.08);
  outline: none;
}

.history-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  overflow: auto;
  background: var(--history-panel-bg, rgba(7, 12, 24, 0.98));
  color: var(--text-primary, #e5e7eb);
  border-radius: inherit;
}

.history-panel[hidden] { display: none; }

.history-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.history-panel h3 {
  margin: 0 0 4px;
  color: var(--text-primary, #e5e7eb);
  font-size: 1.15rem;
}

.history-meta {
  margin: 0;
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
}

.history-close-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--history-control-bg, rgba(15, 23, 42, 0.82));
  color: var(--text-secondary, #cbd5e1);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.history-periods {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-period-btn {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--history-control-bg, rgba(15, 23, 42, 0.76));
  color: var(--text-secondary, #94a3b8);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.history-period-btn.active {
  border-color: var(--history-chart-line, #7aa2f7);
  background: var(--history-control-bg-active, rgba(122, 162, 247, 0.12));
  color: var(--history-chart-line-strong, #dbeafe);
}

.history-range-toggle[aria-expanded="true"] {
  border-color: var(--history-chart-line, #7aa2f7);
  background: var(--history-control-bg-active, rgba(122, 162, 247, 0.12));
  color: var(--history-chart-line-strong, #dbeafe);
}

.history-custom-range {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--history-control-bg, rgba(15, 23, 42, 0.76));
  color: var(--text-secondary, #94a3b8);
  padding: 10px 11px;
}

.history-custom-range[hidden] { display: none; }

.history-range-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.history-range-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.history-range-field > span {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.7rem;
  font-weight: 700;
}

.history-date-input-wrap {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--history-control-bg, rgba(15, 23, 42, 0.76));
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.history-date-guide {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 0;
  overflow: hidden;
  max-width: calc(100% - 22px);
  color: var(--text-muted, #64748b);
  font: inherit;
  font-size: 0.74rem;
  line-height: 1;
  pointer-events: none;
  white-space: pre;
  transform: translateY(-50%);
}

.history-date-input {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px 11px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text-primary, #e5e7eb);
  font: inherit;
  font-size: 0.74rem;
  outline: none;
}

.history-date-input::placeholder { color: transparent; }

.history-date-input-wrap:focus-within {
  border-color: var(--history-chart-line, #7aa2f7);
  box-shadow: 0 0 0 2px var(--history-control-bg-active, rgba(122, 162, 247, 0.12));
}

.history-range-actions {
  display: flex;
  gap: 8px;
  padding: 10px 0 0;
}

.history-range-apply {
  border: 1px solid var(--history-chart-line, #7aa2f7);
  border-radius: 8px;
  padding: 7px 11px;
  background: var(--history-control-bg-active, rgba(122, 162, 247, 0.12));
  color: var(--history-chart-line-strong, #dbeafe);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.history-range-apply:hover,
.history-range-apply:focus-visible {
  border-color: var(--history-chart-line-strong, #dbeafe);
  background: var(--history-control-bg, rgba(15, 23, 42, 0.76));
  outline: none;
}

.history-range-error {
  margin: 0;
  padding: 10px 0 0;
  color: var(--color-red, #ff3d3d);
  font-size: 0.72rem;
}

.history-range-error[hidden] { display: none; }

.history-chart-card {
  min-height: 280px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--history-chart-card-bg, rgba(10, 17, 31, 0.82));
}

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

.history-chart { width: 100%; overflow: hidden; }
.history-chart-dates {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px 0 44px;
  color: var(--history-chart-axis, #64748b);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-chart-dates span { overflow: hidden; text-overflow: ellipsis; }
.history-point-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--history-panel-bg, rgba(7, 12, 24, 0.58));
  color: var(--text-secondary, #94a3b8);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}
.history-point-readout strong { color: var(--history-chart-line-strong, #dbeafe); }
.history-chart-svg { display: block; width: 100%; min-width: 520px; height: auto; }
.history-safe-band { fill: var(--history-chart-safe-band, rgba(74, 222, 128, 0.1)); pointer-events: none; }
.history-grid-line { stroke: var(--history-chart-grid, rgba(148, 163, 184, 0.16)); stroke-width: 1; }
.history-axis-label, .history-time-label { fill: var(--history-chart-axis, #64748b); font-size: 11px; }
.history-line { fill: none; stroke: var(--history-chart-line, #7aa2f7); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.history-last-point { fill: var(--history-chart-line-strong, #dbeafe); stroke: var(--history-chart-line, #7aa2f7); stroke-width: 3; }
.history-focus-line { stroke: var(--history-chart-focus, rgba(219, 234, 254, 0.44)); stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.history-focus-point { fill: var(--history-chart-line-strong, #dbeafe); stroke: var(--history-chart-line, #7aa2f7); stroke-width: 3; pointer-events: none; }
.history-threshold-line { fill: none; stroke-width: 1.8; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; pointer-events: none; }
.history-threshold-alarm { stroke: var(--history-threshold-alarm, #ff3d3d); }
.history-threshold-prealarm { stroke: var(--history-threshold-prealarm, #ffb800); }
.history-point-hit { fill: transparent; stroke: transparent; cursor: crosshair; }
.history-point-hit:hover, .history-point-hit:focus, .history-point-hit.selected { fill: var(--history-chart-point-hover, rgba(122, 162, 247, 0.2)); stroke: var(--history-chart-line-strong, #dbeafe); stroke-width: 1.5; outline: none; }

@media (max-width: 640px) {
  .history-panel { padding: 18px; }
  .history-range-form { grid-template-columns: 1fr; }
  .history-point-readout { align-items: flex-start; flex-direction: column; gap: 4px; }
}
.bottom-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.3s;
}

.bottom-sheet.open,
.bottom-sheet.peek {
  visibility: visible;
}

/* Semi-translucent Backdrop Overlay */
.sheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 4, 8, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: auto;
}

.bottom-sheet.open .sheet-backdrop {
  opacity: 1;
}

.bottom-sheet.peek .sheet-backdrop {
  opacity: 0;
  pointer-events: none;
  /* Keep map behind fully clickable in peek mode */
}

/* Drawer Content Container */
.sheet-content {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  width: auto;
  max-height: calc(85vh - env(safe-area-inset-top, 0px));
  /* Maximum height: 85% of screen */
  background: rgba(8, 14, 28, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), inset 0 0 15px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transform: translateY(calc(100% + 20px));
  /* cubic-bezier for snappy springy mobile-native feeling */
  transition: transform 0.35s cubic-bezier(0.15, 0.85, 0.35, 1);
  pointer-events: auto;
  z-index: 2;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

body.sirms-authenticated:not(.sirms-route-login) .sheet-content {
  bottom: 51px; /* 10px above the 41px tab bar */
}

.bottom-sheet.open .sheet-content {
  transform: translateY(0);
}

.bottom-sheet.peek .sheet-content {
  transform: translateY(calc(100% - 210px));
  /* Peek height: header + 3 cards (Thiết bị, Tọa độ, Liên hệ) */
}

.bottom-sheet.peek.has-frequencies .sheet-content {
  transform: translateY(calc(100% - 275px));
}

/* Peek: chặn cuộn, chỉ hiện profile. Open: cho phép cuộn toàn bộ */
.bottom-sheet.peek .sheet-body {
  overflow-y: hidden;
}

.bottom-sheet.open .sheet-body {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Swipe handle at the top of sheet */
.sheet-handle-area {
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  /* Disable default gestures to handle drag manually */
  flex-direction: column;
  gap: 4px;
}

.sheet-handle-area:active {
  cursor: grabbing;
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background-color: var(--text-muted);
  border-radius: 3px;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
}

.sheet-handle-area:hover .sheet-handle {
  opacity: 1;
}

/* Hint arrow shown below the handle in peek mode */
.sheet-handle-hint {
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  user-select: none;
}

/* Animation: bounce-up gợi ý vuốt lên khi ở peek mode */
@keyframes peek-bounce-up {
  0% {
    transform: translateY(0);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }

  60% {
    transform: translateY(0);
    opacity: 0.5;
  }

  80% {
    transform: translateY(-3px);
    opacity: 0.85;
  }

  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
}

@keyframes peek-hint-fade {

  0%,
  100% {
    opacity: 0;
  }

  30%,
  70% {
    opacity: 0.8;
  }
}

.bottom-sheet.peek .sheet-handle {
  animation: peek-bounce-up 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  background-color: var(--color-cyan);
  opacity: 0.85;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
  width: 52px;
}

.bottom-sheet.peek .sheet-handle-hint {
  animation: peek-hint-fade 2s ease-in-out infinite;
}

.bottom-sheet.open .sheet-handle {
  animation: none;
  background-color: var(--text-muted);
  box-shadow: none;
  width: 44px;
  opacity: 0.6;
}

.sheet-header {
  padding: 4px 20px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sheet-title {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.sheet-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.sheet-close-btn:active {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Scrollable sheet body content */
.sheet-body {
  padding: 16px 20px 30px 20px;
  overflow-y: hidden;
  /* Default hidden, controlled by .peek/.open states */
  -webkit-overflow-scrolling: touch;
  /* Momentum scrolling in iOS */
  flex-grow: 1;
  min-height: 0;
  /* Allow flex child to shrink and enable overflow scroll */
}

/* --- 9. DETAILS DRAWER SPECIFIC --- */
#details-drawer .sheet-body {
  padding-top: 0;
}

#details-drawer .sheet-header {
  padding: 12px 20px 6px 20px;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

#login-drawer .sheet-header {
  justify-content: center;
}

.station-title-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

.status-indicator-dot.green {
  color: var(--color-green);
  background-color: var(--color-green);
}

.status-indicator-dot.warn {
  color: var(--color-yellow);
  background-color: var(--color-yellow);
  animation: pulse-warn 1.5s infinite;
}

.status-indicator-dot.danger {
  color: var(--color-red);
  background-color: var(--color-red);
  animation: pulse-danger 1s infinite;
}

.status-indicator-dot.gray {
  color: var(--color-gray);
  background-color: var(--color-gray);
}

.station-meta-names {
  display: flex;
  flex-direction: column;
}

.station-code-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Meta Data Grid (Equipment list + coords) */
.station-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.meta-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Allow grid item to shrink below content size */
  overflow: hidden;
  /* Clip any overflowing child content */
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.01);
}

.meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.meta-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Horizontal tab scroller for devices */
.tab-scroller-container {
  width: calc(100% + 40px);
  margin-left: -20px;
  margin-right: -20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  /* Hide scrollbar Firefox */
}

.tab-scroller-container::-webkit-scrollbar {
  display: none;
  /* Hide scrollbar Chrome/Safari */
}

.device-tabs {
  display: flex;
  padding: 0 20px;
  gap: 12px;
  white-space: nowrap;
}

.device-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 4px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
  cursor: pointer;
  transition: color 0.2s;
}

.device-tab-btn.active {
  color: var(--color-cyan);
  font-weight: 700;
}

.device-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-cyan);
  box-shadow: var(--glow-shadow-cyan);
}

.device-status-banner {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.device-status-lbl {
  color: var(--text-secondary);
}

.device-status-val {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Parameters Table */
.parameters-container {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.parameters-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

.parameters-table th {
  background: rgba(18, 30, 54, 0.4);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 1px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.parameters-table th:first-child,
.parameters-table td:first-child {
  width: 65%;
}

.parameters-table th:last-child,
.parameters-table td:last-child {
  width: 35%;
}

.parameters-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.parameters-table tr:last-child td {
  border-bottom: none;
}


.param-name {
  display: block;
  font-weight: 400;
}

.param-desc {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  word-break: break-word;
}

.param-val {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.param-val.disconnected {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.text-right {
  text-align: right !important;
}

/* Lớp đồng bộ màu sắc và font chữ cho số liệu tần số đài trạm */
.freq-value {
  font-family: "Be Vietnam Pro", var(--font-ui);
  font-weight: 600;
  color: var(--color-cyan); /* Màu sáng rực rỡ ở theme tối */
}

/* Điều chỉnh màu sắc cho theme sáng để tăng độ tương phản rõ ràng */
body.light-mode .freq-value {
  color: #007ab5; /* Màu xanh dương đậm rõ ràng trên nền trắng */
}

/* Inlined from styles/04-forms-settings-feedback.css */
/* --- 10. LOGIN FORM DRAWER SPECIFIC --- */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-ui);
  color: #fff;
  font-size: 16px;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--border-glow-active);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

/* Demo Switch Toggle */
.form-toggle-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0;
  padding: 12px 14px;
  background: rgba(0, 212, 255, 0.05);
  border: 1px dashed var(--border-glow);
  border-radius: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-glow);
  border-radius: 24px;
  transition: .3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  transition: .3s cubic-bezier(0.18, 0.89, 0.35, 1.15);
}

.toggle-switch input:checked+.toggle-slider {
  border-color: var(--color-cyan);
  background-color: rgba(0, 212, 255, 0.15);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(20px);
  background-color: var(--color-cyan);
  box-shadow: var(--glow-shadow-cyan);
}

.toggle-labels {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-cyan);
}

.toggle-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.form-error-msg {
  color: var(--color-red);
  font-size: 0.75rem;
  margin-bottom: 12px;
  text-shadow: 0 0 5px rgba(255, 61, 61, 0.2);
}

.submit-btn {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--color-cyan);
  color: var(--color-cyan);
  border-radius: 8px;
  padding: 12px;
  width: 100%;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.1);
}

.submit-btn:active {
  background: rgba(0, 212, 255, 0.2);
  transform: scale(0.98);
}

/* Logged In Info Panel inside Drawer */
.user-info-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.user-profile {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  margin-bottom: 16px;
}

.user-avatar-container {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
  transition: transform 0.2s, border-color 0.2s;
}

.user-avatar-container:hover {
  transform: scale(1.05);
  border-color: var(--border-glow-active);
}

.user-avatar {
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  text-shadow: var(--glow-shadow-cyan);
  border-radius: 50%;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 50%;
  pointer-events: none;
}

.user-avatar-container:hover .avatar-edit-overlay {
  opacity: 1;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-grow: 1;
}

.profile-name {
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dept {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-theme-btn {
  margin-left: auto;
  /* Giữ input absolute của switch nằm gọn trong chính công tắc,
     không phủ lên toàn bộ user drawer. */
  position: relative;
  flex-shrink: 0;
}

.logout-btn {
  background: rgba(255, 61, 61, 0.08);
  border: 1px solid var(--color-red);
  color: var(--color-red);
  padding: 10px 24px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  letter-spacing: 1px;
  display: block;
  width: fit-content;
  min-width: 160px;
  margin: 20px auto 0 auto;
}

.logout-btn:active {
  background: rgba(255, 61, 61, 0.2);
  transform: scale(0.98);
}

/* --- 11. SETTINGS DRAWER SPECIFIC --- */
.settings-instructions {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
}

.settings-tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.settings-tab-btn {
  background: none;
  border: none;
  flex: 1;
  text-align: center;
  padding: 10px;
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}

.settings-tab-btn.active {
  color: var(--color-cyan);
  font-weight: 700;
}

.settings-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background-color: var(--color-cyan);
  box-shadow: var(--glow-shadow-cyan);
}

.settings-tab-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.settings-tab-panel.active {
  display: flex;
}

/* Individual Threshold Rows */
.settings-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
}

.settings-row:last-child {
  border-bottom: none;
}

.setting-label {
  display: flex;
  flex-direction: column;
}

.setting-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.setting-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.setting-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-tag {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}

.input-tag.warn {
  color: var(--color-yellow);
}

.input-tag.danger {
  color: var(--color-red);
}

.setting-input-wrapper input {
  background: var(--bg-input);
  border: 1px solid var(--border-glow);
  color: #fff;
  border-radius: 4px;
  padding: 6px;
  font-size: 16px;
  font-family: var(--font-mono);
  text-align: center;
}

.setting-input-wrapper input:focus {
  outline: none;
  border-color: var(--border-glow-active);
}

.settings-action-row {
  display: flex;
  gap: 12px;
}

.reset-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.reset-btn:active {
  background: rgba(255, 255, 255, 0.05);
}

.save-btn {
  background: rgba(0, 255, 157, 0.1);
  border: 1px solid var(--color-green);
  color: var(--color-green);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  flex-grow: 1;
  transition: all 0.2s;
  box-shadow: inset 0 0 10px rgba(0, 255, 157, 0.1);
}

.save-btn:active {
  background: rgba(0, 255, 157, 0.25);
  transform: scale(0.98);
}

/* --- 12. TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  top: calc(10px + max(0px, env(safe-area-inset-top, 0px) - 10px));
  right: 56px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100% - 120px);
}

.toast {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  opacity: 0;
  transform: scale(0);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: scale(1);
}

.toast.success,
.toast.warning {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #f5f5f0;
  font-weight: 500;
}

.toast.error {
  background: rgba(var(--color-red-raw), 0.08);
  border: 1px solid rgba(var(--color-red-raw), 0.25);
  color: var(--color-red);
}

/* --- 13. LOADING SCREEN --- */
#loading-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-darker);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loader-pulse {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 212, 255, 0.1);
  border-top: 3px solid var(--color-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: var(--glow-shadow-cyan);
}

.loader-logo {
  font-family: var(--font-ui);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.loader-logo span {
  color: var(--color-cyan);
  text-shadow: var(--glow-shadow-cyan);
}

.loader-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.monitor-data-loading {
  position: absolute;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 18, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}

.monitor-data-loading[hidden] {
  display: none;
}

.monitor-data-loading-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: 8px;
  background: rgba(8, 14, 26, 0.9);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38), 0 0 18px rgba(0, 212, 255, 0.12);
  color: var(--text-primary);
}

.monitor-data-spinner {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0, 212, 255, 0.16);
  border-top-color: var(--color-cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.monitor-data-loading-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
}

.monitor-data-loading-text {
  margin-top: 3px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.monitor-data-loading.is-error {
  background: rgba(4, 8, 18, 0.2);
}

.monitor-data-loading.is-error .monitor-data-loading-panel {
  border-color: rgba(255, 184, 0, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34), 0 0 18px rgba(255, 184, 0, 0.1);
}

.monitor-data-loading.is-error .monitor-data-spinner {
  border-color: rgba(255, 184, 0, 0.18);
  border-top-color: var(--color-yellow);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* --- 14. CUSTOM SCROLLBARS --- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan);
}

/* Inlined from styles/05-responsive-modals.css */
/* --- 15. MOBILE OPTIMIZATIONS & MEDIA QUERIES --- */
@media (max-width: 576px) {
  .hidden-sm {
    display: none !important;
  }

  .sheet-content {
    max-height: 80vh;
  }

  .sheet-title {
    font-size: 1rem;
  }
}

/* --- 15b. TABLET / PC — Giới hạn chiều rộng drawer --- */
@media (min-width: 768px) {
  .sheet-content {
    left: 50%;
    right: auto;
    width: calc(100% - 32px);
    max-width: 520px;
    transform: translateX(-50%) translateY(calc(100% + 20px));
  }

  .bottom-sheet.open .sheet-content {
    transform: translateX(-50%) translateY(0);
  }

  .bottom-sheet.peek .sheet-content {
    transform: translateX(-50%) translateY(calc(100% - 210px));
  }

  .bottom-sheet.peek.has-frequencies .sheet-content {
    transform: translateX(-50%) translateY(calc(100% - 275px));
  }
}


/* --- 16. NOTIFICATION BADGE ON AUTH BUTTON --- */
.auth-btn {
  position: relative;
  /* Needed for absolute badge positioning */
}

.auth-notif-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  background: var(--color-red);
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 900;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--color-red), 0 0 16px rgba(255, 61, 61, 0.5);
  animation: badge-pulse 1.5s infinite;
  border: 1.5px solid rgba(6, 10, 19, 0.9);
  z-index: 10;
  pointer-events: none;
}

@keyframes badge-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px var(--color-red);
  }

  50% {
    transform: scale(1.2);
    box-shadow: 0 0 18px rgba(255, 61, 61, 0.9);
  }
}

/* --- 17. NEW STATION ALERT ROW IN USER PANEL --- */
.new-station-alert {
  background: rgba(255, 184, 0, 0.06);
  border: 1px solid var(--color-yellow);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  animation: alert-glow 2s infinite;
}

.new-station-alert:active {
  background: rgba(255, 184, 0, 0.15);
  transform: scale(0.98);
}

@keyframes alert-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 184, 0, 0);
  }

  50% {
    box-shadow: 0 0 12px rgba(255, 184, 0, 0.3);
  }
}

.new-station-alert-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.new-station-alert-text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 2px;
}

.new-station-alert-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-yellow);
}

.new-station-alert-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.new-station-alert-arrow {
  font-size: 1.3rem;
  color: var(--color-yellow);
  opacity: 0.7;
  flex-shrink: 0;
}

/* --- 18. MODAL OVERLAY & CARD --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 9, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: modal-fade-in 0.25s ease;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-card {
  background: rgba(8, 14, 28, 0.96);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glow);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.7);
  animation: modal-slide-up 0.3s cubic-bezier(0.15, 0.85, 0.35, 1);
  overflow: hidden;
}

@keyframes modal-slide-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 20px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}

.modal-title {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  margin: 0;
}

.modal-subtitle {
  font-size: 0.7rem;
  color: var(--color-cyan);
  font-family: var(--font-ui);
  margin: 0;
  letter-spacing: 0.5px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close-btn:active {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.modal-body {
  padding: 16px 20px;
}

/* Station Info Grid */
.modal-station-info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-info-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}

.modal-info-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-info-val.mono {
  font-family: var(--font-mono);
  color: var(--color-cyan);
}

/* Modal Form */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-form-group label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.modal-form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  color: #fff;
  font-size: 16px;
  transition: all 0.2s;
  width: 100%;
}

.modal-form-group input:focus {
  outline: none;
  border-color: var(--border-glow-active);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.modal-form-group input[type="text"] {
  font-family: var(--font-ui);
}

.modal-error-msg {
  color: var(--color-red);
  font-size: 0.75rem;
  min-height: 1rem;
  text-shadow: 0 0 5px rgba(255, 61, 61, 0.2);
}

/* Modal Footer Buttons */
.modal-footer {
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px)) 20px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border-light);
}

.modal-skip-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.modal-skip-btn:active {
  background: rgba(255, 255, 255, 0.05);
}

.modal-save-btn {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--color-cyan);
  color: var(--color-cyan);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  flex-grow: 1;
  transition: all 0.2s;
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.1);
}

.modal-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-save-btn:not(:disabled):active {
  background: rgba(0, 212, 255, 0.25);
  transform: scale(0.98);
}

/* Pagination dots */
.modal-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 14px;
}

.modal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-glow);
  transition: all 0.2s;
  cursor: pointer;
}

.modal-dot.active {
  background: var(--color-cyan);
  box-shadow: 0 0 6px var(--color-cyan);
  width: 20px;
  border-radius: 3.5px;
}

/* ==========================================================================

/* Inlined from styles/06-routes-reports-drawer.css */
/* ==========================================================================
   SIRMS MOBILE - SPA ROUTING & PREMIUM COMPONENT STYLES
   ========================================================================== */

.app-bottom-tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  z-index: 9000;
  display: none;
  width: max-content;
  max-width: 90vw;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  background: rgba(5, 10, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

/* Ẩn pills khi có drawer (sheet) đang bật (peek hoặc open) */
body.drawer-active .app-bottom-tabs,
body:has(.bottom-sheet.open) .app-bottom-tabs,
body:has(.bottom-sheet.peek) .app-bottom-tabs {
  display: none !important;
  pointer-events: none;
}



body.sirms-authenticated:not(.sirms-route-login) .app-bottom-tabs {
  display: grid;
}

.bottom-tab-link {
  min-width: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 20px;
  font-family: var(--font-ui);
  transition: all 0.25s ease;
}

.bottom-tab-link svg {
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

.bottom-tab-link.active svg {
  opacity: 1;
}

.bottom-tab-link.active {
  color: var(--color-cyan);
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.25);
}

.bottom-tab-text {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

/* Thu nhỏ thanh Pills trên màn hình mobile (khoảng 60-70% diện tích gốc) */
@media (max-width: 768px) {
  .app-bottom-tabs {
    gap: 4px;
    padding: 4px;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
  }
  .bottom-tab-link {
    height: 30px;
    padding: 0 10px;
    gap: 4px;
    border-radius: 15px;
  }
  .bottom-tab-text {
    font-size: 0.65rem;
  }
  .bottom-tab-link svg {
    width: 14px;
    height: 14px;
  }
}



.cns-page {
  flex: 1;
  min-height: 0;
  height: auto;
  padding: 14px 12px 60px;
  overflow-y: auto;
  background: radial-gradient(circle at top right, rgba(0, 212, 255, 0.07), transparent 34%), #03060c;
}

.cns-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cns-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 6px;
}

.cns-page-header h2,
.cns-card h3 {
  letter-spacing: 0;
}

.cns-page-header h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.15rem;
  color: var(--text-primary);
}

.cns-page-subtitle {
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.cns-menu-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(0, 212, 255, 0.24);
  background: rgba(0, 212, 255, 0.08);
  color: var(--color-cyan);
  font-size: 1.1rem;
  cursor: pointer;
}

.cns-summary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.cns-sync-status {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
}

.cns-sync-status.status-fresh {
  color: var(--color-green);
  border-color: rgba(0, 255, 157, 0.24);
  background: rgba(0, 255, 157, 0.08);
}

.cns-sync-status.status-loading {
  color: var(--color-cyan);
  border-color: rgba(0, 212, 255, 0.24);
}

.cns-sync-status.status-error {
  color: var(--color-yellow);
  border-color: rgba(255, 184, 0, 0.28);
  background: rgba(255, 184, 0, 0.07);
}

.cns-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cns-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(8, 14, 28, 0.86);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  padding: 14px;
}

.cns-card-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.production-ring {
  position: relative;
  width: 86px;
  height: 86px;
  color: var(--accent, var(--color-cyan));
}

.production-ring svg {
  width: 86px;
  height: 86px;
  transform: rotate(-90deg);
}

.production-ring-bg,
.production-ring-value {
  fill: none;
  stroke-width: 4;
}

.production-ring-bg {
  stroke: rgba(255, 255, 255, 0.09);
}

.production-ring-value {
  stroke: currentColor;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px currentColor);
}

.production-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
}

.cns-kicker {
  color: var(--color-cyan);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.cns-card h3 {
  margin: 3px 0 7px;
  font-family: var(--font-ui);
  font-size: 0.98rem;
  color: var(--text-primary);
}

.cns-large-number {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.cns-large-number span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.cns-muted-line {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.production-detail-grid,
.alos-hours-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.cns-detail-cell {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.cns-detail-cell span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.65rem;
  margin-bottom: 2px;
}

.cns-detail-cell strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── ALOS Shell Container ─── */
.cns-shell.alos-shell {
  width: min(1200px, 100%);
}

/* ─── ALOS Filter Bar ─── */
.alos-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.alos-filter-buttons {
  display: flex;
  gap: 6px;
}

.alos-filter-btn {
  padding: 5px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.alos-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.alos-filter-btn.active {
  background: var(--color-cyan);
  color: #03060c;
  border-color: var(--color-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.35);
}

/* ─── ALOS Matrix Header (Desktop) ─── */
.alos-matrix-header {
  display: none;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px 8px 0 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

@media (min-width: 1024px) {
  .alos-matrix-header {
    display: grid;
    grid-template-columns: minmax(160px, 1.2fr) minmax(600px, 5fr) 110px;
    gap: 16px;
    align-items: center;
  }

  .matrix-col-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    text-align: center;
  }

  .matrix-col-status {
    text-align: right;
  }
}

/* ─── ALOS Service Row / Card ─── */
.alos-service-row {
  margin: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.alos-service-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.alos-service-summary::-webkit-details-marker {
  display: none;
}

@media (min-width: 1024px) {
  .alos-service-summary {
    display: grid;
    grid-template-columns: minmax(160px, 1.2fr) minmax(600px, 5fr) 110px;
    gap: 16px;
    align-items: center;
  }

  .matrix-service-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .matrix-service-info strong {
    font-size: 0.9rem;
    color: var(--text-primary);
  }

  .matrix-metric-count {
    display: none;
  }

  .matrix-metric-cells {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }

  .matrix-status-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }
}

@media (max-width: 1023px) {
  .alos-service-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .matrix-service-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .matrix-metric-count {
    font-size: 0.65rem;
    color: var(--text-muted);
  }

  .matrix-metric-cells {
    display: none;
  }

  .matrix-status-cell {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

.alos-status-text {
  font-size: 0.78rem;
  font-weight: 800;
}

.alos-status-text.status-good {
  color: var(--color-green, #00ff9d);
}

.alos-status-text.status-warning {
  color: var(--color-yellow, #ffb800);
}

.alos-status-text.status-bad {
  color: var(--color-red, #ff3d3d);
}

.alos-status-text.status-missing {
  color: var(--text-muted, #718096);
}

.alos-chevron {
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.alos-service-row[open] .alos-chevron {
  transform: rotate(180deg);
}

.alos-expanded-details {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 12px;
  padding-top: 12px;
}

.matrix-cell-empty {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ─── 1. Container cho Thanh Gauge ALoS (20 segments) ─── */
.alos-bar {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  max-width: 180px;
  margin-inline: auto;
  font-variant-numeric: tabular-nums;
}

.alos-bar-matrix {
  justify-self: center;
  max-width: 120px;
}

.alos-bar-detail {
  max-width: 240px;
  margin-top: 4px;
}

/* ─── 2. Track chứa 20 Vạch Segment ─── */
.alos-bar-track {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 16px;
  padding: 3px 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
              inset 0 -1px 0 rgba(0, 0, 0, 0.16);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

/* Vạch mặc định (Chưa tô màu) */
.alos-bar-segment {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.alos-bar-segment-empty {
  background: #dfe5ec;
  box-shadow: none;
}

/* Track rỗng vẫn giữ khung để các giá trị 0/thiếu dữ liệu không bị mất dấu. */
.alos-bar.status-empty .alos-bar-track {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.035);
}

.alos-bar.status-empty .alos-bar-segment {
  background: #dfe5ec;
}

/* ─── 3. Màu sắc 3 Phân vùng Vạch Segment ─── */

/* Vạch Xanh An toàn (0% – 75%: Vạch 0-14) */
.alos-bar-seg-good {
  background: hsl(142 72% 48%);
}

/* Vạch Vàng Cảnh báo (75% – 90%: Vạch 15-17) + Hiệu ứng Glow */
.alos-bar-seg-warning {
  background: hsl(42 100% 55%);
  box-shadow: 0 0 4px 1px hsla(42 100% 55% / 0.6),
              0 0 8px 2px hsla(42 100% 55% / 0.3);
}

/* Vạch Đỏ Báo động (90% – 100%+: Vạch 18-19) + Hiệu ứng Glow */
.alos-bar-seg-danger {
  background: hsl(0 85% 55%);
  box-shadow: 0 0 4px 1px hsla(0 85% 55% / 0.6),
              0 0 8px 2px hsla(0 85% 55% / 0.3);
}

/* ─── 4. Nhãn hiển thị bên dưới thanh ALoS ─── */
.alos-bar-label {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.alos-bar-empty-label {
  color: var(--text-muted);
  font-weight: 600;
}

body.light-mode .alos-bar-track {
  border-color: rgba(74, 96, 128, 0.22);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              inset 0 -1px 0 rgba(74, 96, 128, 0.08);
}

body.light-mode .alos-bar-segment-empty {
  background: #dfe5ec;
}

body.light-mode .alos-bar.status-empty .alos-bar-track {
  border-color: rgba(74, 96, 128, 0.3);
  background: rgba(226, 232, 240, 0.32);
}

body.light-mode .alos-bar.status-empty .alos-bar-segment {
  background: #dfe5ec;
}

.alos-bar-sep {
  color: var(--text-muted);
  font-weight: 400;
}

.alos-bar-diff {
  font-size: 0.62rem;
  font-weight: 800;
  margin-left: 2px;
}

.alos-bar-diff.status-good {
  color: var(--color-green, #00ff9d);
}

.alos-bar-diff.status-warning {
  color: var(--color-yellow, #ffb800);
}

.alos-bar-diff.status-bad {
  color: var(--color-red, #ff3d3d);
}

.alos-status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.66rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

.alos-status-pill.status-good {
  color: var(--color-green, #00ff9d);
  border-color: rgba(0, 255, 157, 0.26);
  background: rgba(0, 255, 157, 0.08);
}

.alos-status-pill.status-warning {
  color: var(--color-yellow, #ffb800);
  border-color: rgba(255, 184, 0, 0.28);
  background: rgba(255, 184, 0, 0.08);
}

.alos-status-pill.status-bad {
  color: var(--color-red, #ff3d3d);
  border-color: rgba(255, 61, 61, 0.28);
  background: rgba(255, 61, 61, 0.08);
}

.alos-metric-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
}

.alos-metric-row {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.02);
}

.alos-metric-top,
.alos-metric-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.72rem;
  color: var(--text-secondary);
  gap: 8px;
}

.alos-metric-top span {
  color: var(--text-primary);
  font-weight: 600;
}

.alos-metric-gauge-wrap {
  margin: 6px 0;
}

.alos-metric-foot {
  margin-top: 4px;
  font-size: 0.66rem;
  color: var(--text-muted);
}

/* Route View State */
.route-view {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}


/* 1. Header Navigation Bar styling */
.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 20px;
}

.nav-link {
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, text-shadow 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--color-cyan);
  background: rgba(0, 212, 255, 0.05);
  text-shadow: var(--glow-shadow-cyan);
}

.nav-link.active {
  color: var(--color-cyan);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  box-shadow: inset 0 0 8px rgba(0, 212, 255, 0.1), 0 0 10px rgba(0, 212, 255, 0.05);
  text-shadow: var(--glow-shadow-cyan);
}

/* Ensure body background is dark when on login page to prevent white gaps/overscroll on iOS */
body.sirms-route-login {
  background-color: #03060c !important;
}

/* 2. Full-Screen Login Page Styling */
.login-page-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(3, 6, 12, 0.45), rgba(3, 6, 12, 0.5)), url('/assets/login_bg.webp') no-repeat center center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.login-radial-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, rgba(3, 6, 12, 0) 70%);
  z-index: 1;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  background: rgba(8, 14, 28, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), inset 0 0 15px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.login-logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-logo-pulse {
  width: 48px;
  height: 48px;
  background: rgba(0, 212, 255, 0.1);
  border: 2px solid var(--color-cyan);
  border-radius: 50%;
  margin-bottom: 12px;
  box-shadow: var(--glow-shadow-cyan);
  animation: logo-blink 2s infinite alternate;
}

@keyframes logo-blink {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  }

  100% {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.7);
  }
}

.login-logo {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 5px;
  color: #fff;
  margin: 20px 0 0 0;
}

.login-logo .accent {
  color: var(--color-cyan);
  text-shadow: var(--glow-shadow-cyan);
}

.login-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-top: 4px;
  text-transform: uppercase;
}

/* Input wrappers with icons */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  pointer-events: none;
  transition: color 0.25s ease, filter 0.25s ease;
}

.input-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  display: block;
}

.input-wrapper input {
  background: var(--bg-input);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 12px 12px 12px 38px !important;
  color: #fff;
  font-size: 16px;
  transition: all 0.2s;
  width: 100%;
  -webkit-user-select: text !important;
  user-select: text !important;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--border-glow-active);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.input-wrapper:focus-within .input-icon {
  color: var(--color-cyan);
  filter: drop-shadow(0 0 4px var(--color-cyan));
}

/* Remember Me Toggle */
.remember-me-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  width: fit-content;
  margin-bottom: 15px;
}

.remember-me-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.remember-me-track input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.remember-me-thumb {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 20px;
  transition: background 0.25s, border-color 0.25s;
}

.remember-me-thumb::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 2px;
  left: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s, box-shadow 0.25s;
}

.remember-me-track input:checked+.remember-me-thumb {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--color-cyan);
}

.remember-me-track input:checked+.remember-me-thumb::after {
  transform: translateX(16px);
  background: var(--color-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.7);
}

.remember-me-label:hover .remember-me-thumb {
  border-color: rgba(0, 212, 255, 0.5);
}

.remember-me-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.remember-me-label:hover .remember-me-text {
  color: var(--text-primary);
}

.login-card-footer {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* 3. Daily Report View Component Styling */
.reports-main-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-height: 0;
  height: auto;
  overflow-y: auto;
}

.glass-panel {
  background: rgba(8, 14, 28, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 800px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.report-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.report-header h2 {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  margin: 0;
}

.report-date {
  font-size: 0.75rem;
  font-family: var(--font-ui);
  margin-top: 4px;
}

.report-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 700;
}

.report-table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 20px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.report-table th,
.report-table td {
  padding: 12px 16px;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.report-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.report-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
}

.status-pill.status-green {
  background: rgba(0, 255, 157, 0.1);
  color: var(--color-green);
  border: 1px solid rgba(0, 255, 157, 0.2);
}

.report-action-row {
  display: flex;
  justify-content: flex-end;
}

.action-btn-glow {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--color-cyan);
  color: var(--color-cyan);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.1);
}

.action-btn-glow:active {
  background: rgba(0, 212, 255, 0.2);
  transform: scale(0.98);
}

/* Animations */
.animate-fade-in {
  animation: fade-in 0.4s cubic-bezier(0.15, 0.85, 0.35, 1);
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Adjustments for reports and top-nav */
@media (max-width: 768px) {
  .top-nav {
    margin-left: 10px;
    gap: 4px;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
}

/* --- 19. DRAWER NAVIGATION MENU --- */
.drawer-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.drawer-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, text-shadow 0.2s ease;
  cursor: pointer;
  position: relative;
  gap: 12px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.01);
}

.drawer-nav-link:hover {
  color: var(--color-cyan);
  background: rgba(0, 212, 255, 0.05);
  border-color: var(--border-glow);
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.05), 0 0 12px rgba(0, 212, 255, 0.05);
}

.drawer-nav-link.active {
  color: var(--color-cyan);
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--border-glow-active);
  box-shadow: inset 0 0 12px rgba(0, 212, 255, 0.1), 0 0 15px rgba(0, 212, 255, 0.1);
  text-shadow: var(--glow-shadow-cyan);
}

.drawer-nav-link.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.01);
  border-color: var(--border-light);
  color: var(--text-muted);
}

.drawer-nav-link.disabled:hover {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-muted);
  border-color: var(--border-light);
  box-shadow: none;
}

/* Premium alert warning menu item */
.drawer-nav-link.warning-link {
  color: var(--color-yellow) !important;
  border-color: rgba(255, 184, 0, 0.25) !important;
  background: rgba(255, 184, 0, 0.04) !important;
  animation: alert-glow 2s infinite;
  text-shadow: 0 0 8px rgba(255, 184, 0, 0.2);
}

.drawer-nav-link.warning-link:hover {
  color: #fff !important;
  background: rgba(255, 184, 0, 0.15) !important;
  border-color: var(--color-yellow) !important;
  box-shadow: inset 0 0 12px rgba(255, 184, 0, 0.1), 0 0 15px rgba(255, 184, 0, 0.1);
  text-shadow: 0 0 8px rgba(255, 184, 0, 0.5);
}

.drawer-nav-icon {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-nav-text {
  flex-grow: 1;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}

.badge-dev {
  background: rgba(255, 184, 0, 0.1);
  border: 1px solid var(--color-yellow);
  color: var(--color-yellow);
  font-size: 0.65rem;
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 6px rgba(255, 184, 0, 0.2);
}

/* --- 20. USER PROFILE & DRAWER COUNTERS --- */
.user-info-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.01);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 255, 157, 0.15));
  border: 1px solid var(--border-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-grow: 1;
}

.profile-name {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dept {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-counters-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.drawer-counter-item {
  background: rgba(2, 4, 9, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  flex: 1 1 calc(50% - 5px);
  box-sizing: border-box;
}

.drawer-counter-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.drawer-counter-item.ok::before {
  background-color: var(--color-green);
}

.drawer-counter-item.warn::before {
  background-color: var(--color-yellow);
}

.drawer-counter-item.danger::before {
  background-color: var(--color-red);
}

.drawer-counter-item.offline::before {
  background-color: var(--color-gray);
}

/* Restored lost drawer counter styles */
.counter-lbl {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.counter-val {
  font-family: var(--font-ui);
  font-size: 1.3rem;
  font-weight: 700;
}

.counter-val.text-green {
  color: var(--color-green);
  text-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.counter-val.text-yellow {
  color: var(--color-yellow);
  text-shadow: 0 0 10px rgba(255, 184, 0, 0.3);
}

.counter-val.text-red {
  color: var(--color-red);
  text-shadow: 0 0 10px rgba(255, 61, 61, 0.3);
}

.counter-val.text-gray {
  color: var(--color-gray);
  text-shadow: 0 0 10px rgba(128, 138, 157, 0.3);
}

/* Premium Dynamic Interactive Form Styles */
.report-metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
}

.report-metadata-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-metadata-item label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-metadata-item select,
.report-metadata-item input {
  background: var(--bg-input);
  border: 1px solid var(--border-glow);
  border-radius: 6px;
  color: #fff;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-family: var(--font-ui);
  transition: all 0.2s ease;
}

.report-metadata-item select:focus,
.report-metadata-item input:focus {
  outline: none;
  border-color: var(--border-glow-active);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.report-section-card {
  background: rgba(12, 20, 38, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.report-section-card:hover {
  border-color: rgba(0, 212, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.05);
}

.report-section-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-cyan);
  margin-top: 0;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  letter-spacing: 0.5px;
}

.report-device-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  margin-bottom: 10px;
  transition: background-color 0.2s ease;
}

.report-device-item:last-child {
  margin-bottom: 0;
}

.report-device-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.report-device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.report-device-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  font-family: var(--font-ui);
}

/* Premium Segmented Normal / Broken Switch button */
.segmented-control {
  display: flex;
  background: rgba(2, 4, 9, 0.6);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2px;
  width: 170px;
  position: relative;
}

.segment-btn {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-ui);
  padding: 6px 0;
  cursor: pointer;
  border-radius: 18px;
  transition: all 0.25s cubic-bezier(0.15, 0.85, 0.35, 1);
  text-align: center;
}

.segment-btn:focus {
  outline: none;
}

.segment-btn.active.normal {
  background: rgba(0, 255, 157, 0.15);
  color: var(--color-green);
  border: 1px solid rgba(0, 255, 157, 0.3);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.15);
  text-shadow: 0 0 4px rgba(0, 255, 157, 0.3);
}

.segment-btn.active.broken {
  background: rgba(255, 61, 61, 0.15);
  color: var(--color-red);
  border: 1px solid rgba(255, 61, 61, 0.3);
  box-shadow: 0 0 10px rgba(255, 61, 61, 0.15);
  text-shadow: 0 0 4px rgba(255, 61, 61, 0.3);
}

.report-device-remark {
  width: 100%;
}

.report-device-remark input {
  width: 100%;
  background: rgba(2, 4, 9, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  padding: 8px 10px;
  font-size: 0.78rem;
  transition: all 0.2s ease;
  font-family: var(--font-ui);
}

.report-device-remark input:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.3);
  color: #fff;
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.1);
}

.form-loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
  color: var(--text-secondary);
}

/* ==========================================================================

/* Inlined from styles/07-media-light.css */
/* ==========================================================================
   STATION IMAGE SLIDER, LIGHT MODE, AND CROPPER OVERRIDES
   ========================================================================== */
.station-image-slider {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Ẩn thanh cuộn trên mọi trình duyệt */
.station-image-slider::-webkit-scrollbar {
  display: none;
}

.station-image-slider {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

.station-image-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
}

.station-image-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.station-image-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
  pointer-events: none;
}

.station-image-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.station-image-dot.active {
  background: var(--color-cyan);
  width: 14px;
  border-radius: 3px;
}

/* ==========================================================================
   LIGHT MODE — MISSING COMPONENT OVERRIDES
   ========================================================================== */

/* LOGIN PAGE */
body.light-mode .login-page-container {
  background: linear-gradient(rgba(232, 238, 245, 0.5), rgba(232, 238, 245, 0.6)), url('/assets/login_bg.webp') no-repeat center center;
  background-size: cover;
}

body.light-mode .login-radial-glow {
  background: radial-gradient(circle, rgba(0, 150, 200, 0.05) 0%, rgba(232, 238, 245, 0) 70%);
}

body.light-mode .login-card {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 15px 35px rgba(10, 35, 55, 0.1), inset 0 0 15px rgba(255, 255, 255, 0.2);
}

body.light-mode .login-card::before,
body.light-mode .login-card::after {
  opacity: 0.15;
  mix-blend-mode: normal;
}

body.light-mode .login-logo {
  color: #1a2a3a;
  text-shadow: none;
}

body.light-mode .login-logo .accent {
  color: #007ab5;
  text-shadow: 0 0 10px rgba(0, 150, 200, 0.3);
}

body.light-mode .login-subtitle {
  color: var(--text-secondary);
}

body.light-mode .login-logo-pulse {
  background: rgba(0, 150, 200, 0.1);
  border-color: #007ab5;
  box-shadow: 0 0 12px rgba(0, 150, 200, 0.35);
}

body.light-mode .input-wrapper input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 150, 200, 0.3);
  color: #1a2a3a;
}

body.light-mode .input-wrapper input:focus {
  border-color: rgba(0, 150, 200, 0.7);
  box-shadow: 0 0 10px rgba(0, 150, 200, 0.15);
}

body.light-mode .input-icon {
  color: var(--text-secondary);
}

body.light-mode .input-wrapper:focus-within .input-icon {
  color: #007ab5;
  filter: drop-shadow(0 0 4px rgba(0, 150, 200, 0.3));
}

body.light-mode .remember-me-thumb {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 150, 200, 0.25);
}

body.light-mode .remember-me-thumb::after {
  background: #7a95b0;
}

body.light-mode .remember-me-track input:checked + .remember-me-thumb {
  background: rgba(0, 150, 200, 0.12);
  border-color: #007ab5;
}

body.light-mode .remember-me-track input:checked + .remember-me-thumb::after {
  background: #007ab5;
  box-shadow: 0 0 8px rgba(0, 150, 200, 0.5);
}

body.light-mode .remember-me-text {
  color: var(--text-secondary);
}

body.light-mode .remember-me-label:hover .remember-me-text {
  color: var(--text-primary);
}

body.light-mode .login-card-footer {
  color: var(--text-muted);
}

/* MODAL CARD (station contact, new station) */
body.light-mode .modal-overlay {
  background: rgba(10, 20, 40, 0.4);
}

body.light-mode .monitor-data-loading {
  background: rgba(236, 246, 251, 0.45);
}

body.light-mode .monitor-data-loading-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 150, 200, 0.24);
  box-shadow: 0 12px 34px rgba(10, 35, 55, 0.16), 0 0 18px rgba(0, 150, 200, 0.1);
}

body.light-mode .monitor-data-loading-title {
  color: #1a2a3a;
}

body.light-mode .monitor-data-loading.is-error .monitor-data-loading-panel {
  border-color: rgba(214, 145, 0, 0.4);
}

body.light-mode .modal-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 150, 200, 0.2);
  box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.12);
}

body.light-mode .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .modal-title {
  color: #1a2a3a;
}

body.light-mode .modal-subtitle {
  color: #007ab5;
}

body.light-mode .modal-close-btn {
  color: var(--text-secondary);
}

body.light-mode .modal-close-btn:active {
  background: rgba(0, 0, 0, 0.06);
  color: #1a2a3a;
}

body.light-mode .modal-station-info {
  background: rgba(220, 232, 245, 0.5);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .modal-info-label {
  color: var(--text-muted);
}

body.light-mode .modal-info-val {
  color: var(--text-primary);
}

body.light-mode .modal-info-val.mono {
  color: #007ab5;
}

body.light-mode .modal-form-group label {
  color: var(--text-secondary);
}

body.light-mode .modal-form-group input,
body.light-mode .modal-form-group select {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 150, 200, 0.3) !important;
  color: #1a2a3a !important;
}

body.light-mode .modal-form-group input:focus,
body.light-mode .modal-form-group select:focus {
  border-color: rgba(0, 150, 200, 0.7) !important;
  box-shadow: 0 0 10px rgba(0, 150, 200, 0.15) !important;
}

body.light-mode .modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .modal-skip-btn {
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
}

body.light-mode .modal-skip-btn:active {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .modal-save-btn {
  background: rgba(0, 150, 200, 0.1);
  border-color: #007ab5;
  color: #007ab5;
  box-shadow: inset 0 0 10px rgba(0, 150, 200, 0.08);
}

body.light-mode .modal-save-btn:not(:disabled):active {
  background: rgba(0, 150, 200, 0.2);
}

body.light-mode .modal-dot {
  background: rgba(0, 150, 200, 0.25);
}

body.light-mode .modal-dot.active {
  background: #007ab5;
  box-shadow: 0 0 6px rgba(0, 150, 200, 0.5);
}

/* REPORTS / GLASS PANEL */
body.light-mode .glass-panel {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(0, 0, 0, 0.07) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

body.light-mode .report-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .report-metadata-grid {
  background: rgba(220, 232, 245, 0.4);
  border-color: rgba(0, 0, 0, 0.07);
}

body.light-mode .report-metadata-item label {
  color: var(--text-secondary);
}

body.light-mode .report-metadata-item select,
body.light-mode .report-metadata-item input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 150, 200, 0.3);
  color: #1a2a3a;
}

body.light-mode .report-metadata-item select:focus,
body.light-mode .report-metadata-item input:focus {
  border-color: rgba(0, 150, 200, 0.7);
  box-shadow: 0 0 8px rgba(0, 150, 200, 0.12);
}

body.light-mode .report-section-card {
  background: rgba(235, 242, 250, 0.7);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

body.light-mode .report-section-card:hover {
  border-color: rgba(0, 150, 200, 0.15);
  box-shadow: 0 4px 24px rgba(0, 150, 200, 0.06);
}

body.light-mode .report-section-title {
  color: #007ab5;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .report-device-item {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .report-device-item:hover {
  background: rgba(255, 255, 255, 0.85);
}

body.light-mode .report-device-name {
  color: #1a2a3a;
}

body.light-mode .segmented-control {
  background: rgba(210, 225, 240, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .segment-btn {
  color: var(--text-secondary);
}

/* DRAWER COUNTERS (user profile panel) */
body.light-mode .drawer-counter-item {
  background: rgba(225, 235, 248, 0.8);
  border-color: rgba(0, 0, 0, 0.07);
}

body.light-mode .counter-lbl {
  color: var(--text-secondary);
}

/* DRAWER NAV LINKS */
body.light-mode .drawer-nav-link {
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.07);
  background: rgba(240, 246, 252, 0.7);
}

body.light-mode .drawer-nav-link:active,
body.light-mode .drawer-nav-link.active {
  background: rgba(0, 150, 200, 0.1);
  border-color: rgba(0, 150, 200, 0.25);
}

body.light-mode .drawer-nav-text {
  color: var(--text-primary);
}

/* SETTING INPUTS */
body.light-mode .setting-input-wrapper input {
  color: #1a2a3a;
}

/* NAV LINKS (top nav in reports view) */
body.light-mode .nav-link {
  color: var(--text-secondary);
}

body.light-mode .nav-link:hover {
  color: #007ab5;
  background: rgba(0, 150, 200, 0.06);
  text-shadow: none;
}

body.light-mode .nav-link.active {
  color: #007ab5;
  background: rgba(0, 150, 200, 0.1);
  border-color: rgba(0, 150, 200, 0.25);
  box-shadow: inset 0 0 8px rgba(0, 150, 200, 0.08);
  text-shadow: none;
}

/* Override hardcoded inline color:#fff on modal inputs/selects (station_contact_modal, etc.) */
body.light-mode .modal-card input[style],
body.light-mode .modal-card select[style],
body.light-mode .modal-card textarea[style] {
  color: #1a2a3a !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 150, 200, 0.3) !important;
}

body.light-mode .modal-card input[style]:focus,
body.light-mode .modal-card select[style]:focus {
  border-color: rgba(0, 150, 200, 0.7) !important;
  box-shadow: 0 0 10px rgba(0, 150, 200, 0.15) !important;
}

/* ==========================================================================
   CUSTOM CROPPER.JS STYLES (DARK/LIGHT NEON CYAN THEMING)
   ========================================================================== */
.cropper-bg {
  background-image: repeating-conic-gradient(rgba(0, 0, 0, 0.2) 0% 25%, rgba(0, 0, 0, 0.4) 0% 50%) !important;
  background-position: 0 0;
  background-size: 12px 12px;
}
body.light-mode .cropper-bg {
  background-image: repeating-conic-gradient(rgba(255, 255, 255, 0.5) 0% 25%, rgba(240, 240, 240, 0.7) 0% 50%) !important;
}
.cropper-view-box {
  outline: 2px solid var(--color-cyan) !important;
  outline-color: var(--color-cyan) !important;
  border-radius: 4px;
}
.cropper-line {
  background-color: var(--color-cyan) !important;
}
.cropper-point {
  background-color: var(--color-cyan) !important;
}
.cropper-point.point-se {
  height: 8px !important;
  opacity: 1 !important;
  width: 8px !important;
}

/* Inlined from styles/08-desktop-sidebar.css */
/* ==========================================================================
   DESKTOP SIDEBAR – DANH SÁCH ĐÀI TRẠM (chỉ hiển thị trên desktop ≥ 1024px)
   ========================================================================== */

/* --- Sidebar Container --- */
.desktop-sidebar {
  display: none;
  /* Ẩn mặc định trên mobile */
}

@media (min-width: 1024px) {

  /* Hiển thị sidebar trên desktop */
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    height: 100%;
    background: rgba(6, 10, 19, 0.45);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 500;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      min-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.3s ease;
    flex-shrink: 0;
    overflow: hidden;
  }

  /* Trạng thái thu gọn */
  .desktop-sidebar.collapsed {
    width: 0;
    min-width: 0;
    max-width: 0;
    border-right: none;
    opacity: 0;
  }

  /* Khi sidebar thu gọn, map tự chiếm toàn bộ width */
  #map-container {
    display: flex;
    flex-direction: row;
  }

  #map {
    position: relative;
    flex: 1;
    min-width: 0;
  }

  /* --- Sidebar Header --- */
  .sidebar-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
  }

  .sidebar-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.7); /* Màu xám trắng ở chế độ tối */
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    text-align: center;
  }

  /* --- Bộ đếm trạng thái --- */
  .sidebar-counters {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 8px;
    justify-content: space-around;
  }

  .sidebar-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
  }

  .counter-num {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
  }

  .counter-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
  }

  /* --- Bộ lọc nhanh (Tabs) --- */
  .sidebar-filters {
    display: flex;
    gap: 6px;
  }

  .sidebar-filter-btn {
    flex: 1;
    padding: 6px 0;
    border: 1px solid var(--border-glow);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
  }

  .sidebar-filter-btn:hover {
    background: rgba(0, 212, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--border-glow-active);
  }

  .sidebar-filter-btn.active {
    background: rgba(0, 212, 255, 0.12);
    color: var(--color-cyan);
    border-color: var(--color-cyan);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
  }

  /* --- Danh sách đài trạm (Cuộn) --- */
  .sidebar-station-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 0;
  }

  /* Custom scrollbar cho sidebar */
  .sidebar-station-list::-webkit-scrollbar {
    width: 4px;
  }

  .sidebar-station-list::-webkit-scrollbar-track {
    background: transparent;
  }

  .sidebar-station-list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.2);
    border-radius: 4px;
  }

  .sidebar-station-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.4);
  }

  /* --- Station Item --- */
  .sidebar-station-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-left-color 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
  }

  .sidebar-station-item:hover {
    background: rgba(0, 212, 255, 0.05);
  }

  .sidebar-station-item.active {
    background: rgba(0, 212, 255, 0.1);
    border-left-color: var(--color-cyan);
  }

  .sidebar-station-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-cyan);
    box-shadow: 0 0 8px var(--color-cyan);
  }

  /* Chấm trạng thái */
  .sidebar-station-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
  }

  .sidebar-station-dot.green {
    background: var(--color-green);
    box-shadow: 0 0 6px var(--color-green);
  }

  .sidebar-station-dot.warn {
    background: var(--color-yellow);
    box-shadow: 0 0 6px var(--color-yellow);
    animation: sidebar-dot-warn 1.8s infinite;
  }

  .sidebar-station-dot.danger {
    background: var(--color-red);
    box-shadow: 0 0 6px var(--color-red);
    animation: sidebar-dot-danger 1.2s infinite;
  }

  .sidebar-station-dot.gray {
    background: var(--color-gray);
    box-shadow: 0 0 4px rgba(120, 144, 156, 0.3);
    opacity: 0.7;
  }

  @keyframes sidebar-dot-warn {

    0%,
    100% {
      box-shadow: 0 0 4px var(--color-yellow);
    }

    50% {
      box-shadow: 0 0 10px var(--color-yellow);
    }
  }

  @keyframes sidebar-dot-danger {

    0%,
    100% {
      box-shadow: 0 0 4px var(--color-red);
    }

    50% {
      box-shadow: 0 0 12px var(--color-red);
    }
  }

  /* Thông tin đài trạm */
  .sidebar-station-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .sidebar-station-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }

  .sidebar-station-equip {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  /* Mã ICAO bên phải */
  .sidebar-station-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    flex-shrink: 0;
    opacity: 0.7;
  }

  .sidebar-station-item.active .sidebar-station-code {
    color: var(--color-cyan);
    opacity: 1;
  }

  /* --- Nút Toggle (Thu/Mở Sidebar) --- */
  .sidebar-toggle-btn {
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 48px;
    background: rgba(6, 10, 19, 0.9);
    border: 1px solid var(--border-glow);
    border-left: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 6px 6px 0;
    z-index: 501;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
  }

  .sidebar-toggle-btn:hover {
    color: var(--color-cyan);
    background: rgba(0, 212, 255, 0.08);
    border-color: var(--color-cyan);
  }

  /* Khi sidebar thu gọn, nút toggle đổi vị trí và icon */
  .desktop-sidebar.collapsed .sidebar-toggle-btn {
    right: -16px;
  }

  .desktop-sidebar.collapsed .sidebar-toggle-btn::after {
    content: '›';
  }

  /* --- Empty State --- */
  .sidebar-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
  }

  .sidebar-empty-icon {
    font-size: 1.6rem;
    opacity: 0.5;
  }

  .sidebar-empty-text {
    font-size: 0.75rem;
    font-style: italic;
  }

  /* --- Sidebar Search --- */
  .sidebar-search-container {
    position: relative;
    margin-top: 12px;
    margin-bottom: 2px;
  }

  .sidebar-search-input {
    width: 100%;
    padding: 8px 30px 8px 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    transition: all 0.2s ease;
  }

  .sidebar-search-input:focus {
    outline: none;
    border-color: var(--color-cyan);
    background: rgba(0, 212, 255, 0.04);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
  }

  .sidebar-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
  }

  .sidebar-search-input:focus+.sidebar-search-icon {
    color: var(--color-cyan);
  }

  .sidebar-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: none;
  }

  .sidebar-search-clear:hover {
    color: var(--color-cyan);
  }
}

/* --- LIGHT MODE OVERRIDES --- */
@media (min-width: 1024px) {
  .light-mode .desktop-sidebar {
    background: rgba(255, 255, 255, 0.45) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.4) !important;
  }

  .light-mode .desktop-sidebar::before,
  .light-mode .desktop-sidebar::after {
    opacity: 0.1;
    mix-blend-mode: normal;
  }

  .light-mode .sidebar-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
  }

  .light-mode .sidebar-counters {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
  }

  .light-mode .sidebar-filter-btn {
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-secondary);
  }

  .light-mode .sidebar-filter-btn:hover {
    background: rgba(0, 122, 255, 0.06);
  }

  .light-mode .sidebar-filter-btn.active {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    border-color: #007aff;
  }

  .light-mode .sidebar-station-item:hover {
    background: rgba(0, 122, 255, 0.04);
  }

  .light-mode .sidebar-station-item.active {
    background: rgba(0, 122, 255, 0.08);
    border-left-color: #007aff;
  }

  .light-mode .sidebar-station-item.active .sidebar-station-code {
    color: #007aff;
  }

  .light-mode .sidebar-toggle-btn {
    background: rgba(240, 244, 248, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
  }

  .light-mode .sidebar-toggle-btn:hover {
    background: rgba(0, 122, 255, 0.06);
    color: #007aff;
    border-color: #007aff;
  }

  .light-mode .sidebar-station-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
  }

  .light-mode .sidebar-station-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
  }

  .light-mode .sidebar-search-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
  }

  .light-mode .sidebar-search-input:focus {
    background: rgba(0, 122, 255, 0.04);
    border-color: #007aff;
    box-shadow: 0 0 8px rgba(0, 122, 255, 0.15);
  }

  .light-mode .sidebar-search-input:focus+.sidebar-search-icon {
    color: #007aff;
  }

  .light-mode .sidebar-search-clear:hover {
    color: #007aff;
  }

  .light-mode .sidebar-title {
    color: #0b2545; /* Màu xanh dương đậm ở chế độ sáng */
    text-shadow: none;
  }

  /* Move bottom pills to the right edge on desktop screens and shrink further */
  .app-bottom-tabs {
    left: auto;
    right: 32px;
    bottom: 32px;
    transform: scale(0.7);
    transform-origin: bottom right;
  }


}
