/* =====================================================================
   PSB Online SMP Negeri 5 Lahusa
   Design System Frontend (modern, profesional, responsif)
   Catatan: hanya tampilan. Semua nama class lama dipertahankan.
   ===================================================================== */

:root {
    --brand-navy: #0b2a5b;
    --brand-navy-700: #123a76;
    --brand-blue: #1657c8;
    --brand-blue-600: #2b6ee0;
    --brand-blue-100: #e7effb;
    --brand-sky: #e9f2ff;
    --brand-accent: #f5a524;
    --ink: #14203a;
    --ink-soft: #5b6883;
    --line: #e3e9f3;
    --surface: #ffffff;
    --page-bg: #f4f7fc;
    --radius-sm: .65rem;
    --radius: 1rem;
    --radius-lg: 1.35rem;
    --shadow-xs: 0 1px 2px rgba(16, 34, 66, .06);
    --shadow-sm: 0 6px 18px rgba(16, 34, 66, .07);
    --shadow-md: 0 14px 36px rgba(16, 34, 66, .10);
    --shadow-lg: 0 26px 60px rgba(16, 34, 66, .14);
    --sidebar-w: 268px;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    background: var(--page-bg);
    color: var(--ink);
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: .975rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .header-title { color: var(--ink); font-weight: 700; letter-spacing: -.015em; }
h1, .display-5 { letter-spacing: -.03em; }
a { text-decoration: none; }
.text-muted { color: var(--ink-soft) !important; }
.text-primary { color: var(--brand-blue) !important; }
.bg-primary { background-color: var(--brand-navy) !important; }
.bg-light { background-color: #f7f9fd !important; }
::selection { background: rgba(22, 87, 200, .16); }

/* ------------------------------ Focus ------------------------------ */
:focus-visible,
.btn:focus-visible,
.form-control:focus-visible {
    outline: 3px solid rgba(22, 87, 200, .28);
    outline-offset: 2px;
}

/* ---------------------------- Animations --------------------------- */
@keyframes psbFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes psbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes psbShimmer { 100% { transform: translateX(100%); } }
.psb-animate { animation: psbFadeUp .5s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ----------------------------- Buttons ----------------------------- */
.btn {
    --bs-btn-focus-box-shadow: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: .01em;
    padding: .58rem 1.15rem;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: .38rem .75rem; border-radius: .55rem; }
.btn-lg { padding: .8rem 1.6rem; border-radius: .85rem; font-size: 1rem; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-navy) 100%);
    border: none;
    box-shadow: 0 8px 20px rgba(22, 87, 200, .22);
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--brand-blue-600) 0%, var(--brand-navy-700) 100%);
    box-shadow: 0 12px 26px rgba(22, 87, 200, .28);
}
.btn-outline-primary { color: var(--brand-blue); border-color: rgba(22, 87, 200, .35); }
.btn-outline-primary:hover { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.btn-outline-secondary { color: var(--ink-soft); border-color: var(--line); background: #fff; }
.btn-outline-secondary:hover { background: #f1f5fc; color: var(--ink); border-color: #cfd9ea; }
.btn-outline-danger:hover { background-color: #dc3545; color: #fff; }
.btn-outline-success:hover { background-color: #157347; color: #fff; }
.btn-outline-warning { color: #8a5a00; border-color: #ffdf9e; }
.btn-outline-warning:hover { background-color: #ffc107; color: #3d2c00; }
.btn.disabled, .btn:disabled { opacity: .6; transform: none; box-shadow: none; }
.btn-icon {
    width: 2.3rem; height: 2.3rem; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: .6rem;
}
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ''; position: absolute; inset: 0; margin: auto;
    width: 1.05rem; height: 1.05rem; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
    animation: psbSpin .7s linear infinite;
}
.btn-outline-primary.is-loading::after, .btn-outline-secondary.is-loading::after,
.btn-light.is-loading::after { border-color: rgba(22, 87, 200, .3); border-top-color: var(--brand-blue); }
@keyframes psbSpin { to { transform: rotate(360deg); } }

/* ------------------------------ Cards ------------------------------ */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card-body { padding: 1.4rem; }
.card-title { font-weight: 700; }
.card-soft, .summary-card, .card-soft-blue, .hero-card {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.verification-module { border-color: rgba(22, 87, 200, .16); background: #f8fbff; }
.accepted-module { border-color: rgba(21, 176, 75, .2); background: #f2fbf5; }
.card-soft.verification-module, .card-soft.accepted-module { padding: 1.5rem; }

/* --------------------------- Stat / KPI ---------------------------- */
.stat-card, .hero-stat-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem 1.4rem;
    overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.stat-card::before, .hero-stat-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, var(--brand-blue), var(--brand-navy));
}
.stat-card:hover, .hero-stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card h3, .hero-stat-card h3 { font-size: 2rem; font-weight: 800; margin-bottom: 0; color: var(--brand-navy); }
.stat-icon, .hero-stat-card .icon-circle {
    width: 46px; height: 46px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-blue-100); color: var(--brand-blue); font-size: 1.25rem;
}

/* ------------------------------ Badges ----------------------------- */
.badge { font-weight: 600; letter-spacing: .01em; padding: .45rem .7rem; border-radius: 999px; }
.badge-status {
    font-size: .74rem; padding: .45rem .8rem; border-radius: 999px;
    display: inline-flex; align-items: center; gap: .4rem; font-weight: 700;
}
.badge-status::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.badge-status.badge-aktif, .badge-status.badge-lulus, .badge-status.badge-terverifikasi, .badge-status.badge-diterima {
    background: rgba(21, 176, 75, .12); color: #12833c;
}
.badge-status.badge-nonaktif, .badge-status.badge-menunggu, .badge-status.badge-pending, .badge-status.badge-proses {
    background: rgba(245, 165, 36, .16); color: #9a6200;
}
.badge-status.badge-ditolak, .badge-status.badge-tidak_lulus { background: rgba(220, 53, 69, .12); color: #b02a37; }
.badge-success { background-color: #15b04b !important; }
.status-text { font-weight: 600; }

/* ------------------------------ Tables ----------------------------- */
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
    color: var(--ink);
    vertical-align: middle;
}
.table > :not(caption) > * > * { padding: .85rem 1rem; }
.table thead th {
    background: #f3f7fd;
    color: var(--ink-soft);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid #eef2f8; transition: background .18s var(--ease); }
.table tbody tr:hover { background: #f7faff; }
.table-rounded thead th { background: #f3f7fd; color: var(--brand-navy); border: none; }
.table-rounded thead th:first-child { border-top-left-radius: 12px; }
.table-rounded thead th:last-child { border-top-right-radius: 12px; }
.table-rounded tbody td { vertical-align: middle; }
.table-rounded .btn-outline-secondary.btn-icon { border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.table-borderless th, .table-borderless td { border: none; }
.table-borderless thead th { color: var(--ink-soft); background: transparent; border-bottom: 1px solid var(--line); }
.table-borderless tbody tr:hover { background: rgba(22, 87, 200, .04); }

/* Wrapper responsif otomatis (ditambahkan oleh app.js) */
.table-responsive, .psb-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    scrollbar-width: thin;
}
.psb-table-wrap::-webkit-scrollbar { height: 8px; }
.psb-table-wrap::-webkit-scrollbar-thumb { background: #cdd8ea; border-radius: 8px; }

/* Empty state */
.psb-empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); }
.psb-empty i { font-size: 2.4rem; color: #b9c6de; display: block; margin-bottom: .6rem; }

/* ------------------------------ Forms ------------------------------ */
.form-label { font-weight: 600; font-size: .875rem; color: var(--ink); margin-bottom: .35rem; }
.form-control, .form-select {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .65rem .85rem;
    font-size: .95rem;
    color: var(--ink);
    background-color: #fff;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.form-control::placeholder { color: #9aa7bf; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 .2rem rgba(22, 87, 200, .14);
}
.form-control:disabled, .form-select:disabled { background: #f4f6fa; }
.input-group-text { background: #f3f7fd; border-color: var(--line); color: var(--ink-soft); border-radius: var(--radius-sm); }
.form-control.is-invalid, .form-select.is-invalid { border-color: #dc3545; }
.invalid-feedback { font-size: .8rem; }
textarea.form-control { min-height: 120px; }
.form-check-input:checked { background-color: var(--brand-blue); border-color: var(--brand-blue); }

/* ------------------------------ Alerts ----------------------------- */
.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: .9rem 1.1rem;
    font-size: .92rem;
    box-shadow: var(--shadow-xs);
    animation: psbFadeUp .35s var(--ease) both;
}
.alert-success { background: #eefaf1; border-color: #bfe8cd; color: #14663a; }
.alert-danger { background: #fdeeef; border-color: #f6c8cd; color: #9f2530; }
.alert-warning { background: #fff8e9; border-color: #ffe1a6; color: #8a5a00; }
.alert-info { background: #eaf3ff; border-color: #c3dbfb; color: #16457f; }

/* --------------------------- Public navbar -------------------------- */
.navbar-blue, .navbar { position: relative; z-index: 1100; }
.navbar-blue {
    background: linear-gradient(120deg, var(--brand-navy) 0%, var(--brand-blue) 100%);
    box-shadow: 0 8px 26px rgba(11, 42, 91, .18);
    position: sticky;
    top: 0;
}
.navbar-blue .navbar-brand, .navbar-blue .nav-link { color: #fff !important; }
.navbar-blue .navbar-brand { font-weight: 800; font-size: 1.15rem; }
.navbar-brand-logo, .brand-logo {
    width: 46px; height: 46px; border-radius: 14px;
    background: #fff; padding: .25rem;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
    flex-shrink: 0;
}
.navbar-brand-logo img, .brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.navbar-blue .nav-link {
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .01em;
    padding: .55rem .85rem !important;
    border-radius: .6rem;
    position: relative;
    opacity: .92;
    transition: opacity .2s var(--ease), background-color .2s var(--ease);
}
.navbar-blue .nav-link:hover, .navbar-blue .nav-link.active {
    opacity: 1;
    background: rgba(255, 255, 255, .12);
}
.navbar-blue .nav-link::after {
    content: ''; position: absolute; left: 50%; bottom: .25rem; transform: translateX(-50%);
    width: 0; height: 2px; border-radius: 2px; background: var(--brand-accent);
    transition: width .25s var(--ease);
}
.navbar-blue .nav-link:hover::after, .navbar-blue .nav-link.active::after { width: 42%; }
.navbar-blue .dropdown-toggle::after { margin-left: .35rem; }
.navbar-toggler { border: 1px solid rgba(255, 255, 255, .45); border-radius: .6rem; padding: .35rem .55rem; }
.navbar-toggler:focus { box-shadow: none; }
.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: .4rem;
}
.dropdown-item { border-radius: .5rem; font-weight: 500; padding: .55rem .75rem; }
.dropdown-item:hover { background: var(--brand-blue-100); color: var(--brand-navy); }
@media (max-width: 991.98px) {
    .navbar-blue .navbar-collapse {
        background: rgba(255, 255, 255, .07);
        border-radius: var(--radius-sm);
        padding: .75rem;
        margin-top: .75rem;
    }
    .navbar-blue .nav-item.ms-3, .navbar-blue .nav-item.ms-2 { margin: .35rem 0 0 0 !important; }
    .navbar-blue .nav-item .btn { width: 100%; }
}

/* ------------------------------ Hero ------------------------------- */
.hero { min-height: auto; }
.home-hero, .admin-topbar {
    background: linear-gradient(120deg, var(--brand-navy) 0%, var(--brand-blue) 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    padding: 2.25rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.home-hero::after, .admin-topbar::after {
    content: ''; position: absolute; right: -80px; top: -80px;
    width: 260px; height: 260px; border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.home-hero { margin-bottom: 2rem; }
.home-hero h1, .home-hero p, .home-hero .hero-badge, .home-hero .btn,
.home-hero .text-white-50, .home-hero .navbar-brand, .home-hero .nav-link { color: #fff !important; }
.home-hero .lead { color: rgba(255, 255, 255, .9); }
.home-hero .btn-light { color: var(--brand-navy) !important; background: #fff; }
.home-hero .btn-outline-light, .admin-topbar .btn-outline-light { border-color: rgba(255, 255, 255, .75); color: #fff; }
.home-hero .btn-outline-light:hover, .admin-topbar .btn-outline-light:hover { background: rgba(255, 255, 255, .18); }
.home-hero .hero-stat-card, .admin-topbar .hero-stat-card {
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    backdrop-filter: blur(6px);
}
.home-hero .hero-stat-card::before, .admin-topbar .hero-stat-card::before { background: rgba(255, 255, 255, .5); }
.home-hero .hero-stat-card h3 { color: #fff; }
.home-hero .hero-stat-card .text-white-50 { color: rgba(255, 255, 255, .78) !important; }
.admin-topbar .btn { border-radius: .7rem; }

.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(22, 87, 200, .1);
    color: var(--brand-blue);
    border: 1px solid rgba(22, 87, 200, .18);
    border-radius: 999px;
    padding: .5rem .95rem;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.home-hero .hero-badge { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); }
.badge-dot { width: .55rem; height: .55rem; background: var(--brand-accent); border-radius: 50%; box-shadow: 0 0 0 5px rgba(245, 165, 36, .22); }

/* ------------------------------ Banner ----------------------------- */
.banner-section { position: relative; z-index: 0; margin: 0 !important; }
.banner-image { position: relative; z-index: 0; width: 100%; overflow: hidden; margin: 0; padding: 0; }
.banner-home { display: flex; justify-content: center; align-items: center; margin: 0; padding: 0; position: relative; }
.banner-home::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(11, 42, 91, .35) 0%, rgba(11, 42, 91, .05) 45%, rgba(11, 42, 91, .45) 100%);
    pointer-events: none;
}
.banner-home img {
    width: 100%;
    height: clamp(300px, 55vw, 680px) !important;
    object-fit: cover;
    object-position: center center;
    display: block;
    margin: 0;
    background: #f8f9fb;
}

/* ---------------------------- Sidebar ------------------------------ */
.admin-layout { background: var(--page-bg); min-height: 100vh; }
.sidebar {
    min-height: 100vh;
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    max-width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--line);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1045;
    transition: transform .3s var(--ease);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); border-radius: 6px; }
.sidebar-blue, .user-sidebar {
    background: linear-gradient(185deg, var(--brand-navy) 0%, #071e42 100%);
    border-right: 1px solid rgba(255, 255, 255, .07);
    color: #fff;
    box-shadow: var(--shadow-md);
}
.sidebar-blue .nav-link, .user-sidebar .nav-link {
    color: rgba(255, 255, 255, .78);
    font-weight: 600;
    font-size: .93rem;
    padding: .7rem .9rem;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.sidebar-blue .nav-link i, .user-sidebar .nav-link i { font-size: 1.05rem; width: 1.4rem; }
.sidebar-blue .nav-link:hover, .user-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    transform: translateX(2px);
}
.sidebar-blue .nav-link.active, .user-sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(43, 110, 224, .95), rgba(22, 87, 200, .55));
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}
.sidebar-brand { text-align: center; }
.sidebar-brand img, .sidebar-brand .brand-logo {
    width: 62px; height: 62px; border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: #fff; padding: .35rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}
.sidebar-brand .fw-bold { color: #fff; font-size: 1rem; margin-top: .5rem; }
.sidebar-blue h4 { color: #fff; }
.sidebar .nav-section-title {
    color: rgba(255, 255, 255, .45);
    font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    padding: .35rem .9rem; margin-top: .5rem;
}
.dashboard-content { background: transparent; min-width: 0; width: 100%; }

/* Topbar panel + drawer mobile */
.panel-topbar {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: .75rem 1.25rem;
    display: flex; align-items: center; gap: .85rem;
}
.panel-topbar .topbar-title { font-size: 1.05rem; font-weight: 700; margin: 0; line-height: 1.2; }
.panel-topbar .topbar-sub { font-size: .78rem; color: var(--ink-soft); }
.sidebar-toggle {
    display: none;
    border: 1px solid var(--line); background: #fff; color: var(--brand-navy);
    width: 2.4rem; height: 2.4rem; border-radius: .7rem;
    align-items: center; justify-content: center; font-size: 1.15rem;
}
.user-chip {
    display: inline-flex; align-items: center; gap: .55rem;
    background: #f3f7fd; border: 1px solid var(--line);
    border-radius: 999px; padding: .3rem .8rem .3rem .3rem;
    font-size: .85rem; font-weight: 600; color: var(--ink);
    max-width: 100%;
}
.user-chip .avatar { margin: 0; }
.avatar {
    width: 2.1rem; height: 2.1rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-navy));
    color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .04em;
    flex-shrink: 0;
}
.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(9, 22, 45, .5);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .25s var(--ease); z-index: 1040;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; }
    .dashboard-content { padding: 1rem !important; }
    .panel-topbar { padding: .65rem .9rem; }
}

/* --------------------------- Breadcrumb ---------------------------- */
.breadcrumb { font-size: .82rem; margin-bottom: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: #b6c2d8; }
.breadcrumb-item a { color: var(--brand-blue); }
.breadcrumb-item.active { color: var(--ink-soft); }

/* --------------------------- Pagination ---------------------------- */
.pagination { gap: .3rem; }
.page-link {
    border: 1px solid var(--line); border-radius: .6rem !important;
    color: var(--brand-navy); font-weight: 600; padding: .45rem .8rem;
}
.page-link:hover { background: var(--brand-blue-100); color: var(--brand-navy); }
.page-item.active .page-link { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.page-item.disabled .page-link { color: #a8b4ca; background: #f7f9fd; }

/* ---------------------------- Documents ---------------------------- */
.document-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.document-card:hover {
    transform: translateY(-4px);
    border-color: rgba(22, 87, 200, .25);
    box-shadow: var(--shadow-md);
}
.document-card .badge { min-width: 118px; }
.file-btn { transition: transform .2s var(--ease); }
.file-btn:hover { transform: translateY(-2px); }
.file-name, .file-info, .replace-file-info { font-size: .82rem; color: var(--ink-soft); word-break: break-all; }
.document-input, .replace-input { border-radius: var(--radius-sm); }

/* ----------------------------- Receipt ----------------------------- */
.receipt-module {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: clamp(1rem, 2vw, 2rem) !important;
}
.receipt-card {
    background: #fff;
    border: 1px solid #e6edf8;
    border-radius: var(--radius-lg);
    box-shadow: none;
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(1rem, 2vw, 2rem);
}
.receipt-top {
    border-bottom: 2px solid rgba(11, 42, 91, .18);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.receipt-header-brand { min-width: 0; }
.receipt-header-text { min-width: 0; }
.receipt-icon {
    width: 72px;
    height: 72px;
    min-width: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .35rem;
    background: #fff;
    border: 1px solid rgba(11, 42, 91, .09);
}
.receipt-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.receipt-header-meta {
    min-width: 220px;
    white-space: normal;
}
.receipt-status { font-weight: 700; }
.receipt-signature {
    text-align: center;
    border-top: 1px solid rgba(11, 42, 91, .09);
    padding-top: 1rem;
}
.receipt-photo-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.receipt-photo {
    width: 100%;
    max-width: 180px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #f8faff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.receipt-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.receipt-meta .row {
    margin: 0;
    padding-bottom: .25rem;
}
.receipt-meta .row > [class*='col-'] {
    padding-left: .25rem;
    padding-right: .25rem;
}

@media (max-width: 767.98px) {
    .receipt-module {
        margin: 1rem auto;
        padding: .9rem !important;
    }
    .receipt-card {
        padding: .9rem;
    }
    .receipt-top {
        align-items: flex-start !important;
        gap: 1rem;
    }
    .receipt-header-brand {
        width: 100%;
        align-items: flex-start;
    }
    .receipt-header-meta {
        width: 100%;
        text-align: left !important;
        min-width: unset;
    }
    .receipt-icon {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }
    .receipt-photo {
        max-width: 150px;
    }
}

@media (max-width: 575.98px) {
    .receipt-module {
        border-radius: 1rem;
    }
    .receipt-top {
        border-bottom-width: 1px;
        margin-bottom: 1rem;
    }
    .receipt-header-brand {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .receipt-meta .row {
        padding-bottom: 0;
    }
    .receipt-meta .row .col-12 {
        width: 100%;
        max-width: 100%;
    }
    .receipt-meta .row .col-12:first-child {
        margin-bottom: .25rem;
    }
    .receipt-signature {
        flex-direction: column;
        align-items: flex-start !important;
        text-align: left;
    }
}

@media print {
    body {
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .no-print,
    .navbar,
    .sidebar,
    .site-footer,
    .footer,
    .btn,
    .sidebar-backdrop,
    .admin-layout,
    header,
    nav {
        display: none !important;
    }
    .receipt-module,
    .receipt-card {
        border: none !important;
        box-shadow: none !important;
        background: #fff !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .receipt-card {
        border: 1px solid #dfe7f5 !important;
        padding: 0.75rem !important;
    }
    .receipt-top {
        border-bottom: 1px solid #111 !important;
        margin-bottom: 0.8rem;
        padding-bottom: 0.6rem;
    }
    .receipt-status {
        background: #198754 !important;
    }
}

/* ----------------------------- Gallery ----------------------------- */
.gallery-item {
    border-radius: var(--radius); overflow: hidden; display: block;
    box-shadow: var(--shadow-sm); background: #fff;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.gallery-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.gallery-item:hover img { transform: scale(1.06); }

/* ----------------------------- Charts ------------------------------ */
.chart-canvas-wrap { position: relative; width: 100%; }
.chart-center-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }

/* --------------------------- Announcements -------------------------- */
.announcement-content { color: var(--ink-soft); font-size: .93rem; }
.announcement-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.announcement-content table { width: 100%; }

/* ------------------------------ Modal ------------------------------ */
body.modal-open {
    overflow: hidden !important;
}
.modal-backdrop {
    z-index: 1040 !important;
    pointer-events: auto !important;
    background: rgba(0, 0, 0, 0.45) !important;
}
.modal {
    z-index: 1055 !important;
    pointer-events: auto !important;
}
.psb-reject-modal {
    z-index: 1065 !important;
    pointer-events: auto !important;
    background: rgba(10, 18, 34, 0.52);
}
.psb-reject-dialog,
.psb-reject-dialog .modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex !important;
    flex-direction: column !important;
    max-height: 80vh !important;
    overflow: visible !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
}
.modal-dialog, .modal-dialog-scrollable {
    position: relative;
    z-index: 2;
}
.psb-reject-modal.show,
.modal.show {
    display: flex !important;
}
.modal-header, .modal-footer { border-color: var(--line); }
.modal-header { 
    padding: 1.1rem 1.4rem;
    flex-shrink: 0 !important;
}
.modal-body { 
    padding: 1.4rem;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    min-height: 0 !important;
}
.modal-footer {
    flex-shrink: 0 !important;
}
.modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
}
.modal-dialog {
    max-height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
}
.modal-dialog .modal-content {
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(85vh - 3rem) !important;
}
.modal-dialog .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 200px !important;
}

/* ------------------------------ Footer ----------------------------- */
footer.site-footer {
    background: linear-gradient(120deg, #081f43 0%, var(--brand-navy) 100%);
    color: rgba(255, 255, 255, .78);
}
footer.site-footer h6, footer.site-footer .fw-bold { color: #fff; }
footer.site-footer a { color: rgba(255, 255, 255, .78); transition: color .2s var(--ease); }
footer.site-footer a:hover { color: #fff; }
footer.site-footer .footer-divider { border-top: 1px solid rgba(255, 255, 255, .12); }

/* ------------------------- Login / Register ------------------------ */
.auth-shell {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 10% 10%, rgba(43, 110, 224, .18), transparent 45%),
        radial-gradient(circle at 90% 90%, rgba(11, 42, 91, .22), transparent 45%),
        var(--page-bg);
}
.auth-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; }

/* --------------------------- Utilities ----------------------------- */
.rounded-4 { border-radius: var(--radius-lg) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.psb-skeleton {
    position: relative; overflow: hidden; background: #eef2f8; border-radius: var(--radius-sm);
}
.psb-skeleton::after {
    content: ''; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
    animation: psbShimmer 1.4s infinite;
}

@media (max-width: 575.98px) {
    body { font-size: .93rem; }
    .card-body { padding: 1.1rem; }
    .home-hero, .admin-topbar { padding: 1.5rem; border-radius: var(--radius); }
    .stat-card h3, .hero-stat-card h3 { font-size: 1.6rem; }
    .btn { padding: .55rem 1rem; }
    .table > :not(caption) > * > * { padding: .7rem .75rem; }
}

@media print {
    .sidebar, .panel-topbar, .navbar, footer, .btn, .sidebar-backdrop { display: none !important; }
    body, .dashboard-content { background: #fff !important; }
    .card, .receipt-module { box-shadow: none !important; border: 1px solid #ccc !important; }
}
