:root {
    --dark: #2c2c2a;
    --muted: #6b6b66;
    --border: #e4ddd0;
    --danger: #c0392b;
    --danger-bg: #fbeceb;
    --success: #2f7d4f;
    --success-bg: #eaf5ee;
    --warning-bg: #fdf3e0;
    --warning-text: #93650c;
    --radius: 8px;

    --toscha: #0f7c73;
    --toscha-dark: #0b5c55;
    --toscha-light: #6fe0d1;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #faf8f4;
    color: var(--dark);
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--toscha-dark);
    color: #fff;
    padding: 20px 0 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 100;
}

.sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.content {
    margin-left: 220px;
}

.sidebar h1 {
    font-size: 16px;
    padding: 0 20px 16px;
    margin: 0 0 12px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    color: var(--toscha-light);
}

/* ================= BRANDING: KILAU ================= */

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 8px;
}

.app-gem {
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(127,233,218,0.35));
}

.app-sparkle {
    animation: sparkle-pulse 2.4s ease-in-out infinite;
    transform-origin: 17.5px 5px;
}

@keyframes sparkle-pulse {
    0%, 100% { opacity: 0.2; transform: scale(0.6); }
    50% { opacity: 1; transform: scale(1.3); }
}

.app-name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.1;
    background: linear-gradient(100deg, #bff2e9 0%, #ffffff 18%, #f4c95d 36%, #bff2e9 54%, #ffffff 72%, #f4c95d 90%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: kilau-shimmer 5s linear infinite;
}

@keyframes kilau-shimmer {
    0% { background-position: 0% center; }
    100% { background-position: -300% center; }
}

.app-tagline {
    font-size: 10.5px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-top: 1px;
}

/* ================= BANNER PROMO POIN (DASHBOARD) ================= */

.promo-poin-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid #e8b100;
    background: linear-gradient(100deg, #ffd23f 0%, #ffe066 25%, #ffb703 50%, #ffe066 75%, #ffd23f 100%);
    background-size: 300% auto;
    animation: promo-poin-gradient 6s linear infinite, promo-poin-pulse 2.2s ease-in-out infinite;
    box-shadow: 0 4px 16px rgba(230,160,0,0.4);
}

@keyframes promo-poin-gradient {
    0% { background-position: 0% center; }
    100% { background-position: -300% center; }
}

@keyframes promo-poin-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(230,160,0,0.4); }
    50% { box-shadow: 0 4px 26px rgba(230,160,0,0.75); }
}

.promo-poin-shine {
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
    animation: promo-poin-shine-sweep 3.2s ease-in-out infinite;
}

@keyframes promo-poin-shine-sweep {
    0% { left: -60%; }
    60%, 100% { left: 130%; }
}

.promo-poin-icon {
    flex-shrink: 0;
    animation: promo-poin-spin-sparkle 2.6s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.25));
}

@keyframes promo-poin-spin-sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.18) rotate(12deg); }
}

.promo-poin-text { position: relative; z-index: 1; }

.promo-poin-judul {
    font-size: 15px;
    font-weight: 700;
    color: #4a3200;
    text-shadow: none;
    letter-spacing: 0.2px;
}

.promo-poin-detail {
    font-size: 12.5px;
    color: #6b4d00;
    margin-top: 2px;
}

.promo-poin-countdown {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    vertical-align: middle;
    animation: promo-poin-pulse-badge 1.4s ease-in-out infinite;
}

@keyframes promo-poin-pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@media (max-width: 640px) {
    .promo-poin-banner { padding: 12px 14px; gap: 10px; }
    .promo-poin-judul { font-size: 13.5px; }
    .promo-poin-detail { font-size: 11.5px; }
}

/* ================= INFO KONTEKS (CABANG + TANGGAL) ================= */

.sidebar-context-info {
    padding: 8px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 6px;
}

.sidebar-context-cabang {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin-bottom: 3px;
}

.sidebar-context-tanggal {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

/* ================= GARIS PEMISAH DI DALAM GRUP MENU ================= */

.menu-separator {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 6px 20px;
}

/* ================= SHORTCUT KEYBOARD ================= */

.sidebar-shortcuts {
    margin-top: auto;
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-shortcuts-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    padding: 3px 0;
}

.sidebar a.submenu {
    text-transform: capitalize;
}

.shortcut-row span {
    text-transform: capitalize;
}

.shortcut-row kbd {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10.5px;
    font-family: inherit;
    color: #fff;
    min-width: 22px;
    text-align: center;
}

#cari-menu {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    background: rgba(255,255,255,0.12);
    color: #fff;
}
#cari-menu::placeholder { color: rgba(255,255,255,0.5); }
#cari-menu:focus { outline: 1px solid var(--toscha-light); background: rgba(255,255,255,0.18); }

.menu-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #f4c95d;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.menu-group:first-child .menu-group-header { border-top: none; }

.menu-group-header:hover { color: #ffd97a; }

.menu-group-header .chev {
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 15px;
}

.menu-group-header.open .chev { transform: rotate(90deg); }

.menu-group-header.open {
    background: rgba(244,201,93,0.16);
    color: #ffd97a;
    border-left: 3px solid #f4c95d;
    padding-left: 13px;
}

.menu-group-body { padding-bottom: 4px; }

.sidebar a.menu-main {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 2px;
}

.sidebar a.menu-main:hover, .sidebar a.menu-main.active {
    background: var(--toscha);
}

.sidebar a.submenu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 20px 7px 30px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.sidebar a.submenu::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.sidebar a.submenu:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar a.submenu.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left: 3px solid var(--toscha-light);
    font-weight: 600;
}

.sidebar a.submenu.active::before {
    background: var(--toscha-light);
}

.content {
    flex: 1;
    padding: 24px 32px;
    max-width: 1100px;
}

.content h2 {
    margin: 0 0 10px;
    font-size: 21px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 800;
    color: var(--toscha-dark);
    padding-left: 12px;
    border-left: 4px solid #f4c95d;
}

.subtitle {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 20px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(15,124,115,0.08);
    border-color: #d8cfa0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

/* Versi lebih rapat -- kolom tidak melar penuh, cocok buat form dengan
   banyak field pendek (dropdown, kode 3 digit, ukuran, dst) supaya semua
   variabel kelihatan sekaligus tanpa tiap kotak jadi kelewat lebar. */
.form-row-tight {
    grid-template-columns: repeat(auto-fit, minmax(160px, 240px));
}

/* 2 kolom tetap, selalu isi penuh lebar form tanpa sisa ruang kosong. */
.form-2col {
    grid-template-columns: 1fr 1fr;
}

.form-3col {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-4col {
    grid-template-columns: repeat(4, 1fr);
}

.form-5col {
    grid-template-columns: repeat(5, 1fr);
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

input, select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--toscha);
    background: #f2faf9;
    box-shadow: 0 0 0 3px rgba(15,124,115,0.12);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    background: #e6f5f3;
    padding: 8px 10px;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

/* ================= TABEL DENGAN TINGGI DIBATASI (scroll di dalam kotak) ================= */
/* Dipakai buat daftar item transaksi (Penjualan, dst) supaya kalau barangnya
   banyak, yang digulir cuma tabelnya sendiri -- bagian form di BAWAH tabel
   (Pelanggan, Metode Bayar, Total, dst) tidak ikut terdorong jauh ke bawah. */
.tabel-scroll-terbatas {
    max-height: 340px;
    overflow-y: auto;
}

.tabel-scroll-terbatas thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: var(--dark);
}

.btn:hover { background: #f5f2ea; }

.btn-primary {
    background: var(--toscha);
    border-color: var(--toscha);
    color: #fff;
}

.btn-primary:hover { background: var(--toscha-dark); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger-outline { color: var(--danger); border-color: var(--danger); background: #fff; }

.actions-right { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }

.preview-box {
    background: #e6f5f3;
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
}

.preview-box span.kode {
    font-weight: 600;
    color: var(--toscha-dark);
}

.text-muted { color: var(--muted); }
.text-right { text-align: right; }

.autocomplete-wrap { position: relative; }

/* Select asli di combo pencarian (class sel-cari) -- tetap ada di DOM & ikut
   submit form seperti biasa, cuma disembunyikan secara visual. Cara pilihnya
   lewat input teks + daftar pencarian di sampingnya (lihat form-ux.js). */
.sel-cari-hidden { display: none; }

.autocomplete-list {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    max-height: 220px;
    overflow-y: auto;
    z-index: 9999;
}

.autocomplete-list.open { display: block; }

.autocomplete-item {
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--toscha);
    color: #fff;
}

.autocomplete-item:hover .text-muted,
.autocomplete-item.active .text-muted {
    color: rgba(255,255,255,0.85);
}

.autocomplete-item .kode { font-weight: 600; }
.autocomplete-item .nama { color: var(--muted); font-size: 12px; }
.autocomplete-item:hover .nama,
.autocomplete-item.active .nama { color: rgba(255,255,255,0.85); }
.autocomplete-empty { padding: 8px 10px; font-size: 13px; color: var(--muted); }

.autocomplete-item.habis { cursor: not-allowed; opacity: 0.65; }
.autocomplete-item.habis .nama { text-decoration: line-through; }
.autocomplete-item.habis .text-muted { color: var(--danger); font-weight: 600; }
.autocomplete-item.habis:hover,
.autocomplete-item.habis.active {
    background: var(--danger-bg);
}
.autocomplete-item.habis:hover .nama,
.autocomplete-item.habis.active .nama,
.autocomplete-item.habis:hover .text-muted,
.autocomplete-item.habis.active .text-muted {
    color: var(--danger);
}

.item-pembelian .baris-field {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.item-pembelian .baris-field > div { flex: 0 0 auto; }
.item-pembelian .f-satuan { width: 130px; }
.item-pembelian .f-jumlah { width: 90px; }
.item-pembelian .f-isi { width: 90px; }
.item-pembelian .f-totalpcs { width: 90px; }
.item-pembelian .f-harga { width: 160px; }

.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--toscha-dark);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 900;
}

.mobile-topbar-title {
    font-size: 15px;
    font-weight: 600;
}

#btn-hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    padding: 11px 14px; /* total area sentuh jadi ~44x44px, sesuai standar minimal Apple/Google buat elemen sentuh */
    margin: -11px -14px; /* biar tetap sejajar visual sama elemen mobile-topbar lain walau area sentuhnya diperbesar */
    cursor: pointer;
}

.sidebar-backdrop {
    display: none;
}

/* Card content that may overflow (mainly wide tables) gets its own scroll */
.card {
    overflow-x: auto;
}

.topbar-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.cabang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.user-chip-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
}

.user-chip-nama {
    font-size: 13px;
    font-weight: 600;
}

.user-chip-role {
    font-size: 11px;
    color: var(--muted);
}

/* Tablet (iPad portrait & landscape) */
@media (max-width: 1024px) {
    .sidebar { width: 190px; }
    .content { padding: 20px; margin-left: 190px; }
}

/* Smartphone */
@media (max-width: 768px) {
    body { flex-direction: column; }

    .mobile-topbar { display: flex; }

    .content { margin-left: 0; }

    /* Field input DI BAWAH 16px bikin Safari iPhone otomatis zoom-in tiap kali
       field-nya di-tap (baik disengaja atau tidak) -- sangat mengganggu karena
       halaman jadi "loncat" zoom tiap ganti field. 16px itu ambang batasnya. */
    input, select, textarea { font-size: 16px; }

    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        height: 100dvh; /* viewport dinamis -- ikut nyesuain kalau address bar browser HP nongol/hilang, dvh diabaikan browser lama & otomatis fallback ke 100vh di atas */
        width: 240px;
        z-index: 1000;
        transition: left 0.25s ease;
        overflow: hidden;
    }

    .sidebar.open { left: 0; }

    .sidebar-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 999;
    }

    .content {
        padding: 16px;
        max-width: 100%;
    }

    .topbar-actions { justify-content: flex-start; }

    .form-row {
        grid-template-columns: 1fr;
    }

    .content h2 { font-size: 18px; }

    table { font-size: 12px; }
    th, td { padding: 6px 8px; }

    .actions-right {
        flex-wrap: wrap;
    }

    .btn:not(.btn-sm) { font-size: 14px; padding: 11px 16px; min-height: 44px; }
    .btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }

    .autocomplete-item { padding: 12px 10px; font-size: 14px; }
}

@media (max-width: 420px) {
    .content { padding: 12px; }
    .card { padding: 14px 14px; }
}

/* ================= CETAK HALAMAN RIWAYAT ================= */

.print-header { display: none; }

tfoot td {
    font-weight: 600;
    background: var(--gold-light, #f3f1ea);
    border-top: 2px solid var(--border);
}

@media print {
    .sidebar, .mobile-topbar, .sidebar-backdrop, .topbar-actions,
    form, .btn, .actions-right { display: none !important; }

    body { background: #fff; }
    .content { padding: 0; max-width: 100%; margin: 0; }
    .card { border: none; padding: 0; box-shadow: none; }

    .print-header { display: block; margin-bottom: 16px; }
    .print-header hr { border: none; border-top: 1px solid #000; margin-top: 8px; }

    table { font-size: 12px; }
    .badge { border: 1px solid #999; background: transparent !important; color: #000 !important; }
}

.struk-58mm {
    width: 280px;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #000;
    background: #fff;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.struk-58mm .center { text-align: center; }
.struk-58mm .bold { font-weight: 700; }
.struk-58mm .row { display: flex; justify-content: space-between; gap: 8px; }
.struk-58mm .item-row { margin-bottom: 4px; }
.struk-58mm .dashed {
    border: none;
    border-top: 1px dashed #000;
    margin: 8px 0;
}

/* ================= DASHBOARD SECTION LABELS ================= */
.dash-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a8578;
    margin: 20px 0 8px;
}
.dash-section-label:first-of-type { margin-top: 4px; }

/* ================= IKON MENU ================= */
.menu-icon { flex-shrink: 0; opacity: 0.8; }
.menu-group-title { display: flex; align-items: center; gap: 10px; }
.menu-group-title .menu-icon { opacity: 0.75; }
.menu-group-header.open .menu-icon,
.menu-group-header:hover .menu-icon { opacity: 1; }

/* ================= SIDEBAR USER FOOTER ================= */
.sidebar-user-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.1);
}

.user-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7fe9da, #f4c95d);
    color: #0b3d38;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.user-footer-info { flex: 1; min-width: 0; }
.user-footer-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-footer-role {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
}

.btn-logout-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    transition: background 0.15s, color 0.15s;
}
.btn-logout-icon:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ================= MODAL KONFIRMASI LOGOUT ================= */
.logout-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20,30,28,0.45);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.logout-modal-overlay.open { display: flex; }

/* ================= MODAL FORM (buat "Tambah barang" dsb -- beda dari modal konfirmasi kecil di atas) ================= */

.form-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20,30,28,0.45);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}
.form-modal-overlay.open { display: flex; }

.form-modal {
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    animation: logout-modal-pop 0.16s ease-out;
}

.form-modal-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
}

.form-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.form-modal-subjudul {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin: 14px 0 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.form-modal-subjudul:first-of-type { border-top: none; padding-top: 0; }

.logout-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px 32px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    animation: logout-modal-pop 0.16s ease-out;
}
@keyframes logout-modal-pop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.logout-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-top: 10px;
    color: var(--toscha-dark);
}

/* ================= STATUS ONLINE/OFFLINE ================= */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.status-dot.online {
    background: var(--success, #2e9e6a);
    box-shadow: 0 0 0 3px rgba(46,158,106,0.18);
}
.status-dot.offline {
    background: #c7c2b6;
}

/* ================= BEL NOTIFIKASI ================= */
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger, #d9534f);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--toscha-dark);
}

.notif-panel {
    display: none;
    position: fixed;
    left: 16px;
    bottom: 76px;
    width: 300px;
    max-width: calc(100vw - 32px); /* jaga-jaga di HP paling sempit (layar ~320px), tidak pernah kepotong/overflow */
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(0,0,0,0.25);
    z-index: 1001;
}

.notif-panel.open { display: block; }

.notif-panel-title {
    padding: 12px 14px 8px;
    font-weight: 700;
    font-size: 13px;
    color: var(--toscha-dark);
    border-bottom: 1px solid var(--border);
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text, #333);
    font-size: 12.5px;
    line-height: 1.4;
    transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f5f2ea; }

.notif-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 4px;
}
.notif-tinggi .notif-dot { background: var(--danger, #d9534f); }
.notif-sedang .notif-dot { background: #e67e22; }

.notif-kosong {
    padding: 24px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ================= HIGHLIGHT FIELD KOSONG/SALAH ================= */
.field-invalid,
.field-invalid:focus {
    border-color: var(--danger) !important;
    background: #fff5f5;
    box-shadow: 0 0 0 2px rgba(192,57,43,0.12);
}

/* ================= TOMBOL IKON DI TABEL (aksi ringkas) ================= */
.btn-ikon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--toscha-dark, #0b5c55);
    text-decoration: none;
    margin-left: 3px;
    transition: background 0.12s, border-color 0.12s;
}
.btn-ikon:hover {
    background: var(--toscha, #0f7c73);
    border-color: var(--toscha, #0f7c73);
    color: #fff;
}
.btn-ikon-danger { color: var(--danger, #c0392b); }
.btn-ikon-danger:hover { background: var(--danger, #c0392b); border-color: var(--danger, #c0392b); color: #fff; }
