:root {
    /* Color Palette - Premium Dark Mode */
    --bg-base: #191724;
    --bg-surface: rgba(31, 29, 46, 0.6);
    --bg-surface-hover: rgba(38, 35, 58, 0.8);

    --text-primary: #e0def4;
    --text-secondary: #908caa;
    --text-muted: #6e6a86;

    --accent-primary: #c4a7e7;
    --accent-primary-hover: #b895e6;
    --accent-glow: rgba(196, 167, 231, 0.2);

    --border-subtle: rgba(224, 222, 244, 0.1);

    /* Log Levels */
    --level-debug: #6e6a86;
    --level-info: #9ccfd8;
    --level-warn: #f6c177;
    --level-error: #eb6f92;
    --level-crit: #ebbcba;

    /* Log Level Bg */
    --level-debug-bg: rgba(110, 106, 134, 0.1);
    --level-info-bg: rgba(156, 207, 216, 0.1);
    --level-warn-bg: rgba(246, 193, 119, 0.1);
    --level-error-bg: rgba(235, 111, 146, 0.1);
    --level-crit-bg: rgba(235, 188, 186, 0.2);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: 'Space Mono', SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;

    /* Effects */
    --shadow-glow: 0 0 20px var(--accent-glow);
    --glass-blur: blur(12px);
    --transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(196, 167, 231, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(246, 193, 119, 0.03), transparent 25%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem;
    gap: 1rem;
}

/* Glassmorphism Panel Utilities */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    height: 70px;
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    background: conic-gradient(from 180deg at 50% 50%, var(--accent-primary) 0deg, transparent 180deg, var(--accent-primary) 360deg);
    border-radius: 50%;
    box-shadow: var(--shadow-glow);
    animation: rotate 4s linear infinite;
}

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

h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 span {
    font-weight: 400;
    color: var(--text-secondary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: rgba(49, 116, 143, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(49, 116, 143, 0.2);
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: #31748f;
    border-radius: 50%;
    box-shadow: 0 0 10px #31748f;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(49, 116, 143, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(49, 116, 143, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(49, 116, 143, 0);
    }
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    flex: 1;
    gap: 1rem;
    overflow: hidden;
}

/* Sidebar / Filters */
.filters-panel {
    width: 300px;
    align-self: flex-start;
    height: fit-content;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
    display: block;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.65rem;
    color: var(--text-secondary);
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

select {
    width: 100%;
    appearance: none;
    background: rgba(31, 29, 46, 0.6);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    backdrop-filter: blur(4px);
}

select:hover {
    border-color: rgba(196, 167, 231, 0.5);
    background: rgba(31, 29, 46, 0.8);
}

select:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(196, 167, 231, 0.3);
    background: rgba(31, 29, 46, 0.9);
}

select option {
    background: var(--bg-base);
}

/* Toggle Group */
.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toggle-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-mono);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.toggle-btn.active {
    border-color: transparent;
}

/* Specific colors for toggle buttons */
.toggle-btn[data-level="1"].active {
    background: var(--level-debug-bg);
    color: var(--level-debug);
    border-color: var(--level-debug);
}

.toggle-btn[data-level="2"].active {
    background: var(--level-info-bg);
    color: var(--level-info);
    border-color: var(--level-info);
}

.toggle-btn[data-level="3"].active {
    background: var(--level-warn-bg);
    color: var(--level-warn);
    border-color: var(--level-warn);
}

.toggle-btn[data-level="4"].active,
.toggle-btn[data-level="5"].active,
.toggle-btn[data-level="6"].active {
    background: var(--level-error-bg);
    color: var(--level-error);
    border-color: var(--level-error);
}

/* Buttons */
.btn, .tab-btn, .toggle-btn {
    outline: none;
}

.btn:focus-visible, .tab-btn:focus-visible, .toggle-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(196, 167, 231, 0.2);
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    width: 100%;
    margin-top: auto;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: var(--shadow-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-subtle);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* Logs Panel */
.logs-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logs-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(31, 29, 46, 0.8);
}

.log-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.log-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Log Table Display Grid */
.log-table-header,
.log-entry {
    display: grid;
    grid-template-columns: 130px 60px 130px 130px 180px 1fr;
    gap: 16px;
    align-items: start;
}

.log-table-header {
    padding: 12px 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    background: rgba(31, 29, 46, 0.6);
}

.log-entry {
    padding: 12px 1.5rem;
    border-bottom: 1px solid rgba(224, 222, 244, 0.04);
    transition: background 0.15s ease;
}

.log-entry:hover {
    background: var(--bg-surface-hover);
}

/* Columns */
.col-time {
    color: var(--text-secondary);
}

.col-level {
    font-weight: bold;
}

.col-sat {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.col-dev {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.col-mod {
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
    overflow-wrap: anywhere;
}

.col-msg {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

/* Log Levels Specific Styling */
.level-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.log-entry[data-level="1"] .level-badge {
    color: var(--level-debug);
    background: var(--level-debug-bg);
}

.log-entry[data-level="2"] .level-badge {
    color: var(--level-info);
    background: var(--level-info-bg);
}

.log-entry[data-level="3"] .level-badge {
    color: var(--level-warn);
    background: var(--level-warn-bg);
}

.log-entry[data-level="4"],
.log-entry[data-level="5"],
.log-entry[data-level="6"] .level-badge {
    color: var(--level-error);
    background: var(--level-error-bg);
}

/* Highlight critically failing logs slightly */
.log-entry[data-level="4"],
.log-entry[data-level="5"],
.log-entry[data-level="6"] {
    background: linear-gradient(90deg, rgba(235, 111, 146, 0.05) 0%, transparent 50%);
    border-left: 2px solid var(--level-error);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 1rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Tabs Container */
.tabs-container {
    display: flex;
    gap: 8px;
    background: rgba(31, 29, 46, 0.6);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
}

/* Status Panel */
.status-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.status-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
}

.status-card {
    background: rgba(31, 29, 46, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition);
}

.status-card:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(196, 167, 231, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.status-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.status-card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge.online {
    background: rgba(49, 116, 143, 0.15);
    color: #31748f;
    border: 1px solid rgba(49, 116, 143, 0.3);
}

.status-badge.offline {
    background: rgba(235, 111, 146, 0.15);
    color: #eb6f92;
    border: 1px solid rgba(235, 111, 146, 0.3);
}

.status-badge.unknown {
    background: rgba(110, 106, 134, 0.15);
    color: #6e6a86;
    border: 1px solid rgba(110, 106, 134, 0.3);
}

.status-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

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

.status-value {
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .dashboard {
        flex-direction: column;
    }

    .filters-panel {
        width: 100%;
        max-height: 250px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .filter-group {
        flex: 1;
        min-width: 120px;
    }

    .actions {
        width: 100%;
        border-top: none;
        padding-top: 0;
    }
}

.status-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.status-row>.status-card {
    flex: 0 0 135px;
    min-width: 135px;
    max-width: 135px;
}
/* Input Field styles matching select */
.input-field {
    width: 100%;
    appearance: none;
    background: rgba(31, 29, 46, 0.6);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.input-field:hover {
    border-color: rgba(196, 167, 231, 0.5);
    background: rgba(31, 29, 46, 0.8);
}

.input-field:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(196, 167, 231, 0.3);
    background: rgba(31, 29, 46, 0.9);
}

/* Voltage Database Grid Table */
.voltage-table-header,
.voltage-entry {
    display: grid;
    grid-template-columns: 50px 70px 70px 100px 1fr 220px;
    gap: 16px;
    align-items: center;
}

.voltage-table-header {
    padding: 12px 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    background: rgba(31, 29, 46, 0.6);
}

.voltage-entry {
    padding: 12px 1.5rem;
    border-bottom: 1px solid rgba(224, 222, 244, 0.04);
    transition: background 0.15s ease;
    font-size: 0.9rem;
}

.voltage-entry:hover {
    background: var(--bg-surface-hover);
}

.col-id {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-weight: 600;
}

.col-numeric {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.col-comments {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-gcs {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--level-info);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-gcs:hover {
    text-decoration: underline;
    color: var(--accent-primary);
}

/* ==========================================================
   Google Sign-In / Authentication CSS
   ========================================================== */
#auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 9, 14, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#auth-overlay.auth-overlay-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    text-align: center;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: authCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-subtle);
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.auth-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.auth-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

#google-signin-btn-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

#auth-error-msg {
    font-size: 0.85rem;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

#auth-error-msg.auth-error-hidden {
    display: none;
}

@keyframes authCardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================
   Voltage Database Expandable Details CSS
   ========================================================== */
.voltage-record-item {
    border-bottom: 1px solid rgba(224, 222, 244, 0.04);
}

.voltage-record-item .voltage-entry {
    border-bottom: none !important;
}

.voltage-details-panel {
    padding: 1.25rem 2rem;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px dashed var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.voltage-details-section {
    margin-bottom: 1rem;
}

.voltage-details-section:last-child {
    margin-bottom: 0;
}

.voltage-details-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.voltage-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.voltage-details-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.6rem 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voltage-details-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

/* Voltage Spatial Visualization Styles */
.voltage-details-layout {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.voltage-details-info {
    flex: 1.2;
    min-width: 320px;
}

.voltage-details-plot-container {
    flex: 1;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: rgba(15, 17, 26, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.25rem;
    position: relative;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.2);
}

.voltage-details-plot-container h4 {
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: var(--accent-primary);
    text-align: center;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.voltage-plot-canvas-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.voltage-plot-canvas {
    width: 100%;
    height: 100%;
    background: #0f111a;
    display: block;
    cursor: crosshair;
}

.voltage-color-bar-legend {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.25rem;
    padding: 0 0.5rem;
}

.voltage-color-bar {
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(to right, 
        rgb(0, 0, 143),   /* Blue (min) */
        rgb(0, 0, 255), 
        rgb(0, 255, 255), 
        rgb(255, 255, 0), 
        rgb(255, 0, 0), 
        rgb(127, 0, 0)    /* Red (max) */
    );
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.voltage-color-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.voltage-tooltip {
    position: absolute;
    background: rgba(10, 12, 18, 0.95);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 8px var(--accent-primary-dim);
    color: #fff;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.15s ease;
    line-height: 1.4;
    min-width: 140px;
}

/* Dialog / Modal Styling */
dialog.filter-modal {
    background: #1f1d2e;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: auto; /* center in viewport */
    backdrop-filter: var(--glass-blur);
}

dialog.filter-modal::backdrop {
    background: rgba(25, 23, 36, 0.75);
    backdrop-filter: blur(6px);
}

dialog.filter-modal h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
}

dialog.filter-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

dialog.filter-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}



