/* =====================================================================
   Penyesuaian aplikasi di atas Adminator v4 (komponen yang tak ada di v4:
   modal, flash/alert, badge status, drawer sidebar mobile).
   Memakai token Adminator (--bg-card, --border, --primary, dll) agar
   ikut light/dark. Di-load setelah CSS Adminator disuntik JS.
   ===================================================================== */

/* ---- Flash / alert ---- */
.flash {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid transparent;
}
.flash svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.flash--success { background: var(--success-soft, #ECFDF5); color: var(--success, #10B981); border-color: var(--success, #10B981); }
.flash--danger  { background: var(--danger-soft,  #FEF2F2); color: var(--danger,  #EF4444); border-color: var(--danger,  #EF4444); }
.flash--info    { background: var(--info-soft,    #F0F9FF); color: var(--info,    #0EA5E9); border-color: var(--info,    #0EA5E9); }
.flash ul { margin: 4px 0 0; padding-left: 18px; }

/* Badge: pakai native Adminator (.badge.primary/.success/.danger/.warning + .dot). */

/* ---- Tombol tambahan (v4 punya .btn .btn--primary .btn--ghost) ---- */
.btn--success { background: var(--success, #10B981); color: #fff; border: none; }
.btn--danger  { background: var(--danger,  #EF4444); color: #fff; border: none; }
.btn--block   { width: 100%; justify-content: center; }
.btn--sm      { padding: 6px 12px; font-size: 12.5px; }

/* ---- Tombol lihat password (Adminator .ico = pointer-events:none, jadi pakai kelas sendiri) ---- */
.input-icon .pw-toggle {
    position: absolute;
    right: 10px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; background: none; cursor: pointer;
    color: var(--t-light, #94a3b8);
    pointer-events: auto;
}
.input-icon .pw-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.input-icon .pw-toggle:hover { color: var(--text, #e2e8f0); }
.input-icon:has(.pw-toggle) .input { padding-right: 40px; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(8, 12, 24, .55);
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.is-open { display: flex; }
.modal {
    width: 100%; max-width: 460px;
    background: var(--bg-card, #fff);
    color: var(--text, #0f172a);
    border: 1px solid var(--border, #E4E8EF);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(8, 12, 24, .35);
    overflow: hidden;
}
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--border-soft, #EEF1F5); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--t-muted, #64748B); font-size: 20px; line-height: 1; }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border-soft, #EEF1F5); display: flex; justify-content: flex-end; gap: 8px; }

/* ---- Drawer sidebar di layar kecil ---- */
@media (max-width: 860px) {
    .d-sidebar {
        position: fixed; top: 0; left: 0; height: 100%; z-index: 1000;
        transform: translateX(-100%); transition: transform .25s ease;
    }
    body.drawer-open .d-sidebar { transform: none; }
    body.drawer-open::after {
        content: ''; position: fixed; inset: 0; z-index: 999;
        background: rgba(8, 12, 24, .45);
    }
}

/* ---- Kolom grid tambahan (Adminator hanya punya col-12 & col-6) ---- */
.grid > .col-3 { grid-column: span 3; }
.grid > .col-4 { grid-column: span 4; }
.grid > .col-8 { grid-column: span 8; }
@media (max-width: 860px) {
    .grid > .col-3, .grid > .col-4, .grid > .col-8 { grid-column: 1 / -1; }
}

/* ---- Tombol dalam kartu tidak meregang penuh (kartu Adminator flex-column) ---- */
.card > .btn,
.card > .page-actions { align-self: flex-start; }
.page-actions .btn { width: auto; flex: 0 0 auto; }
/* Dorong baris aksi ke bawah agar kartu se-baris tinggi & tombolnya rapi sejajar */
.card > .page-actions:last-child { margin-top: auto; }

/* ---- KPI value panjang (mis. NISN) agar muat & tidak terpotong ---- */
.kpi-value.kpi-value--id {
    font-size: 1.5rem;
    line-height: 1.3;
    letter-spacing: 0;
    word-break: break-all;
}

/* ---- Util ---- */
.app-mt { margin-top: 14px; }
.app-muted { color: var(--t-muted, #64748B); }
.app-right { text-align: right; }
.table td .badge { font-size: 11px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
