:root {
    --bg-main: #f3f4f6;
    --bg-card: #ffffff;
    --border-card: #e5e7eb;

    --bg-main: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.7);
    --border-card: rgba(255, 255, 255, 0.5);

    --text-primary: #1f2937;
    --text-secondary: #6b7280;

    --astra-green: #005c29;
    --astra-green-light: #e6efec;
    --astra-gold: #f39200;

    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;

    --font-main: "Inter", sans-serif;
    --badge-purple: #8b5cf6;
    --badge-purple-glow: rgba(139, 92, 246, 0.1);
}

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

body {
    font-family: "Inter", sans-serif;
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    background: #f8f7f2;
}

.dashboard-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.dashboard-main {
    flex: 1;
    min-height: 0;
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 40px;
    background: #113b24;
    border-bottom: 1px solid #0f331f;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.15),
        0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: flex-start;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1.5;
}

.header-center h1 {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #f8f7f2;
    margin-top: 2px;
    margin-bottom: 0;
    text-transform: uppercase;
}

.subtitle {
    color: rgba(248, 247, 242, 0.85);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0;
}

.update-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.clock-widget.stacked-clock {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 10px 24px 12px 24px;
}

.clock-top-label {
    color: rgba(248, 247, 242, 0.9);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    justify-content: flex-end;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
}

.calendar-widget {
    background: #f8f7f2;
    border-radius: 6px;
    text-align: center;
    min-width: 65px;
    flex-shrink: 0;

    box-shadow:
        0 2px 0 #e2e0d5,
        0 4px 0 #d1cfc2,
        0 6px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    border: 1px solid #d1cfc2;
    margin-top: 6px;
}

.calendar-top {
    background: #113b24;
    color: #f8f7f2;
    font-size: 11px;
    font-weight: 800;
    padding: 8px 4px 4px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 5px 5px 0 0;
    position: relative;
    border-bottom: 2px dashed rgba(0, 0, 0, 0.1);
}

.calendar-top::before,
.calendar-top::after {
    content: "";
    position: absolute;
    top: -6px;
    width: 6px;
    height: 12px;
    background: linear-gradient(to bottom, #f0f0f0, #a0a0a0);
    border-radius: 4px;
    box-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.5),
        inset 1px 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid #666;
}

.calendar-top::before {
    left: 14px;
}
.calendar-top::after {
    right: 14px;
}

.calendar-bottom {
    background: #f8f7f2;
    color: #111827;
    font-size: 26px;
    font-weight: 900;
    padding: 6px 4px 8px 4px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    border-radius: 0 0 5px 5px;
}

.clock-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 20px;
    border-radius: 35px;
    border: 1px solid rgba(248, 247, 242, 0.15);
    box-shadow:
        inset 0 3px 6px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.clock-icon {
    width: 28px;
    height: 28px;
    color: #f8f7f2;
    filter: drop-shadow(0 0 4px rgba(248, 247, 242, 0.3));
}

.realtime-clock-text {
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-block {
    background: rgba(0, 0, 0, 0.5);
    color: #f8f7f2;
    font-size: 26px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.8),
        0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(248, 247, 242, 0.3);
    line-height: 1;
}

.time-sep {
    color: #f8f7f2;
    font-size: 24px;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(248, 247, 242, 0.5);
    margin: 0 2px;
}

.time-sep.blink {
    animation: blink 1s step-start infinite;
}

.time-zone {
    color: rgba(248, 247, 242, 0.6);
    font-size: 15px;
    font-weight: 700;
    margin-left: 6px;
    letter-spacing: 1px;
}

@keyframes blink {
    50% {
        opacity: 0.1;
    }
}

.status-indicator span {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #10b981;
}

.dot.pulse {
    box-shadow: 0 0 0 0 rgba(0, 92, 41, 0.7);
    animation: pulse-green 2s infinite;
}

.dot.offline {
    background-color: #ef4444;
    animation: none;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 24px;
}

.multi-chart-grid {
    display: grid;
    height: 100%;
    gap: 8px;
    padding: 0 16px 16px 16px;
}

#centrifugeGrid {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

#centrifugeGrid .glass-panel:nth-child(-n + 3) {
    grid-column: span 4;
}

#centrifugeGrid .glass-panel:nth-child(n + 4) {
    grid-column: span 3;
}

#pressGrid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

#ebpGrid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

#ebpGrid .glass-panel:nth-child(1) {
    grid-column: span 2;
}

#ebpGrid .glass-panel:nth-child(n + 2) {
    grid-column: span 1;
}

.multi-chart-grid .chart-container {
    flex: 1;
    min-height: 0;
}

.multi-chart-grid .card-header h2 {
    font-size: 16px;
}

.glass-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.glass-panel:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #113b24;
    padding: 12px 16px;
    border-bottom: none;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
}

.chart-container {
    padding: 20px;
    position: relative;
    width: 100%;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.badge.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.badge.blue {
    background: rgba(0, 86, 164, 0.1);
    color: #0056a4;
    border: 1px solid rgba(0, 86, 164, 0.2);
}
.badge.orange {
    background: rgba(243, 146, 0, 0.1);
    color: #d97706;
    border: 1px solid rgba(243, 146, 0, 0.2);
}
.badge.green {
    background: rgba(0, 92, 41, 0.1);
    color: #005c29;
    border: 1px solid rgba(0, 92, 41, 0.2);
}

.navbar {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.navbar::-webkit-scrollbar {
    height: 8px;
}

.navbar::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 4px;
}

.nav-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-card);
    color: var(--text-secondary);
    padding: 16px 40px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.nav-btn:hover {
    background: var(--bg-main);
}

.nav-btn.active {
    background: var(--accent-green);
    color: #ffffff;
    border-color: var(--accent-green);
    box-shadow: 0 8px 15px rgba(0, 166, 81, 0.3);
}

.view-section {
    display: block;
    animation: fadeIn 0.4s ease-out;
    height: calc(100vh - 130px);
}

.view-section.hidden {
    display: none;
}

.full-width {
    width: 100%;
}

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

.chart-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 247, 242, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-overlay p {
    color: #113b24;
    font-size: 24px;
    font-weight: 600;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 12px solid rgba(0, 92, 41, 0.1);
    border-radius: 50%;
    border-top-color: #113b24;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 24px;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 92, 41, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(0, 92, 41, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 92, 41, 0);
    }
}

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

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .chart-container {
        height: 40vh;
    }
}
