/* Global CSS Variables & Settings */
:root {
    --bg-dark: #0a0b10;
    --bg-space: radial-gradient(circle at top right, #1a1e2e 0%, #0a0b10 100%);
    --bg-card: rgba(22, 28, 45, 0.45);
    --bg-card-hover: rgba(28, 36, 58, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-glow: rgba(59, 130, 246, 0.3);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    
    /* Vibrant harmonized colors */
    --color-blue: #3b82f6;
    --color-cyan: #06b6d4;
    --color-green: #10b981;
    --color-yellow: #f59e0b;
    --color-red: #ef4444;
    --color-purple: #8b5cf6;
    
    /* Font sizes & spaces */
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-space);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* App Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    background: rgba(10, 11, 16, 0.85);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    backdrop-filter: blur(20px);
    z-index: 10;
}

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

.logo-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ecami-logo-img:hover {
    transform: scale(1.08);
}

.logo-text h1 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Sidebar File Loading Card */
.upload-sidebar-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: var(--transition-smooth);
}

.upload-sidebar-card:hover, .upload-sidebar-card.dragover {
    border-color: var(--color-cyan);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.upload-icon {
    width: 28px;
    height: 28px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-sidebar-card:hover .upload-icon {
    color: var(--color-cyan);
    transform: translateY(-2px);
    transition: var(--transition-smooth);
}

.upload-title {
    font-family: var(--font-header);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.custom-file-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-cyan);
    color: #050508;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.custom-file-upload:hover {
    background: #08d9fd;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* Nav Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    width: 100%;
}

.nav-item:hover:not(.disabled) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--color-blue);
    box-shadow: inset 5px 0 15px rgba(59, 130, 246, 0.05);
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Selectors Container */
.selector-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.selector-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.premium-select {
    background: #0f131a;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.premium-select:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pulse-dot.green {
    background: var(--color-green);
    box-shadow: 0 0 8px var(--color-green);
    animation: pulse 2s infinite;
}

.pulse-dot.yellow {
    background: var(--color-yellow);
    box-shadow: 0 0 8px var(--color-yellow);
    animation: pulse 2s infinite;
}

.pulse-dot.red {
    background: var(--color-red);
    box-shadow: 0 0 8px var(--color-red);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.app-version {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.2);
    font-family: var(--font-mono);
}

.developer-credit {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 6px;
    font-family: var(--font-mono);
    transition: var(--transition-smooth);
}

.developer-credit:hover {
    color: var(--color-cyan);
}

.credit-icon {
    width: 9px;
    height: 9px;
}

/* Main Content Area */
.main-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    max-height: 100vh;
}

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

#header-page-title {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 700;
}

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

.text-sm {
    font-size: 0.8rem;
}

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

.quick-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quick-badge i {
    width: 14px;
    height: 14px;
}

/* Health statuses */
.text-success { color: var(--color-green); }
.text-warning { color: var(--color-yellow); }
.text-danger { color: var(--color-red); }
.text-blue { color: var(--color-blue); }

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-green); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-yellow); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--color-red); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Glass Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-glow);
    box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--color-cyan);
}

/* Tabs Toggle Display */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active-tab {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 11, 16, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.glass-loader {
    background: var(--bg-card);
    border: 1px solid var(--border-color-glow);
    border-radius: 20px;
    padding: 40px;
    width: 450px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--color-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-blue), var(--color-cyan));
    border-radius: 4px;
    transition: width 0.1s ease;
}

.progress-percent {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Large Welcome Container */
.welcome-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.welcome-card {
    text-align: center;
    max-width: 700px;
    padding: 48px;
    background: rgba(22, 28, 45, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.welcome-icon-glow {
    width: 80px;
    height: 80px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.2);
}

.welcome-icon-glow i {
    width: 40px;
    height: 40px;
    color: var(--color-cyan);
}

.welcome-card h2 {
    font-family: var(--font-header);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    text-align: left;
}

.feat-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feat-item i {
    color: var(--color-blue);
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.feat-item h4 {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
}

.feat-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.upload-trigger-large {
    background: linear-gradient(135deg, var(--color-blue) 0%, #1d4ed8 100%);
    color: #fff;
    padding: 16px 32px;
    border-radius: 12px;
    font-family: var(--font-header);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    transition: var(--transition-smooth);
}

.upload-trigger-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.upload-trigger-large i {
    width: 20px;
    height: 20px;
}

/* Stats Cards Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    border-color: var(--border-color-glow);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.bg-blue { background: rgba(59, 130, 246, 0.1); color: var(--color-blue); }
.bg-green { background: rgba(16, 185, 129, 0.1); color: var(--color-green); }
.bg-yellow { background: rgba(245, 158, 11, 0.1); color: var(--color-yellow); }
.bg-red { background: rgba(239, 68, 68, 0.1); color: var(--color-red); }

.stat-details h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.stat-value {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 700;
}

/* Chart Layouts */
.dashboard-charts-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-wrapper-large {
    position: relative;
    height: 380px;
    width: 100%;
}

.chart-wrapper-small {
    position: relative;
    height: 200px;
    width: 100%;
}

/* Tables Styling */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.scrollable-table {
    max-height: 280px;
    overflow-y: auto;
}

.scrollable-table-large {
    max-height: 350px;
    overflow-y: auto;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.premium-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.premium-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    color: var(--text-primary);
}

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

.view-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.view-btn:hover {
    background: var(--color-blue);
    color: #fff;
}

/* Diagnostics Layout */
.diagnostics-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.battery-status-strip {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 24px;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

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

.strip-item .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.strip-item .value {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 600;
}

.border-glow-green { border-bottom: 3px solid var(--color-green); }
.border-glow-yellow { border-bottom: 3px solid var(--color-yellow); }
.border-glow-red { border-bottom: 3px solid var(--color-red); }

.diag-report-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diag-explanation {
    font-size: 0.9rem;
    line-height: 1.6;
}

.recommendation-box {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    align-items: flex-start;
}

.recommendation-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.recommendation-content h5 {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.recommendation-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Metrics Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    height: 100%;
}

.metric-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

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

/* Alarms Breakdown */
.alarms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.alarm-card-detail {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alarm-card-detail.active {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.alarm-card-detail.warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.alarm-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alarm-info-detail h5 {
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 600;
}

.alarm-info-detail p {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Imbalance Layout */
.balance-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.balance-stats {
    display: flex;
    gap: 24px;
}

.b-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.b-stat .lbl {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.b-stat .val {
    font-family: var(--font-header);
    font-size: 1.2rem;
    font-weight: 700;
}

.alert-status-box {
    display: flex;
    gap: 12px;
    border-radius: 12px;
    padding: 16px;
    align-items: flex-start;
}

.alert-status-box.success {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--color-green);
}

.alert-status-box.warning {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--color-yellow);
}

.alert-status-box.danger {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-red);
}

.alert-status-box h5 {
    font-family: var(--font-header);
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-status-box p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Solar Cycles Layout */
.solar-cycles-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.cycles-comparison-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cycle-comparison-gauge {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
}

.gauge-center-text {
    position: absolute;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gauge-center-text .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.gauge-center-text .value {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
}

.cycles-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cycle-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.energy-analysis-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Margin Utilities */
.margin-top-20 { margin-top: 20px; }
.margin-top-40 { margin-top: 40px; }

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Technical Report & Ranking Tab Styles */
.report-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 12px;
}

.btn-print {
    background: linear-gradient(135deg, var(--color-purple) 0%, #6d28d9 100%);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
    border: none;
    height: 48px;
    padding: 0 24px;
}

.btn-print:hover {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
}

.technical-report-sheet {
    background: rgba(22, 28, 45, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.report-print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 24px;
}

.report-meta-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.report-logo-icon {
    color: var(--color-purple);
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.report-meta-logo h2 {
    font-family: var(--font-header);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.report-meta-logo span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.report-meta-date {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.report-section-title {
    font-family: var(--font-header);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid var(--color-purple);
    padding-left: 8px;
    margin-bottom: 16px;
}

.report-summary-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.rep-stat-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rep-stat-box .lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.rep-stat-box .val {
    font-family: var(--font-header);
    font-size: 1.4rem;
    font-weight: 700;
}

.report-statement {
    font-size: 0.9rem;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 8px;
    border-left: 3px solid var(--color-cyan);
}

/* Ranking Table Specifics */
.ranking-table th {
    background: rgba(139, 92, 246, 0.05);
}

.score-cell-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-bar-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.score-percent {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
}

.protocol-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.protocol-box h5 {
    font-family: var(--font-header);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.protocol-box p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.report-signature-block {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.sig-line {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 250px;
}

.sig-line p {
    font-size: 0.85rem;
    font-weight: 500;
}

.sig-line span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.margin-top-12 { margin-top: 12px; }

/* ==========================================================================
   PRINT MEDIA STYLES - Ensures professional paper printouts of Technical Report
   ========================================================================== */
@media print {
    /* Hide layout chrome and controls */
    .sidebar,
    .main-header,
    .report-controls-bar,
    .no-print,
    button,
    .view-btn {
        display: none !important;
    }
    
    /* Expand content area to fill paper */
    .app-container {
        display: block !important;
    }
    
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        color: #000 !important;
        overflow: visible !important;
        max-height: none !important;
    }
    
    /* Make tab visible unconditionally during printing */
    #tab-global-report {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Force page sheet styles to suit white paper */
    .technical-report-sheet {
        background: #fff !important;
        color: #000 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    .report-print-header {
        border-bottom: 2px solid #000 !important;
    }
    
    .report-logo-icon {
        color: #000 !important;
        filter: none !important;
    }
    
    .report-meta-logo h2 {
        color: #000 !important;
    }
    
    .report-meta-logo span {
        color: #555 !important;
    }
    
    .report-meta-date {
        color: #333 !important;
    }
    
    .report-section-title {
        color: #000 !important;
        border-left: 4px solid #000 !important;
    }
    
    .report-summary-box {
        background: #f9fafb !important;
        border: 1px solid #ddd !important;
        color: #000 !important;
    }
    
    .rep-stat-box {
        background: #fff !important;
        border: 1px solid #eee !important;
        color: #000 !important;
    }
    
    .rep-stat-box .lbl {
        color: #555 !important;
    }
    
    .rep-stat-box .val {
        color: #000 !important;
    }
    
    .report-statement {
        background: #f3f4f6 !important;
        border-left: 4px solid #3b82f6 !important;
        color: #111 !important;
    }
    
    /* Ranking Table Printing */
    .premium-table {
        color: #000 !important;
    }
    
    .premium-table th {
        background: #f3f4f6 !important;
        border-bottom: 2px solid #000 !important;
        color: #000 !important;
    }
    
    .premium-table td {
        border-bottom: 1px solid #ddd !important;
        color: #000 !important;
    }
    
    .score-bar-track {
        background: #eee !important;
        border: 1px solid #ccc !important;
    }
    
    .score-bar-fill {
        /* CSS backgrounds usually don't print unless forced, so we use print styles */
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .score-percent {
        color: #000 !important;
    }
    
    .badge {
        background: none !important;
        border: 1px solid #000 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .badge-success { background: #d1fae5 !important; color: #065f46 !important; border: 1px solid #10b981 !important; }
    .badge-warning { background: #fef3c7 !important; color: #92400e !important; border: 1px solid #f59e0b !important; }
    .badge-danger { background: #fee2e2 !important; color: #991b1b !important; border: 1px solid #ef4444 !important; }
    
    .protocol-box {
        background: #fff !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
    
    .protocol-box h5 {
        color: #000 !important;
    }
    
    .protocol-box p {
        color: #333 !important;
    }
    
    .report-signature-block {
        border-top: 1px dashed #000 !important;
        margin-top: 60px !important;
        page-break-inside: avoid;
    }
    
    .sig-line p {
        color: #000 !important;
    }
    
    .sig-line span {
        color: #555 !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
    }
}

/* Custom ECAMI Brand Hover Micro-animations */
.ecami-logo-svg {
    transition: var(--transition-smooth);
}

.sidebar:hover .ecami-logo-svg {
    transform: rotate(12deg) scale(1.05);
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.45));
}

/* Word Export Button & Report Charts Grid */
.btn-word {
    background: linear-gradient(135deg, var(--color-blue) 0%, #1e40af 100%);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
    border: none;
    height: 48px;
    padding: 0 24px;
}

.btn-word:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
}

.report-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.report-charts-grid .chart-box {
    background: rgba(255, 255, 255, 0.01) !important;
    padding: 20px !important;
}

.report-charts-grid h5 {
    font-family: var(--font-header);
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

@media print {
    .report-charts-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        page-break-inside: avoid;
    }
    .report-charts-grid .chart-box {
        border: 1px solid #ddd !important;
        background: #fff !important;
        color: #000 !important;
    }
    .report-charts-grid h5 {
        color: #000 !important;
    }
}

/* Copyright Developer Name Glow Animation */
.glow-developer {
    font-weight: 700;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 30%, #a855f7 70%, #06b6d4 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShine 4s linear infinite, glowPulse 1.5s ease-in-out infinite alternate;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.3s ease;
}

.glow-developer:hover {
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.95)) brightness(1.2);
}

@keyframes textShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes glowPulse {
    from {
        filter: drop-shadow(0 0 2px rgba(6, 182, 212, 0.4));
    }
    to {
        filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8));
    }
}
/* ==========================================
   INTERACTIVE BATTERY RACK (Inspiración Siemens SCADA & Tesla Energy)
   ========================================== */
.battery-rack-card {
    background: rgba(13, 14, 20, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5) !important;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.rack-visualization-container {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 24px;
    margin-top: 15px;
    min-height: 250px;
}

/* Rack Cabinet Frame */
.rack-frame {
    background: linear-gradient(180deg, #1e2230 0%, #0d0f14 100%);
    border: 4px solid #2e354a;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column; /* Top down stack */
    gap: 12px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5);
    max-height: 340px;
    overflow-y: auto;
    position: relative;
}

/* Cabinet side rails */
.rack-frame::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #475170;
    opacity: 0.3;
}
.rack-frame::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #475170;
    opacity: 0.3;
}

/* Pylontech Module Rack Faceplate */
.rack-module {
    background: linear-gradient(90deg, #13161c 0%, #1c202a 10%, #13161c 50%, #1c202a 90%, #13161c 100%);
    border: 2px solid #282f3d;
    border-radius: 6px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
    user-select: none;
}

/* Module rack mounting ears and handles */
.rack-module::before {
    content: '';
    position: absolute;
    left: -4px;
    width: 4px;
    height: 35px;
    background: #3b4356;
    border-radius: 2px 0 0 2px;
}
.rack-module::after {
    content: '';
    position: absolute;
    right: -4px;
    width: 4px;
    height: 35px;
    background: #3b4356;
    border-radius: 0 2px 2px 0;
}

.rack-module-handles {
    position: absolute;
    left: 6px;
    width: 4px;
    height: 30px;
    border: 2px solid #4a556e;
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.rack-module-handles-right {
    position: absolute;
    right: 6px;
    width: 4px;
    height: 30px;
    border: 2px solid #4a556e;
    border-left: none;
    border-radius: 0 4px 4px 0;
}

/* Module Active highlight (glowing border) */
.rack-module.active {
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4), inset 0 0 8px rgba(6, 182, 212, 0.15);
    background: linear-gradient(90deg, #151d2a 0%, #1c2738 10%, #151d2a 50%, #1c2738 90%, #151d2a 100%);
}

.rack-module:hover:not(.active) {
    border-color: var(--color-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

/* Digital Display OLED Screen on the Module */
.rack-module-screen {
    background: #04080c;
    border: 1px solid #1a293b;
    border-radius: 4px;
    width: 170px;
    height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8px;
    font-family: var(--font-mono);
    color: #06b6d4;
    text-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
    font-size: 0.64rem;
    line-height: 1.2;
    margin-left: 20px;
}

.rack-module-screen .scr-row {
    display: flex;
    justify-content: space-between;
}

.rack-module-screen .val {
    font-weight: 700;
    color: #f3f4f6;
}

/* LEDs status indicators */
.rack-module-leds {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 10px;
}

.led-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.led-indicator span {
    font-size: 0.45rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.led-bulb {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1f2937;
}

.led-bulb.run.green {
    background: var(--color-green);
    box-shadow: 0 0 6px var(--color-green);
    animation: ledPulse 1.2s infinite;
}

.led-bulb.alm.active-alm {
    background: var(--color-yellow);
    box-shadow: 0 0 6px var(--color-yellow);
}

.led-bulb.alm.active-crit {
    background: var(--color-red);
    box-shadow: 0 0 6px var(--color-red);
    animation: ledPulse 0.5s infinite;
}

@keyframes ledPulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Module label/names */
.rack-module-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-left: 12px;
}

.rack-module-meta h5 {
    font-family: var(--font-header);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rack-module-meta span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* SCADA Terminals */
.rack-module-terminals {
    display: flex;
    gap: 12px;
    align-items: center;
}

.terminal-knob {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #111;
    position: relative;
}

.terminal-knob::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
}

.terminal-knob.pos {
    background: #991b1b;
}

.terminal-knob.neg {
    background: #111827;
}

/* Summary Panel Styles */
.rack-summary-panel {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rack-summary-panel h4 {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    color: var(--text-primary);
}

.summary-details-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

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

.summary-row .val {
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ==========================================================================
   FORENSIC DIAGNOSTIC SCADA PORTAL STYLES (Siemens SCADA & Tesla Energy)
   ========================================================================== */

.forensic-dashboard-container {
    animation: fadeIn 0.5s ease-out;
}

.forensic-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.forensic-title-icon {
    display: flex;
    align-items: center;
    gap: 16px;
}

.forensic-title-icon h4 {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.forensic-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 24px;
    align-items: start;
}

.forensic-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* SCADA Bank Telemetry Widget */
.SCADA-bank-card {
    background: rgba(10, 15, 26, 0.5) !important;
}

.scada-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.scada-metric-box {
    background: #060911;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition-smooth);
}

.scada-metric-box:hover {
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.05);
}

.scada-metric-box .lbl {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.scada-metric-box .lbl i {
    width: 14px;
    height: 14px;
}

.scada-metric-box .val {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', var(--font-mono);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
}

/* Cell Heatmap Widget */
.cell-heatmap-card {
    background: rgba(8, 12, 20, 0.6) !important;
}

.heatmap-live-delta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.heatmap-live-delta .lbl {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.heatmap-live-delta .val {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', var(--font-mono);
}

.cell-heatmap-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.cell-block {
    background: #04070c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    user-select: none;
    transition: var(--transition-smooth);
}

.cell-block:hover {
    transform: translateY(-2px);
}

.cell-block .cell-id {
    font-size: 0.62rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.cell-block .cell-voltage {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', var(--font-mono);
}

.cell-block .cell-temp {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', var(--font-mono);
}

/* Cell Heatmap glowing classes */
.cell-block.normal {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: inset 0 0 8px rgba(6, 182, 212, 0.08), 0 2px 10px rgba(6, 182, 212, 0.05);
    color: var(--color-cyan);
}
.cell-block.normal:hover {
    border-color: var(--color-cyan);
    box-shadow: inset 0 0 12px rgba(6, 182, 212, 0.15), 0 4px 15px rgba(6, 182, 212, 0.15);
}

.cell-block.warning {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.08), 0 2px 10px rgba(245, 158, 11, 0.05);
    color: var(--color-yellow);
}
.cell-block.warning:hover {
    border-color: var(--color-yellow);
    box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.15), 0 4px 15px rgba(245, 158, 11, 0.15);
}

.cell-block.critical {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.15), 0 2px 12px rgba(239, 68, 68, 0.1);
    color: var(--color-red);
    animation: glowPulseRed 1.2s infinite alternate;
}
.cell-block.critical:hover {
    border-color: var(--color-red);
    box-shadow: inset 0 0 15px rgba(239, 68, 68, 0.3), 0 4px 20px rgba(239, 68, 68, 0.25);
}

@keyframes glowPulseRed {
    from {
        border-color: rgba(239, 68, 68, 0.35);
        box-shadow: inset 0 0 6px rgba(239, 68, 68, 0.08);
    }
    to {
        border-color: rgba(239, 68, 68, 0.8);
        box-shadow: inset 0 0 12px rgba(239, 68, 68, 0.25), 0 0 15px rgba(239, 68, 68, 0.15);
    }
}

/* Anomalies & Risk Board */
.anomalies-risk-card {
    background: rgba(8, 10, 16, 0.6) !important;
}

.anomalies-board-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    align-items: center;
}

.anomalies-indicators-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.anomaly-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
}

.anomaly-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
}

.anomaly-item .anom-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.anomaly-item .anom-icon i {
    width: 16px;
    height: 16px;
}

.anomaly-item .anom-details h5 {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
    font-weight: 500;
}

.anomaly-item .anom-details span {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', var(--font-mono);
}

/* Module Risk Gauge */
.module-risk-container {
    background: #04070b;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

.module-risk-container h5 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.risk-gauge-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.risk-gauge-fill {
    height: 100%;
    border-radius: 5px;
    width: 0%;
    background: linear-gradient(90deg, var(--color-green) 0%, var(--color-yellow) 40%, var(--color-red) 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    transition: width 1s ease-in-out;
}

.risk-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.risk-score-summary {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-primary);
    font-family: var(--font-body);
    background: rgba(255, 255, 255, 0.01);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    min-height: 46px;
    align-items: center;
    justify-content: center;
}

/* Glassmorphic Login Overlay */
.login-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(16, 20, 32, 0.9) 0%, rgba(6, 8, 12, 0.98) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: loginFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card {
    background: rgba(18, 24, 38, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(6, 182, 212, 0.05),
                inset 0 0 20px rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    padding: 40px;
    width: 440px;
    max-width: 90%;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.login-logo-glow {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.1);
    z-index: 1;
}

.login-logo-glow::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-blue));
    z-index: -1;
    opacity: 0.3;
    filter: blur(4px);
    animation: logoGlowPulse 4s infinite ease-in-out;
}

.login-logo-img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 50%;
}

.login-card h2 {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
    z-index: 1;
    position: relative;
}

.login-card h3 {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-cyan);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    z-index: 1;
    position: relative;
}

.login-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 28px;
    z-index: 1;
    position: relative;
}

.login-input-group {
    text-align: left;
    margin-bottom: 24px;
    z-index: 1;
    position: relative;
}

.login-input-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-input-group label i {
    width: 14px;
    height: 14px;
    color: var(--color-cyan);
}

.login-input-group .input-wrapper {
    position: relative;
    border-radius: 12px;
    background: #090c12;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
}

.login-input-group .input-wrapper:focus-within {
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15),
                inset 0 0 10px rgba(6, 182, 212, 0.02);
}

.login-input-group input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 44px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-align: center;
    text-transform: uppercase;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--color-cyan);
    background-color: rgba(255, 255, 255, 0.05);
}

.password-toggle-btn:focus-visible {
    outline: 2px solid var(--color-cyan);
}

.login-input-group input::placeholder {
    font-family: var(--font-body);
    font-size: 0.88rem;
    letter-spacing: 0;
    text-transform: none;
    color: rgba(255, 255, 255, 0.25);
}

.login-error-msg {
    color: #ef4444;
    font-size: 0.78rem;
    margin-top: 8px;
    min-height: 18px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.login-error-msg.visible {
    opacity: 1;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-blue) 100%);
    color: #030712;
    border: none;
    outline: none;
    padding: 14px;
    border-radius: 12px;
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-smooth);
    z-index: 1;
    position: relative;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.35);
    filter: brightness(1.1);
}

.btn-login:active {
    transform: translateY(0);
}

.login-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(3, 7, 18, 0.2);
    border-top-color: #030712;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.login-card-footer {
    margin-top: 32px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.2);
    font-family: var(--font-mono);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 16px;
    z-index: 1;
    position: relative;
}

/* User Profile in Sidebar Styling */
.user-profile-bar .btn-logout:hover {
    color: var(--color-red) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.user-profile-bar .btn-logout i {
    transition: transform 0.3s ease;
}

.user-profile-bar .btn-logout:hover i {
    transform: translateX(2px);
}

/* Keyframes Animations */
@keyframes loginFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(25px); }
}

@keyframes logoGlowPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.04); }
}

/* Shaking animation for rejected code */
.login-card.shake {
    animation: loginCardShake 0.4s ease-in-out;
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(239, 68, 68, 0.15);
}

@keyframes loginCardShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-4px); }
}

/* ==========================================================================
   Siemens & Tesla SCADA Cabinet styling for PYTES and RITAR Batteries
   ========================================================================== */

/* PYTES Rack Module Styles */
.rack-module.pytes {
    background: linear-gradient(90deg, #2b2e35 0%, #3a3f47 10%, #2b2e35 50%, #3a3f47 90%, #2b2e35 100%);
    border: 2px solid #4a505b;
}

.rack-module.pytes::before,
.rack-module.pytes::after {
    background: #5a6170;
}

.rack-module.pytes .rack-module-handles,
.rack-module.pytes .rack-module-handles-right {
    border-color: #6b7280;
}

.rack-module.pytes.active {
    border-color: #f59e0b; /* Amber/orange active state */
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4), inset 0 0 8px rgba(245, 158, 11, 0.15);
    background: linear-gradient(90deg, #32353d 0%, #3e444e 10%, #32353d 50%, #3e444e 90%, #32353d 100%);
}

.rack-module.pytes .rack-module-screen {
    border-color: #f59e0b;
    color: #f59e0b; /* Amber OLED screen font */
    text-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}

.rack-module.pytes:hover:not(.active) {
    border-color: #fbbf24;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

/* RITAR Rack Module Styles */
.rack-module.ritar {
    background: linear-gradient(90deg, #0b1528 0%, #15253f 10%, #0b1528 50%, #15253f 90%, #0b1528 100%);
    border: 2px solid #1e3a5f;
}

.rack-module.ritar::before,
.rack-module.ritar::after {
    background: #2563eb;
}

.rack-module.ritar .rack-module-handles,
.rack-module.ritar .rack-module-handles-right {
    border-color: #3b82f6;
}

.rack-module.ritar.active {
    border-color: #3b82f6; /* Royal Blue active state */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), inset 0 0 8px rgba(59, 130, 246, 0.15);
    background: linear-gradient(90deg, #10203a 0%, #1c325c 10%, #10203a 50%, #1c325c 90%, #10203a 100%);
}

.rack-module.ritar .rack-module-screen {
    border-color: #3b82f6;
    color: #3b82f6; /* Blue OLED screen font */
    text-shadow: 0 0 4px rgba(59, 130, 246, 0.5);
}

.rack-module.ritar:hover:not(.active) {
    border-color: #60a5fa;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}



