/* ==========================================================================
   Helix GridOS - High-Performance Industrial HMI (ISA-101 / ISA-18.2)
   Helix Systems Ltd. "Power, orchestrated."
   ========================================================================== */

:root {
    --hx-bg: #0B0E12;
    --hx-panel: #121821;
    --hx-surface: #1A222D;
    --hx-surface-hover: #222C3A;
    --hx-surface-active: #2A374A;
    --hx-border: #263140;
    --hx-border-subtle: #1C2430;
    --hx-border-light: #37475D;

    --hx-text: #E6EDF3;
    --hx-text-muted: #8B98A9;
    --hx-text-dim: #5E6D82;

    --hx-teal: #2DE2C8;
    --hx-teal-glow: rgba(45, 226, 200, 0.25);
    --hx-blue: #3B82F6;
    --hx-blue-glow: rgba(59, 130, 246, 0.25);

    /* Voltage classes */
    --v-765: #E5484D;
    --v-400: #F5A524;
    --v-220: #46A758;
    --v-132: #3E9BFF;
    --v-hvdc: #B26EF0;
    --v-deenergized: #4B5563;

    /* ISA-18.2 Alarm Priorities */
    --alm-p1: #EF4444; /* Critical */
    --alm-p2: #F97316; /* High */
    --alm-p3: #EAB308; /* Medium */
    --alm-p4: #06B6D4; /* Low */

    --font-ui: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--hx-bg);
    color: var(--hx-text);
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--hx-panel);
}
::-webkit-scrollbar-thumb {
    background: var(--hx-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--hx-border-light);
}

/* ==========================================================================
   Industrial Operator Login
   ========================================================================== */
.login-screen-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #12161c;
    z-index: 1000;
}

.login-card-hmi {
    width: 380px;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.login-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    background: #21262d;
    border-bottom: 1px solid #30363d;
}

.login-card-header .logo-glyph {
    width: 28px;
    height: 28px;
    color: #58a6ff;
}

.login-brand-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #e6edf3;
}

.login-brand-sub {
    font-size: 11px;
    color: #8b949e;
    letter-spacing: 0.4px;
    font-weight: 500;
}

.login-card-body {
    padding: 22px;
}

.form-field-hmi {
    margin-bottom: 14px;
}

.form-label-hmi {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #8b949e;
    margin-bottom: 6px;
}

.form-input-hmi {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #e6edf3;
    font-family: var(--font-ui);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input-hmi:focus {
    border-color: #58a6ff;
}

.btn-hmi-submit {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #238636;
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-hmi-submit:hover {
    background: #2ea043;
}
.btn-hmi-submit:active {
    background: #238636;
}

.hx-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

/* ==========================================================================
   Shell Layout
   ========================================================================== */
.hx-shell {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar */
.hx-topbar {
    height: 48px;
    background: var(--hx-panel);
    border-bottom: 1px solid var(--hx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    flex-shrink: 0;
    gap: 14px;
    z-index: 10;
}

.hx-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hx-brand svg {
    width: 24px;
    height: 24px;
    color: var(--hx-teal);
}

.hx-brand-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--hx-text);
}

.hx-brand-sub {
    font-size: 11px;
    color: var(--hx-text-muted);
    font-weight: 500;
    padding-left: 6px;
    border-left: 1px solid var(--hx-border);
}

.hx-topbar-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hx-select-control-center {
    background: var(--hx-surface);
    border: 1px solid var(--hx-border);
    color: var(--hx-text);
    height: 30px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.hx-freq-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--hx-surface);
    border: 1px solid var(--hx-border);
    padding: 4px 10px;
    border-radius: 4px;
}

.hx-freq-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--hx-teal);
}

.hx-rocof {
    font-size: 10px;
    color: var(--hx-text-muted);
}

.hx-alarm-summary {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hx-alarm-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
}
.hx-alarm-pill.p1 { background: rgba(239, 68, 68, 0.2); color: var(--alm-p1); border: 1px solid var(--alm-p1); }
.hx-alarm-pill.p2 { background: rgba(249, 115, 22, 0.2); color: var(--alm-p2); border: 1px solid var(--alm-p2); }
.hx-alarm-pill.p3 { background: rgba(234, 179, 8, 0.2); color: var(--alm-p3); border: 1px solid var(--alm-p3); }
.hx-alarm-pill.p4 { background: rgba(6, 182, 212, 0.2); color: var(--alm-p4); border: 1px solid var(--alm-p4); }

.hx-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hx-clocks {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--hx-text-muted);
    font-family: var(--font-mono);
}
.hx-clocks span { color: var(--hx-text); }

.hx-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--hx-surface);
    border: 1px solid var(--hx-border);
    padding: 4px 10px;
    border-radius: 4px;
}
.hx-user-name { font-weight: 700; font-size: 12px; color: var(--hx-text); }
.hx-user-role { font-size: 10px; text-transform: uppercase; padding: 1px 5px; border-radius: 2px; background: rgba(59, 130, 246, 0.2); color: var(--hx-blue); font-weight: 700; }

/* Main Workspace Area */
.hx-main-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Icon Rail */
.hx-rail {
    width: 54px;
    background: var(--hx-panel);
    border-right: 1px solid var(--hx-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 8px;
    flex-shrink: 0;
}

.hx-rail-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--hx-text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.hx-rail-btn:hover {
    color: var(--hx-text);
    background: var(--hx-surface);
    border-color: var(--hx-border);
}

.hx-rail-btn.active {
    color: var(--hx-teal);
    background: var(--hx-surface);
    border-color: var(--hx-teal);
}

.hx-rail-btn svg {
    width: 20px;
    height: 20px;
}

/* Tooltip on rail hover */
.hx-rail-btn:hover::after {
    content: attr(data-label);
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--hx-surface);
    border: 1px solid var(--hx-border-light);
    color: var(--hx-text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* Central Workspace */
.hx-workspace {
    flex: 1;
    background: var(--hx-bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Collapsible Right Rail */
.hx-right-rail {
    width: 320px;
    background: var(--hx-panel);
    border-left: 1px solid var(--hx-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s ease;
}

.hx-right-rail.collapsed {
    width: 0;
    overflow: hidden;
    border-left: none;
}

.hx-right-rail-header {
    height: 38px;
    padding: 0 12px;
    border-bottom: 1px solid var(--hx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hx-text-muted);
}

.hx-soe-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hx-soe-item {
    background: var(--hx-surface);
    border: 1px solid var(--hx-border);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 11px;
}
.hx-soe-time { font-family: var(--font-mono); color: var(--hx-text-muted); font-size: 10px; }
.hx-soe-dev { font-weight: 700; color: var(--hx-text); margin-top: 2px; }
.hx-soe-desc { color: var(--hx-teal); font-family: var(--font-mono); font-size: 10px; }

/* Statusbar */
.hx-statusbar {
    height: 28px;
    background: var(--hx-panel);
    border-top: 1px solid var(--hx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    font-size: 11px;
    color: var(--hx-text-muted);
    flex-shrink: 0;
}

.hx-status-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hx-badge-live {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid #22c55e;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.hx-badge-live::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 6px #4ade80;
}

/* ==========================================================================
   Screen: Wide-Area Overview
   ========================================================================== */
.overview-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
}

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.kpi-card {
    background: var(--hx-panel);
    border: 1px solid var(--hx-border);
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--hx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--hx-text);
    margin-top: 4px;
}

.kpi-unit {
    font-size: 12px;
    color: var(--hx-text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.kpi-sub {
    font-size: 10px;
    color: var(--hx-teal);
    font-family: var(--font-mono);
    margin-top: 4px;
}

.overview-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    flex: 1;
}

.overview-panel {
    background: var(--hx-panel);
    border: 1px solid var(--hx-border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.overview-panel-header {
    height: 40px;
    padding: 0 14px;
    background: var(--hx-surface);
    border-bottom: 1px solid var(--hx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.map-container {
    flex: 1;
    min-height: 420px;
    position: relative;
    background: radial-gradient(circle at center, #151C26 0%, #0B0E12 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Top 5 Corridors Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    background: var(--hx-surface);
    padding: 8px 12px;
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--hx-text-muted);
    border-bottom: 1px solid var(--hx-border);
    font-weight: 600;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--hx-border-subtle);
}

.data-table tr:hover {
    background: var(--hx-surface-hover);
}

/* ==========================================================================
   Screen: Single-Line Diagram (SLD) & Select-Before-Operate
   ========================================================================== */
.sld-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0B0E12;
    position: relative;
    min-height: 580px;
    overflow: hidden;
}

.sld-toolbar {
    height: 40px;
    background: var(--hx-panel);
    border-bottom: 1px solid var(--hx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.sld-canvas {
    flex: 1;
    position: relative;
    overflow: auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* IEC 60617 Breaker Symbol and Interaction */
.sld-cb {
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}
.sld-cb:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px var(--hx-teal));
}

/* Select Before Operate Modal */
.sbo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.sbo-modal {
    width: 420px;
    background: var(--hx-panel);
    border: 2px solid var(--hx-teal);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--hx-teal-glow);
    overflow: hidden;
}

.sbo-header {
    background: var(--hx-surface);
    padding: 14px 18px;
    border-bottom: 1px solid var(--hx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 13px;
    color: var(--hx-teal);
}

.sbo-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 12px;
}

.sbo-stat-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--hx-border-subtle);
    padding-bottom: 6px;
}

.sbo-timer {
    text-align: center;
    font-size: 24px;
    font-family: var(--font-mono);
    color: var(--hx-teal);
    padding: 8px 0;
    font-weight: 700;
}

.sbo-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.btn-sbo-confirm {
    flex: 1;
    height: 40px;
    background: #DC2626;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}
.btn-sbo-confirm.close-act {
    background: #16A34A;
}

.btn-sbo-cancel {
    flex: 1;
    height: 40px;
    background: var(--hx-surface);
    color: var(--hx-text);
    border: 1px solid var(--hx-border);
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================================================
   Screen: Transformer Inspector
   ========================================================================== */
.inspector-container {
    padding: 16px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    flex: 1;
}

.transformer-view-box {
    background: var(--hx-panel);
    border: 1px solid var(--hx-border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fan-spinner {
    transform-origin: center;
}
.fan-spinning {
    animation: fanRotate 0.6s linear infinite;
}
@keyframes fanRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Screen: HX-P7 Feeder IED Controller Faceplate
   ========================================================================== */
.ied-faceplate-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: 100%;
}

.hx-p7-enclosure {
    width: 680px;
    background: #181c22;
    border: 8px solid #282f3a;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), inset 0 0 12px rgba(0, 0, 0, 0.6);
    padding: 20px;
    position: relative;
}

.hx-p7-ears {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 90%;
    background: #232832;
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}
.hx-p7-ears.left { left: -32px; border-radius: 4px 0 0 4px; }
.hx-p7-ears.right { right: -32px; border-radius: 0 4px 4px 0; }
.rack-screw {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4b5563;
    border: 1px solid #1f2937;
    position: relative;
}
.rack-screw::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 2px;
    width: 8px;
    height: 2px;
    background: #111827;
}

.hx-p7-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #2d3748;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.hx-p7-nameplate {
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.8px;
}
.hx-p7-serial {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--hx-teal);
}

.hx-p7-inner-grid {
    display: grid;
    grid-template-columns: 140px 1fr 140px;
    gap: 18px;
}

/* LED Columns */
.ied-led-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ied-led-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    font-family: var(--font-mono);
}

.led-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #27272a;
    border: 1px solid #3f3f46;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}
.led-indicator.active-green {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e, inset 0 0 4px #86efac;
}
.led-indicator.active-red {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444, inset 0 0 4px #fca5a5;
}
.led-indicator.active-amber {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b, inset 0 0 4px #fde68a;
}

/* LCD Display */
.ied-lcd-panel {
    background: #0d1e18;
    border: 3px solid #1f2937;
    border-radius: 4px;
    padding: 12px;
    font-family: var(--font-mono);
    color: #34d399;
    min-height: 220px;
    box-shadow: inset 0 0 16px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
}

.lcd-header {
    border-bottom: 1px solid #064e3b;
    padding-bottom: 6px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
}

.lcd-nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.lcd-nav-btn {
    background: #064e3b;
    color: #a7f3d0;
    border: 1px solid #047857;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 2px;
    cursor: pointer;
}
.lcd-nav-btn.active {
    background: #10b981;
    color: #064e3b;
    font-weight: 700;
}

.lcd-content {
    flex: 1;
    font-size: 11px;
    line-height: 1.6;
}

/* 5-way Keypad */
.ied-keypad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.keypad-btn {
    width: 38px;
    height: 34px;
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.05s ease, background 0.1s ease;
}
.keypad-btn:active {
    transform: translateY(2px);
    background: #1e293b;
}

/* ==========================================================================
   Screen: Alarm Console (ISA-18.2)
   ========================================================================== */
.alarm-console-frame {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.alarm-toolbar {
    background: var(--hx-panel);
    border: 1px solid var(--hx-border);
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.alarm-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn {
    background: var(--hx-surface);
    border: 1px solid var(--hx-border);
    color: var(--hx-text-muted);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}
.filter-btn.active {
    background: var(--hx-surface-active);
    color: var(--hx-teal);
    border-color: var(--hx-teal);
}

.alarm-actions {
    display: flex;
    gap: 8px;
}

.btn-alarm-action {
    background: var(--hx-surface);
    border: 1px solid var(--hx-border);
    color: var(--hx-text);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.15s ease;
}
.btn-alarm-action:hover {
    background: var(--hx-surface-hover);
    border-color: var(--hx-border-light);
}
.btn-alarm-action.primary {
    background: var(--hx-teal);
    color: #0B0E12;
    border: none;
    font-weight: 700;
}

/* Alarm Flood Banner */
.flood-banner {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--alm-p1);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   Screen: Historian Trends (Multi-pen uPlot)
   ========================================================================== */
.trends-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.trends-toolbar {
    background: var(--hx-panel);
    border: 1px solid var(--hx-border);
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-viewport {
    flex: 1;
    background: var(--hx-panel);
    border: 1px solid var(--hx-border);
    border-radius: 6px;
    padding: 16px;
    position: relative;
    min-height: 420px;
}

/* ==========================================================================
   Screen: Outages and Switching Sequences
   ========================================================================== */
.switching-container {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
    flex: 1;
}

.step-card {
    background: var(--hx-surface);
    border: 1px solid var(--hx-border);
    border-radius: 4px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hx-border);
    color: var(--hx-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}
.step-card.completed .step-num {
    background: #16a34a;
    color: #fff;
}
