/* ==========================================
   全局色阶规范 (高对比度增强版)
   ========================================== */
:root {
  --bg-base: #eef3f8; --bg-panel: rgba(255,255,255,0.92); --bg-card: #ffffff; --bg-elevated: rgba(255,255,255,0.78); --border: rgba(148,163,184,0.24);
  --text-main: #0f172a; --text-body: #1e293b; --text-sub: #475569; --text-muted: #64748b;
  --danger-red: #e11d48; --warn-yellow: #f59e0b; --normal-green: #0f9f6e; --standby-gray: #cbd5e1;
  --blue-charge: #1473e6; --brand-primary: #1473e6; --brand-primary-hover: #2984ef; --brand-primary-deep: #0f5bb8; --brand-soft: rgba(20,115,230,0.10);
  --radius-sm: 10px; --radius-base: 14px; --radius-lg: 24px;
  --shadow-base: 0 18px 44px rgba(15, 23, 42, 0.08), 0 3px 10px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 22px 48px rgba(15, 23, 42, 0.14), 0 10px 24px rgba(20, 115, 230, 0.10);
  --shadow-dropdown: 0 24px 48px rgba(15,23,42,0.16), 0 10px 24px rgba(15,23,42,0.08);
  --sidebar-width: 202px;
  --font-sans: "Segoe UI Variable", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { display: flex; flex-direction: column; height: 100vh; color: var(--text-body); overflow: hidden; user-select: none; position: relative; }
body::before { content: ""; position: fixed; top: -180px; right: -140px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(20,115,230,0.18) 0%, rgba(20,115,230,0) 68%); pointer-events: none; z-index: 0; }
body::after { content: ""; position: fixed; bottom: -220px; left: -160px; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle, rgba(14,165,233,0.16) 0%, rgba(14,165,233,0) 70%); pointer-events: none; z-index: 0; }
input, textarea, select { user-select: auto; }
.history-table, .sk-main, .sk-sub-val, .matrix-table { user-select: text; }
#login_page, #main_app { position: relative; z-index: 1; }

#login_page { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: flex; z-index: 10000; background: var(--bg-base); }
.login-left { flex: 1.2; background: linear-gradient(135deg, rgba(237,244,255,0.96) 0%, rgba(255,255,255,0.82) 44%, rgba(241,245,249,0.86) 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.login-left::before { content: ""; position: absolute; inset: 8% auto auto 10%; width: 280px; height: 280px; border-radius: 36px; background: linear-gradient(135deg, rgba(20,115,230,0.15), rgba(20,115,230,0)); transform: rotate(18deg); }
.login-left::after { content: ""; position: absolute; inset: auto 8% 10% auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(14,165,233,0.18) 0%, rgba(14,165,233,0) 70%); }
.login-right { width: 460px; background: rgba(255,255,255,0.84); display: flex; flex-direction: column; justify-content: center; padding: 54px; box-shadow: -20px 0 40px rgba(15,23,42,0.08); backdrop-filter: blur(16px); border-left: 1px solid rgba(255,255,255,0.65); }
.login-title { font-size: 30px; font-weight: 900; margin-bottom: 30px; color: var(--text-main); }
.login-label { font-size: 14px; font-weight: bold; color: var(--text-sub); display: block; margin-bottom: 8px;}
.input-group { position: relative; margin-bottom: 20px; width: 100%; }
.login-input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; background: rgba(248,250,252,0.88); color: var(--text-main); font-size: 14px; transition: all 0.3s; box-shadow: inset 0 1px 1px rgba(255,255,255,0.6); }
.login-input:focus { border-color: rgba(20, 115, 230, 0.38); background: var(--bg-card); box-shadow: 0 0 0 4px rgba(20, 115, 230, 0.10); }
.error-text { color: var(--danger-red); font-size: 12px; position: absolute; bottom: -18px; left: 2px; display: none; font-weight: 500; }
.input-group.has-error .error-text { display: block; }
.eye-btn { position: absolute; right: 12px; top: 12px; cursor: pointer; color: var(--text-muted); }
.slider-captcha { width: 100%; height: 40px; background: rgba(248,250,252,0.82); border: 1px solid var(--border); border-radius: var(--radius-sm); position: relative; overflow: hidden; margin-bottom: 24px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); }
.slider-bg { width: 0; height: 100%; background: var(--brand-soft); position: absolute; top: 0; left: 0; }
.slider-text { width: 100%; line-height: 40px; text-align: center; position: absolute; font-size: 13px; color: var(--text-sub); pointer-events: none; font-weight: bold;}
.slider-btn { width: 42px; height: 38px; background: #fff; border: 1px solid var(--border); border-radius: 8px; position: absolute; top: 0; left: 0; cursor: grab; display: flex; align-items: center; justify-content: center; z-index: 2; color: var(--text-sub); box-shadow: 0 10px 22px rgba(15,23,42,0.08); }
.slider-btn:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.slider-captcha.success .slider-bg { background: #d1fae5; border-right: 1px solid #6ee7b7;}
.slider-captcha.success .slider-btn { border-color: #10b981; color: #10b981; cursor: default; }

.login-btn-submit { width: 100%; padding: 12px; background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-deep)); color: white; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: bold; cursor: pointer; transition: all 0.2s; box-shadow: 0 18px 30px rgba(20,115,230,0.26); }
.login-btn-submit:hover:not(:disabled) { background: linear-gradient(135deg, var(--brand-primary-hover), var(--brand-primary-deep)); transform: translateY(-1px); }

#main_app { display: none; flex-direction: column; height: 100vh; width: 100vw; }

.app-body { display: flex; flex: 1; overflow: hidden; width: 100%; }
.page-content.active { display: flex; }

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; opacity: 0.8; }

.kpi-card { padding: 16px 20px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid rgba(255,255,255,0.58); background: linear-gradient(180deg, rgba(255,255,255,0.90) 0%, rgba(248,250,252,0.80) 100%); border-radius: 20px; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(20,115,230,0.18); }

.btn { min-height: 38px; padding: 0 14px; border-radius: 14px; background: rgba(255,255,255,0.82); color: var(--text-main); border: 1px solid rgba(129,151,181,0.18); font-size: 13px; cursor: pointer; font-weight: 700; transition: all 0.2s; backdrop-filter: blur(10px); box-shadow: none; }
.btn:hover { border-color: rgba(20,115,230,0.22); color: var(--text-main); box-shadow: 0 16px 28px rgba(16,35,59,0.08); }
.btn-primary { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-deep)) !important; color: #fff !important; border: none !important; box-shadow: 0 16px 28px rgba(20,115,230,0.2) !important; }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-primary-hover), var(--brand-primary-deep)) !important; color: #fff !important; transform: translateY(-1px); }

.sn-selector { min-width: 250px; min-height: 34px; padding: 0 34px 0 62px; border: 1px solid rgba(129,151,181,0.2); border-radius: 12px; background: rgba(255,255,255,0.9); color: var(--text-main); font-size: 12px; font-weight: 700; outline: none; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s; box-shadow: inset 0 1px 0 rgba(255,255,255,0.94); }
.sn-selector:hover { box-shadow: 0 0 0 4px rgba(20, 115, 230, 0.10); }

.panel { background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.88) 100%); border: 1px solid rgba(255,255,255,0.66); border-radius: var(--radius-lg); box-shadow: var(--shadow-base); display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(16px); }
.panel-header { min-height: 54px; padding: 12px 18px !important; font-size: 14px; font-weight: 700; color: var(--text-main); border-bottom: 1px solid rgba(129, 151, 181, 0.14); display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 253, 0.94)) !important; letter-spacing: 0.02em; }
.panel-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; overflow-y: auto; position: relative;}
.chart-box { position: absolute !important; top: 12px; left: 12px; right: 12px; bottom: 12px;}

.sys-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; flex-shrink: 0; }
.sk-main { font-size: 24px; font-weight: 700; color: var(--text-main); display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px;}
.sk-unit { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.sk-sub-row-no-border { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; margin-top: 4px; font-size: 12px; color: var(--text-sub); font-weight: 600;}
.sk-sub-val { font-weight: 700; color: var(--text-main); font-family: ui-monospace, Consolas, monospace;}
.badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: bold; }
.badge.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger-red); }
.badge.warn { background: rgba(245, 158, 11, 0.1); color: var(--warn-yellow); }

.switch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 10px 0 0 0; }
.sw-card { background: linear-gradient(180deg, rgba(248,250,252,0.80), rgba(255,255,255,0.90)); border: 1px solid rgba(148,163,184,0.16); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; box-shadow: inset 0 1px 0 rgba(255,255,255,0.7); }
.sw-title { font-size: 12px; color: var(--text-sub); font-weight: 600; }
.sw-status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; font-family: ui-monospace, Consolas, monospace;}
.sw-dot { width: 8px; height: 8px; border-radius: 50%; }
.sw-on { color: var(--normal-green); }
.sw-on .sw-dot { background-color: var(--normal-green); box-shadow: 0 0 6px var(--normal-green); }
.sw-off { color: var(--text-muted); }
.sw-off .sw-dot { background-color: var(--standby-gray); }
.sw-danger { color: var(--danger-red); }
.sw-danger .sw-dot { background-color: var(--danger-red); box-shadow: 0 0 6px var(--danger-red); }
.diag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 0 0 0; }
.diag-card { background: linear-gradient(180deg, rgba(248,250,252,0.82), rgba(255,255,255,0.92)); border: 1px solid rgba(148,163,184,0.16); border-radius: 16px; padding: 12px; min-height: 92px; }
.diag-card.wide { grid-column: 1 / -1; }
.diag-title { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 10px; }
.diag-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.diag-tag { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-body); font-size: 12px; line-height: 1.2; }
.diag-tag.ok { background: #f0fdf4; border-color: #bbf7d0; color: #047857; }
.diag-tag.warn { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.diag-tag.alarm { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.diag-empty { font-size: 12px; color: var(--text-muted); }
.diag-hex { min-height: 44px; padding: 10px 12px; border: 1px dashed rgba(148,163,184,0.30); border-radius: 14px; background: rgba(255,255,255,0.92); color: var(--text-body); font-size: 12px; line-height: 1.5; word-break: break-all; font-family: ui-monospace, Consolas, monospace; }

.matrix-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: center; border: 1px solid rgba(148,163,184,0.18); overflow: hidden; border-radius: 16px; }
.matrix-table th { background: rgba(248,250,252,0.88); padding: 8px 4px; font-size: 12px; font-weight: 700; color: var(--text-sub); border: 1px solid rgba(148,163,184,0.16); }
.matrix-table td { background: rgba(255,255,255,0.94); padding: 10px 4px; font-size: 14px; font-family: ui-monospace, Consolas, monospace; font-weight: 700; border: 1px solid rgba(148,163,184,0.12); color: var(--text-main); }

.history-table-wrapper { overflow-x: auto; width: 100%; height: 100%; }
.history-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.history-table th, .history-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.history-table th { color: var(--text-sub); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; position: sticky; top: 0; background: rgba(250,252,255,0.98); z-index: 1; box-shadow: 0 1px 0 rgba(148,163,184,0.18); backdrop-filter: blur(14px);}
.history-table td { color: var(--text-body); font-family: var(--font-mono); font-weight: 600;}
.history-table tbody tr:nth-child(odd) { background: rgba(249,252,255,0.72); }
.history-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.92); }
.history-table tbody tr:hover { background: rgba(236,245,255,0.88); }
.history-table-wrapper::-webkit-scrollbar { height: 10px; width: 10px; }
.history-table-wrapper::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.38); border-radius: 999px; }
.history-table-wrapper::-webkit-scrollbar-track { background: rgba(241,245,249,0.7); border-radius: 999px; }
.sys-mini-alarm-tb { font-size: 12px; width: 100%; border-collapse: collapse; text-align: left; }
.sys-mini-alarm-tb td { padding: 10px; border-bottom: 1px dashed var(--border); }

.custom-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(15, 23, 42, 0.4); z-index: 10000; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.custom-modal { background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92)); border-radius: var(--radius-lg); width: 360px; padding: 24px; box-shadow: var(--shadow-dropdown); display: flex; flex-direction: column; gap: 16px; animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); border: 1px solid rgba(255,255,255,0.64); }
@keyframes modalPop { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.custom-modal-title { font-size: 15px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 8px;}
.double-chart-row { display: flex; gap: 18px; width: 100%; height: 388px; flex-shrink: 0; margin-bottom: 0; }
.dropdown-wrapper { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: 100%; margin-top: 6px; background: rgba(255,255,255,0.96); border: 1px solid rgba(148,163,184,0.18); box-shadow: var(--shadow-dropdown); border-radius: var(--radius-base); z-index: 999; display: none; min-width: 150px; padding: 8px 0; max-height: 260px; overflow-y: auto; backdrop-filter: blur(18px); }
.dropdown-menu.show { display: block; animation: dropdownFade 0.2s ease; }
@keyframes dropdownFade { 0% { opacity: 0; transform: translateY(-5px); } 100% { opacity: 1; transform: translateY(0); } }
.dropdown-item { padding: 8px 14px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 600; }
.dropdown-item:hover { background: var(--bg-base); color: var(--brand-primary); }
@keyframes panelRise { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: translateY(0); } }
.panel, .kpi-card { animation: panelRise 0.35s ease both; }
@media (max-width: 1280px) {
  .sys-kpi-grid, .switch-grid, .diag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .sys-kpi-grid, .switch-grid, .diag-grid { grid-template-columns: 1fr; }
  .app-body { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav-item { min-width: max-content; margin: 0 6px 0 0; }
  .nav-children { display: flex; gap: 6px; margin: 0 8px 0 0; }
  .nav-subitem { min-width: max-content; }
  .topbar-logo { display: none; }
}

.section-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(20,115,230,0.18); background: rgba(255,255,255,0.72); color: var(--brand-primary-deep); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.state-pill { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; border: 1px solid transparent; white-space: nowrap; }
.state-pill.tone-ok { color: #065f46; background: rgba(16,185,129,0.14); border-color: rgba(16,185,129,0.24); }
.state-pill.tone-live { color: #075985; background: rgba(14,165,233,0.16); border-color: rgba(14,165,233,0.28); }
.state-pill.tone-warn { color: #9a3412; background: rgba(249,115,22,0.16); border-color: rgba(249,115,22,0.26); }
.state-pill.tone-danger { color: #9f1239; background: rgba(225,29,72,0.12); border-color: rgba(225,29,72,0.22); }
.state-pill.tone-offline { color: #475569; background: rgba(203,213,225,0.42); border-color: rgba(148,163,184,0.2); }
.overview-kpi-grid .kpi-card { padding: 18px 20px; }
.kpi-label-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.metric-icon { width: 42px; height: 42px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.metric-icon.tone-orange { color: var(--brand-primary); background: rgba(249,115,22,0.12); }
.metric-icon.tone-green { color: var(--normal-green); background: rgba(15,159,110,0.12); }
.metric-icon.tone-red { color: var(--danger-red); background: rgba(225,29,72,0.12); }
.metric-icon.tone-slate { color: var(--text-sub); background: rgba(148,163,184,0.18); }
.metric-icon.tone-blue { color: var(--blue-charge); background: rgba(14,165,233,0.14); }
.metric-icon.tone-lime { color: #15803d; background: rgba(34,197,94,0.12); }
.metric-icon.tone-amber { color: #b45309; background: rgba(245,158,11,0.14); }
.metric-title { font-size: 14px; font-weight: 700; color: var(--text-main); }
.metric-subtitle { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.fleet-board-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr); gap: 14px; }
.panel-caption { margin-top: 4px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.command-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.command-search { width: 220px; height: 38px; margin-bottom: 0; }
.command-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fleet-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fleet-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; border-radius: 22px; border: 1px dashed rgba(148,163,184,0.32); background: rgba(248,250,252,0.8); color: var(--text-muted); text-align: center; padding: 24px; }
.fleet-device-card { position: relative; width: 100%; text-align: left; padding: 18px; border: 1px solid rgba(148,163,184,0.16); border-radius: 22px; background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.88)); box-shadow: 0 18px 32px rgba(15,23,42,0.08); cursor: pointer; transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; overflow: hidden; }
.fleet-device-card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 4px; background: linear-gradient(90deg, rgba(249,115,22,0.7), rgba(14,165,233,0.7)); opacity: 0.7; }
.fleet-device-card:hover { transform: translateY(-4px); box-shadow: 0 26px 44px rgba(15,23,42,0.12); }
.fleet-device-card.is-active { border-color: rgba(249,115,22,0.34); box-shadow: 0 26px 44px rgba(249,115,22,0.12), 0 14px 24px rgba(15,23,42,0.08); }
.fleet-device-card.tone-offline::before { background: linear-gradient(90deg, rgba(100,116,139,0.9), rgba(148,163,184,0.75)); }
.fleet-device-card.tone-warn::before { background: linear-gradient(90deg, rgba(249,115,22,0.95), rgba(225,29,72,0.8)); }
.fleet-device-card.tone-live::before { background: linear-gradient(90deg, rgba(14,165,233,0.95), rgba(6,182,212,0.75)); }
.fleet-device-card.tone-ok::before { background: linear-gradient(90deg, rgba(16,185,129,0.95), rgba(34,197,94,0.75)); }
.fleet-device-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.fleet-device-name { font-size: 18px; font-weight: 800; color: var(--text-main); line-height: 1.15; }
.fleet-device-sn { margin-top: 6px; font-size: 12px; color: var(--text-muted); font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.fleet-device-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fleet-inline-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px; background: rgba(248,250,252,0.92); border: 1px solid rgba(148,163,184,0.16); font-size: 11px; font-weight: 700; color: var(--text-sub); }
.fleet-device-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fleet-device-metric { min-width: 0; padding: 12px 13px; border-radius: 16px; background: rgba(248,250,252,0.86); border: 1px solid rgba(148,163,184,0.12); }
.fleet-device-metric span { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.fleet-device-metric strong { display: block; font-size: 17px; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet-health-wrap { margin-bottom: 12px; }
.fleet-health-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-sub); margin-bottom: 8px; }
.fleet-health-track { width: 100%; height: 10px; border-radius: 999px; background: rgba(226,232,240,0.9); overflow: hidden; }
.fleet-health-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e 0%, #14b8a6 42%, #f97316 78%, #e11d48 100%); }
.fleet-device-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 12px; color: var(--text-muted); }
.fleet-device-footer strong { color: var(--text-main); font-weight: 700; }
.fleet-side-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.fleet-side-stat { min-width: 0; padding: 14px 16px; border-radius: 18px; background: rgba(248,250,252,0.84); border: 1px solid rgba(148,163,184,0.14); }
.fleet-side-stat span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.fleet-side-stat strong { display: block; font-size: 20px; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet-table-panel .history-table tbody tr td:first-child { font-weight: 800; color: var(--brand-primary); }
.overview-layout { display: flex; flex-direction: column; gap: 14px; }
.overview-main { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(360px, 0.92fr); gap: 14px; align-items: stretch; min-width: 0; }
.matrix-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; font-size: 13px; font-weight: 700; color: var(--text-main); }
.matrix-section-title span:last-child { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.switch-grid.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-alarm-shell { padding: 0; display: flex; flex: 1; }
.history-table .table-pill-cell { display: inline-flex; }
.fleet-status-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fleet-status-search { width: 280px; min-width: 240px; height: 38px; margin-bottom: 0; }
.fleet-status-note { min-height: 38px; padding: 0 12px; border-radius: 12px; display: inline-flex; align-items: center; border: 1px solid rgba(112, 138, 176, 0.2); background: rgba(248, 251, 255, 0.84); font-size: 12px; color: var(--text-muted); font-weight: 600; }
.overview-support-row { display: contents; }
.overview-main > .panel:first-child { grid-column: 1; grid-row: 1; min-width: 0; }
.overview-alarm-panel { grid-column: 2; grid-row: 1; min-height: 100%; min-width: 0; }
.overview-alarm-panel .panel-body { padding: 0; overflow-y: auto; flex: 1; display: flex; }
.overview-alarm-panel .sys-mini-alarm-tb { width: 100%; }
.overview-hardware-panel { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
.overview-hardware-panel .switch-grid.is-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#p_dash { gap: 10px !important; }
#p_dash .sys-kpi-grid { gap: 10px; }
#p_dash .kpi-card { padding: 13px 16px; border-radius: 18px; }
#p_dash .kpi-label-row { margin-bottom: 8px; }
#p_dash .sk-main { font-size: 18px; margin-bottom: 6px; }
#p_dash .sk-sub-row-no-border { padding-top: 4px; margin-top: 0; font-size: 11.5px; }
#p_dash .device-hero { grid-template-columns: 1fr; }
#p_dash .device-hero-main { display: grid; gap: 12px; padding: 18px 20px; }
#p_dash .page-headline { margin-bottom: 4px; font-size: 28px; }
#p_dash .device-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
#p_dash .device-summary-grid > * {
  min-width: 0;
}
#p_dash .device-summary-grid > .summary-metric-card,
#p_dash .device-summary-grid > .device-status-card {
  min-height: 188px;
  padding: 16px 18px;
  border-radius: 20px;
  border-color: rgba(129, 151, 181, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 248, 254, 0.92));
  box-shadow: 0 14px 28px rgba(16, 35, 59, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
#p_dash .device-summary-grid > .summary-metric-card {
  display: flex;
  flex-direction: column;
}
#p_dash .summary-metric-header,
#p_dash .summary-dual-header {
  margin-bottom: 12px;
}
#p_dash .summary-metric-kicker { font-size: 12px; }
#p_dash .summary-dual-header {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#p_dash .summary-dual-main {
  padding: 10px 12px;
  border-radius: 14px;
}
#p_dash .summary-metric-main span {
  font-size: 30px;
}
#p_dash .summary-metric-main-tight span {
  font-size: 25px;
}
#p_dash .summary-metric-main em {
  font-size: 13px;
}
#p_dash .summary-metric-header small,
#p_dash .summary-dual-main small {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}
#p_dash .summary-metric-rowset {
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(129, 151, 181, 0.14);
}
#p_dash .summary-metric-row {
  gap: 10px;
  padding-top: 0;
  font-size: 12px;
  border-top: none;
}
#p_dash .summary-metric-row b {
  font-size: 13.5px;
}
#p_dash .device-hero-side { display: none; }
#p_dash .device-summary-grid > .device-status-card .device-side-summary,
#p_dash .device-summary-grid > .device-status-card.device-side-summary {
  gap: 8px;
}
#p_dash .device-summary-grid > .device-status-card.device-side-summary {
  display: flex;
  flex-direction: column;
}
#p_dash .device-summary-grid > .device-status-card .device-side-topline,
#p_dash .device-summary-grid > .device-status-card.device-side-summary .device-side-topline {
  align-items: center;
}
#p_dash .device-summary-grid > .device-status-card .device-side-highlight span,
#p_dash .device-summary-grid > .device-status-card.device-side-summary .device-side-highlight span {
  font-size: 30px;
}
#p_dash .device-summary-grid > .device-status-card strong#dash_hero_soc {
  font-size: 36px;
}
#p_dash .device-summary-grid .device-side-list,
#p_dash .device-summary-grid > .device-status-card.device-side-summary .device-side-list {
  gap: 9px;
  margin-top: auto;
  padding-top: 12px;
}
#p_dash .device-summary-grid .device-side-row,
#p_dash .device-summary-grid > .device-status-card.device-side-summary .device-side-row {
  font-size: 12px;
}
#p_dash .device-summary-grid .device-side-row > span,
#p_dash .device-summary-grid > .device-status-card.device-side-summary .device-side-row > span {
  display: inline;
  margin-bottom: 0;
  font-size: 12px;
  line-height: 16px;
}
#p_dash .device-summary-grid .device-side-row b,
#p_dash .device-summary-grid > .device-status-card.device-side-summary .device-side-row b {
  font-size: 13.5px;
  line-height: 16px;
}
#p_dash .device-summary-grid > :nth-child(4) > span {
  margin-bottom: 8px;
}
#p_dash .device-summary-grid > :nth-child(4) > strong#dash_hero_soc {
  margin-top: 0;
  line-height: 1;
}
#p_dash .overview-layout {
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
#p_dash .overview-main { gap: 12px; grid-template-columns: minmax(0, 1.78fr) minmax(300px, 0.82fr); }
#p_dash .overview-main > .panel,
#p_dash .overview-alarm-panel,
#p_dash .overview-hardware-panel {
  border-color: rgba(118, 145, 181, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 254, 0.92));
  box-shadow: 0 16px 30px rgba(23, 43, 77, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
#p_dash .overview-alarm-panel {
  background: linear-gradient(180deg, rgba(254, 255, 255, 0.99), rgba(246, 250, 255, 0.92));
}
#p_dash .panel-header {
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 247, 254, 0.94)) !important;
  border-bottom: 1px solid rgba(118, 145, 181, 0.16);
}
#p_dash .overview-main > .panel:first-child .panel-body {
  padding: 14px 16px !important;
  gap: 14px !important;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.82), rgba(243, 248, 254, 0.62));
}
#p_dash .overview-alarm-panel .panel-body {
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.84), rgba(243, 248, 254, 0.62));
}
#p_dash .overview-hardware-panel .panel-body {
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.84), rgba(243, 248, 254, 0.64));
}
#p_dash .overview-hardware-panel .switch-grid.is-compact {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  padding-top: 0;
}
#p_dash .sw-card {
  padding: 10px 11px;
  border-radius: 14px;
  min-height: 58px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(240, 246, 253, 0.94));
  border: 1px solid rgba(129, 151, 181, 0.2);
  box-shadow: 0 10px 20px rgba(15, 30, 57, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
#p_dash .sw-title { font-size: 10.5px; line-height: 1.2; }
#p_dash .sw-status {
  width: 100%;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  line-height: 1.1;
}
#p_dash .sw-dot { width: 7px; height: 7px; }
#p_dash .matrix-section-title { margin-bottom: 8px; font-size: 12px; }
#p_dash .matrix-table {
  border-color: rgba(129, 151, 181, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
#p_dash .matrix-table th {
  padding: 7px 4px;
  font-size: 11px;
  background: rgba(235, 242, 250, 0.94);
}
#p_dash .matrix-table td {
  padding: 9px 4px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.97);
}
#pic_diagnostics_panel { display: none !important; }
@media (max-width: 1180px) {
  .overview-main { grid-template-columns: 1fr; }
  .overview-alarm-panel, .overview-hardware-panel { grid-column: 1; grid-row: auto; }
  #p_alarm .alarm-hero-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-switch-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1440px) {
  .fleet-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .fleet-board-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .fleet-card-grid, .fleet-side-stats { grid-template-columns: 1fr; }
  .overview-hardware-panel .switch-grid.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-toolbar { width: 100%; justify-content: flex-start; }
  .command-search { width: 100%; }
  .alarm-header-meta { width: 100%; justify-content: flex-start; }
  .alarm-header-item { flex: 1 1 180px; }
}
@media (max-width: 640px) {
  .fleet-device-metrics { grid-template-columns: 1fr; }
  .switch-grid.is-compact, .overview-hardware-panel .switch-grid.is-compact { grid-template-columns: 1fr; }
  .fleet-status-search { width: 100%; }
}

/* ==========================================
   Unified Premium Theme Refresh (2026-04)
   ========================================== */
.fleet-metrics-hidden { display: none !important; }
#p_fleet {
  min-height: 0;
  overflow: hidden;
  scrollbar-gutter: auto;
}
#p_fleet .fleet-table-panel {
  min-height: 0 !important;
  flex: 1 1 auto !important;
}
#p_fleet .fleet-table-panel .panel-body {
  padding: 0;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
#p_fleet .fleet-table-panel .history-table-wrapper {
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: auto;
  scrollbar-gutter: stable;
}
#p_fleet .fleet-table-panel .history-table {
  width: max-content;
  min-width: 100%;
}
#p_fleet .fleet-table-panel .history-table-wrapper::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
#p_fleet .fleet-table-panel .history-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.38);
  border-radius: 999px;
}
#p_fleet .fleet-table-panel .history-table-wrapper::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.7);
  border-radius: 999px;
}
#p_fleet .page-hero {
  grid-template-columns: 1fr;
  gap: 0;
}
#p_fleet .page-hero-main {
  display: grid;
  gap: 16px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
#p_fleet .page-headline {
  margin-bottom: 0;
  font-size: 42px;
}
#p_fleet .page-hero-side {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-self: stretch;
  padding: 0;
}
#p_fleet .hero-side-card {
  min-height: 96px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(129, 151, 181, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 254, 0.92));
  box-shadow: 0 12px 24px rgba(16, 35, 59, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}
#p_fleet .hero-side-card span {
  margin-bottom: 6px;
}
#p_fleet .hero-side-card strong {
  font-size: 34px;
  line-height: 1;
}
#p_fleet .hero-side-card small {
  margin-top: 6px;
  font-size: 12px;
}
.page-title.page-title-fleet {
  font-size: 28px;
}
#p_fleet .panel-header { padding: 14px 18px; }
#p_fleet .section-title-copy h3 {
  font-size: 20px;
}
#p_fleet .fleet-status-toolbar {
  justify-content: flex-end;
  gap: 12px;
}
#p_fleet .fleet-status-search {
  width: 292px;
  min-width: 240px;
}
#p_fleet .fleet-status-note {
  min-width: 72px;
  justify-content: center;
  font-weight: 700;
}
#p_fleet .history-table th,
#p_fleet .history-table td {
  padding: 12px 12px;
  vertical-align: middle;
  text-align: center;
}
#p_fleet .history-table th {
  font-size: 12px;
  line-height: 1.1;
  letter-spacing: 0.04em;
}
#p_fleet .history-table td {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
#p_fleet .history-table thead th {
  border-top: 1px solid rgba(112, 138, 176, 0.18);
  border-bottom: 2px solid rgba(112, 138, 176, 0.28);
}
#p_fleet .history-table tbody td {
  border-bottom-color: rgba(112, 138, 176, 0.18);
}
#p_fleet .history-table tbody tr:first-child td {
  border-top: 2px solid rgba(112, 138, 176, 0.28);
}
#p_fleet .history-table tbody td:not([colspan]):not(:last-child) {
  border-right: 1px solid rgba(112, 138, 176, 0.16);
}
#p_fleet .history-table thead tr {
  height: 44px;
}
#p_fleet .history-table tbody tr {
  height: 56px;
}
#p_fleet .fleet-table-panel .history-table-wrapper {
  max-height: clamp(280px, 52vh, 620px);
}
#p_fleet .fleet-table-panel .history-table tbody tr td:first-child {
  font-size: 16px;
}
.fleet-name-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 184px;
}
.fleet-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.fleet-name-main {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-family: "Plus Jakarta Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 800;
  color: var(--text-main);
}
.fleet-name-sub {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}
.fleet-alias-btn {
  min-width: 48px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(112, 138, 176, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}
.fleet-alias-btn:hover {
  color: var(--brand-primary);
  border-color: rgba(249, 115, 22, 0.28);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
#p_realtime .panel,
#p_history .panel,
#p_alarm .panel {
  border-radius: 20px;
}
#p_realtime .panel-header,
#p_history .panel-header,
#p_alarm .panel-header {
  padding: 14px 16px;
}
#p_realtime {
  gap: 10px;
}
#p_realtime .page-hero-main,
#p_history .page-hero-main {
  padding: 16px 18px;
  width: 100%;
  min-width: 0;
}
#p_realtime .page-hero-inline-main,
#p_history .page-hero-inline-main {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
#p_realtime .page-hero-inline-top,
#p_history .page-hero-inline-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
#p_realtime .page-hero-inline-copy,
#p_history .page-hero-inline-copy {
  min-width: 0;
}
#p_realtime .hero-inline-strip,
#p_history .hero-inline-strip {
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(8px, 0.72vw, 10px);
  width: 100%;
  min-width: 0;
  align-self: stretch;
  align-items: stretch;
  overflow: hidden;
}
#p_realtime .hero-inline-card,
#p_history .hero-inline-card {
  min-width: 0;
  min-height: clamp(80px, 6vw, 92px);
  padding: clamp(10px, 0.82vw, 12px) clamp(12px, 1vw, 15px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#p_realtime .hero-inline-card span,
#p_history .hero-inline-card span {
  margin-bottom: clamp(6px, 0.6vw, 8px);
  font-size: clamp(10px, 0.72vw, 11px);
}
#p_realtime .hero-inline-card strong,
#p_history .hero-inline-card strong {
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#p_realtime .hero-inline-card-tool,
#p_history .hero-inline-card-tool {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: clamp(10px, 0.82vw, 12px) clamp(12px, 0.95vw, 14px);
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: none;
}
#p_realtime .hero-inline-tool-row,
#p_history .hero-inline-tool-row {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.72vw, 10px);
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  justify-content: space-between;
  margin-left: 0;
}
#p_realtime .hero-inline-card-tool > span,
#p_history .hero-inline-card-tool > span {
  width: 100%;
  margin-bottom: clamp(6px, 0.6vw, 8px);
  text-align: left;
}
#p_realtime .hero-inline-tool-date,
#p_history .hero-inline-tool-date {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.55vw, 8px);
  min-height: 38px;
  min-width: 0;
  padding: 0 clamp(8px, 0.72vw, 10px);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
#p_realtime .hero-inline-card-tool .log-date-action,
#p_history .hero-inline-card-tool .log-date-action {
  min-height: 38px;
  padding: 0 clamp(10px, 0.7vw, 14px);
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: clamp(12px, 0.82vw, 13px);
}
#p_realtime .hero-inline-card-tool .log-date-strip-label,
#p_history .hero-inline-card-tool .log-date-strip-label {
  margin: 0;
  font-size: clamp(10px, 0.72vw, 12px);
  white-space: nowrap;
}
#p_realtime .hero-inline-card-tool .log-date-input,
#p_history .hero-inline-card-tool .log-date-input {
  width: clamp(78px, 5.6vw, 112px);
  height: 30px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  box-shadow: none;
  min-width: 0;
  font-size: clamp(12px, 0.82vw, 13px);
}
#p_realtime .hero-inline-card-tool .log-date-input:focus,
#p_history .hero-inline-card-tool .log-date-input:focus {
  border: none;
  background: transparent;
  box-shadow: none;
}
#p_realtime .double-chart-row {
  height: auto;
  min-height: 0;
  gap: 14px;
}
#p_realtime .chart-panel .panel-header,
#p_realtime > .panel:last-child .panel-header {
  padding: 12px 16px;
}
#p_realtime > .panel:last-child .panel-header {
  min-height: 52px;
}
#p_history {
  gap: 10px;
}
#p_history .page-hero-main {
  padding: 16px 18px;
  width: 100%;
  min-width: 0;
}
#p_history .page-hero-inline-main {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
#p_history .page-hero-inline-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
#p_history .page-hero-inline-copy {
  min-width: 0;
}
#p_realtime .hero-inline-strip,
#p_history .hero-inline-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
#p_history .hero-inline-card {
  min-width: 0;
  min-height: 92px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#p_history .hero-inline-card:first-child {
  padding-right: 12px;
}
#p_history .hero-inline-card:first-child strong {
  font-size: 16px;
}
#p_history .hero-inline-card-tool .hero-inline-tool-row {
  justify-content: space-between;
}
#p_history .double-chart-row {
  height: auto;
  min-height: 0;
  gap: 14px;
}
#p_history .chart-panel .panel-header,
#p_history > .panel:last-child .panel-header {
  padding: 12px 16px;
}
#p_history > .panel:last-child .panel-header {
  min-height: 52px;
}
.page-hero-inline-main.has-curve-date {
  display: grid !important;
  gap: 16px;
}
.page-hero-inline-main.has-curve-date .page-hero-inline-copy {
  flex: 1 1 360px;
  min-width: 280px;
}
.page-hero-inline-main.has-curve-date .log-date-strip {
  margin-left: 0;
}
#p_alarm > div:first-child .panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 245, 247, 0.92) 100%);
}
.matrix-empty { color: var(--text-muted); font-weight: 600; }
.metric-subtitle,
.panel-caption,
.matrix-section-title span:last-child {
  display: none !important;
}
.kpi-label-row { margin-bottom: 10px; }
.matrix-section-title { margin-bottom: 8px; }

.theme-panel-body {
  gap: 14px;
  padding: 22px !important;
}
.theme-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

body.theme-tech .sw-card,
body.theme-tech .diag-card,
body.theme-tech .fleet-device-metric,
body.theme-tech .fleet-inline-chip,
body.theme-tech .fleet-side-stat {
  background: var(--tech-card-small-bg);
  border-color: var(--tech-border-strong);
  box-shadow: var(--tech-shadow-small);
}
body.theme-tech .diag-tag {
  background: rgba(20, 37, 62, 0.94);
  border-color: rgba(83, 127, 184, 0.28);
  color: var(--text-main);
}
body.theme-tech .diag-tag.ok {
  background: rgba(14, 71, 60, 0.72);
  border-color: rgba(45, 212, 191, 0.32);
  color: #7ef3d1;
}
body.theme-tech .diag-tag.warn {
  background: rgba(96, 56, 18, 0.7);
  border-color: rgba(251, 191, 36, 0.34);
  color: #ffd36f;
}
body.theme-tech .diag-tag.alarm {
  background: rgba(94, 23, 50, 0.72);
  border-color: rgba(255, 78, 124, 0.34);
  color: #ff9bb7;
}
body.theme-tech .diag-hex,
body.theme-tech .dropdown-menu,
body.theme-tech .custom-modal,
body.theme-tech .login-input {
  background: linear-gradient(180deg, rgba(18, 34, 57, 0.96), rgba(14, 28, 49, 0.94));
  border-color: rgba(83, 127, 184, 0.28);
  color: var(--text-main);
}
body.theme-tech .login-input:focus {
  border-color: rgba(0, 183, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(0, 183, 255, 0.12);
  background: rgba(16, 34, 58, 0.98);
}
body.theme-tech .dropdown-item:hover {
  background: rgba(14, 49, 80, 0.72);
  color: #87ddff;
}
body.theme-tech .history-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(83, 127, 184, 0.42);
}
body.theme-tech .history-table-wrapper::-webkit-scrollbar-track {
  background: rgba(12, 22, 39, 0.72);
}
body.theme-tech .sys-mini-alarm-tb td {
  border-bottom-color: rgba(83, 127, 184, 0.18);
}
body.theme-tech #p_alarm > div:first-child .panel {
  background: linear-gradient(145deg, rgba(19, 34, 56, 0.96) 0%, rgba(14, 24, 43, 0.92) 100%);
  border-color: rgba(83, 127, 184, 0.32);
}
body.theme-tech .matrix-empty {
  color: var(--text-muted);
}
/* ===== Cloud Redesign V3 ===== */
body,
input,
select,
button,
textarea {
  font-family: var(--font-sans);
}

body {
  font-size: 14px;
  background:
    radial-gradient(920px 520px at 100% -6%, rgba(14, 165, 233, 0.12) 0%, rgba(14, 165, 233, 0) 58%),
    radial-gradient(780px 460px at -12% 100%, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0) 54%),
    linear-gradient(180deg, #f5f8fc 0%, #edf3f9 58%, #e9eff6 100%);
}

body::before,
body::after {
  opacity: 0.62;
}

body.theme-light {
  --bg-base: #edf3f9;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-elevated: rgba(247, 250, 254, 0.84);
  --border: rgba(129, 151, 181, 0.2);
  --text-main: #10233b;
  --text-body: #24384f;
  --text-sub: #566d88;
  --text-muted: #7a8fa8;
  --brand-primary: #1473e6;
  --brand-primary-hover: #2984ef;
  --brand-primary-deep: #0f5bb8;
  --brand-soft: rgba(20, 115, 230, 0.1);
  --blue-charge: #1473e6;
  --normal-green: #118a63;
  --danger-red: #d8335d;
  --warn-yellow: #d38a1b;
  --shadow-base: 0 24px 48px rgba(16, 35, 59, 0.08), 0 6px 18px rgba(16, 35, 59, 0.04);
  --shadow-hover: 0 28px 56px rgba(16, 35, 59, 0.14), 0 12px 24px rgba(20, 115, 230, 0.12);
  --shadow-dropdown: 0 28px 48px rgba(16, 35, 59, 0.16), 0 10px 24px rgba(16, 35, 59, 0.08);
  --light-panel-gradient:
    radial-gradient(900px 340px at 0% 0%, rgba(255, 229, 216, 0.42) 0%, rgba(255, 229, 216, 0.14) 36%, rgba(255, 229, 216, 0) 68%),
    radial-gradient(880px 360px at 100% 0%, rgba(218, 242, 255, 0.64) 0%, rgba(218, 242, 255, 0.24) 38%, rgba(218, 242, 255, 0) 70%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 252, 255, 0.90) 56%, rgba(255, 250, 247, 0.86) 100%);
  --light-card-gradient:
    radial-gradient(620px 220px at 0% 0%, rgba(255, 232, 220, 0.34) 0%, rgba(255, 232, 220, 0) 64%),
    radial-gradient(560px 250px at 100% 0%, rgba(224, 246, 255, 0.48) 0%, rgba(224, 246, 255, 0) 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 255, 0.84));
  --light-ota-upload-gradient:
    radial-gradient(920px 300px at 0% 0%, rgba(255, 229, 216, 0.66) 0%, rgba(255, 229, 216, 0.22) 38%, rgba(255, 229, 216, 0) 70%),
    radial-gradient(820px 330px at 100% 0%, rgba(217, 244, 255, 0.74) 0%, rgba(217, 244, 255, 0.30) 42%, rgba(217, 244, 255, 0) 72%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 253, 255, 0.90) 52%, rgba(255, 250, 247, 0.86) 100%);
}

body.theme-aurora {
  --bg-base: #f7f3ef;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-elevated: rgba(255, 251, 248, 0.88);
  --border: rgba(221, 190, 176, 0.34);
  --text-main: #2f2724;
  --text-body: #4d433f;
  --text-sub: #756863;
  --text-muted: #998a84;
  --brand-primary: #c76548;
  --brand-primary-hover: #b9583e;
  --brand-primary-deep: #8f422f;
  --brand-soft: rgba(199, 101, 72, 0.12);
  --blue-charge: #86b8df;
  --normal-green: #5b8a67;
  --danger-red: #c93f5c;
  --warn-yellow: #b97816;
  --shadow-base: 0 22px 46px rgba(99, 74, 62, 0.07), 0 8px 22px rgba(100, 139, 172, 0.07);
  --shadow-hover: 0 28px 58px rgba(99, 74, 62, 0.11), 0 12px 28px rgba(100, 139, 172, 0.10);
  --shadow-dropdown: 0 28px 48px rgba(99, 74, 62, 0.13), 0 10px 24px rgba(100, 139, 172, 0.09);
  --aurora-panel-gradient:
    radial-gradient(780px 270px at 0% 0%, rgba(255, 229, 216, 0.66) 0%, rgba(255, 229, 216, 0.22) 34%, rgba(255, 229, 216, 0) 62%),
    radial-gradient(760px 310px at 100% 0%, rgba(224, 246, 255, 0.76) 0%, rgba(224, 246, 255, 0.28) 38%, rgba(224, 246, 255, 0) 66%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 253, 255, 0.90) 52%, rgba(255, 249, 245, 0.88) 100%);
  --aurora-card-gradient:
    radial-gradient(560px 210px at 0% 0%, rgba(255, 231, 219, 0.46) 0%, rgba(255, 231, 219, 0) 60%),
    radial-gradient(520px 230px at 100% 0%, rgba(229, 247, 255, 0.54) 0%, rgba(229, 247, 255, 0) 62%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 251, 248, 0.88) 100%);
  background:
    linear-gradient(135deg, #f9f3ef 0%, #f6fbff 48%, #fff8f4 100%);
}

body.theme-tech {
  --bg-base: #070d16;
  --bg-panel: rgba(8, 15, 26, 0.94);
  --bg-card: rgba(10, 18, 30, 0.97);
  --bg-elevated: rgba(14, 24, 40, 0.94);
  --border: rgba(92, 117, 152, 0.24);
  --text-main: #eff4ff;
  --text-body: #cdd7e7;
  --text-sub: #9baec8;
  --text-muted: #7386a3;
  --brand-primary: #69b3ff;
  --brand-primary-hover: #89c2ff;
  --brand-primary-deep: #2f7fe4;
  --brand-soft: rgba(105, 179, 255, 0.18);
  --blue-charge: #69b3ff;
  --normal-green: #41d6a5;
  --danger-red: #ff6f93;
  --warn-yellow: #f2b75e;
  --shadow-base: 0 26px 56px rgba(0, 0, 0, 0.42), 0 10px 26px rgba(10, 17, 29, 0.28);
  --shadow-hover: 0 30px 68px rgba(0, 0, 0, 0.5), 0 14px 30px rgba(47, 127, 228, 0.18);
  --shadow-dropdown: 0 34px 60px rgba(0, 0, 0, 0.52), 0 14px 30px rgba(0, 0, 0, 0.24);
  --tech-surface-shell: radial-gradient(140% 140% at 0% 0%, rgba(92, 156, 255, 0.12) 0%, rgba(92, 156, 255, 0.03) 34%, transparent 60%), linear-gradient(180deg, rgba(8, 16, 29, 0.96) 0%, rgba(4, 9, 18, 0.98) 100%);
  --tech-card-large-bg: radial-gradient(140% 140% at 0% 0%, rgba(82, 147, 243, 0.16) 0%, rgba(82, 147, 243, 0.04) 34%, transparent 62%), linear-gradient(180deg, rgba(10, 20, 36, 0.99) 0%, rgba(5, 12, 22, 0.99) 100%);
  --tech-card-medium-bg: radial-gradient(135% 135% at 0% 0%, rgba(108, 181, 255, 0.22) 0%, rgba(108, 181, 255, 0.07) 30%, transparent 58%), linear-gradient(180deg, rgba(18, 36, 61, 0.98) 0%, rgba(11, 24, 42, 0.96) 100%);
  --tech-card-small-bg: radial-gradient(130% 130% at 0% 0%, rgba(136, 212, 255, 0.28) 0%, rgba(136, 212, 255, 0.10) 28%, transparent 56%), linear-gradient(180deg, rgba(25, 50, 84, 0.98) 0%, rgba(16, 33, 58, 0.96) 100%);
  --tech-card-header-bg: linear-gradient(180deg, rgba(21, 40, 67, 0.98) 0%, rgba(12, 26, 44, 0.97) 100%);
  --tech-card-body-bg: linear-gradient(180deg, rgba(11, 23, 39, 0.92) 0%, rgba(8, 16, 28, 0.96) 100%);
  --tech-ota-upload-bg:
    radial-gradient(820px 320px at 0% 0%, rgba(43, 91, 150, 0.34) 0%, rgba(43, 91, 150, 0.12) 34%, transparent 66%),
    radial-gradient(780px 340px at 100% 0%, rgba(78, 170, 224, 0.24) 0%, rgba(78, 170, 224, 0.08) 38%, transparent 70%),
    linear-gradient(135deg, rgba(17, 32, 54, 0.98) 0%, rgba(10, 22, 38, 0.97) 58%, rgba(6, 14, 26, 0.98) 100%);
  --tech-border-soft: rgba(101, 138, 188, 0.22);
  --tech-border-mid: rgba(109, 158, 219, 0.30);
  --tech-border-strong: rgba(132, 191, 255, 0.40);
  --tech-shadow-large: 0 28px 56px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(214, 232, 255, 0.06);
  --tech-shadow-medium: 0 22px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(214, 232, 255, 0.07), inset 0 0 0 1px rgba(96, 159, 232, 0.05);
  --tech-shadow-small: 0 16px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(220, 239, 255, 0.08), inset 0 0 0 1px rgba(116, 183, 255, 0.06);
  background:
    radial-gradient(980px 560px at 100% -8%, rgba(64, 120, 255, 0.12) 0%, rgba(64, 120, 255, 0) 58%),
    radial-gradient(860px 520px at -10% 102%, rgba(36, 179, 255, 0.10) 0%, rgba(36, 179, 255, 0) 54%),
    linear-gradient(180deg, #050a12 0%, #0a111b 58%, #070e18 100%);
}

.global-topbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 100;
  height: 60px;
  padding: 0;
  background: rgba(255, 255, 255, 0.74);
  border-bottom: 1px solid rgba(129, 151, 181, 0.18);
  box-shadow: 0 16px 40px rgba(16, 35, 59, 0.08);
  backdrop-filter: blur(18px) saturate(128%);
}

.topbar-logo {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-right: 1px solid rgba(129, 151, 181, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 253, 0.82));
}

.topbar-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 16px;
}

.topbar-brand-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 115, 230, 0.12), rgba(20, 115, 230, 0.04));
  border: 1px solid rgba(20, 115, 230, 0.14);
  color: var(--brand-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-title-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.page-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.01em;
  line-height: 1.05;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-device-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.topbar-meta-label {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.topbar-connection-pill {
  display: inline-flex;
  align-items: center;
  min-width: 102px;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(129, 151, 181, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.logout-btn {
  min-height: 34px;
  padding-inline: 14px;
  color: var(--danger-red) !important;
  border-color: rgba(216, 51, 93, 0.22) !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

.sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  width: var(--sidebar-width);
  padding: 14px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68) 0%, rgba(244, 248, 253, 0.9) 100%);
  border-right: 1px solid rgba(129, 151, 181, 0.16);
}

.sidebar-section-label {
  margin: 2px 10px 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.22s ease;
  margin: 0 6px 6px;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-sub);
  border-color: transparent;
}

.sidebar .nav-icon {
  width: 19px;
  height: 19px;
}

.nav-item:hover {
  transform: none;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(129, 151, 181, 0.14);
  box-shadow: 0 16px 28px rgba(16, 35, 59, 0.08);
}

.nav-item.active {
  color: var(--brand-primary);
  background: linear-gradient(135deg, rgba(20, 115, 230, 0.14), rgba(255, 255, 255, 0.92));
  border-color: rgba(20, 115, 230, 0.16);
  box-shadow: 0 18px 34px rgba(20, 115, 230, 0.1);
}

.nav-item.active .nav-icon {
  opacity: 1;
  stroke: var(--brand-primary);
}

.nav-children {
  display: grid;
  gap: 6px;
  margin: -2px 6px 8px 36px;
}
.nav-children[hidden] { display: none !important; }
.nav-subitem {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nav-subitem:hover {
  color: var(--text-main);
  background: rgba(255,255,255,0.78);
  border-color: rgba(129,151,181,0.14);
}
.nav-subitem.is-active {
  color: var(--brand-primary);
  background: rgba(20,115,230,0.10);
  border-color: rgba(20,115,230,0.14);
}
@media (max-width: 768px) {
  .nav-children {
    display: flex;
    gap: 6px;
    margin: 0 8px 0 0;
  }
  .nav-subitem { min-width: max-content; }
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
  padding: 12px;
}

.page-content {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 12px;
  padding: 0;
  scrollbar-gutter: stable both-edges;
}

.page-surface {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.86), rgba(242, 247, 252, 0.94));
  border: 1px solid rgba(129, 151, 181, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(16, 35, 59, 0.04);
}

.page-hero,
.device-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(280px, 0.86fr);
  gap: 12px;
}

.page-hero-main,
.device-hero-main,
.page-hero-side,
.device-hero-side,
.hero-side-card,
.device-health-card,
.device-status-card,
.overview-rail-card {
  border-radius: 18px;
  border: 1px solid rgba(129, 151, 181, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 254, 0.84));
  box-shadow: 0 20px 40px rgba(16, 35, 59, 0.08);
}

.page-hero-main,
.device-hero-main {
  padding: 20px 22px;
}

.page-hero-side,
.device-hero-side {
  display: grid;
  gap: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.page-headline {
  font-size: 28px;
  line-height: 1.04;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

.page-subtitle:empty,
.section-title-copy p:empty {
  display: none;
}

.page-hero-inline-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-side-card,
.device-health-card,
.device-status-card {
  padding: 14px 16px;
}

.hero-side-card span,
.device-health-card span,
.device-status-card span,
.overview-rail-card span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-side-card strong,
.device-health-card strong,
.device-status-card strong,
.overview-rail-card strong {
  display: block;
  color: var(--text-main);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
}

.hero-side-card small,
.device-health-card p,
.device-status-card small,
.overview-rail-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 11px;
  line-height: 1.5;
}

.device-identity-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.device-hero-rebuilt .device-hero-main {
  display: grid;
  gap: 12px;
}

.device-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 10px;
  align-items: stretch;
}

.summary-metric-card {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.88);
  border: 1px solid rgba(129, 151, 181, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.summary-metric-header,
.summary-dual-header {
  margin-bottom: 10px;
}

.summary-metric-header {
  display: grid;
  gap: 8px;
}

.summary-dual-header {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(150px, 0.88fr);
  gap: 10px;
}

.summary-dual-main {
  padding: 10px 11px 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(129, 151, 181, 0.12);
}

.summary-metric-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.summary-metric-main {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-main);
  font-weight: 800;
}

.summary-metric-main span {
  font-size: 38px;
  line-height: 1;
}

.summary-metric-main em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-metric-main-tight span {
  font-size: 34px;
}

.summary-metric-header small,
.summary-dual-main small {
  display: block;
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.6;
}

.summary-metric-rowset {
  display: grid;
  gap: 8px;
}

.summary-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(129, 151, 181, 0.12);
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 700;
}

.summary-metric-row b {
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.device-side-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-start;
}

.device-side-summary .state-pill {
  align-self: flex-start;
}

.device-side-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.device-side-topline span {
  margin-bottom: 0;
}

.device-side-highlight {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-main);
  font-weight: 800;
}

.device-side-highlight span {
  margin-bottom: 0;
  color: var(--text-main);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.device-side-highlight em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.device-side-summary strong {
  margin-top: 2px;
  font-size: 18px;
}

.device-side-summary strong#dash_hero_soc {
  font-size: 40px;
  line-height: 1;
}

.device-side-summary small {
  margin-top: 0;
}

.device-side-summary small + small {
  margin-top: -2px;
}

.device-side-list {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(129, 151, 181, 0.14);
}

.device-side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
}

.device-side-row b {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.device-side-row b.status-accent {
  font-family: inherit;
}

.page-hero-inline {
  grid-template-columns: 1fr;
}

.page-hero-inline-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  min-width: 0;
}

.page-hero-inline-copy {
  flex: 1 1 320px;
  min-width: 280px;
}

.hero-inline-strip {
  flex: 1 1 620px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hero-inline-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(129, 151, 181, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 254, 0.9));
  box-shadow: 0 14px 28px rgba(16, 35, 59, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hero-inline-card span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-inline-card strong {
  display: block;
  color: var(--text-main);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

.table-scroll-shell {
  max-height: clamp(320px, 44vh, 520px);
  overflow: auto;
}

.settings-hero {
  grid-template-columns: 1fr;
}

.settings-device-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.settings-device-card {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(129, 151, 181, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 254, 0.9));
  box-shadow: 0 18px 34px rgba(16, 35, 59, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 112px;
}

.settings-device-card > span,
.settings-device-card > small {
  display: block;
}

.settings-device-card > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-device-card strong {
  display: block;
  color: var(--text-main);
  font-size: 22px;
  line-height: 1.12;
  font-weight: 800;
  font-family: var(--font-mono);
  word-break: break-word;
}

.settings-device-card.is-device-name strong {
  font-family: var(--font-sans);
}

.settings-device-card > small {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 11px;
  line-height: 1.5;
}

body.theme-tech .summary-metric-card,
body.theme-tech .summary-dual-main,
body.theme-tech .hero-inline-card {
  background: var(--tech-card-medium-bg);
  border-color: var(--tech-border-mid);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech .summary-metric-row,
body.theme-tech .device-side-list {
  border-color: rgba(89, 130, 182, 0.18);
}

body.theme-tech .settings-device-card {
  background: var(--tech-card-medium-bg);
  border-color: var(--tech-border-mid);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech .fleet-device-card {
  background: var(--tech-card-medium-bg);
  border-color: var(--tech-border-mid);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech .fleet-device-card:hover {
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(214, 232, 255, 0.08);
}

body.theme-tech .fleet-device-card.is-active {
  border-color: rgba(147, 200, 255, 0.42);
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(220, 238, 255, 0.1), 0 0 0 1px rgba(105, 179, 255, 0.08);
}

body.theme-tech .device-side-highlight em,
body.theme-tech .summary-metric-main em {
  color: #8aa7cb;
}

.settings-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.identity-card,
.settings-meta-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.84);
  border: 1px solid rgba(129, 151, 181, 0.14);
}

.identity-card span,
.settings-meta-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.identity-card strong,
.settings-meta-card strong {
  display: block;
  color: var(--text-main);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
  font-family: var(--font-sans);
  word-break: break-word;
}

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

.device-health-top strong {
  font-size: 22px;
}

.device-health-track {
  width: 100%;
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(216, 226, 239, 0.84);
  overflow: hidden;
}

.device-health-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #18b77f 0%, #1db1b1 40%, #34b8ff 100%);
  transition: width 0.3s ease;
}

.device-status-card strong {
  margin-top: 10px;
  font-size: 18px;
}

.overview-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.overview-rail-card {
  padding: 18px 20px;
}

.overview-rail-card strong {
  font-size: 22px;
}

.panel,
.kpi-card {
  border-radius: 24px;
  border: 1px solid rgba(129, 151, 181, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 254, 0.86));
  box-shadow: 0 20px 40px rgba(16, 35, 59, 0.08);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.section-title-copy {
  min-width: 0;
}

.section-title-copy h3 {
  color: var(--text-main);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-title-copy p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.surface-toolbar,
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.log-date-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.92));
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
  align-self: flex-start;
  width: auto;
  max-width: 100%;
}

.log-date-strip-label {
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.log-date-input {
  width: 132px;
  height: 30px;
  margin-bottom: 0;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.log-date-action {
  min-height: 30px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.log-date-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  padding-bottom: 2px;
}

.log-date-chip-row::-webkit-scrollbar {
  height: 6px;
}

.log-date-chip-row::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

.log-date-chip-row::-webkit-scrollbar-track {
  background: transparent;
}

.log-date-chip {
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(226, 232, 240, 0.6);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.log-date-chip.no-data {
  background: rgba(226, 232, 240, 0.54);
  border-color: rgba(148, 163, 184, 0.12);
  color: rgba(100, 116, 139, 0.72);
}

.log-date-chip.has-data {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.1);
  color: var(--text-main);
}

.log-date-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(249, 115, 22, 0.28);
  color: var(--brand-primary);
}

.log-date-chip.active {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-deep));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 22px rgba(249, 115, 22, 0.22);
}

body.theme-tech .log-date-strip {
  background: var(--tech-card-medium-bg);
  border-color: var(--tech-border-mid);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech .log-date-input {
  background: var(--tech-card-small-bg);
  border-color: var(--tech-border-strong);
  color: #e2e8f0;
}

body.theme-tech .hero-inline-tool-date {
  background: linear-gradient(180deg, rgba(15, 30, 50, 0.96), rgba(10, 21, 37, 0.94));
  border-color: rgba(89, 130, 182, 0.22);
  box-shadow: inset 0 1px 0 rgba(214, 232, 255, 0.05), 0 10px 18px rgba(5, 10, 18, 0.2);
}

body.theme-tech .hero-inline-card-tool .log-date-strip-label {
  color: #9fb7d8;
}

body.theme-tech #p_realtime .hero-inline-tool-date,
body.theme-tech #p_history .hero-inline-tool-date {
  background: linear-gradient(180deg, rgba(15, 30, 50, 0.96), rgba(10, 21, 37, 0.94)) !important;
  border-color: rgba(89, 130, 182, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(214, 232, 255, 0.05), 0 10px 18px rgba(5, 10, 18, 0.2) !important;
}

body.theme-tech #p_realtime .hero-inline-card-tool .log-date-input,
body.theme-tech #p_history .hero-inline-card-tool .log-date-input {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: none !important;
  color: #e8f0fb !important;
  -webkit-text-fill-color: #e8f0fb;
  box-shadow: none !important;
}

body.theme-tech #p_realtime .hero-inline-card-tool .log-date-input::-webkit-calendar-picker-indicator,
body.theme-tech #p_history .hero-inline-card-tool .log-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.92) sepia(0.12) saturate(0.7) brightness(1.05);
  opacity: 0.9;
}

body.theme-tech #p_realtime .hero-inline-card-tool .log-date-input::-webkit-datetime-edit,
body.theme-tech #p_history .hero-inline-card-tool .log-date-input::-webkit-datetime-edit,
body.theme-tech #p_realtime .hero-inline-card-tool .log-date-input::-webkit-datetime-edit-text,
body.theme-tech #p_history .hero-inline-card-tool .log-date-input::-webkit-datetime-edit-text,
body.theme-tech #p_realtime .hero-inline-card-tool .log-date-input::-webkit-datetime-edit-year-field,
body.theme-tech #p_history .hero-inline-card-tool .log-date-input::-webkit-datetime-edit-year-field,
body.theme-tech #p_realtime .hero-inline-card-tool .log-date-input::-webkit-datetime-edit-month-field,
body.theme-tech #p_history .hero-inline-card-tool .log-date-input::-webkit-datetime-edit-month-field,
body.theme-tech #p_realtime .hero-inline-card-tool .log-date-input::-webkit-datetime-edit-day-field,
body.theme-tech #p_history .hero-inline-card-tool .log-date-input::-webkit-datetime-edit-day-field {
  color: #e8f0fb;
}

body.theme-tech .log-date-chip.no-data {
  background: linear-gradient(180deg, rgba(30, 42, 60, 0.92), rgba(18, 28, 43, 0.92));
  border-color: rgba(95, 119, 150, 0.26);
  color: rgba(191, 219, 254, 0.48);
}

body.theme-tech .log-date-chip.has-data {
  background: var(--tech-card-small-bg);
  border-color: var(--tech-border-strong);
  color: #dbeafe;
}

body.theme-tech .log-date-chip:hover {
  border-color: rgba(249, 115, 22, 0.32);
  color: #fff7ed;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.insight-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
}

.insight-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  opacity: 0.8;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.88), rgba(14, 165, 233, 0.88));
}

.insight-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.insight-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0 14px;
}

.insight-main strong {
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  color: var(--text-main);
}

.insight-main span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.insight-pairs {
  display: grid;
  gap: 10px;
}

.insight-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(129, 151, 181, 0.14);
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 700;
}

.insight-pair b {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.ops-command-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 14px;
}

.command-card {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 18px 20px;
}

.command-card-emphasis {
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(249, 115, 22, 0.14) 0%, rgba(249, 115, 22, 0) 48%),
    radial-gradient(120% 120% at 100% 0%, rgba(14, 165, 233, 0.14) 0%, rgba(14, 165, 233, 0) 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 254, 0.88));
}

.command-card-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.command-card-title {
  margin-top: 8px;
  color: var(--text-main);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
}

.command-card-copy {
  margin-top: 10px;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.75;
}

.command-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.command-card-actions .login-input {
  margin-bottom: 0;
  min-width: 140px;
}

.settings-panels-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
}

.settings-command-strip {
  margin-bottom: 14px;
}

.settings-stack {
  display: grid;
  gap: 14px;
}

.surface-body-flush {
  padding: 0 !important;
}

.chart-action-btn {
  min-height: 38px;
  padding: 0 14px;
}

.theme-switch-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 136px;
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 254, 0.9));
  border: 1px solid rgba(129, 151, 181, 0.18);
  box-shadow: 0 16px 30px rgba(16, 35, 59, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.theme-switch-btn.active {
  border-color: rgba(20, 115, 230, 0.34);
  box-shadow: 0 20px 36px rgba(20, 115, 230, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.theme-switch-preview {
  display: grid;
  flex: 0 0 132px;
  gap: 10px;
  width: 132px;
  min-width: 132px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(129, 151, 181, 0.16);
  background: linear-gradient(180deg, rgba(244, 248, 253, 0.98), rgba(233, 240, 248, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.theme-switch-preview-top {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.26);
}

.theme-switch-preview-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.theme-switch-preview-card {
  display: block;
  min-height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(129, 151, 181, 0.14);
}

.theme-switch-preview-card.is-wide {
  grid-column: 1 / -1;
  min-height: 36px;
}

.theme-switch-preview.tech {
  background: linear-gradient(180deg, rgba(15, 27, 47, 0.98), rgba(10, 19, 33, 0.94));
  border-color: rgba(80, 126, 186, 0.28);
}

.theme-switch-preview.tech .theme-switch-preview-top {
  background: rgba(105, 179, 255, 0.26);
}

.theme-switch-preview.tech .theme-switch-preview-card {
  background: rgba(19, 35, 58, 0.88);
  border-color: rgba(89, 130, 182, 0.18);
}

.theme-switch-preview.aurora {
  background:
    radial-gradient(90% 100% at 0% 0%, rgba(255, 229, 216, 0.72), transparent 62%),
    radial-gradient(90% 100% at 100% 0%, rgba(224, 246, 255, 0.72), transparent 64%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 247, 0.92));
  border-color: rgba(221, 190, 176, 0.28);
}

.theme-switch-preview.aurora .theme-switch-preview-top {
  background: linear-gradient(90deg, rgba(199, 101, 72, 0.56), rgba(255, 230, 218, 0.70), rgba(224, 246, 255, 0.76));
}

.theme-switch-preview.aurora .theme-switch-preview-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(221, 190, 176, 0.22);
}

.theme-switch-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.theme-switch-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--text-main);
}

.theme-switch-desc {
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.7;
}

.theme-switch-btn.active .theme-switch-title {
  color: var(--brand-primary);
}

.matrix-table td,
.diag-hex,
.sk-sub-val,
.sw-status,
.fleet-device-sn {
  font-family: var(--font-mono);
}

.chart-panel .panel-body {
  padding-top: 0 !important;
}
#p_fleet .fleet-status-note {
  font-size: 13px;
}

.alarm-focus strong {
  color: var(--danger-red);
  font-size: 32px;
}

#p_alarm .page-hero {
  grid-template-columns: 1fr;
}

#p_alarm .page-hero-main {
  display: grid;
  gap: 14px;
}

#p_alarm .alarm-hero-copy {
  min-width: 0;
}

#p_alarm .alarm-hero-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#p_alarm .hero-side-card {
  min-height: 96px;
}

#p_alarm .hero-side-card strong {
  font-size: 30px;
}

#p_alarm .panel-header {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.alarm-header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.alarm-header-item {
  display: grid;
  gap: 4px;
  min-width: 132px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(129, 151, 181, 0.16);
  background: linear-gradient(180deg, rgba(249, 252, 255, 0.96), rgba(244, 248, 253, 0.9));
}

.alarm-header-item span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.alarm-header-item strong {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

body.theme-tech .alarm-header-item {
  background: linear-gradient(180deg, rgba(18, 34, 57, 0.96), rgba(12, 24, 41, 0.94));
  border-color: rgba(89, 130, 182, 0.22);
  box-shadow: inset 0 1px 0 rgba(214, 232, 255, 0.05), 0 10px 18px rgba(5, 10, 18, 0.18);
}

body.theme-tech .alarm-header-item span {
  color: #8ea7ca;
}

body.theme-tech .alarm-header-item strong {
  color: #e8f0fb;
}

.theme-switch-btn.active .theme-switch-desc {
  color: var(--text-main);
}

#p_alarm .alarm-protect strong {
  color: var(--warn-yellow);
}

body.theme-light::before {
  background: radial-gradient(circle, rgba(218, 242, 255, 0.54) 0%, rgba(218, 242, 255, 0) 68%);
}

body.theme-light::after {
  background: radial-gradient(circle, rgba(255, 229, 216, 0.46) 0%, rgba(255, 229, 216, 0) 70%);
}

body.theme-light .page-surface {
  background:
    radial-gradient(1000px 440px at 100% 0%, rgba(218, 242, 255, 0.32) 0%, rgba(218, 242, 255, 0) 66%),
    radial-gradient(900px 420px at 0% 0%, rgba(255, 229, 216, 0.20) 0%, rgba(255, 229, 216, 0) 64%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.76), rgba(248, 252, 255, 0.70) 54%, rgba(255, 250, 247, 0.62));
  border-color: rgba(129, 151, 181, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 10px 24px rgba(16, 35, 59, 0.05);
}

body.theme-light .page-hero-main,
body.theme-light .device-hero-main,
body.theme-light .panel,
body.theme-light .kpi-card {
  background: var(--light-panel-gradient);
  border-color: rgba(129, 151, 181, 0.18);
  box-shadow: var(--shadow-base);
}

body.theme-light .hero-side-card,
body.theme-light .device-health-card,
body.theme-light .device-status-card,
body.theme-light .overview-rail-card {
  background: var(--light-card-gradient);
  border-color: rgba(129, 151, 181, 0.18);
  box-shadow: 0 18px 38px rgba(16, 35, 59, 0.07);
}

body.theme-light .panel-header {
  background:
    radial-gradient(560px 160px at 0% 0%, rgba(255, 229, 216, 0.24) 0%, rgba(255, 229, 216, 0) 66%),
    radial-gradient(560px 180px at 100% 0%, rgba(224, 246, 255, 0.34) 0%, rgba(224, 246, 255, 0) 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 252, 255, 0.78)) !important;
  border-bottom-color: rgba(129, 151, 181, 0.16);
}

body.theme-light .command-card,
body.theme-light .params-group-card,
body.theme-light .params-switch-card {
  background: var(--light-card-gradient);
  border-color: rgba(129, 151, 181, 0.16);
  box-shadow: 0 18px 38px rgba(16, 35, 59, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

body.theme-light .command-card-emphasis {
  background: var(--light-ota-upload-gradient);
  border-color: rgba(129, 151, 181, 0.18);
  box-shadow: 0 18px 38px rgba(16, 35, 59, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body.theme-light .command-card-actions .login-input,
body.theme-light .params-field-card,
body.theme-light .params-switch-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 252, 255, 0.72));
  border-color: rgba(129, 151, 181, 0.18);
}

body.theme-aurora .global-topbar,
body.theme-aurora .sidebar {
  background: rgba(255, 255, 255, 0.90);
  border-color: rgba(221, 190, 176, 0.28);
  box-shadow: inset 0 -1px 0 rgba(221, 190, 176, 0.07), 0 14px 32px rgba(99, 74, 62, 0.05);
}

body.theme-aurora .topbar-logo {
  background:
    radial-gradient(120% 110% at 0% 0%, rgba(255, 231, 219, 0.46), transparent 62%),
    radial-gradient(120% 110% at 100% 0%, rgba(229, 247, 255, 0.42), transparent 64%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 247, 0.90));
}

body.theme-aurora .brand-mark {
  background: linear-gradient(135deg, rgba(255, 231, 219, 0.78), rgba(231, 248, 255, 0.72));
  border-color: rgba(221, 190, 176, 0.24);
}

body.theme-aurora .topbar-connection-pill,
body.theme-aurora .identity-card,
body.theme-aurora .settings-meta-card,
body.theme-aurora .theme-switch-btn {
  background: var(--aurora-card-gradient);
  border-color: rgba(221, 190, 176, 0.24);
  box-shadow: 0 16px 34px rgba(99, 74, 62, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body.theme-aurora .theme-switch-btn.active {
  background: var(--aurora-panel-gradient);
  border-color: rgba(199, 101, 72, 0.28);
  box-shadow: 0 18px 36px rgba(199, 101, 72, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.theme-aurora .nav-item:hover {
  color: var(--text-main);
  background: var(--aurora-card-gradient);
  border-color: rgba(221, 190, 176, 0.22);
  box-shadow: none;
}

body.theme-aurora .nav-item.active {
  color: #5a3428;
  background:
    linear-gradient(90deg, rgba(199, 101, 72, 0.14) 0%, rgba(199, 101, 72, 0.06) 38%, rgba(255, 255, 255, 0.58) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 249, 246, 0.74));
  border-color: rgba(199, 101, 72, 0.22);
  box-shadow: inset 3px 0 0 rgba(199, 101, 72, 0.74), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body.theme-aurora .nav-item.active .nav-icon {
  stroke: var(--brand-primary);
}

body.theme-aurora .nav-subitem:hover {
  color: var(--text-main);
  background: rgba(255, 249, 246, 0.78);
  border-color: rgba(221, 190, 176, 0.22);
}

body.theme-aurora .nav-subitem.is-active {
  color: #5a3428;
  background: rgba(199, 101, 72, 0.10);
  border-color: rgba(199, 101, 72, 0.18);
}

body.theme-aurora .page-surface {
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(255, 229, 216, 0.20) 0%, rgba(255, 229, 216, 0) 64%),
    radial-gradient(900px 420px at 100% 0%, rgba(224, 246, 255, 0.24) 0%, rgba(224, 246, 255, 0) 66%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(250, 253, 255, 0.68) 48%, rgba(255, 249, 245, 0.64));
  border-color: rgba(221, 190, 176, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), inset 0 0 0 1px rgba(221, 190, 176, 0.05);
}

body.theme-aurora .page-hero-main,
body.theme-aurora .device-hero-main,
body.theme-aurora .panel,
body.theme-aurora .kpi-card {
  background: var(--aurora-panel-gradient);
  border-color: rgba(221, 190, 176, 0.24);
  box-shadow: var(--shadow-base);
}

body.theme-aurora .hero-side-card,
body.theme-aurora .device-health-card,
body.theme-aurora .device-status-card,
body.theme-aurora .overview-rail-card {
  background: var(--aurora-card-gradient);
  border-color: rgba(221, 190, 176, 0.24);
  box-shadow: 0 16px 34px rgba(99, 74, 62, 0.06);
}

body.theme-aurora .panel-header {
  background:
    radial-gradient(520px 170px at 0% 0%, rgba(255, 229, 216, 0.30) 0%, rgba(255, 229, 216, 0) 66%),
    radial-gradient(520px 170px at 100% 0%, rgba(229, 247, 255, 0.38) 0%, rgba(229, 247, 255, 0) 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(255, 250, 247, 0.70)) !important;
  border-bottom-color: rgba(221, 190, 176, 0.20);
}

body.theme-aurora .command-card,
body.theme-aurora .params-group-card,
body.theme-aurora .params-switch-card {
  background: var(--aurora-panel-gradient);
  border-color: rgba(221, 190, 176, 0.24);
  box-shadow: 0 18px 40px rgba(99, 74, 62, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body.theme-aurora .command-card-emphasis {
  background:
    radial-gradient(820px 300px at 0% 0%, rgba(255, 229, 216, 0.78) 0%, rgba(255, 229, 216, 0.28) 36%, rgba(255, 229, 216, 0) 66%),
    radial-gradient(760px 340px at 100% 0%, rgba(224, 246, 255, 0.84) 0%, rgba(224, 246, 255, 0.34) 40%, rgba(224, 246, 255, 0) 68%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(250, 253, 255, 0.88) 50%, rgba(255, 249, 245, 0.84) 100%);
}

body.theme-aurora .command-card-actions .login-input,
body.theme-aurora .params-field-card,
body.theme-aurora .params-switch-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 250, 247, 0.72));
  border-color: rgba(221, 190, 176, 0.24);
}

body.theme-aurora .btn-primary {
  color: #fffaf7 !important;
  background: linear-gradient(135deg, #e88968 0%, #f0a98c 100%) !important;
  box-shadow: 0 12px 22px rgba(218, 128, 96, 0.20) !important;
}

body.theme-aurora .btn-primary:hover {
  color: #fffaf7 !important;
  background: linear-gradient(135deg, #dc7857 0%, #eb9778 100%) !important;
}

body.theme-aurora .btn:not(.btn-primary) {
  color: #704235;
  background: linear-gradient(135deg, #ffe9df 0%, #f7d2c2 100%);
  border-color: rgba(218, 128, 96, 0.26);
  box-shadow: 0 10px 20px rgba(218, 128, 96, 0.10);
}

body.theme-aurora .btn:not(.btn-primary):hover {
  color: #5e3429;
  background: linear-gradient(135deg, #fbdccc 0%, #f1bea8 100%);
  border-color: rgba(218, 128, 96, 0.34);
}

body.theme-aurora .login-input:focus {
  border-color: rgba(199, 101, 72, 0.34);
  box-shadow: 0 0 0 4px rgba(199, 101, 72, 0.10);
}

body.theme-aurora .history-table th {
  background: linear-gradient(180deg, rgba(255, 249, 246, 0.98), rgba(244, 251, 255, 0.92));
}

body.theme-aurora .history-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.9);
}

body.theme-aurora .history-table tbody tr:nth-child(even) {
  background: rgba(255, 248, 243, 0.72);
}

body.theme-aurora .history-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(255, 239, 228, 0.84), rgba(239, 249, 255, 0.76));
}

body.theme-tech .global-topbar,
body.theme-tech .sidebar {
  background: rgba(6, 12, 22, 0.88);
  border-color: rgba(105, 179, 255, 0.18);
  box-shadow: inset 0 -1px 0 rgba(105, 179, 255, 0.06);
}

body.theme-tech .topbar-logo {
  background: linear-gradient(135deg, rgba(8, 16, 28, 0.98), rgba(12, 22, 37, 0.94));
}

body.theme-tech .brand-mark {
  background: rgba(105, 179, 255, 0.10);
  border-color: rgba(105, 179, 255, 0.14);
}

body.theme-tech .topbar-connection-pill,
body.theme-tech .identity-card,
body.theme-tech .settings-meta-card,
body.theme-tech .theme-switch-btn {
  background: var(--tech-card-medium-bg);
  border-color: var(--tech-border-mid);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech .theme-switch-btn.active {
  background: var(--tech-card-small-bg);
  border-color: var(--tech-border-strong);
  box-shadow: var(--tech-shadow-small);
}

body.theme-tech .topbar-connection-pill,
body.theme-tech .sn-selector {
  border-color: rgba(105, 179, 255, 0.28);
}

body.theme-tech .topbar-meta-label {
  color: #8fa7c2;
}

body.theme-tech .nav-item {
  color: #8fa7c2;
}

body.theme-tech .nav-item:hover {
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(15, 28, 47, 0.94), rgba(10, 20, 34, 0.92));
  border-color: rgba(105, 179, 255, 0.12);
  box-shadow: none;
}

body.theme-tech .nav-item.active {
  color: #dcecff;
  background: linear-gradient(135deg, rgba(17, 44, 82, 0.96), rgba(9, 20, 34, 0.96));
  border-color: rgba(105, 179, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(201, 222, 255, 0.05), 0 10px 24px rgba(0, 0, 0, 0.24);
}

body.theme-tech .nav-item.active .nav-icon {
  stroke: #69b3ff;
}

body.theme-tech .nav-subitem {
  color: #8fa7c2;
}
body.theme-tech .nav-subitem:hover {
  color: var(--text-main);
  background: rgba(15, 28, 47, 0.82);
  border-color: rgba(105,179,255,0.12);
}
body.theme-tech .nav-subitem.is-active {
  color: #dcecff;
  background: rgba(37,99,235,0.18);
  border-color: rgba(105,179,255,0.16);
}

body.theme-tech .topbar-device-shell {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.theme-tech .page-surface {
  background: var(--tech-surface-shell);
  border-color: rgba(105, 179, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(201, 222, 255, 0.05), inset 0 0 0 1px rgba(105, 179, 255, 0.04);
}

body.theme-tech .page-hero-main,
body.theme-tech .device-hero-main,
body.theme-tech .panel,
body.theme-tech .kpi-card {
  background: var(--tech-card-large-bg);
  border-color: var(--tech-border-soft);
  box-shadow: var(--tech-shadow-large);
}

body.theme-tech .hero-side-card,
body.theme-tech .device-health-card,
body.theme-tech .device-status-card,
body.theme-tech .overview-rail-card {
  background: var(--tech-card-medium-bg);
  border-color: var(--tech-border-mid);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech #p_fleet .hero-side-card {
  border-color: var(--tech-border-mid);
  background: var(--tech-card-medium-bg);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech #p_fleet .hero-side-card span {
  color: var(--text-sub);
}

body.theme-tech #p_fleet .hero-side-card strong {
  color: var(--text-main);
}

body.theme-tech #p_fleet .hero-side-card small {
  color: var(--text-muted);
}

body.theme-tech .panel-header {
  background: var(--tech-card-header-bg) !important;
  border-bottom-color: rgba(132, 191, 255, 0.16);
}

body.theme-tech .command-card,
body.theme-tech .params-group-card,
body.theme-tech .params-switch-card {
  background: var(--tech-card-medium-bg);
  border-color: var(--tech-border-mid);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech .command-card-emphasis {
  background: var(--tech-ota-upload-bg);
  border-color: rgba(132, 191, 255, 0.30);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech .command-card-label {
  color: #69b3ff;
}

body.theme-tech .command-card-title {
  color: var(--text-main);
}

body.theme-tech .command-card-copy {
  color: var(--text-sub);
}

body.theme-tech .command-card-actions .login-input,
body.theme-tech .params-field-card,
body.theme-tech .params-switch-item {
  background: linear-gradient(180deg, rgba(15, 28, 47, 0.96), rgba(9, 19, 33, 0.94));
  border-color: var(--tech-border-mid);
  box-shadow: inset 0 1px 0 rgba(214, 232, 255, 0.05);
  color: var(--text-main);
}

body.theme-tech .section-title-copy h3 {
  color: #d8e4f3;
}

body.theme-tech #p_fleet .history-table tbody td {
  border-bottom-color: rgba(89, 130, 182, 0.18);
}
body.theme-tech #p_fleet .history-table thead th {
  color: #9db2cb;
  border-top-color: rgba(105, 179, 255, 0.16);
  border-bottom-color: rgba(105, 179, 255, 0.24);
  border-bottom-width: 2px;
}
body.theme-tech #p_fleet .history-table tbody tr:first-child td {
  border-top-color: rgba(105, 179, 255, 0.22);
  border-top-width: 2px;
}
body.theme-tech #p_fleet .history-table tbody td:not([colspan]):not(:last-child) {
  border-right-color: rgba(105, 179, 255, 0.14);
}

body.theme-tech .btn {
  background: rgba(10, 20, 34, 0.92);
  border-color: rgba(92, 117, 152, 0.22);
  color: var(--text-main);
}

body.theme-tech .btn:hover {
  border-color: rgba(105, 179, 255, 0.26);
}

body.theme-tech .btn-primary {
  background: linear-gradient(135deg, #3f8cf3, #2d70ca) !important;
  box-shadow: 0 10px 20px rgba(24, 64, 120, 0.22) !important;
}

body.theme-tech .btn-primary:hover {
  background: linear-gradient(135deg, #5aa0ff, #377ad5) !important;
}

body.theme-tech .history-table th {
  background: var(--tech-card-header-bg);
}

body.theme-tech .history-table tbody tr:nth-child(odd) {
  background: rgba(9, 18, 31, 0.84);
}

body.theme-tech .history-table tbody tr:nth-child(even) {
  background: rgba(14, 27, 44, 0.9);
}

body.theme-tech .history-table tbody tr:hover {
  background: rgba(24, 45, 72, 0.92);
}

body.theme-tech .sn-selector,
body.theme-tech .login-input,
body.theme-tech .dropdown-menu,
body.theme-tech .custom-modal {
  background: linear-gradient(180deg, rgba(15, 28, 47, 0.96), rgba(9, 19, 33, 0.94));
  border-color: var(--tech-border-mid);
  box-shadow: inset 0 1px 0 rgba(214, 232, 255, 0.05);
  color: var(--text-main);
}

body.theme-tech .fleet-status-note {
  background: var(--tech-card-small-bg);
  border-color: var(--tech-border-mid);
  box-shadow: inset 0 1px 0 rgba(220, 239, 255, 0.06);
  color: var(--text-sub);
}

body.theme-tech .fleet-name-main {
  color: #d7e2f1;
  font-weight: 700;
}

body.theme-tech .fleet-alias-btn {
  height: 24px;
  padding: 0 9px;
  border-color: var(--tech-border-mid);
  background: linear-gradient(180deg, rgba(18, 34, 57, 0.96), rgba(10, 21, 37, 0.94));
  color: var(--text-sub);
}

body.theme-tech .fleet-alias-btn:hover {
  color: #dcecff;
  border-color: rgba(105, 179, 255, 0.28);
  box-shadow: none;
}

body.theme-tech .state-pill {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

body.theme-tech .state-pill.tone-live {
  color: #8ad9ff;
  background: rgba(11, 60, 95, 0.68);
  border-color: rgba(82, 179, 239, 0.38);
  box-shadow: inset 0 1px 0 rgba(168, 223, 255, 0.08);
}

body.theme-tech .state-pill.tone-ok {
  color: #79e3bb;
  background: rgba(8, 63, 44, 0.72);
  border-color: rgba(60, 201, 146, 0.34);
}

body.theme-tech .state-pill.tone-warn {
  color: #ffd48f;
  background: rgba(94, 58, 18, 0.72);
  border-color: rgba(242, 183, 94, 0.3);
}

body.theme-tech .state-pill.tone-danger {
  color: #ff9ab4;
  background: rgba(96, 20, 45, 0.72);
  border-color: rgba(255, 111, 147, 0.28);
}

body.theme-tech .state-pill.tone-offline {
  color: #c0cede;
  background: rgba(29, 39, 53, 0.78);
  border-color: rgba(92, 117, 152, 0.24);
}

body.theme-tech #p_fleet .fleet-table-panel .history-table tbody tr td:first-child {
  color: #d7e2f1;
}

body.theme-tech #p_fleet .fleet-status-toolbar .btn {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 12px;
}

body.theme-tech #p_fleet .history-table td .btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12px;
  box-shadow: none !important;
}

body.theme-tech .device-health-track {
  background: rgba(40, 58, 81, 0.84);
}

body.theme-tech .matrix-table th {
  background: var(--tech-card-header-bg);
  border-color: var(--tech-border-mid);
  color: #9eb9da;
}

body.theme-tech .matrix-table td {
  background: linear-gradient(180deg, rgba(16, 31, 52, 0.92), rgba(10, 21, 37, 0.9));
  border-color: rgba(89, 130, 182, 0.16);
}

body.theme-tech #p_dash .device-summary-grid > .summary-metric-card,
body.theme-tech #p_dash .device-summary-grid > .device-status-card {
  background: var(--tech-card-medium-bg);
  border-color: var(--tech-border-mid);
  box-shadow: var(--tech-shadow-medium);
}

body.theme-tech #p_dash .summary-dual-main {
  background: var(--tech-card-small-bg);
  border: 1px solid var(--tech-border-strong);
  box-shadow: var(--tech-shadow-small);
}

body.theme-tech #p_dash .summary-metric-rowset,
body.theme-tech #p_dash .device-side-list {
  border-top-color: rgba(89, 130, 182, 0.18);
}

body.theme-tech #p_dash .summary-metric-kicker,
body.theme-tech #p_dash .sw-title,
body.theme-tech #p_dash .matrix-section-title span:last-child {
  color: var(--text-sub);
}

body.theme-tech #p_dash .summary-metric-header small,
body.theme-tech #p_dash .summary-dual-main small,
body.theme-tech #p_dash .device-side-row,
body.theme-tech #p_dash .section-title-copy p {
  color: var(--text-sub);
}

body.theme-tech #p_dash .summary-metric-main em,
body.theme-tech #p_dash .device-side-highlight em {
  color: #8aa7cb;
}

body.theme-tech #p_dash .overview-layout {
  border-color: var(--tech-border-soft);
  background: var(--tech-surface-shell);
  box-shadow: inset 0 1px 0 rgba(201, 222, 255, 0.03), inset 0 0 0 1px rgba(105, 179, 255, 0.03);
}

body.theme-tech #p_dash .overview-main > .panel,
body.theme-tech #p_dash .overview-alarm-panel,
body.theme-tech #p_dash .overview-hardware-panel {
  background: var(--tech-card-large-bg);
  border-color: var(--tech-border-soft);
  box-shadow: var(--tech-shadow-large);
}

body.theme-tech #p_dash .panel-header {
  background: var(--tech-card-header-bg) !important;
  border-bottom-color: rgba(132, 191, 255, 0.16);
}

body.theme-tech #p_dash .overview-main > .panel:first-child .panel-body,
body.theme-tech #p_dash .overview-alarm-panel .panel-body,
body.theme-tech #p_dash .overview-hardware-panel .panel-body {
  background: var(--tech-card-body-bg);
}

body.theme-tech #p_dash .sw-card {
  background: var(--tech-card-small-bg);
  border-color: var(--tech-border-strong);
  box-shadow: var(--tech-shadow-small);
}

body.theme-tech #p_dash .sw-status {
  color: var(--text-main);
}

body.theme-tech #p_dash .matrix-table {
  border-color: rgba(89, 130, 182, 0.22);
  box-shadow: inset 0 1px 0 rgba(201, 222, 255, 0.03);
}

body.theme-tech #p_dash .matrix-table th {
  background: rgba(17, 33, 55, 0.96);
  border-color: rgba(89, 130, 182, 0.22);
  color: #9eb9da;
}

body.theme-tech #p_dash .matrix-table td {
  background: rgba(11, 24, 40, 0.92);
  border-color: rgba(89, 130, 182, 0.16);
  color: var(--text-main);
}

@media (max-width: 1200px) {
  .page-hero,
  .device-hero,
  .overview-main {
    grid-template-columns: 1fr;
  }

  .device-summary-grid,
  .hero-inline-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-identity-grid,
  .settings-meta-grid,
  .overview-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #p_fleet .page-hero-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .global-topbar {
    height: auto;
    min-height: 62px;
    padding-right: 0;
  }

  .topbar-content {
    width: 100%;
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .topbar-brand-shell {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-device-shell {
    width: 100%;
    justify-content: space-between;
  }

  .sn-selector {
    min-width: 0;
    width: 100%;
  }

  .main-content {
    padding: 10px;
  }

  .page-surface {
    padding: 16px;
    border-radius: 22px;
  }

  .page-headline {
    font-size: 25px;
  }

  .device-identity-grid,
  .settings-meta-grid,
  .overview-rail,
  .sys-kpi-grid {
    grid-template-columns: 1fr;
  }

  .settings-device-hero {
    grid-template-columns: 1fr;
  }

  .device-summary-grid,
  .summary-dual-header,
  .hero-inline-strip {
    grid-template-columns: 1fr;
  }

  #p_alarm .alarm-hero-strip {
    grid-template-columns: 1fr;
  }

  #p_fleet .page-hero-side {
    grid-template-columns: 1fr;
  }

  .double-chart-row {
    flex-direction: column;
    height: auto;
    min-height: 720px;
  }

  #p_fleet .fleet-table-panel {
    min-height: 420px !important;
  }
}

#p_realtime.page-surface,
#p_history.page-surface {
  height: 100%;
  min-height: 0;
}

#p_realtime .page-hero,
#p_history .page-hero {
  grid-template-columns: 1fr;
}

#p_realtime .page-hero-main,
#p_history .page-hero-main {
  padding: 16px 18px;
}

#p_realtime .page-hero-inline-main,
#p_history .page-hero-inline-main {
  align-items: stretch;
}

#p_realtime .log-date-strip,
#p_history .log-date-strip {
  padding: 8px 12px;
  gap: 10px;
  justify-self: end;
  margin-left: auto;
}

#p_realtime .log-date-action,
#p_history .log-date-action {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

#p_realtime .double-chart-row,
#p_history .double-chart-row {
  flex: 1 1 auto;
  flex-direction: column;
  height: auto;
  min-height: 560px;
  gap: 14px;
  margin-bottom: 0;
}

#p_realtime .chart-panel,
#p_history .chart-panel {
  flex: 1 1 0 !important;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

#p_realtime .chart-panel .panel-header,
#p_history .chart-panel .panel-header {
  padding: 12px 16px;
}

#p_realtime .chart-panel .panel-body,
#p_history .chart-panel .panel-body {
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
}

#p_realtime .chart-box,
#p_history .chart-box {
  top: 6px;
  right: 8px;
  bottom: 4px;
  left: 8px;
}

@media (max-width: 1440px) {
  #p_realtime .hero-inline-strip,
  #p_history .hero-inline-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #p_realtime .hero-inline-card-tool,
  #p_history .hero-inline-card-tool {
    grid-column: auto;
  }

  #p_realtime .double-chart-row,
  #p_history .double-chart-row {
    min-height: 520px;
  }
}

@media (max-width: 900px) {
  #p_realtime.page-surface,
  #p_history.page-surface {
    min-height: auto;
  }

  #p_realtime .page-hero-inline-top,
  #p_history .page-hero-inline-top {
    grid-template-columns: 1fr;
  }

  #p_realtime .hero-inline-strip,
  #p_history .hero-inline-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #p_realtime .hero-inline-card-tool,
  #p_history .hero-inline-card-tool {
    grid-column: auto;
  }

  #p_realtime .hero-inline-tool-row,
  #p_history .hero-inline-tool-row {
    flex-wrap: nowrap;
  }

  #p_realtime .log-date-strip,
  #p_history .log-date-strip {
    justify-self: start;
    margin-left: 0;
  }

  #p_realtime .double-chart-row,
  #p_history .double-chart-row {
    height: auto;
    min-height: 620px;
  }
}

@media (max-width: 640px) {
  #p_realtime .hero-inline-strip,
  #p_history .hero-inline-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.params-hero .page-hero-main { gap: 12px; }
.params-summary-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.params-action-bar {
  margin-bottom: 10px;
  min-height: 54px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(129,151,181,0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(242,247,253,0.76));
  box-shadow: 0 14px 30px rgba(16,35,59,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 4;
}
.params-action-copy {
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.5;
  min-width: 0;
}
.params-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}
.params-toolbar { display: flex; align-items: center; gap: 10px; }
.params-tabbar {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(129,151,181,0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(241,247,253,0.66));
  box-shadow: 0 16px 34px rgba(16,35,59,0.07);
}
.params-tab-btn {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.params-tab-btn span {
  font-size: 13px;
  letter-spacing: 0.02em;
}
.params-tab-btn strong {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(59,130,246,0.1);
  color: var(--brand-primary);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.params-tab-btn.is-active {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(232,241,255,0.9));
  border-color: rgba(59,130,246,0.22);
  color: var(--text-main);
  box-shadow: 0 12px 28px rgba(37,99,235,0.12);
}
.params-tab-btn:focus-visible {
  outline: 2px solid rgba(37,99,235,0.45);
  outline-offset: 2px;
}
.params-toolbar-note {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(59,130,246,0.08), rgba(14,165,233,0.04));
  border: 1px solid rgba(59,130,246,0.12);
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.6;
}
.params-layout {
  display: block;
  min-height: 0;
}
.params-main-panel,
.params-side-panel { min-width: 0; }
.params-tab-panel[hidden] { display: none !important; }
.params-panel-body { gap: 14px; }
.params-group-stack,
.params-switch-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.params-group-card,
.params-switch-card {
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(248,250,252,0.58));
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.params-group-head,
.params-switch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.params-group-title,
.params-switch-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.params-group-range,
.params-switch-range {
  display: none;
}
.params-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 300px));
  justify-content: start;
  gap: 12px;
}
.params-field-card {
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,250,252,0.78));
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.params-field-card.is-dirty {
  border-color: rgba(249,115,22,0.42);
  box-shadow: 0 0 0 1px rgba(249,115,22,0.12);
}
.params-field-card.is-invalid,
.params-switch-item.is-invalid {
  border-color: rgba(239,68,68,0.42);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.12);
}
.params-field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.params-field-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}
.params-field-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.params-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(59,130,246,0.1);
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 700;
}
.params-field-input {
  margin-bottom: 0;
  height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}
.params-field-input::placeholder { color: var(--text-muted); }
.params-field-card.is-placeholder .params-field-input { color: var(--text-muted); }
.params-field-input:disabled { opacity: 0.75; cursor: not-allowed; }
.params-field-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.params-pcs-card { gap: 12px; }
.params-pcs-current-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.params-pcs-value {
  min-height: 28px;
  display: flex;
  align-items: center;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.params-pcs-action-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) max-content max-content;
  align-items: center;
  gap: 10px;
}
.params-pcs-code-input {
  width: 100%;
  min-width: 0;
}
.params-pcs-preview {
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(248,250,252,0.74);
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(90px, 0.6fr) minmax(180px, 1fr) minmax(130px, 0.8fr);
  gap: 8px;
  align-items: center;
}
.params-pcs-preview.is-ready {
  border-color: rgba(16,185,129,0.34);
  background: rgba(236,253,245,0.66);
}
.params-pcs-preview span,
.params-pcs-preview small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.params-pcs-preview strong {
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.params-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 320px));
  justify-content: start;
  gap: 10px;
}
.params-switch-item {
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,250,252,0.8));
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.params-switch-item.is-dirty {
  border-color: rgba(249,115,22,0.42);
  box-shadow: 0 0 0 1px rgba(249,115,22,0.12);
}
.params-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.params-switch-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
}
.params-switch-bit {
  font-size: 12px;
  color: var(--text-muted);
}
.params-toggle {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.params-toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.params-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(148,163,184,0.42);
  border: 1px solid rgba(148,163,184,0.24);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.params-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15,23,42,0.18);
  transition: transform 0.2s ease;
}
.params-toggle input:checked + .params-toggle-track {
  background: linear-gradient(135deg, rgba(16,185,129,0.9), rgba(34,197,94,0.9));
  border-color: rgba(34,197,94,0.38);
}
.params-toggle input:checked + .params-toggle-track::after { transform: translateX(22px); }
.params-empty {
  min-height: 120px;
  border-radius: 18px;
  border: 1px dashed rgba(148,163,184,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  line-height: 1.7;
}

body.theme-tech .params-action-bar {
  background: linear-gradient(180deg, rgba(9,22,44,0.92), rgba(8,18,34,0.74));
  border-color: rgba(96,165,250,0.16);
  box-shadow: 0 18px 42px rgba(0,0,0,0.28);
}
body.theme-tech .params-action-copy {
  color: var(--text-sub);
}
body.theme-tech .params-tabbar {
  background: linear-gradient(180deg, rgba(9,22,44,0.9), rgba(8,18,34,0.72));
  border-color: rgba(96,165,250,0.16);
  box-shadow: 0 18px 42px rgba(0,0,0,0.28);
}
body.theme-tech .params-tab-btn strong {
  background: rgba(59,130,246,0.18);
  color: #93c5fd;
}
body.theme-tech .params-tab-btn.is-active {
  background: linear-gradient(135deg, rgba(15,36,70,0.96), rgba(20,75,108,0.78));
  border-color: rgba(96,165,250,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 14px 34px rgba(14,116,144,0.16);
}
body.theme-tech .params-group-card,
body.theme-tech .params-switch-card,
body.theme-tech .params-field-card,
body.theme-tech .params-switch-item {
  background: linear-gradient(180deg, rgba(7,18,35,0.94), rgba(12,25,46,0.86));
  border-color: rgba(96,165,250,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
body.theme-tech .params-badge {
  background: rgba(59,130,246,0.18);
  color: #93c5fd;
}
body.theme-tech .params-pcs-preview {
  background: rgba(8,20,38,0.82);
  border-color: rgba(96,165,250,0.14);
}
body.theme-tech .params-pcs-preview.is-ready {
  background: rgba(6,78,59,0.28);
  border-color: rgba(52,211,153,0.26);
}
body.theme-tech .params-toggle-track::after {
  background: linear-gradient(180deg, rgba(241,245,249,0.96), rgba(191,219,254,0.92));
}

@media (max-width: 1220px) {
  .params-group-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 300px)); }
  .params-switch-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 320px)); }
}

@media (max-width: 920px) {
  .params-summary-hero,
  .params-group-grid,
  .params-switch-grid,
  .params-pcs-current-grid {
    grid-template-columns: 1fr;
  }
  .params-pcs-action-row,
  .params-pcs-preview {
    grid-template-columns: 1fr;
  }
  .params-pcs-action-row .btn {
    width: 100%;
  }
  .params-toolbar {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .params-action-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .params-action-buttons {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
