* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: "Inter", Arial, sans-serif;
    background: #eaf1f4;
    color: #26343f;
    overflow: hidden;
}

.dashboard {
    width: 100vw;
    height: 100vh;
    padding: 12px;
    display: grid;
    grid-template-rows: 72px 48px minmax(0, 1fr);
    gap: 10px;
}

.top-header {
    background: #263d4a;
    color: #ffffff;
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) auto;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
}

.logo-box {
    height: 100%;
    background: #2bbf9f;
    display: grid;
    place-items: center;
    font-size: 34px;
    font-weight: 800;
}

.title-box {
    padding: 0 18px;
}

.title-box h1 {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.1;
}

.title-box p {
    margin-top: 5px;
    font-size: 13px;
    color: #d8e3e8;
}

.right-header {
    padding-right: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clock-box {
    background: rgba(255,255,255,0.10);
    border-radius: 8px;
    padding: 9px 13px;
    min-width: 250px;
}

.clock-box span {
    display: block;
    font-size: 11px;
    color: #cbd5e1;
    margin-bottom: 3px;
}

.clock-box strong {
    font-size: 17px;
    font-weight: 800;
}

.refresh-btn,
.export-btn {
    height: 36px;
    border: none;
    border-radius: 999px;
    padding: 0 14px;
    font-weight: 800;
    cursor: pointer;
    color: #ffffff;
    font-family: inherit;
}

.refresh-btn {
    background: #64748b;
}

.export-btn {
    background: #f2c94c;
    color: #26343f;
}

.status-box {
    min-width: 95px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 12px;
}

.status-box.online {
    background: #2bbf9f;
    color: #ffffff;
}

.status-box.warning,
.status-box.loading {
    background: #f2c94c;
    color: #26343f;
}

.status-box.offline {
    background: #eb5757;
    color: #ffffff;
}

.toolbar {
    background: #263d4a;
    color: #ffffff;
    border-left: 6px solid #2bbf9f;
    padding: 0 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.toolbar-title strong {
    font-size: 15px;
    letter-spacing: 1px;
}

.toolbar-title span {
    font-size: 12px;
    color: #cbd5e1;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group input {
    height: 32px;
    border: none;
    border-radius: 6px;
    padding: 0 8px;
    font-family: inherit;
}

.filter-group button {
    height: 32px;
    border: none;
    border-radius: 6px;
    padding: 0 10px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.main-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: 1.25fr 1fr 0.9fr 0.9fr;
    grid-template-rows: 1.1fr 100px 0.9fr;
    gap: 8px;
}

.panel,
.kpi-card {
    background: #ffffff;
    border: 1px solid #dce6eb;
    overflow: hidden;
}

.panel {
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-head {
    height: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.panel-head h3 {
    font-size: 13px;
    font-weight: 800;
    color: #26343f;
    text-transform: uppercase;
}

.panel-head span {
    font-size: 11px;
    color: #64748b;
}

.trend-panel {
    grid-column: 1 / 3;
    grid-row: 1;
}

.ph-panel {
    grid-column: 3 / 5;
    grid-row: 1;
}

.trend-panel canvas,
.ph-panel canvas {
    width: 100% !important;
    flex: 1;
    min-height: 0 !important;
}

.kpi-card {
    padding: 13px 16px;
    border-top: 5px solid #2bbf9f;
}

.kpi-card.green {
    grid-column: 1;
    grid-row: 2;
    border-top-color: #2bbf9f;
}

.kpi-card.blue {
    grid-column: 2;
    grid-row: 2;
    border-top-color: #2f80ed;
}

.kpi-card.red {
    grid-column: 3;
    grid-row: 2;
    border-top-color: #eb5757;
}

.kpi-card.orange {
    grid-column: 4;
    grid-row: 2;
    border-top-color: #f2c94c;
}

.kpi-card span {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.kpi-card strong {
    display: block;
    font-size: 26px;
    color: #26343f;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-card small {
    font-size: 11px;
    color: #64748b;
}

.gauge-panel {
    grid-column: 1 / 3;
    grid-row: 3;
}

.gauge-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.gauge-item {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-items: center;
    justify-items: center;
    padding: 8px;
}

.gauge-canvas-wrap {
    width: 100%;
    height: 108px;
}

.gauge-canvas-wrap canvas {
    width: 100% !important;
    height: 108px !important;
}

.gauge-item strong {
    font-size: 19px;
    font-weight: 800;
    color: #26343f;
}

.gauge-item span {
    font-size: 12px;
    color: #64748b;
}

.info-panel {
    grid-column: 3;
    grid-row: 3;
}

.info-row {
    background: #f8fafc;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-left: 4px solid #2bbf9f;
}

.info-row span {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 3px;
}

.info-row strong {
    font-size: 12px;
    font-weight: 800;
    color: #26343f;
    word-break: break-word;
}

.calendar-mini {
    margin-top: auto;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    padding: 7px;
}

.calendar-top {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.calendar-top button {
    height: 24px;
    border: none;
    background: #263d4a;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.calendar-top strong {
    text-align: center;
    font-size: 11px;
    color: #26343f;
}

.calendar-days,
.calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
}

.calendar-days div {
    text-align: center;
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
}

.date-cell {
    border: none;
    background: #ffffff;
    height: 18px;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
    color: #26343f;
}

.date-cell.outside {
    color: #cbd5e1;
    background: #edf2f7;
}

.date-cell.today {
    background: #2bbf9f;
    color: #ffffff;
}

.date-cell.selected {
    outline: 2px solid #2f80ed;
}

.table-panel {
    grid-column: 4;
    grid-row: 3;
}

.table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border: 1px solid #edf2f7;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 580px;
}

thead {
    position: sticky;
    top: 0;
    background: #263d4a;
    color: #ffffff;
    z-index: 2;
}

th,
td {
    padding: 7px 8px;
    font-size: 10px;
    border-bottom: 1px solid #edf2f7;
    text-align: center;
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: #f8fafc;
}

.tag {
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
}

.tag.netral {
    background: #dcfce7;
    color: #15803d;
}

.tag.asam {
    background: #fef3c7;
    color: #b45309;
}

.tag.basa {
    background: #fee2e2;
    color: #b91c1c;
}

@media (max-width: 1200px) {
    body {
        overflow: auto;
    }

    .dashboard {
        height: auto;
        min-height: 100vh;
    }

    .main-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .trend-panel,
    .ph-panel,
    .gauge-panel,
    .info-panel,
    .table-panel,
    .kpi-card.green,
    .kpi-card.blue,
    .kpi-card.red,
    .kpi-card.orange {
        grid-column: auto;
        grid-row: auto;
    }
}