/* ============================================================
   SIM TIRTA LESTARI - Gaya utama (senior-friendly, ringan)
   ============================================================ */

:root {
    --biru: #0b5fa5;
    --biru-tua: #084a82;
    --biru-muda: #e8f2fb;
    --hijau: #1a7f37;
    --hijau-muda: #e6f4ea;
    --merah: #c62828;
    --merah-muda: #fdecea;
    --kuning: #9a6700;
    --kuning-muda: #fff8e1;
    --abu: #57606a;
    --abu-muda: #f2f4f7;
    --teks: #1a1a1a;
    --putih: #ffffff;
    --radius: 12px;
    --radius-kecil: 8px;
    --tinggi-tombol: 52px;
    --tinggi-input: 52px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.55;
    color: var(--teks);
    background: var(--abu-muda);
}

h1 { font-size: 26px; margin: 0 0 12px; }
h2 { font-size: 22px; margin: 0 0 10px; }
h3 { font-size: 19px; margin: 0 0 8px; }
p { margin: 0 0 12px; }

a { color: var(--biru); text-decoration: none; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #1f7ac4;
    outline-offset: 2px;
}

/* ---------- Layout admin ---------- */
.admin-body { min-height: 100vh; }

.sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    background: var(--biru-tua);
    color: #fff;
    flex-direction: column;
    z-index: 50;
}

.main-area { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--putih);
    border-bottom: 1px solid #e7ecf2;
    padding: 10px 14px;
    min-height: 60px;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--abu-muda);
    border: 1px solid #d8dee6;
    border-radius: var(--radius-kecil);
    font-size: 20px;
    line-height: 1;
    width: 44px;
    height: 44px;
    cursor: pointer;
    color: var(--teks);
}

.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--biru); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 15px; font-weight: 700; }
.user-role { font-size: 13px; color: var(--abu); }

.content {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 14px 110px;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.15); }
.brand-mark { font-size: 30px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.brand-name { font-weight: 800; font-size: 17px; line-height: 1.2; }
.brand-sub { font-size: 13px; opacity: .85; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    color: #fff; padding: 12px 14px; border-radius: var(--radius-kecil);
    font-size: 16px; width: 100%; text-align: left;
    background: none; border: none; cursor: pointer;
}
.sidebar-link:hover { background: rgba(255,255,255,.12); }
.sidebar-link.active { background: rgba(255,255,255,.22); font-weight: 700; box-shadow: inset 3px 0 0 #7cc0f7; }
.menu-ic { font-size: 19px; width: 26px; text-align: center; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.15); padding: 8px; }
.sidebar-logout { color: #ffd7d7; }

/* ---------- Bottom nav (HP) ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: var(--putih);
    border-top: 1px solid #e3e8ef;
    z-index: 45;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-link {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px 7px;
    font-size: 13px; color: var(--abu); font-weight: 600;
}
.bottom-link.active { color: var(--biru); }
.bottom-ic { font-size: 22px; line-height: 1; }

/* ---------- Komponen umum ---------- */
.card {
    background: var(--putih);
    border: 1px solid #e7ecf2;
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(16,24,40,.07);
}
.card-title { font-size: 19px; font-weight: 700; margin-bottom: 14px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tinggi-tombol);
    padding: 10px 22px;
    border-radius: var(--radius-kecil);
    border: 1px solid transparent;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    line-height: 1.3;
    transition: filter .15s;
}
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--biru); color: #fff; }
.btn-success { background: var(--hijau); color: #fff; }
.btn-danger { background: var(--merah); color: #fff; }
.btn-warning { background: var(--kuning); color: #fff; }
.btn-primary, .btn-success, .btn-danger, .btn-warning { box-shadow: 0 2px 4px rgba(16,24,40,.15); }
.btn-outline { background: var(--putih); color: var(--biru); border-color: var(--biru); }
.btn-light { background: var(--abu-muda); color: var(--teks); border-color: #d8dee6; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.btn-lg { min-height: 60px; font-size: 19px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 16px; }
.form-hint { font-size: 14px; color: var(--abu); margin-top: 4px; }
.form-control {
    width: 100%;
    min-height: var(--tinggi-input);
    padding: 12px 14px;
    font-size: 17px;
    border: 2px solid #cfd8e3;
    border-radius: var(--radius-kecil);
    background: var(--putih);
    color: var(--teks);
    -webkit-appearance: none;
    appearance: none;
}
.form-control:focus { outline: none; border-color: var(--biru); }
textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2357606a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
input[type="date"].form-control { padding-right: 10px; }

.input-group { display: flex; gap: 10px; }
.input-group .form-control { flex: 1; }
.input-group .btn { flex-shrink: 0; }

.alert {
    display: flex; align-items: flex-start; gap: 10px;
    border-radius: var(--radius-kecil);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 16px;
    border: 1px solid transparent;
}
.alert-success { background: var(--hijau-muda); border-color: #b7dfc2; color: #0f5c26; }
.alert-danger { background: var(--merah-muda); border-color: #f5c6c6; color: #8f1d1d; }
.alert-warning { background: var(--kuning-muda); border-color: #f0e0b0; color: #6d4c00; }
.alert-info { background: var(--biru-muda); border-color: #c4dcf2; color: #0b4a7a; }
.alert-ic { font-size: 19px; line-height: 1; margin-top: 1px; }
.alert-list { margin: 0; padding-left: 20px; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .02em;
}
.badge-hijau { background: var(--hijau-muda); color: #0f5c26; }
.badge-merah { background: var(--merah-muda); color: #8f1d1d; }
.badge-kuning { background: var(--kuning-muda); color: #6d4c00; }
.badge-biru { background: var(--biru-muda); color: #0b4a7a; }
.badge-abu { background: var(--abu-muda); color: var(--abu); }

/* ---------- Statistik ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    position: relative;
    background: var(--putih);
    border: 1px solid #e7ecf2;
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 1px 3px rgba(16,24,40,.07);
}
.stat-label { font-size: 14px; color: var(--abu); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 2px; word-break: break-word; }
.stat-value.small { font-size: 21px; }
.stat-ic { position: absolute; top: 12px; right: 12px; font-size: 20px; line-height: 1; opacity: .3; color: var(--abu); }
.stat-card.biru { border-left: 5px solid var(--biru); }
.stat-card.hijau { border-left: 5px solid var(--hijau); }
.stat-card.merah { border-left: 5px solid var(--merah); }
.stat-card.kuning { border-left: 5px solid #d4a72c; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid #e9edf2; vertical-align: top; }
.table th { background: var(--abu-muda); font-size: 14px; color: var(--abu); }
.table tbody tr:hover { background: #f8fafc; }

/* ---------- Daftar kartu (HP) ---------- */
.item-list { display: flex; flex-direction: column; gap: 12px; }
.item-card {
    display: block;
    background: var(--putih);
    border: 1px solid #e7ecf2;
    border-radius: var(--radius);
    padding: 16px;
    color: var(--teks);
    box-shadow: 0 1px 3px rgba(16,24,40,.07);
}
.item-card:active { background: #f8fafc; }
.item-title { font-size: 18px; font-weight: 700; }
.item-sub { font-size: 15px; color: var(--abu); }
.item-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }

/* ---------- Aksi cepat ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.quick-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--putih);
    border: 1px solid #e7ecf2;
    border-radius: var(--radius);
    padding: 16px 8px;
    font-size: 15px; font-weight: 700; color: var(--teks);
    min-height: 92px; justify-content: center;
    box-shadow: 0 1px 3px rgba(16,24,40,.07);
}
.quick-btn .quick-ic { font-size: 30px; line-height: 1; }
.quick-btn:active { background: var(--biru-muda); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; justify-content: center; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 46px; min-height: 46px; padding: 6px 12px;
    border-radius: var(--radius-kecil);
    border: 1px solid #d8dee6; background: var(--putih);
    font-size: 16px; font-weight: 600; color: var(--teks);
}
.pagination .active { background: var(--biru); color: #fff; border-color: var(--biru); }
.pagination .disabled { opacity: .5; }

/* ---------- Timeline pengaduan ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 3px; background: #d8dee6; border-radius: 2px; }
.timeline-item { position: relative; margin-bottom: 18px; }
.timeline-dot {
    position: absolute; left: -30px; top: 4px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--biru); border: 5px solid var(--biru-muda);
}
.timeline-item.done .timeline-dot { background: var(--hijau); border-color: var(--hijau-muda); }
.timeline-status { font-weight: 700; font-size: 16px; }
.timeline-meta { font-size: 14px; color: var(--abu); }

/* ---------- Nominal besar ---------- */
.nominal-besar { font-size: 32px; font-weight: 800; text-align: center; margin: 8px 0; }
.nominal-sedang { font-size: 24px; font-weight: 800; }

/* ---------- Detail baris ---------- */
.detail-list { margin: 0; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #e3e8ef; font-size: 16px; }
.detail-row .lbl { color: var(--abu); }
.detail-row .val { font-weight: 700; text-align: right; }
.detail-row.total { border-bottom: none; font-size: 18px; border-top: 2px solid var(--teks); margin-top: 4px; padding-top: 12px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 34px 16px; color: var(--abu); }
.empty-state .empty-ic { font-size: 44px; display: block; margin-bottom: 8px; line-height: 1; }

/* ---------- Login ---------- */
.login-body {
    background: linear-gradient(160deg, var(--biru-tua) 0%, var(--biru) 60%, #1787c9 100%);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    background: var(--putih);
    border-radius: 16px;
    padding: 28px 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 6px; font-size: 46px; line-height: 1; }
.login-title { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.login-sub { text-align: center; color: var(--abu); font-size: 15px; margin-bottom: 22px; }

/* ---------- Konfirmasi ---------- */
.confirm-box { background: var(--kuning-muda); border: 1px solid #f0e0b0; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }

/* ---------- Bantuan ---------- */
.help-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.help-steps li {
    counter-increment: step;
    position: relative;
    padding: 0 0 16px 46px;
    font-size: 16px;
}
.help-steps li::before {
    content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--biru); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 17px;
}

/* ---------- Offline banner ---------- */
.offline-banner {
    position: fixed; top: 0; left: 0; right: 0;
    background: var(--merah); color: #fff;
    text-align: center; padding: 10px 16px; font-weight: 700; font-size: 15px;
    z-index: 100;
}

/* ---------- Desktop (lebar >= 1024px) ---------- */
@media (min-width: 1024px) {
    .sidebar { display: flex; }
    .main-area { margin-left: 264px; }
    .bottom-nav { display: none; }
    .sidebar-toggle { display: none; }
    .content { padding-bottom: 30px; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .quick-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Tablet (641-1023px) ---------- */
@media (min-width: 641px) and (max-width: 1023px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .quick-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Sidebar mobile overlay ---------- */
.sidebar.open { display: flex; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }

/* ---------- Utilitas ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--abu); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ---------- Tema warna ---------- */
body[data-theme="hijau"] { --biru: #1a7f37; --biru-tua: #0f5c26; --biru-muda: #e6f4ea; }
body[data-theme="indigo"] { --biru: #4338ca; --biru-tua: #312e81; --biru-muda: #eef2ff; }
body[data-theme="amber"] { --biru: #b45309; --biru-tua: #92400e; --biru-muda: #fffbeb; }
body[data-theme="rose"] { --biru: #be123c; --biru-tua: #881337; --biru-muda: #fff1f2; }
body[data-theme="violet"] { --biru: #6d28d9; --biru-tua: #4c1d95; --biru-muda: #f5f3ff; }
