/* ===== SPP App — Design System (match: SPP Design.dc.html) ===== */
:root {
    /* Brand — teal-green accent */
    --primary: oklch(0.6 0.15 175);
    --primary-dark: oklch(0.5 0.15 175);
    --primary-hover: oklch(0.55 0.15 175);
    --primary-soft: oklch(0.94 0.05 165);
    --accent-green: oklch(0.55 0.14 165);

    /* Semantic */
    --danger: oklch(0.6 0.12 30);
    --danger-strong: oklch(0.65 0.14 30);
    --danger-soft: oklch(0.93 0.09 30 / 0.55);
    --warning: oklch(0.7 0.14 70);
    --warning-soft: oklch(0.93 0.05 70);
    --info: oklch(0.6 0.13 250);
    --info-soft: oklch(0.93 0.04 250);
    --success: oklch(0.55 0.14 165);
    --success-soft: oklch(0.94 0.05 165);

    /* Warm neutral grounds + cool slate text */
    --bg: oklch(0.97 0.006 80);
    --bg-card: #ffffff;
    --bg-muted: oklch(0.95 0.006 80);
    --bg-input: oklch(0.99 0.003 80);
    --border: oklch(0.92 0.01 80);
    --border-strong: oklch(0.9 0.01 80);
    --text: oklch(0.25 0.02 260);
    --text-body: oklch(0.3 0.02 260);
    --text-muted: oklch(0.55 0.02 260);
    --text-soft: oklch(0.65 0.01 80);

    --sidebar-w: 236px;
    --topbar-h: 72px;
    --radius-lg: 18px;
    --radius: 14px;
    --radius-sm: 12px;
    --radius-xs: 9px;
    --shadow: 0 1px 2px oklch(0.3 0.02 260 / 0.05), 0 4px 14px -8px oklch(0.3 0.02 260 / 0.18);
    --shadow-md: 0 18px 40px -18px oklch(0.3 0.02 260 / 0.28);
    --shadow-primary: 0 8px 20px -6px oklch(0.6 0.15 175 / 0.45);
    --transition: 0.18s ease;
    --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Baloo 2', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { color: var(--text); }

/* ===== Layout ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== Sidebar (white) ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    color: var(--text-body);
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex; flex-direction: column;
    padding: 20px 14px 14px;
    transition: transform var(--transition);
    overflow-y: auto; overflow-x: hidden;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px 18px;
}
.sidebar-brand-icon { flex-shrink: 0; width: 36px; height: 36px; }
.sidebar-brand-icon .brand-avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #fff;
    font-family: var(--font-display);
}
.sidebar-brand-logo { width: 36px; height: 36px; border-radius: 11px; object-fit: cover; }
.sidebar-brand-text {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 700;
    line-height: 1.25; color: var(--text);
}
.sidebar-close {
    display: none;
    position: absolute; top: 14px; right: 14px;
    background: none; border: none; color: var(--text-muted);
    font-size: 24px; cursor: pointer; line-height: 1;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-section {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: .06em; color: oklch(0.6 0.02 260);
    padding: 18px 12px 6px; font-weight: 700;
}
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 14px; font-weight: 600;
    transition: background var(--transition), color var(--transition);
}
.sidebar-link:hover { background: var(--bg-muted); color: var(--text-body); }
.sidebar-link.active {
    background: var(--primary-soft); color: var(--primary-dark); font-weight: 700;
}
.sidebar-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sidebar-icon svg { width: 18px; height: 18px; }
.sidebar-footer { padding-top: 6px; margin-top: 4px; }
.sidebar-link.logout { color: var(--danger); }
.sidebar-link.logout:hover { background: var(--danger-soft); color: var(--danger); }

/* ===== App Main ===== */
.app-main {
    flex: 1; margin-left: var(--sidebar-w);
    transition: margin-left var(--transition);
    min-height: 100vh;
    display: flex; flex-direction: column;
    min-width: 0;
}

/* Sidebar dapat disembunyikan pada layar desktop */
@media (min-width: 769px) {
    body.sidebar-hidden .sidebar { transform: translateX(-100%); }
    body.sidebar-hidden .app-main { margin-left: 0; }
}

/* ===== Topbar ===== */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: flex-start; gap: 12px;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 50;
}
.hamburger {
    display: flex; flex-shrink: 0;
    width: 40px; height: 40px;
    border: none; background: var(--bg-muted);
    cursor: pointer; padding: 8px;
    border-radius: var(--radius-xs);
    color: var(--text-body);
    align-items: center; justify-content: center;
}
.hamburger:hover { background: var(--border); }
.hamburger:focus-visible { outline: 3px solid oklch(0.6 0.15 175 / 0.2); outline-offset: 2px; }
.topbar-left { display: flex; flex-direction: column; gap: 1px; min-width: 0; margin-right: auto; }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--text); line-height: 1.2; }
.topbar-sub { font-size: 13px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-tp {
    font-size: 13px; font-weight: 600;
    background: var(--bg-muted); color: var(--text-body);
    padding: 9px 14px; border-radius: var(--radius-xs);
    white-space: nowrap;
}
.topbar-tp span { color: var(--accent-green); font-weight: 700; }
.topbar-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex-shrink: 0;
}

/* TP switcher */
.tp-switch {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-muted); border-radius: var(--radius-xs);
    padding: 6px 10px 6px 14px; cursor: pointer;
}
.tp-switch-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.tp-switch-select {
    border: none; background: transparent; cursor: pointer;
    font-size: 13px; font-weight: 700; color: var(--accent-green);
    padding-right: 4px; max-width: 150px;
    -webkit-appearance: menulist; appearance: auto;
}
.tp-switch-select:focus { outline: none; }

/* User menu */
.topbar-user { position: relative; }
.topbar-user-btn {
    display: flex; align-items: center; gap: 10px;
    background: none; border: none; cursor: pointer;
    padding: 4px 6px; border-radius: var(--radius-xs);
    transition: background var(--transition);
}
.topbar-user-btn:hover { background: var(--bg-muted); }
.topbar-user-meta { text-align: left; line-height: 1.25; }
.topbar-user-name { font-size: 13px; font-weight: 700; color: var(--text); }
.topbar-user-role { font-size: 11.5px; color: var(--text-muted); }
.topbar-user-caret { color: var(--text-muted); transition: transform var(--transition); }
.topbar-user.open .topbar-user-caret { transform: rotate(180deg); }
.user-menu {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 190px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md); padding: 6px; z-index: 120;
}
.topbar-user.open .user-menu { display: block; }
.user-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-xs);
    font-size: 14px; font-weight: 600; color: var(--text-body);
    transition: background var(--transition);
}
.user-menu-item:hover { background: var(--bg-muted); color: var(--text); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ===== Main Content ===== */
.main-content { padding: 24px 28px; flex: 1; }

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card-header {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card-header h3, .card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); color: var(--text-muted); }
.card-link { display: block; text-decoration: none; color: inherit; transition: box-shadow var(--transition), transform var(--transition); }
.card-link:hover { box-shadow: var(--shadow-md); color: inherit; transform: translateY(-2px); }

/* ===== Stat Grid ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card); padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 8px;
}
.stat-num, .stat-value { font-size: 24px; font-weight: 700; font-family: var(--font-display); line-height: 1.2; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-icon {
    width: 38px; height: 38px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 2px;
}
.stat-icon-green { background: var(--success-soft); color: var(--accent-green); }
.stat-icon-amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon-red { background: var(--danger-soft); color: var(--danger-strong); }

/* ===== Rombel Grid ===== */
.rombel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.rombel-card { height: 100%; }
.rombel-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rombel-card-link { text-decoration: none; color: inherit; }
.rombel-card-link:hover { box-shadow: var(--shadow-md); color: inherit; }
.progress-bar { height: 8px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width var(--transition); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    background: var(--bg-muted); padding: 11px 16px;
    text-align: left; font-weight: 700; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-body); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg); }
.table tfoot td { font-weight: 700; background: var(--bg-muted); color: var(--text); }

/* ===== Toolbar / Search ===== */
.table-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-form { display: flex; gap: 8px; flex: 1 1 320px; min-width: 0; }
.search-form .field-input { width: 0; min-width: 0; flex: 1 1 auto; }
.table-toolbar-actions { display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }

/* ===== Pagination ===== */
.table-pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; font-size: 13px;
}
.pagination-summary { color: var(--text-muted); }
.pagination-controls, .page-size-form, .pagination-nav {
    display: flex; align-items: center; gap: 8px;
}
.page-size-form { color: var(--text-muted); white-space: nowrap; }
.page-size-select {
    min-height: 36px; padding: 6px 28px 6px 10px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--text); font: inherit; cursor: pointer;
}
.page-size-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px oklch(0.6 0.15 175 / 0.12); }
.pagination-nav { gap: 5px; }
.pagination-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 9px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--text-body);
    font-weight: 700; text-decoration: none; transition: all var(--transition);
}
.pagination-link:hover { background: var(--bg-muted); color: var(--primary); border-color: var(--primary); }
.pagination-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-link.disabled { color: var(--text-soft); background: var(--bg-muted); cursor: not-allowed; }
.pagination-arrow { font-size: 20px; line-height: 1; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 18px; border-radius: var(--radius);
    font-weight: 700; font-size: 14px; border: 1.5px solid transparent;
    cursor: pointer; transition: all var(--transition);
    text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs { padding: 6px 12px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-ghost { background: var(--bg-card); color: var(--text-body); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }
.btn-success { background: var(--accent-green); color: #fff; }
.btn-success:hover { filter: brightness(0.96); color: #fff; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-danger { background: var(--bg-card); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-full { width: 100%; padding: 14px 18px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== Forms ===== */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-body); }
.field-input {
    padding: 12px 16px; border: 1.5px solid var(--border-strong);
    border-radius: var(--radius); background: var(--bg-input);
    color: var(--text); font-size: 15px;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-height: 46px;
}
.field-input::placeholder { color: var(--text-soft); }
.field-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px oklch(0.6 0.15 175 / 0.15); }
select.field-input { cursor: pointer; }
textarea.field-input { min-height: 90px; resize: vertical; }

/* Field dengan tombol lihat sandi */
.field-password { position: relative; display: flex; }
.field-password .field-input { width: 100%; padding-right: 48px; }
.field-password-toggle {
    position: absolute; top: 0; right: 0; height: 100%; width: 46px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--text-soft); border-radius: var(--radius);
    transition: color var(--transition);
}
.field-password-toggle:hover { color: var(--primary); }
.field-password-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -4px; }
.field-password-toggle svg { display: none; }
.field-password-toggle svg.is-shown { display: block; }

/* ===== Badges ===== */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
}
.badge-green { background: var(--success-soft); color: var(--accent-green); }
.badge-red { background: var(--danger-soft); color: var(--danger-strong); }
.badge-orange { background: var(--warning-soft); color: var(--warning); }
.badge-gray { background: var(--bg-muted); color: var(--text-muted); }

/* ===== Alerts ===== */
.alert {
    padding: 13px 16px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; margin-bottom: 16px; border: 1px solid transparent;
}
.alert-success { background: var(--success-soft); color: var(--accent-green); border-color: oklch(0.85 0.06 165); }
.alert-error { background: var(--danger-soft); color: var(--danger-strong); border-color: oklch(0.85 0.08 30); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: oklch(0.85 0.06 250); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: oklch(0.3 0.02 260 / 0.4); z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-box {
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: 24px; max-width: 480px; width: 100%;
    max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md);
}
.modal-box h3 { font-family: var(--font-display); font-size: 20px; color: var(--text); margin-bottom: 4px; }

/* ===== Konfirmasi / Peringatan global ===== */
.app-confirm { z-index: 400; }
.app-confirm .modal-box { max-width: 400px; }
.app-confirm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.app-confirm-head h3 { margin-bottom: 0; }
.app-confirm-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: var(--danger-soft); color: var(--danger-strong);
}
.app-confirm-icon.info { background: var(--primary-soft); color: var(--primary-dark); }
.app-confirm-msg { color: var(--text-muted); font-size: 14.5px; line-height: 1.55; margin: 0 0 22px; }
.app-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ===== Toast ===== */
.toast {
    display: none;
    position: fixed; top: 16px; right: 16px;
    z-index: 300; padding: 12px 18px;
    border-radius: var(--radius); font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-md); animation: slideIn .3s ease;
    max-width: 360px;
}
.toast.show { display: block; }
.toast.success { background: var(--accent-green); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== Auth (legacy fallback) ===== */
.auth-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.auth-container { display: flex; max-width: 900px; width: 100%; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: var(--bg-card); }
.auth-brand { flex: 1; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.auth-brand h1 { font-family: var(--font-display); font-size: 32px; margin-bottom: 8px; }
.auth-brand p { opacity: .8; font-size: 14px; }
.auth-form { flex: 1; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 4px; }
.auth-form .form { margin-top: 20px; }

/* ===== Login Page ===== */
.login-page {
    display: flex; min-height: 100vh;
    align-items: center; justify-content: center;
    background: var(--bg); padding: 24px;
}
.login-page::before {
    content: ''; position: fixed; inset: 0; z-index: 0;
    background: radial-gradient(circle at 15% 15%, oklch(0.6 0.15 175 / 0.12), transparent 42%),
                radial-gradient(circle at 85% 85%, oklch(0.55 0.14 165 / 0.12), transparent 42%);
}
.login-card {
    position: relative; z-index: 1;
    display: flex; width: 100%; max-width: 880px;
    border-radius: 28px; overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
}
.login-panel, .login-form-panel {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column;
}
.login-panel {
    background: linear-gradient(150deg, var(--primary), var(--accent-green));
    color: #fff; padding: 52px 44px;
    justify-content: center;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.login-brand-icon {
    width: 44px; height: 44px; border-radius: 14px;
    background: #fff; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 20px; font-weight: 700;
}
.login-brand-logo { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; background: #fff; }
.login-brand-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.login-hero-text {
    font-family: var(--font-display); font-size: 34px; font-weight: 700;
    line-height: 1.2; margin-bottom: 16px;
}
.login-hero-desc { font-size: 16px; opacity: .88; line-height: 1.6; max-width: 340px; }
.login-tp:not(:empty) {
    margin-top: 28px; align-self: flex-start;
    background: oklch(1 0 0 / 0.16); padding: 7px 16px;
    border-radius: 999px; font-size: 13px; font-weight: 600;
}
.login-form-panel {
    background: var(--bg-card); padding: 52px 44px;
    justify-content: center;
}
.login-form-box { width: 100%; }
.login-welcome { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-hint {
    margin-top: 22px; font-size: 13px; color: var(--text-muted);
    text-align: center; background: var(--bg-muted);
    border-radius: var(--radius-sm); padding: 12px;
}
.login-hint strong { color: var(--text-body); }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ===== Dashboard ===== */
.dashboard-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 32px;
    min-height: 196px; margin-bottom: 18px; padding: 30px 34px;
    border-radius: 24px;
    background: linear-gradient(125deg, oklch(0.42 0.11 178), oklch(0.59 0.15 170));
    box-shadow: 0 20px 44px -26px oklch(0.4 0.13 175 / 0.72);
    color: #fff;
}
.dashboard-hero::before,
.dashboard-hero::after {
    content: ''; position: absolute; pointer-events: none; border-radius: 50%;
    border: 1px solid oklch(1 0 0 / 0.12);
}
.dashboard-hero::before { width: 330px; height: 330px; right: -98px; top: -190px; }
.dashboard-hero::after { width: 220px; height: 220px; right: 150px; bottom: -174px; }
.dashboard-hero-content { position: relative; z-index: 1; max-width: 650px; }
.dashboard-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 8px; font-size: 12px; font-weight: 700;
    letter-spacing: .02em; color: oklch(1 0 0 / 0.82);
}
.dashboard-eyebrow-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #a7f3d0;
    box-shadow: 0 0 0 4px oklch(1 0 0 / 0.1);
}
.dashboard-hero h2 {
    color: #fff; font-family: var(--font-display); font-size: 30px;
    line-height: 1.15; font-weight: 700; margin-bottom: 5px;
}
.dashboard-hero-content > p { font-size: 14px; color: oklch(1 0 0 / 0.78); }
.dashboard-hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 19px; }
.dashboard-primary-action,
.dashboard-secondary-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 9px 16px; border-radius: 11px;
    font-size: 13px; font-weight: 700; transition: var(--transition);
}
.dashboard-primary-action { background: #fff; color: var(--primary-dark); box-shadow: 0 8px 20px -12px oklch(0.2 0.05 175 / 0.6); }
.dashboard-primary-action:hover { color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 12px 24px -12px oklch(0.2 0.05 175 / 0.7); }
.dashboard-secondary-action { color: #fff; border: 1px solid oklch(1 0 0 / 0.3); background: oklch(1 0 0 / 0.08); }
.dashboard-secondary-action:hover { color: #fff; background: oklch(1 0 0 / 0.15); }
.dashboard-today-card {
    position: relative; z-index: 1; flex: 0 0 270px;
    display: flex; align-items: flex-start; gap: 13px;
    padding: 18px; border: 1px solid oklch(1 0 0 / 0.2);
    border-radius: 18px; background: oklch(1 0 0 / 0.13);
    box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.1);
    backdrop-filter: blur(8px);
}
.dashboard-today-icon {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 42px; height: 42px; border-radius: 13px;
    color: #fff; background: oklch(1 0 0 / 0.15);
}
.dashboard-today-copy { display: flex; flex-direction: column; min-width: 0; }
.dashboard-today-copy span { font-size: 11.5px; color: oklch(1 0 0 / 0.74); white-space: nowrap; }
.dashboard-today-copy strong { margin-top: 2px; color: #fff; font-family: var(--font-display); font-size: 21px; line-height: 1.3; }
.dashboard-today-copy small { font-size: 11.5px; color: oklch(1 0 0 / 0.74); }

.dashboard-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px; margin-bottom: 18px;
}
.dashboard-stat {
    position: relative; overflow: hidden; min-width: 0;
    padding: 18px; border: 1px solid var(--border); border-radius: 18px;
    background: var(--bg-card); box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}
.dashboard-stat::after {
    content: ''; position: absolute; width: 72px; height: 72px;
    right: -28px; bottom: -33px; border-radius: 50%; background: var(--stat-soft);
}
.dashboard-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dashboard-stat--teal { --stat-color: var(--primary-dark); --stat-soft: var(--primary-soft); }
.dashboard-stat--amber { --stat-color: oklch(0.64 0.14 70); --stat-soft: var(--warning-soft); }
.dashboard-stat--blue { --stat-color: oklch(0.56 0.13 245); --stat-soft: var(--info-soft); }
.dashboard-stat--rose { --stat-color: var(--danger-strong); --stat-soft: var(--danger-soft); }
.dashboard-stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.dashboard-stat-icon {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 11px;
    background: var(--stat-soft); color: var(--stat-color);
}
.dashboard-stat-chip {
    max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 4px 8px; border-radius: 999px; background: var(--bg-muted);
    color: var(--text-muted); font-size: 10.5px; font-weight: 700;
}
.dashboard-stat-label { display: block; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.dashboard-stat-value {
    position: relative; z-index: 1; display: block; margin: 2px 0 5px;
    color: var(--text); font-family: var(--font-display); font-size: 27px; line-height: 1.2; font-weight: 700;
    overflow-wrap: anywhere;
}
.dashboard-stat-value--money { font-size: clamp(19px, 1.65vw, 25px); }
.dashboard-stat-meta { position: relative; z-index: 1; display: block; color: var(--text-soft); font-size: 10.5px; line-height: 1.4; }

.dashboard-target { margin-bottom: 18px; }
.dashboard-target-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dashboard-target-percent { flex-shrink: 0; text-align: right; }
.dashboard-target-percent strong {
    display: block; font-family: var(--font-display); font-size: 30px; line-height: 1;
    color: var(--primary-dark);
}
.dashboard-target-percent span {
    display: block; margin-top: 2px; color: var(--text-muted); font-size: 10px;
    font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.dashboard-target-bar {
    position: relative; height: 16px; margin: 18px 0 16px;
    border-radius: 999px; background: var(--bg-muted); overflow: hidden;
}
.dashboard-target-fill {
    height: 100%; width: var(--target-width); min-width: 8px; border-radius: 999px;
    background: linear-gradient(90deg, oklch(0.66 0.15 170), var(--primary-dark));
    box-shadow: 0 6px 14px -8px var(--primary-dark);
    animation: dashboardTargetGrow .8s ease-out both; transform-origin: left;
}
.dashboard-target-fill.is-empty { min-width: 0; width: 0; }
@keyframes dashboardTargetGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.dashboard-target-legend { display: flex; flex-wrap: wrap; gap: 14px 26px; }
.dashboard-target-metric { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dashboard-target-metric small { display: block; color: var(--text-muted); font-size: 10.5px; font-weight: 600; }
.dashboard-target-metric strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 16px; line-height: 1.3; }
.dashboard-target-dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.dashboard-target-dot.is-paid { background: var(--primary-dark); }
.dashboard-target-dot.is-remaining { background: var(--warning); }
.dashboard-target-dot.is-total { background: var(--text-soft); }

.dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); gap: 18px; align-items: start; }
.dashboard-side-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dashboard-panel {
    min-width: 0; padding: 21px; border: 1px solid var(--border);
    border-radius: 20px; background: var(--bg-card); box-shadow: var(--shadow);
}
.dashboard-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dashboard-panel-header h3 { font-family: var(--font-display); font-size: 18px; line-height: 1.25; }
.dashboard-panel-header p { margin-top: 3px; color: var(--text-muted); font-size: 11.5px; }
.dashboard-panel-kicker {
    display: block; margin-bottom: 3px; color: var(--primary-dark);
    font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.dashboard-chart-summary { flex-shrink: 0; text-align: right; }
.dashboard-chart-summary span { display: block; color: var(--text-muted); font-size: 10.5px; }
.dashboard-chart-summary strong { color: var(--text); font-family: var(--font-display); font-size: 19px; }
.dashboard-chart-area { position: relative; height: 268px; margin-top: 16px; padding: 8px 0 0; }
.dashboard-chart-grid {
    position: absolute; inset: 9px 0 48px; display: flex;
    flex-direction: column; justify-content: space-between; pointer-events: none;
}
.dashboard-chart-grid i { display: block; width: 100%; border-top: 1px dashed var(--border); }
.dashboard-bars { position: relative; z-index: 1; display: flex; align-items: stretch; gap: 12px; height: 100%; }
.dashboard-bar-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end; text-align: center;
}
.dashboard-bar-value {
    width: 100%; min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-muted); font-size: 9px; font-weight: 700;
}
.dashboard-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.dashboard-bar-fill {
    width: min(44px, 66%); height: var(--bar-height);
    min-height: 3px; border-radius: 9px 9px 4px 4px;
    background: linear-gradient(180deg, oklch(0.66 0.15 170), var(--primary-dark));
    box-shadow: 0 8px 15px -10px var(--primary-dark);
    animation: dashboardBarGrow .65s ease-out both; transform-origin: bottom;
}
.dashboard-bar-fill.is-empty { height: 3px; min-height: 3px; background: var(--border-strong); box-shadow: none; }
.dashboard-bar-item > strong { margin-top: 7px; color: var(--text-body); font-size: 11px; }
.dashboard-bar-item > small { color: var(--text-soft); font-size: 8.5px; line-height: 1.2; }
@keyframes dashboardBarGrow { from { transform: scaleY(0); opacity: .2; } to { transform: scaleY(1); opacity: 1; } }
.dashboard-chart-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 12px; padding-top: 13px; border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 10.5px;
}
.dashboard-chart-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.dashboard-chart-footer i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--primary); }
.dashboard-chart-footer strong { color: var(--text-body); }

.dashboard-panel-header--compact { align-items: center; margin-bottom: 8px; }
.dashboard-text-link { flex-shrink: 0; color: var(--primary-dark); font-size: 11px; font-weight: 700; }
.dashboard-activity-list { display: flex; flex-direction: column; }
.dashboard-activity-item {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.dashboard-activity-item:last-child { border-bottom: none; padding-bottom: 2px; }
.dashboard-activity-avatar {
    display: flex; align-items: center; justify-content: center; flex: 0 0 36px;
    width: 36px; height: 36px; border-radius: 11px;
    color: var(--primary-dark); background: var(--primary-soft); font-size: 10.5px; font-weight: 800;
}
.dashboard-activity-content { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.dashboard-activity-content strong,
.dashboard-activity-content span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-activity-content strong { color: var(--text-body); font-size: 11.5px; }
.dashboard-activity-content span { color: var(--text-muted); font-size: 9.5px; }
.dashboard-activity-amount { flex: 0 0 auto; text-align: right; line-height: 1.35; }
.dashboard-activity-amount strong { display: block; color: var(--text); font-size: 10.5px; }
.dashboard-activity-amount span { display: block; color: var(--success); font-size: 9px; font-weight: 700; }
.dashboard-empty-state { display: flex; min-height: 180px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.dashboard-empty-state div { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; margin-bottom: 10px; border-radius: 15px; background: var(--primary-soft); color: var(--primary-dark); }
.dashboard-empty-state strong { font-size: 12px; }
.dashboard-empty-state span { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.dashboard-quick-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 19px; }
.dashboard-quick-heading { flex: 0 0 auto; }
.dashboard-quick-heading span { color: var(--text); font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.dashboard-quick-heading p { color: var(--text-muted); font-size: 9.5px; }
.dashboard-quick-links { display: flex; align-items: center; gap: 7px; }
.dashboard-quick-links a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-width: 68px; padding: 8px 6px; border-radius: 11px;
    color: var(--text-muted); background: var(--bg-muted); font-size: 8.5px; font-weight: 700;
    transition: var(--transition);
}
.dashboard-quick-links a:hover { color: var(--primary-dark); background: var(--primary-soft); transform: translateY(-1px); }
.dashboard-quick-links a > span { display: flex; color: var(--primary-dark); }

@media (max-width: 1180px) {
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-main-grid { grid-template-columns: 1fr; }
    .dashboard-side-stack { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); }
    .dashboard-quick-panel { flex-direction: column; align-items: stretch; justify-content: flex-start; }
    .dashboard-quick-links { flex: 1; }
    .dashboard-quick-links a { flex: 1; }
}
@media (max-width: 820px) {
    .dashboard-hero { align-items: stretch; padding: 26px; }
    .dashboard-today-card { flex-basis: 230px; }
    .dashboard-side-stack { grid-template-columns: 1fr; }
    .dashboard-quick-panel { flex-direction: row; align-items: center; }
}
@media (max-width: 680px) {
    .dashboard-hero { flex-direction: column; gap: 22px; padding: 24px; border-radius: 20px; }
    .dashboard-hero h2 { font-size: 26px; }
    .dashboard-today-card { flex-basis: auto; width: 100%; }
    .dashboard-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .dashboard-stat { padding: 15px; }
    .dashboard-stat-value { font-size: 23px; }
    .dashboard-stat-value--money { font-size: 18px; }
    .dashboard-panel { padding: 17px; border-radius: 17px; }
    .dashboard-panel-header { flex-direction: column; gap: 8px; }
    .dashboard-panel-header--compact { flex-direction: row; }
    .dashboard-chart-summary { text-align: left; }
    .dashboard-chart-area { height: 235px; }
    .dashboard-bars { gap: 6px; }
    .dashboard-bar-value { font-size: 8px; }
    .dashboard-chart-footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
    .dashboard-hero-actions { align-items: stretch; flex-direction: column; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .dashboard-stat { min-height: 145px; }
    .dashboard-stat-value--money { font-size: 22px; }
    .dashboard-quick-panel { flex-direction: column; align-items: stretch; }
    .dashboard-quick-links a { min-width: 0; }
    .dashboard-activity-amount strong { font-size: 9.5px; }
}

/* ===== Portal Siswa (Tagihan Saya) ===== */
.siswa-hero.dashboard-hero {
    min-height: 0; padding: 20px 24px; border-radius: 20px; margin-bottom: 14px;
}
.siswa-hero .dashboard-hero-content h2 { font-size: 22px; margin-bottom: 3px; }
.siswa-hero .dashboard-hero-content > p { font-size: 13px; }
.siswa-hero.dashboard-hero::before { width: 220px; height: 220px; right: -70px; top: -140px; }
.siswa-hero.dashboard-hero::after { display: none; }

.bill-summary {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg-card); box-shadow: var(--shadow); overflow: hidden;
}
.bill-summary-item {
    min-width: 0; padding: 16px 18px;
    border-right: 1px solid var(--border);
}
.bill-summary-item:last-child { border-right: 0; }
.bill-summary-item span {
    display: block; margin-bottom: 4px;
    color: var(--text-muted); font-size: 11px; font-weight: 700;
    letter-spacing: .03em; text-transform: uppercase;
}
.bill-summary-item strong {
    display: block; color: var(--text); font-family: var(--font-display);
    font-size: clamp(15px, 4vw, 22px); line-height: 1.2; overflow-wrap: anywhere;
}
.bill-summary-item.is-danger strong { color: var(--danger-strong); }
.bill-summary-item.is-success strong { color: var(--primary-dark); }

.bill-list { display: flex; flex-direction: column; }
.bill-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.bill-item:last-child { border-bottom: 0; }
.bill-info { flex: 1; min-width: 0; }
.bill-info strong {
    display: block; color: var(--text); font-size: 14px; font-weight: 700;
    overflow-wrap: anywhere;
}
.bill-meta { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.bill-progress {
    height: 5px; margin-top: 8px; max-width: 260px;
    border-radius: 99px; background: var(--bg-muted); overflow: hidden;
}
.bill-progress i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.bill-side {
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
    flex: 0 0 auto; text-align: right;
}
.bill-badge {
    display: inline-block; padding: 4px 10px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
}
.bill-badge--lunas { background: var(--success-soft); color: var(--primary-dark); }
.bill-badge--cicil { background: var(--warning-soft); color: oklch(0.5 0.12 70); }
.bill-badge--belum { background: var(--danger-soft); color: var(--danger-strong); }
.bill-sisa { color: var(--danger-strong); font-size: 12.5px; font-weight: 700; }
.bill-item.is-lunas .bill-info strong { color: var(--text-muted); font-weight: 600; }
.bill-empty { padding: 22px 20px; color: var(--text-muted); font-size: 13px; text-align: center; }
.bill-card-tunggakan { border: 1.5px solid var(--danger-soft); }
.bill-card-tunggakan .card-header { background: var(--danger-soft); }

/* --- Petugas: pilih siswa & checkout --- */
a.bill-item { color: inherit; text-decoration: none; transition: background var(--transition); }
a.bill-item:hover { background: var(--bg); color: inherit; }

.checkout-grid {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
    gap: 18px; align-items: start;
}
.checkout-panel { position: sticky; top: 16px; }
.checkout-pilih-semua {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
label.checkout-item { cursor: pointer; }
label.checkout-item:hover { background: var(--bg); }
.checkout-item input.cek-tagihan { width: 19px; height: 19px; flex: 0 0 auto; accent-color: var(--primary); }
.checkout-item.is-tunggakan { background: oklch(0.98 0.015 30); }
.checkout-tag-tunggakan {
    display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 99px;
    background: var(--danger-soft); color: var(--danger-strong);
    font-size: 10.5px; font-weight: 700; vertical-align: 1px;
}
.checkout-tag-diskon {
    display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 99px;
    background: oklch(0.95 0.06 155); color: oklch(0.42 0.11 155);
    font-size: 10.5px; font-weight: 700; vertical-align: 1px;
}
.checkout-item .bill-meta s { color: var(--text-muted); opacity: 0.75; }
.checkout-item .bill-meta strong { color: var(--text); font-weight: 700; }
.checkout-total-row {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--border-strong);
    color: var(--text-muted); font-size: 13px;
}
.checkout-total-row strong { color: var(--text); font-family: var(--font-display); font-size: 21px; }
/* Baris Total di halaman sukses pembayaran (rapi di desktop & HP) */
.main-content .table td.checkout-success-total,
.main-content .table.mobile-card-table td.checkout-success-total.mobile-card-full {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; text-align: left; background: var(--bg-muted);
}
.checkout-success-total span { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.checkout-success-total strong { color: var(--text); font-family: var(--font-display); font-size: 20px; }
.checkout-mode { display: flex; gap: 16px; margin-bottom: 14px; }
.checkout-mode label {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.checkout-mode input { accent-color: var(--primary); width: 17px; height: 17px; }
.checkout-preview { margin-bottom: 12px; }
.checkout-preview-table { font-size: 12px; }
.checkout-preview-table th, .checkout-preview-table td { padding: 7px 8px; }

@media (max-width: 900px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .checkout-panel { position: static; }
}

@media (max-width: 680px) {
    .bill-summary-item { padding: 12px 12px; }
    .bill-summary-item span { font-size: 9.5px; }
    .bill-item { padding: 12px 14px; gap: 10px; }
    .siswa-hero.dashboard-hero { padding: 16px 18px; border-radius: 16px; }
    .siswa-hero .dashboard-hero-content h2 { font-size: 19px; }
    .siswa-hero .dashboard-hero-content > p { font-size: 12.5px; }
}

/* ===== Print ===== */
.print-only { display: none !important; }
@media print {
    .no-print, .sidebar, .topbar { display: none !important; }
    .print-only { display: block !important; }
    .app-main { margin-left: 0 !important; }
    .main-content { padding: 0 !important; }
    .card { box-shadow: none; border: none; }
}

/* ===== Sidebar Overlay (mobile) ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: oklch(0.3 0.02 260 / 0.4); z-index: 90; }

/* ===== Mobile Responsive ===== */
@media screen and (max-width: 768px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-md); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay.show { display: block; }
    .app-main { margin-left: 0 !important; }
    .hamburger { display: flex; }
    .topbar { padding: 0 16px; height: 64px; }
    .main-content { padding: 16px; }
    .topbar-title { font-size: 17px; }
    .topbar-sub { display: none; }
    .topbar-user-meta, .topbar-user-caret { display: none; }
    .tp-switch { padding: 6px 8px; }
    .tp-switch-label { display: none; }
    .tp-switch-select { max-width: 110px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-num, .stat-value { font-size: 21px; }
    .rombel-grid { grid-template-columns: 1fr; }
    .auth-container { flex-direction: column; }
    .auth-brand { padding: 28px 20px; }
    .auth-brand h1 { font-size: 24px; }
    .auth-form { padding: 28px 20px; }
    .login-page { padding: 16px; }
    .login-card { flex-direction: column; max-width: 440px; border-radius: 24px; }
    .login-panel { padding: 32px 28px; }
    .login-hero-text { font-size: 24px; }
    .login-hero-desc { max-width: none; }
    .login-form-panel { padding: 32px 28px; }

    /* Semua tabel aplikasi menjadi kartu agar tidak perlu digeser horizontal. */
    .main-content .table-wrap { overflow: visible; }
    .main-content .table.mobile-card-table {
        display: block; width: 100%; font-size: 13px;
        border-collapse: separate;
    }
    .main-content .table.mobile-card-table thead {
        position: absolute; width: 1px; height: 1px;
        padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0);
        white-space: nowrap; border: 0;
    }
    .main-content .table.mobile-card-table tbody,
    .main-content .table.mobile-card-table tfoot {
        display: flex; flex-direction: column; gap: 18px; width: 100%;
    }
    .main-content .table.mobile-card-table tfoot { margin-top: 18px; }
    .main-content .table.mobile-card-table tbody tr,
    .main-content .table.mobile-card-table tfoot tr {
        display: flex; flex-direction: column; width: 100%;
        overflow: hidden; background: var(--bg-card);
        border: 1.5px solid var(--border-strong);
        border-left: 5px solid var(--primary);
        border-radius: var(--radius);
        box-shadow: 0 4px 12px oklch(0.35 0.02 260 / 0.10);
    }
    .main-content .table.mobile-card-table tbody tr:hover { background: var(--bg-card); }
    .main-content .table.mobile-card-table td {
        display: grid; grid-template-columns: minmax(88px, 36%) minmax(0, 1fr);
        gap: 12px; align-items: start; width: 100%; min-width: 0;
        padding: 11px 13px; border-bottom: 1px solid var(--border-strong);
        text-align: right; overflow-wrap: anywhere;
    }
    .main-content .table.mobile-card-table td:last-child { border-bottom: 0; }
    .main-content .table.mobile-card-table td::before {
        content: attr(data-label); min-width: 0;
        color: var(--text-muted); font-size: 11px; font-weight: 700;
        letter-spacing: .03em; line-height: 1.5; text-align: left;
        text-transform: uppercase;
    }
    .main-content .table.mobile-card-table td > * { min-width: 0; max-width: 100%; }
    .main-content .table.mobile-card-table td .btn-group,
    .main-content .table.mobile-card-table td .form-inline {
        justify-content: flex-end;
    }
    .main-content .table.mobile-card-table td.mobile-card-full {
        display: block; padding: 18px 12px; text-align: center;
    }
    .main-content .table.mobile-card-table td.mobile-card-full::before { content: none; }
    .main-content .table.mobile-card-table input[type="checkbox"] {
        width: 20px; height: 20px; justify-self: end;
    }

    .table-toolbar .search-form {
        flex: 1 1 100%; min-width: 0; flex-wrap: wrap;
    }
    .table-toolbar .search-form .field-input {
        flex: 1 1 180px !important; min-width: 0;
    }
    .table-pagination { align-items: stretch; padding: 14px; }
    .pagination-summary { width: 100%; text-align: center; }
    .pagination-controls {
        width: 100%; flex-direction: column; align-items: stretch; gap: 12px;
    }
    .page-size-form { justify-content: center; }
    .pagination-nav { justify-content: center; flex-wrap: wrap; }
    .pagination-link { min-width: 38px; height: 38px; }

    .form-inline { flex-direction: column; }
    .form-inline > * { width: 100%; }
    .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .dash-grid { grid-template-columns: 1fr; }
    .bar-chart { height: 150px; }

    /* Tombol aksi halaman sukses pembayaran: full-width bertumpuk */
    .checkout-success-actions { flex-direction: column; gap: 10px; }
    .checkout-success-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .btn { padding: 9px 14px; font-size: 13px; }
    .topbar { gap: 8px; }
    .tp-switch-select { max-width: 92px; }
}

/* ===== Detail Tagihan: kartu ringkas mobile ===== */
.detail-mobile { display: none; }

@media screen and (max-width: 768px) {
    .detail-desktop { display: none; }
    .detail-mobile { display: flex; flex-direction: column; gap: 10px; }

    .scard {
        background: var(--bg-card);
        border: 1.5px solid var(--border-strong);
        border-left: 4px solid var(--primary);
        border-radius: var(--radius);
        padding: 12px 13px;
        box-shadow: 0 2px 8px oklch(0.35 0.02 260 / 0.08);
    }
    .scard-head {
        display: flex; align-items: center; justify-content: space-between;
        gap: 10px; margin-bottom: 10px;
    }
    .scard-id { display: flex; flex-direction: column; min-width: 0; }
    .scard-name { font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
    .scard-nis { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
    .scard-head > span { flex-shrink: 0; white-space: nowrap; }

    .scard-amounts {
        display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
        padding: 9px 0; border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border); margin-bottom: 10px;
    }
    .scard-amt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .scard-lbl {
        font-size: 10px; font-weight: 700; letter-spacing: .03em;
        text-transform: uppercase; color: var(--text-muted);
    }
    .scard-val { font-size: 14px; font-weight: 600; color: var(--text-body); overflow-wrap: anywhere; }
    .scard-strike { font-size: 11px; font-weight: 400; color: var(--text-muted); }
    .scard-amt .checkout-tag-diskon { margin-top: 3px; align-self: flex-start; }

    .scard-actions { display: flex; flex-wrap: wrap; gap: 6px; }
    .scard-actions .btn { flex: 1 1 auto; min-width: 0; padding: 8px 10px; font-size: 12.5px; }
}
