/* =====================================================
   style.css — Smart Waste Monitor
   Tema: Putih & Biru — Bersih & Profesional
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #f0f4f8;
    font-family: 'Inter', sans-serif;
    color: #1e3a5f;
    min-height: 100vh;
    padding: 20px 16px 40px;
    font-size: 14px;
    line-height: 1.5;
}

.dash-wrapper { max-width: 1100px; margin: 0 auto; }

/* ===== HEADER ===== */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d0dce8;
    border-radius: 10px;
    padding: 16px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.dash-header-left { display: flex; align-items: center; gap: 14px; }

.header-logo {
    width: 42px; height: 42px;
    border-radius: 8px;
    background: #1a56db;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}

.header-title {
    font-size: 1rem; font-weight: 700;
    color: #1e3a5f;
}

.header-subtitle {
    font-size: 0.68rem;
    color: #6b8aaa;
    margin-top: 2px;
}

.header-right { display: flex; align-items: center; gap: 10px; }

/* ===== LIVE BADGE ===== */
.live-badge {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.68rem; font-weight: 600;
    color: #1a7a3a;
    background: #e8f5ee;
    border: 1px solid #b0d8be;
    border-radius: 6px;
    padding: 4px 10px;
}

.live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* ===== USER PILL ===== */
.user-pill {
    display: flex; align-items: center; gap: 8px;
    background: #f0f4f8;
    border: 1px solid #d0dce8;
    border-radius: 6px;
    padding: 5px 12px 5px 8px;
}

.user-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #1a56db;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    color: #ffffff;
}

.user-name { font-size: 0.78rem; font-weight: 500; color: #1e3a5f; }

.reset-link {
    font-size: 0.70rem; color: #6b8aaa;
    text-decoration: none;
    display: flex; align-items: center; gap: 5px;
    padding: 5px 8px; border-radius: 5px;
    transition: color 0.15s, background 0.15s;
}
.reset-link:hover { color: #1a56db; background: #e8eef8; }

/* ===== NAVIGATION ===== */
.dash-nav {
    display: flex; gap: 3px;
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid #d0dce8;
    border-radius: 8px; padding: 4px;
    width: fit-content;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.nav-item {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 5px;
    text-decoration: none;
    font-size: 0.82rem; font-weight: 500;
    color: #6b8aaa;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.nav-item:hover { color: #1a56db; background: #e8eef8; }

.nav-item.active {
    background: #1a56db;
    color: #ffffff;
    font-weight: 600;
}

/* ===== SUMMARY CARDS ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #d0dce8;
    border-radius: 10px;
    padding: 18px 20px;
    border-top: 3px solid transparent;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.stat-card.total  { border-top-color: #1a56db; }
.stat-card.penuh  { border-top-color: #dc2626; }
.stat-card.hampir { border-top-color: #d97706; }
.stat-card.normal { border-top-color: #16a34a; }

.stat-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; margin-bottom: 12px;
}

.stat-card.total  .stat-icon { background: #eff4ff; color: #1a56db; }
.stat-card.penuh  .stat-icon { background: #fef2f2; color: #dc2626; }
.stat-card.hampir .stat-icon { background: #fffbeb; color: #d97706; }
.stat-card.normal .stat-icon { background: #f0fdf4; color: #16a34a; }

.stat-label {
    font-size: 0.65rem; font-weight: 600;
    color: #6b8aaa;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }

.stat-card.total  .stat-value { color: #1a56db; }
.stat-card.penuh  .stat-value { color: #dc2626; }
.stat-card.hampir .stat-value { color: #d97706; }
.stat-card.normal .stat-value { color: #16a34a; }

/* ===== TABLE SECTION ===== */
.table-section {
    background: #ffffff;
    border: 1px solid #d0dce8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.table-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #e8eef8;
    background: #f8fafd;
}

.table-title {
    font-size: 0.90rem; font-weight: 600; color: #1e3a5f;
    display: flex; align-items: center; gap: 8px;
}

.table-title i { color: #1a56db; }

.table-count {
    font-size: 0.68rem; color: #6b8aaa;
    background: #e8eef8;
    border: 1px solid #d0dce8;
    border-radius: 4px; padding: 3px 9px;
}

/* ===== TABLE ===== */
.monitoring-table { width: 100%; border-collapse: collapse; }

.monitoring-table thead tr {
    border-bottom: 1px solid #e8eef8;
    background: #f8fafd;
}

.monitoring-table thead th {
    padding: 11px 16px;
    font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: #6b8aaa; text-align: left;
    white-space: nowrap;
}

.monitoring-table tbody tr {
    border-bottom: 1px solid #f0f4f8;
    transition: background 0.1s;
}

.monitoring-table tbody tr:last-child { border-bottom: none; }
.monitoring-table tbody tr:hover { background: #f5f8ff; }
.monitoring-table tbody td { padding: 13px 16px; vertical-align: middle; }

/* ===== CELLS ===== */
.cell-id {
    font-size: 0.68rem; font-weight: 700;
    color: #a0b4cc; font-family: monospace;
}

.cell-name { font-size: 0.85rem; font-weight: 600; color: #1e3a5f; }

.badge-type {
    display: inline-block;
    font-size: 0.58rem; font-weight: 600;
    padding: 2px 6px; border-radius: 4px;
    margin-top: 3px; text-transform: uppercase; letter-spacing: 0.3px;
}

.badge-simulasi { background: #f5f0ff; color: #7c3aed; border: 1px solid #ddd0f8; }
.badge-asli     { background: #eff4ff; color: #1a56db; border: 1px solid #c8d8f0; }

.cell-persen-main { font-size: 0.95rem; font-weight: 700; color: #1e3a5f; }
.cell-sub { font-size: 0.65rem; color: #a0b4cc; margin-top: 2px; display: block; }

/* ===== PROGRESS BAR ===== */
.progress-thin {
    height: 4px; border-radius: 99px;
    background: #e8eef8; margin-top: 6px;
    overflow: hidden; width: 70px;
}

.progress-fill { height: 100%; border-radius: 99px; }

.fill-normal { background: #16a34a; }
.fill-hampir { background: #d97706; }
.fill-penuh  { background: #dc2626; }

/* ===== STATUS BADGE ===== */
.status-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.68rem; font-weight: 600;
    padding: 4px 10px; border-radius: 5px;
    text-transform: uppercase; letter-spacing: 0.3px;
}

.chip-dot { width: 5px; height: 5px; border-radius: 50%; }

.status-normal  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.status-normal  .chip-dot { background: #16a34a; }

.status-hampir  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.status-hampir  .chip-dot { background: #d97706; }

.status-penuh   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.status-penuh   .chip-dot { background: #dc2626; }

/* ===== KEPENUHAN ===== */
.kepenuhan-val { font-size: 0.95rem; font-weight: 700; color: #1a56db; }

/* ===== FOOTER ===== */
.dash-footer {
    margin-top: 18px; text-align: center;
    font-size: 0.65rem; color: #a0b4cc;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    body { padding: 10px 10px 28px; }

    .dash-header {
        flex-direction: column; gap: 10px;
        padding: 12px 14px;
    }

    .dash-header-left { flex-direction: column; text-align: center; }
    .header-right { flex-wrap: wrap; justify-content: center; }
    .dash-nav { width: 100%; flex-direction: column; }
    .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

    .monitoring-table thead th:nth-child(4),
    .monitoring-table tbody td:nth-child(4) { display: none; }

    .table-header { flex-direction: column; gap: 8px; align-items: flex-start; }
}
