/* ============================================================
   EWS DASHBOARD - MAIN STYLE
   ============================================================ */


/* ============================================================
   1. GLOBAL
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}


/* ============================================================
   2. HEADER
   ============================================================ */

.dashboard-header {
    width: 100%;
    min-height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 32px;

    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.header-left p {
    margin-top: 5px;
    font-size: 13px;
    color: #6b7280;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 12px;
    font-weight: 700;
}

.status-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;
    background: #22c55e;
}

.last-update {
    font-size: 12px;
    color: #6b7280;
}


/* ============================================================
   3. MAIN CONTAINER
   ============================================================ */

.dashboard-container {
    width: 100%;
    max-width: 1600px;

    margin: 0 auto;
    padding: 24px 32px 40px;
}


/* ============================================================
   4. KPI CARDS
   ============================================================ */

.kpi-section {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 20px;
}

.kpi-card {
    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    padding: 20px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.kpi-title {
    font-size: 12px;
    font-weight: 700;

    letter-spacing: 0.8px;

    color: #6b7280;
}

.kpi-value {
    margin-top: 10px;

    font-size: 28px;
    font-weight: 700;

    color: #111827;
}

.kpi-change {
    margin-top: 8px;

    font-size: 13px;
    font-weight: 700;
}

.kpi-change.positive {
    color: #16a34a;
}

.kpi-change.negative {
    color: #dc2626;
}

.kpi-description {
    margin-top: 5px;

    font-size: 11px;
    color: #9ca3af;
}


/* ============================================================
   5. CHART SECTION
   ============================================================ */

.charts-section {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 20px;

    margin-bottom: 20px;
}

.chart-card {
    min-width: 0;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    padding: 20px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 10px;
}

.chart-header h2 {
    font-size: 16px;
    font-weight: 700;

    color: #111827;
}

.chart-header p {
    margin-top: 4px;

    font-size: 11px;
    color: #9ca3af;
}


/* ============================================================
   6. HIGHCHART CONTAINERS
   ============================================================ */

#column-chart,
#area-chart {
    width: 100%;
    height: 360px;
}

#speedometer {
    width: 100%;
    height: 430px;
}


/* ============================================================
   7. EWS SECTION
   ============================================================ */

.ews-section {
    width: 100%;

    margin-top: 20px;
}

.ews-card {
    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    padding: 24px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.ews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ews-header h2 {
    font-size: 18px;
    font-weight: 700;

    color: #111827;
}

.ews-header p {
    margin-top: 4px;

    font-size: 12px;
    color: #9ca3af;
}


/* ============================================================
   8. EWS BADGE
   ============================================================ */

.ews-badge {
    padding: 7px 14px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.5px;
}

.ews-badge.normal {
    color: #166534;
    background: #dcfce7;
}

.ews-badge.warning {
    color: #854d0e;
    background: #fef9c3;
}

.ews-badge.critical {
    color: #991b1b;
    background: #fee2e2;
}


/* ============================================================
   9. EWS STATUS LEGEND
   ============================================================ */

.ews-status {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 28px;

    margin-top: 10px;
}

.ews-status-item {
    display: flex;
    align-items: center;
    gap: 7px;

    font-size: 12px;
    font-weight: 600;
}

.status-indicator {
    width: 9px;
    height: 9px;

    border-radius: 50%;
}

.ews-status-item.normal .status-indicator {
    background: #22c55e;
}

.ews-status-item.warning .status-indicator {
    background: #eab308;
}

.ews-status-item.critical .status-indicator {
    background: #ef4444;
}


/* ============================================================
   10. ALERT SECTION
   ============================================================ */

.alert-section {
    width: 100%;

    margin-top: 20px;
}

.alert-box {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 18px 20px;

    border-radius: 12px;

    border: 1px solid;
}

.alert-box.normal {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.alert-box.warning {
    background: #fefce8;
    border-color: #fde68a;
}

.alert-box.critical {
    background: #fef2f2;
    border-color: #fecaca;
}

.alert-icon {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    font-size: 18px;
    font-weight: 700;

    background: #22c55e;
    color: #ffffff;
}

.alert-content h3 {
    font-size: 14px;
    font-weight: 700;

    color: #111827;
}

.alert-content p {
    margin-top: 3px;

    font-size: 12px;
    color: #6b7280;
}


/* ============================================================
   11. RESPONSIVE - TABLET
   ============================================================ */

@media (max-width: 1100px) {

    .dashboard-container {
        padding: 20px;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    #column-chart,
    #area-chart {
        height: 340px;
    }

    #speedometer {
        height: 400px;
    }

}


/* ============================================================
   12. RESPONSIVE - MOBILE
   ============================================================ */

@media (max-width: 700px) {

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;

        gap: 15px;

        padding: 18px 20px;
    }

    .header-right {
        width: 100%;

        justify-content: space-between;
    }

    .dashboard-container {
        padding: 15px;
    }

    .kpi-section {
        grid-template-columns: 1fr;
    }

    .chart-card,
    .ews-card {
        padding: 15px;
    }

    #column-chart,
    #area-chart {
        height: 300px;
    }

    #speedometer {
        height: 340px;
    }

    .ews-status {
        flex-wrap: wrap;
        gap: 15px;
    }

}