* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Kunci Viewport Fullscreen Tanpa Scrollbar */
html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden; 
    background-color: #f4f6f9;
    color: #1e293b;
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 210px;
    height: 100vh;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0f172a 0%, #030712 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    border-right: 1px solid #1e293b;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 4px;
}

.brand .logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.brand-text h2 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1.2;
    color: #f8fafc;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

.nav-item.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 10px;
    color: #64748b;
    padding: 0 4px;
}

.powered-title {
    font-size: 9px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.powered-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 10px;
    color: #94a3b8;
}

.copyright {
    margin-top: 10px;
    font-size: 9px;
    border-top: 1px solid #1e293b;
    padding-top: 8px;
}

.unja-highlight {
    color: #f97316;
    font-weight: 600;
}

/* ================= MAIN CONTENT ================= */
.main-content {
    flex: 1;
    min-width: 0;
    height: 100vh;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* HEADER */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
    flex-shrink: 0;
}

.header-title h1 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.header-title p {
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
}

.header-status {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-badge, .time-card {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.dot {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* CARDS COMMON STYLING */
.card {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.page-section {
    display: none;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.page-section.active {
    display: flex;
}

/* 1. METRICS GRID */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex-shrink: 0;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

.icon-box {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.icon-box svg {
    width: 18px;
    height: 18px;
}

.icon-box.green { background: linear-gradient(135deg, #10b981, #059669); }
.icon-box.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.icon-box.orange { background: linear-gradient(135deg, #f97316, #c2410c); }
.icon-box.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.metric-info .label { 
    font-size: 10px; 
    color: #64748b; 
    font-weight: 500;
    display: block; 
    margin-bottom: 2px;
}

.metric-info .value { 
    font-size: 16px; 
    font-weight: 700; 
    line-height: 1.1; 
}

.metric-info .unit { 
    font-size: 11px; 
    font-weight: 500; 
    color: #64748b;
}

.badge { 
    display: inline-block; 
    font-size: 9px; 
    font-weight: 600; 
    margin-top: 2px;
}

/* 2. STATUS GRID */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-shrink: 0;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-circle svg {
    width: 18px;
    height: 18px;
}

.green-light { background: #ecfdf5; color: #10b981; }
.teal-light { background: #f0fdfa; color: #0d9488; }

.status-title { font-size: 12px; font-weight: 700; margin-top: 1px; }
.status-card .label { font-size: 10px; color: #64748b; font-weight: 500; }
.subtext { font-size: 10px; color: #94a3b8; }

/* 3. CHARTS GRID (SIMETRIS) */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex: 1; 
    min-height: 0;
}

.chart-card {
    display: flex;
    flex-direction: column;
    padding: 10px;
    min-height: 0;
}

.chart-card h4 {
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.chart-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 0;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* 4. SYSTEM FOOTER INFO */
.system-footer-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex-shrink: 0;
    padding: 8px 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item div {
    display: flex;
    flex-direction: column;
    font-size: 10px;
    line-height: 1.2;
}

.info-item span { color: #64748b; font-size: 9px; }
.info-item small { color: #94a3b8; font-size: 8px; }

.icon-large { width: 20px; height: 20px; flex-shrink: 0; }

/* TENTANG & RIWAYAT DATA PAGES */
.page-container {
    padding: 15px;
    height: 100%;
    overflow-y: auto;
}

.divider {
    margin: 8px 0 12px 0;
    border: 0;
    height: 1px;
    background: #e2e8f0;
}

.about-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.about-text {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    line-height: 1.4;
    font-size: 12px;
    color: #4a5568;
}

.about-text h3 { color: #031536; font-size: 14px; }

.author-info {
    margin-top: 6px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #0f62fe;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    width: 100%;
    max-width: 150px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    object-fit: cover;
}

.img-caption {
    margin-top: 4px;
    font-size: 10px;
    color: #718096;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-primary {
    background-color: #0f62fe;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.table-responsive {
    overflow-y: auto;
    max-height: calc(100vh - 160px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
}

.data-table th {
    background-color: #f8fafc;
    color: #4a5568;
}

/* MAIN FOOTER */
.main-footer {
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 16px;
    flex-shrink: 0;
}

/* TEXT COLOR HELPER */
.text-green { color: #10b981; }
.text-blue { color: #2563eb; }
.text-orange { color: #f97316; }
.text-purple { color: #8b5cf6; }