/* Heat Load App - Professional Enterprise Dashboard Theme */

:root {
    /* Brand & Layout Colors */
    --primary: #0f172a;
    /* Slate 900 - Deep Navy Sidebar */
    --primary-hover: #1e293b;
    /* Slate 800 */
    --accent: #2563eb;
    /* Blue 600 - Primary Actions */
    --accent-hover: #1d4ed8;
    /* Blue 700 */

    /* Backgrounds */
    --bg-body: #f8fafc;
    /* Slate 50 - Off white workspace */
    --bg-card: #ffffff;
    /* Pure white panels */
    --bg-sidebar: var(--primary);

    /* Text */
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-regular: #334155;
    /* Slate 700 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-sidebar: #e2e8f0;
    /* Slate 200 */

    /* Status Colors (Crucial for Heat Data) */
    --status-safe-bg: #dcfce7;
    --status-safe-text: #166534;
    --status-safe-border: #22c55e;

    --status-caution-bg: #fef3c7;
    --status-caution-text: #92400e;
    --status-caution-border: #f59e0b;

    --status-danger-bg: #ffedd5;
    --status-danger-text: #9a3412;
    --status-danger-border: #f97316;

    --status-critical-bg: #fee2e2;
    --status-critical-text: #991b1b;
    --status-critical-border: #dc2626;

    /* Semantic / Theme Mapping */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Borders & Shadows */
    --border-light: #e2e8f0;
    /* Slate 200 */
    --border-dark: #cbd5e1;
    /* Slate 300 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Variables */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Typography */
    --font-heading: 'Inter', -apple-system, system-ui, sans-serif;
    --font-body: 'Inter', -apple-system, system-ui, sans-serif;
}

/* Dark Mode - Overrides */
[data-theme="dark"] {
    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-sidebar: #020617;
    /* Slate 950 */

    --text-primary: #f8fafc;
    --text-regular: #cbd5e1;
    --text-muted: #94a3b8;

    --border-light: #334155;
    --border-dark: #475569;

    /* Inverted Status Backs for dark mode readability */
    --status-safe-bg: rgba(34, 197, 94, 0.15);
    --status-safe-text: #4ade80;

    --status-caution-bg: rgba(245, 158, 11, 0.15);
    --status-caution-text: #fbbf24;

    --status-danger-bg: rgba(249, 115, 22, 0.15);
    --status-danger-text: #fb923c;

    --status-critical-bg: rgba(220, 38, 38, 0.15);
    --status-critical-text: #f87171;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-regular);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

/* ------------------------------------
 * Core App Layout (Sidebar + Main)
 * ------------------------------------ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background-color: rgba(0, 0, 0, 0.1);
    /* Slightly darker header area */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
    margin-right: 12px;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.125rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: -2px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: var(--primary-hover);
    color: #fff;
}

.nav-item.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: #fff;
    border-left-color: var(--accent);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    opacity: 0.7;
}

.nav-item:hover svg,
.nav-item.active svg {
    opacity: 1;
}

.nav-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    padding: 1rem 1.5rem 0.5rem;
    margin-top: 1rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0;
    background: transparent;
    border: none;
    color: var(--text-sidebar);
    cursor: pointer;
    font-size: 0.875rem;
}

.theme-toggle-btn svg {
    width: 18px;
    margin-right: 10px;
}

.theme-toggle-btn:hover {
    color: #fff;
}

/* Main Content Area */
.app-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header Strip */
.content-header {
    height: var(--header-height);
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Page Body Layout */
.page-body {
    padding: 0;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Dashboard uses its own internal container spacing (.saas-container).
   Other pages rely on the shared page-body wrapper for workspace gutters. */
body:not([data-page="dashboard"]) .page-body {
    padding: 1.25rem 2rem 2rem;
}

@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    body:not([data-page="dashboard"]) .page-body {
        padding: 1rem;
    }
}

/* ------------------------------------
 * Components
 * ------------------------------------ */

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.01);
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Widgets */
.stat-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Status Indicators */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    background-color: currentColor;
}

.status-safe {
    color: var(--status-safe-text);
    background-color: var(--status-safe-bg);
    border-color: var(--status-safe-border);
}

.status-caution {
    color: var(--status-caution-text);
    background-color: var(--status-caution-bg);
    border-color: var(--status-caution-border);
}

.status-danger {
    color: var(--status-danger-text);
    background-color: var(--status-danger-bg);
    border-color: var(--status-danger-border);
}

.status-critical {
    color: var(--status-critical-text);
    background-color: var(--status-critical-bg);
    border-color: var(--status-critical-border);
}

/* Status Text Colors */
.text-safe {
    color: var(--status-safe-border);
}

.text-caution {
    color: var(--status-caution-border);
}

.text-danger {
    color: var(--status-danger-border);
}

.text-critical {
    color: var(--status-critical-border);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    background-color: rgba(0, 0, 0, 0.02);
}

.data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

/* Dashboard Specifics - Premium HLI Panel */
.hli-panel-dynamic {
    transition: background 0.5s ease-in-out, box-shadow 0.5s ease;
}

.hero-hli-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .hero-hli-panel {
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
}

/* Dynamic Panel Backglows */
.hero-hli-panel.panel-safe {
    box-shadow: inset 0 0 100px rgba(34, 197, 94, 0.15), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    border-color: rgba(34, 197, 94, 0.2);
}

.hero-hli-panel.panel-caution {
    box-shadow: inset 0 0 100px rgba(245, 158, 11, 0.15), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    border-color: rgba(245, 158, 11, 0.2);
}

.hero-hli-panel.panel-danger {
    box-shadow: inset 0 0 100px rgba(249, 115, 22, 0.15), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    border-color: rgba(249, 115, 22, 0.2);
}

.hero-hli-panel.panel-critical {
    box-shadow: inset 0 0 100px rgba(220, 38, 38, 0.15), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    border-color: rgba(220, 38, 38, 0.2);
}

/* Panel Header & Live Indicator */
.hli-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    z-index: 2;
}

.hli-panel-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #cbd5e1;
    margin: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .live-indicator {
    background: rgba(255, 255, 255, 0.05);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-safe-border);
    box-shadow: 0 0 8px var(--status-safe-border);
    animation: pulse 0.8s infinite;
}

.live-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #f8fafc;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Heat Orb Visualizer */
.heat-orb-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.orb-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.outer-ring {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: orb-pulse-slow 1s ease-in-out infinite alternate;
}

.inner-ring {
    width: 170px;
    height: 170px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 80%);
    animation: orb-pulse-fast 0.7s ease-in-out infinite alternate;
}

.orb-core {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 3;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.5s ease;
}

@keyframes orb-pulse-slow {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.4;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
    }
}

@keyframes orb-pulse-fast {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
}

/* Orb Status Colors */
.orb-status-safe .outer-ring {
    background: radial-gradient(circle, rgba(34, 197, 94, 0.5) 0%, transparent 70%);
}

.orb-status-safe .inner-ring {
    background: radial-gradient(circle, rgba(34, 197, 94, 0.6) 0%, transparent 65%);
}

.orb-status-safe .orb-core {
    border-color: rgba(34, 197, 94, 0.8);
    box-shadow: 0 0 60px rgba(34, 197, 94, 0.6), inset 0 0 30px rgba(34, 197, 94, 0.15);
}

.orb-status-caution .outer-ring {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.5) 0%, transparent 70%);
}

.orb-status-caution .inner-ring {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.6) 0%, transparent 65%);
}

.orb-status-caution .orb-core {
    border-color: rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.6), inset 0 0 30px rgba(245, 158, 11, 0.15);
}

.orb-status-danger .outer-ring {
    background: radial-gradient(circle, rgba(249, 115, 22, 0.5) 0%, transparent 70%);
}

.orb-status-danger .inner-ring {
    background: radial-gradient(circle, rgba(249, 115, 22, 0.6) 0%, transparent 65%);
}

.orb-status-danger .orb-core {
    border-color: rgba(249, 115, 22, 0.8);
    box-shadow: 0 0 60px rgba(249, 115, 22, 0.6), inset 0 0 30px rgba(249, 115, 22, 0.15);
}

.orb-status-critical .outer-ring {
    background: radial-gradient(circle, rgba(220, 38, 38, 0.5) 0%, transparent 70%);
}

.orb-status-critical .inner-ring {
    background: radial-gradient(circle, rgba(220, 38, 38, 0.6) 0%, transparent 65%);
}

.orb-status-critical .orb-core {
    border-color: rgba(220, 38, 38, 0.8);
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.6), inset 0 0 30px rgba(220, 38, 38, 0.15);
}

/* Gauge Center Content (HTML overlay instead of SVG text for better styling) */
.gauge-center-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin: 0;
    color: #f8fafc;
    background-clip: text;
    -webkit-background-clip: text;
    transition: color 0.5s ease;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.hero-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #cbd5e1;
    margin-top: 4px;
    font-weight: 600;
}

/* Status Colors & Glows */
.safe {
    color: var(--status-safe-border);
}

.caution {
    color: var(--status-caution-border);
}

.danger {
    color: var(--status-danger-border);
}

.critical {
    color: var(--status-critical-border);
}

.svg-gauge-fg.safe {
    stroke: var(--status-safe-border);
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.4));
}

.svg-gauge-fg.caution {
    stroke: var(--status-caution-border);
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
}

.svg-gauge-fg.danger {
    stroke: var(--status-danger-border);
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.4));
}

.svg-gauge-fg.critical {
    stroke: var(--status-critical-border);
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.6));
}

/* Panel Footer & Glass Refresh Button */
.hli-panel-footer {
    display: flex;
    justify-content: center;
    width: 100%;
    z-index: 2;
    margin-top: 1rem;
}

.hli-lag-warning {
    color: var(--status-danger-border);
    font-size: 0.8rem;
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    min-height: 1.2em;
}

.btn-glass-refresh {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-dark);
    color: var(--text-primary);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .btn-glass-refresh {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-regular);
}

.btn-glass-refresh:hover {
    background: var(--bg-card);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn-glass-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--border-dark);
}

.profile-card.safe::before {
    background-color: var(--status-safe-border);
}

.profile-card.caution::before {
    background-color: var(--status-caution-border);
}

.profile-card.danger::before {
    background-color: var(--status-danger-border);
}

.profile-card.critical::before {
    background-color: var(--status-critical-border);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.profile-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.profile-stats {
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
    margin-top: 1rem;
}

.profile-stat-item {
    flex: 1;
}

.profile-stat-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
}

.profile-stat-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Layout Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.main-chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .main-chart-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero-value {
        font-size: 3rem;
    }
}

/* loading states */
.loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Login Box */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-body);
    padding: 1rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.auth-header {
    padding: 2rem;
    text-align: center;
    background-color: var(--primary);
    color: white;
}

.auth-body {
    padding: 2rem;
}

/* ------------------------------------
 * Print & Report Styles
 * ------------------------------------ */
/* ------------------------------------
 * Modal & Dialog Redesign (SaaS Pro)
 * ------------------------------------ */
.saas-dialog {
    border: none;
    background: transparent;
    padding: 0;
    max-width: 550px;
    width: 90%;
    margin: auto;
    /* Centers the dialog */
    overflow: visible;
}

.saas-dialog.dialog-wide {
    max-width: 960px;
}

.saas-dialog::backdrop {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: backdrop-fade 0.3s ease-out;
}

.dialog-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform-origin: center;
    animation: modal-appear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dialog-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
}

.dialog-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.dialog-body {
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

@keyframes backdrop-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Pipeline Specifics */
.pipeline-grid {
    display: grid;
    gap: 1.5rem;
}

.pipeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.pipe-label {
    font-weight: 600;
    color: var(--text-primary);
}

.pipe-data {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lag-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Chart Container in Modal */
.chart-stack {
    display: grid;
    gap: 2rem;
}

.chart-box h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

@media print {

    /* Set page margins to standard A4 size */
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-family: Arial, sans-serif !important;
        min-height: auto;
    }

    /* Hide Navigation, Controls, and Interactivity */
    .app-sidebar,
    .content-header,
    .header-actions,
    .btn,
    button,
    .rap-actions,
    .form-group,
    input,
    select,
    .auth-wrapper,
    [style*="display:none"],
    #rap-message,
    #rap-empty-note {
        display: none !important;
    }

    /* Fix Main Content Layout */
    .app-content,
    .page-body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    /* Remove Card Backgrounds & Shadows */
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background-color: transparent !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid;
    }

    .card-header {
        background-color: #f8f9fa !important;
        border-bottom: 2px solid #ccc !important;
        padding: 10px 15px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .card-title {
        color: #000 !important;
        font-size: 14pt !important;
        margin: 0 !important;
    }

    .card-body {
        padding: 15px !important;
    }

    /* Print Header (Visible Only in PDF) */
    .print-report-header {
        display: block !important;
        text-align: center;
        margin-bottom: 30px;
        border-bottom: 3px solid #000;
        padding-bottom: 15px;
        page-break-after: avoid;
    }

    .print-report-header h1 {
        font-size: 24pt;
        margin: 0 0 5px 0;
        color: #000;
    }

    .print-report-header p {
        font-size: 11pt;
        color: #555;
        margin: 0;
    }

    /* Ensure specific grid layouts behave nicely */
    .rap-kpi-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .rap-kpi {
        flex: 1 1 calc(25% - 10px) !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .rap-kpi-label {
        font-size: 8pt !important;
        color: #333 !important;
    }

    .rap-kpi-value {
        font-size: 14pt !important;
        color: #000 !important;
    }

    /* Charts sizing for Print */
    .chart-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 250px !important;
        page-break-inside: avoid;
        margin: 0 auto;
    }

    canvas {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
    }

    /* Tables */
    .data-table {
        border-collapse: collapse !important;
        width: 100% !important;
        page-break-inside: auto;
    }

    .data-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .data-table th,
    .data-table td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
        font-size: 9pt !important;
        color: #000 !important;
    }

    .data-table th {
        background-color: #f1f3f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Blocking Overlay for Long Operations */
.blocking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}


/* Status Pills */
.status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
}

.status-pill.danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-pill.safe,
.status-pill.fresh {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pill.critical {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.status-pill.caution {
    background-color: var(--warning-light);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ------------------------------------
 * SaaS Dashboard Layout (Restored)
 * ------------------------------------ */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.saas-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

.saas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.saas-column-hero {
    display: flex;
    flex-direction: column;
}

.saas-column-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Card System */
.saas-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background-color: rgba(0, 0, 0, 0.01);
    border-bottom: 1px solid var(--border-light);
}

.label-caps {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.live-tag {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

.mono-tag {
    font-size: 0.7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--text-muted);
}

.text-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.text-link:hover {
    color: var(--accent-hover);
}

/* Status dot in header buttons */
.status-dot-mini {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-left: 4px;
    background: #10b981;
}

/* Summary Stats Grid */
.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.stat-box {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.015);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.stat-box:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}

.stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.peak-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Color utilities */
.color-danger {
    color: var(--danger) !important;
}

.color-warning {
    color: var(--warning) !important;
}

.color-success {
    color: var(--success) !important;
}

/* Profile Risk Board – Modern SaaS Grid */
.profiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 0.5rem 0;
}

.profile-card-clean {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    /* subtle top accent placeholder */
    border-top: 4px solid var(--border-light);
}

.profile-card-clean:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 8px 16px rgba(0, 0, 0, 0.05);
    border-color: var(--border-focus);
}

/* Status Accents for Profile Cards */
.profile-card-clean:has(.status-safe) {
    border-top-color: #10b981;
}

.profile-card-clean:has(.status-caution) {
    border-top-color: #f59e0b;
}

.profile-card-clean:has(.status-danger) {
    border-top-color: #ef4444;
}

.profile-card-clean:has(.status-critical) {
    border-top-color: #f43f5e;
}

.p-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.p-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.p-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.p-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.p-stat-lbl {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.p-stat-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Loading state */
.loading-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.dots-spinner {
    width: 40px;
    height: 10px;
    display: flex;
    gap: 6px;
}

.dots-spinner::before,
.dots-spinner::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: dot-bounce 1.4s ease-in-out infinite both;
}

.dots-spinner::after {
    animation-delay: 0.2s;
}

@keyframes dot-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* HERO HLI PANEL & ORB GAUGE – Dark Operations Room */
.hero-hli-panel {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.hero-hli-panel .card-header-clean {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.hero-hli-panel .label-caps {
    color: #94a3b8;
}

.hero-hli-panel .live-tag {
    color: #94a3b8;
}

/* Panel status overrides - Subtle status indication via border and very faint glow */
.panel-safe {
    background: #0f172a !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(16, 185, 129, 0.02) !important;
}

.panel-caution {
    background: #0f172a !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(245, 158, 11, 0.02) !important;
}

.panel-danger {
    background: #0f172a !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(239, 68, 68, 0.02) !important;
}

.panel-critical {
    background: #0f172a !important;
    border-color: rgba(244, 63, 94, 0.5) !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(244, 63, 94, 0.05) !important;
    animation: panel-danger-pulse 4s ease-in-out infinite alternate;
}

@keyframes panel-danger-pulse {
    0% {
        border-color: rgba(244, 63, 94, 0.3);
    }

    100% {
        border-color: rgba(244, 63, 94, 0.6);
    }
}

.hero-gauge-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    aspect-ratio: 1;
    margin: 1.5rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.saas-gauge {
    position: relative;
    width: 220px;
    height: 220px;
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #1e293b 0%, #0f172a 100%) !important;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.6s ease, transform 0.4s ease;
}

/* Status-based orb glow */
.orb-status-safe {
    --orb-color: #10b981;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(16, 185, 129, 0.25), 0 0 80px rgba(16, 185, 129, 0.1);
}

.orb-status-safe .gauge-track-outer {
    border-color: var(--orb-color);
    transform: rotate(0deg);
}

.orb-status-caution {
    --orb-color: #f59e0b;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(245, 158, 11, 0.3), 0 0 80px rgba(245, 158, 11, 0.1);
}

.orb-status-danger {
    --orb-color: #ef4444;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 0 50px rgba(239, 68, 68, 0.35), 0 0 100px rgba(239, 68, 68, 0.15);
}

.orb-status-critical {
    --orb-color: #f43f5e;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 0 50px rgba(244, 63, 94, 0.3), 0 0 100px rgba(244, 63, 94, 0.15);
    animation: orb-pulse 4s ease-in-out infinite alternate;
}

@keyframes orb-pulse {
    0% {
        transform: scale(1);
        box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 0 30px rgba(244, 63, 94, 0.2);
    }

    100% {
        transform: scale(1.02);
        box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 0 60px rgba(244, 63, 94, 0.4);
    }
}

.gauge-tracks {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 206px;
    height: 206px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gauge-track-outer {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--orb-color);
    border-right-color: var(--orb-color);
    border-bottom-color: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(255, 255, 255, 0.05);
    transform: rotate(45deg);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px var(--orb-color));
}

.gauge-track-inner {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gauge-content {
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: #f1f5f9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.gauge-value.safe {
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.gauge-value.caution {
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.gauge-value.danger {
    color: #f87171;
    text-shadow: 0 0 20px rgba(248, 113, 113, 0.3);
}

.gauge-value.critical {
    color: #fb7185;
    text-shadow: 0 0 25px rgba(251, 113, 133, 0.4);
}

.hero-value.safe {
    color: #10b981;
}

.hero-value.caution {
    color: #fbbf24;
}

.hero-value.danger {
    color: #f87171;
}

.hero-value.critical {
    color: #fb7185;
}

.gauge-unit {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 2px;
}

.gauge-status {
    margin-top: 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    background: rgba(0, 0, 0, 0.3);
    color: var(--orb-color);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.lag-warning {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #f59e0b;
    margin-top: 0.5rem;
}

.weather-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.weather-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.weather-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.weather-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
}

.hero-hli-panel .divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.hero-footer {
    width: 100%;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.w-full {
    width: 100%;
    justify-content: center;
}

.hero-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.hero-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.saas-main-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

/* Global Button variants - ensuring they exist in style.css */
.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--border-focus);
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* ------------------------------------
 * High-Fidelity Modal System (saas-dialog)
 * ------------------------------------ */
.saas-dialog {
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg), 0 20px 50px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    outline: none;
    overflow: hidden;
}

.saas-dialog.dialog-wide {
    max-width: 1000px;
}

.saas-dialog::backdrop {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.dialog-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.01);
}

.dialog-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.dialog-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.dialog-footer {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.01);
}

/* ------------------------------------
 * Professional Data Grids (saas-table)
 * ------------------------------------ */
.table-container-clean {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.saas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.saas-table th,
.saas-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.saas-table th {
    background: #f8fafc;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.saas-table tbody tr:last-child td {
    border-bottom: none;
}

.saas-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.01);
}

/* Matrix Table Specifics */
.matrix-cell {
    text-align: center;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    width: 80px;
    border-left: 1px solid rgba(0, 0, 0, 0.03);
}

.matrix-cell-safe {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.matrix-cell-caution {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.matrix-cell-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.matrix-cell-critical {
    background: rgba(244, 63, 94, 0.1);
    color: #e11d48;
}

.loading-spinner-sm {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
