/* Tampilan panel WA Bot Pondok di atas AdminLTE 3: cerah, membulat, kartu statistik gradien.
   Mode gelap mengikuti kelas body.dark-mode dari tombol bulan di navbar. */
:root {
    --latar: #f2f5fb;
    --kartu: #ffffff;
    --garis-halus: #e8edf5;
    --thead: #f6f8fc;
    --teks-redup: #64748b;
    --sidebar: #ffffff;
    --bayang: 0 4px 18px rgba(30, 41, 70, .07);
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
body.dark-mode {
    --latar: #141a24;
    --kartu: #1d2532;
    --garis-halus: #2a3443;
    --thead: #222c3a;
    --teks-redup: #94a3b8;
    --sidebar: #18202b;
    --bayang: 0 4px 18px rgba(0, 0, 0, .35);
}

body, .main-sidebar, .brand-link, .nav-sidebar, .btn, .form-control, .custom-select, .table, .dropdown-menu,
.badge, h1, h2, h3, h4, h5, h6, .card-title {
    font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body, .content-wrapper { background: var(--latar) !important; -webkit-font-smoothing: antialiased; }
.main-header { border-bottom: 1px solid var(--garis-halus) !important; }
.dark-mode .main-header { background: var(--sidebar) !important; }
.main-footer { background: transparent; border-top: 1px solid var(--garis-halus); }
.content-header h1 { font-weight: 700; letter-spacing: -.02em; font-size: 1.6rem; }
@media (max-width: 576px) { .content-header h1 { font-size: 1.3rem; } }

.nav-sidebar .nav-link { border-radius: 10px !important; margin-bottom: 2px; }
.nav-sidebar .nav-link p { font-weight: 500; }
.nav-sidebar .nav-header { font-size: .72rem !important; font-weight: 700; letter-spacing: .06em; opacity: .75; }
.sidebar-dark-success .nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(135deg, #34c759, #1e8e3e) !important;
    box-shadow: 0 4px 12px rgba(30, 142, 62, .35);
}

.card { border-radius: 14px; border: 0; box-shadow: var(--bayang); background: var(--kartu); }
.card-header { background: transparent; border-bottom: 1px solid var(--garis-halus); padding: .85rem 1.15rem; }
.card-title { font-weight: 600; font-size: 1.02rem; }
.card-footer { background: transparent; border-top: 1px solid var(--garis-halus); }
.btn { border-radius: 9px; font-weight: 600; }
.badge { border-radius: 20px; padding: .38em .7em; font-weight: 600; }
.form-control, .custom-select, .input-group-text { border-radius: 9px; }
.input-group > .form-control:not(:first-child), .input-group > .custom-select:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-prepend > .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-append > .btn, .input-group > .input-group-append > .input-group-text { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.table thead th {
    background: var(--thead); color: var(--teks-redup); font-size: .74rem; text-transform: uppercase;
    letter-spacing: .05em; border-bottom: 0 !important; border-top: 0; font-weight: 700; white-space: nowrap;
}
.table td { border-top: 1px solid var(--garis-halus); vertical-align: middle; }
.table { font-size: .9rem; }
.tabular, .table td.angka { font-variant-numeric: tabular-nums; }
.dropdown-menu { border-radius: 12px; border: 0; box-shadow: 0 10px 30px rgba(30, 41, 70, .15); }
.modal-content { border-radius: 16px; border: 0; background: var(--kartu); }
.modal-header, .modal-footer { border-color: var(--garis-halus); }
.text-redup { color: var(--teks-redup) !important; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 380px; }
code, pre.kode { font-family: var(--mono); }
pre.kode { background: #1f2633; color: #e6edf3; font-size: 12.5px; line-height: 1.55; padding: 14px 16px; border-radius: 10px; overflow-x: auto; white-space: pre; }
.kode-wrap { position: relative; }
.kode-wrap .btn-salin { position: absolute; top: 6px; right: 6px; font-size: 11px; padding: 2px 8px; }
.catatan { border-left: 4px solid #3b82f6; background: rgba(59, 130, 246, .08); padding: 10px 14px; border-radius: 6px; margin: .75rem 0; }
.catatan.awas { border-color: #f59e0b; background: rgba(245, 158, 11, .1); }

/* Kartu statistik */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; margin-bottom: 1.25rem; }
@media (min-width: 1200px) { .stat-grid.enam { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat {
    --a: #5b6478; --b: #3a4458; --fg: #fff;
    position: relative; display: flex; flex-direction: column; min-height: 140px; padding: 18px 20px 16px; border-radius: 16px;
    background: linear-gradient(135deg, var(--a), var(--b)); color: var(--fg) !important; text-decoration: none !important;
    box-shadow: 0 8px 20px -6px rgba(30, 41, 70, .35); transition: transform .15s ease;
}
a.stat:hover { transform: translateY(-3px); }
.stat .angka { font-size: 2.3rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .judul { font-size: 1rem; font-weight: 600; margin-top: 4px; }
.stat .sub { margin-top: auto; padding-top: 10px; font-size: .85rem; opacity: .9; }
.stat .ikon-bg { position: absolute; right: 14px; top: 14px; font-size: 1.6rem; opacity: .25; }
.stat.slate { --a: #5b6478; --b: #384257; }
.stat.kuning { --a: #ffd54a; --b: #f4a100; --fg: #3a2a00; }
.stat.teal { --a: #22b8cc; --b: #117a8b; }
.stat.biru { --a: #3d8bfd; --b: #0a58ca; }
.stat.hijau { --a: #3cc461; --b: #1e7e34; }
.stat.merah { --a: #ef2b2b; --b: #c10c0c; }
.stat.ungu { --a: #8b6cf6; --b: #5a3fd1; }
@media (max-width: 420px) { .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; } .stat { padding: 14px; } .stat .angka { font-size: 1.9rem; } }
@media (prefers-reduced-motion: reduce) { .stat { transition: none; } a.stat:hover { transform: none; } }

/* QR */
.qr-bingkai { display: inline-block; padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 6px 20px rgba(30, 41, 70, .12); }
.qr-bingkai img { width: 260px; height: 260px; max-width: 70vw; max-height: 70vw; display: block; image-rendering: pixelated; }
.qr-kosong { width: 260px; height: 260px; max-width: 70vw; max-height: 70vw; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #64748b; text-align: center; }
.qr-kosong i { font-size: 3.5rem; margin-bottom: 10px; }
.qr-kosong.sukses { color: #16a34a; font-weight: 700; }

/* Realtime */
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: #16a34a; background: rgba(22, 163, 74, .12); padding: 3px 10px; border-radius: 20px; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; animation: denyut 1.6s infinite; }
@keyframes denyut { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); } 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
#realtime-indicator.realtime-on { color: #16a34a; }
#realtime-indicator.realtime-off { color: #94a3b8; }
.baris-kilat { animation: kilat 1.5s ease-out; }
@keyframes kilat { from { background: rgba(255, 193, 7, .35); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot i, .baris-kilat { animation: none; } }

/* Matriks izin role */
.izin-grup { font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--teks-redup); margin: 1rem 0 .4rem; }
.izin-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--garis-halus); border-radius: 8px; margin: 2px; font-size: .85rem; cursor: pointer; user-select: none; }
.izin-chip input { margin: 0; }

/* Penyaring */
.filter-bar .form-control, .filter-bar .custom-select { min-width: 140px; }
