/* =========================================================
   SPMB SIT JABAL NOOR — Global Stylesheet
   Tema modern: responsif, ringan, penuh animasi halus.
   ========================================================= */

/* ------------------ Design Tokens ------------------ */
:root {
    --primary:      #262b7c;
    --primary-600:  #303896;
    --primary-700:  #1b1f5c;
    --primary-50:   #eef2ff;
    --accent:       #009fe3;
    --accent-600:   #0284c7;

    --ink:          #0f172a;
    --muted:        #64748b;
    --line:         #e5e9f0;
    --bg:           #eef2f7;
    --card:         #ffffff;

    --success:      #16a34a;
    --danger:       #e11d48;
    --warning:      #f59e0b;
    --info:         #0ea5e9;

    --radius:       16px;
    --radius-sm:    12px;
    --shadow-sm:    0 1px 2px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.06);
    --shadow:       0 10px 30px rgba(15,23,42,.09);
    --shadow-lg:    0 22px 48px rgba(15,23,42,.16);

    --grad:         linear-gradient(135deg, #1b1f5c 0%, #262b7c 52%, #009fe3 130%);
    --grad-soft:    linear-gradient(135deg, #262b7c, #303896);
    --grad-accent:  linear-gradient(135deg, #009fe3, #0284c7);

    --sidebar-w:    264px;
    --topbar-h:     66px;
    --ease:         cubic-bezier(.22, 1, .36, 1);
}

/* ------------------ Reset & Base ------------------ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 520px at 100% -10%, rgba(0,159,227,.10), transparent 60%),
        radial-gradient(900px 480px at -10% 110%, rgba(38,43,124,.12), transparent 55%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ------------------ Animasi global ------------------ */
@keyframes gradientMove {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(38,43,124,.45); }
    70%  { box-shadow: 0 0 0 12px rgba(38,43,124,0); }
    100% { box-shadow: 0 0 0 0 rgba(38,43,124,0); }
}
@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60% { transform: translateX(5px); }
}

/* Reveal-on-scroll (hanya jika JS aktif) */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
    will-change: opacity, transform;
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* =========================================================
   TOP BAR
   ========================================================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    height: var(--topbar-h);
    background: var(--grad);
    background-size: 220% 220%;
    animation: gradientMove 16s ease infinite;
    box-shadow: 0 8px 26px rgba(27,31,92,.28);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 0 clamp(12px, 3vw, 26px);
    color: #fff;
}
.topbar-spacer { flex: 1 1 auto; }

.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-logo {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.95);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
    overflow: hidden;
    flex: 0 0 auto;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 1.15rem; font-weight: 800; letter-spacing: .5px; }
.brand-text small { font-size: .74rem; opacity: .85; letter-spacing: .3px; }

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 6px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255,255,255,.95);
    color: var(--primary-700);
    font-size: .95rem;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-meta strong { font-size: .82rem; font-weight: 700; }
.user-meta small { font-size: .68rem; opacity: .85; }

.btn-logout {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: .82rem; font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.30);
    transition: transform .25s var(--ease), background .25s, box-shadow .25s;
}
.btn-logout:hover {
    background: #fff;
    color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0,0,0,.22);
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border: 1px solid rgba(255,255,255,.30);
    background: rgba(255,255,255,.16);
    color: #fff;
    border-radius: 12px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.menu-toggle:hover { background: rgba(255,255,255,.28); transform: scale(1.05); }

/* =========================================================
   APP SHELL & SIDEBAR
   ========================================================= */
.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - var(--topbar-h)); }

.sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--line);
    padding: 18px 14px 24px;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform .38s var(--ease);
}

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }

.side-heading {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 12px 6px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #334155;
    font-size: .875rem;
    font-weight: 600;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background .22s, color .22s, transform .22s var(--ease);
}
.side-link .ico {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: #f1f5f9;
    color: var(--primary);
    font-size: .85rem;
    flex: 0 0 auto;
    transition: background .25s, color .25s, transform .25s;
}
.side-link::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 4px; height: 0;
    background: var(--grad);
    border-radius: 4px;
    transform: translateY(-50%);
    transition: height .28s var(--ease);
}
.side-link:hover { background: var(--primary-50); color: var(--primary-700); transform: translateX(3px); }
.side-link:hover .ico { background: var(--grad); color: #fff; transform: rotate(-6deg) scale(1.05); }

.side-link.active {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 10px 22px rgba(38,43,124,.30);
}
.side-link.active .ico { background: rgba(255,255,255,.22); color: #fff; }
.side-link.active::before { height: 60%; background: #fff; }

/* Grup submenu */
.side-parent { justify-content: flex-start; }
.side-parent .caret { margin-left: auto; font-size: .72rem; transition: transform .3s var(--ease); }
.side-group.open > .side-parent .caret { transform: rotate(180deg); }
.side-group.open > .side-parent { background: var(--primary-50); color: var(--primary-700); }

.side-submenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .34s var(--ease);
}
.side-group.open .side-submenu { grid-template-rows: 1fr; }
.side-submenu > * {
    overflow: hidden;
    min-height: 0;
}
.side-link.sub {
    font-weight: 500;
    font-size: .82rem;
    color: var(--muted);
    padding: 9px 12px 9px 46px;
}
.side-link.sub i { font-size: .72rem; opacity: .8; }
.side-link.sub::before { left: 22px; }

.side-foot { padding-top: 14px; margin-top: 10px; border-top: 1px dashed var(--line); }
.side-danger { color: var(--danger); }
.side-danger .ico { background: #fff1f2; color: var(--danger); }
.side-danger:hover { background: #fff1f2; color: var(--danger); }
.side-danger:hover .ico { background: var(--danger); color: #fff; }

/* Sembunyikan / tampilkan panel sidebar (desktop) */
@media (min-width: 992px) {
    .sidebar { transition: flex-basis .3s var(--ease), width .3s var(--ease), padding .3s var(--ease); }
    body.sidebar-collapsed .sidebar {
        flex-basis: 0;
        width: 0;
        padding-left: 0;
        padding-right: 0;
        border-right: 0;
        overflow: hidden;
    }
}

/* Overlay (mobile) */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    z-index: 1030;
    transition: opacity .3s, visibility .3s;
}
.overlay.show { opacity: 1; visibility: visible; }

/* =========================================================
   HALAMAN & KONTEN
   ========================================================= */
.page { flex: 1 1 auto; min-width: 0; }
.page-inner { padding: clamp(16px, 2.4vw, 30px); }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.page-head h1 {
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-head h1 .head-ico {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 13px;
    background: var(--grad);
    color: #fff;
    box-shadow: 0 10px 22px rgba(38,43,124,.32);
}
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }

.breadcrumb-nav { font-size: .8rem; color: var(--muted); }
.breadcrumb-nav a { color: var(--primary-600); font-weight: 600; }

/* ------------------ Hero (Dashboard) ------------------ */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: clamp(20px, 3vw, 34px);
    color: #fff;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradientMove 18s ease infinite;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}
.hero h2 { font-weight: 800; margin: 0 0 6px; font-size: clamp(1.3rem, 2.8vw, 1.9rem); }
.hero p { margin: 0; opacity: .92; max-width: 620px; }
.hero .hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .78rem; font-weight: 600;
    margin-bottom: 12px;
}
.hero::after,
.hero::before {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    pointer-events: none;
}
.hero::before { width: 220px; height: 220px; top: -80px; right: -40px; animation: floaty 7s ease-in-out infinite; }
.hero::after  { width: 140px; height: 140px; bottom: -60px; right: 120px; animation: floaty 9s ease-in-out infinite; }

/* =========================================================
   CARD / PANEL
   ========================================================= */
.card,
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    padding: 15px 20px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.panel { padding: 20px; }

.panel-title {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 1rem; margin: 0 0 16px;
}
.panel-title i { color: var(--primary); }

/* ------------------ Stat Cards ------------------ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s;
}
.stat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.stat-card::after {
    content: "";
    position: absolute;
    right: -50px; bottom: -60px;
    width: 150px; height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(38,43,124,.12), transparent 70%);
    transition: transform .5s var(--ease);
}
.stat-card:hover::after { transform: scale(1.25); }

.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-icon {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 14px;
    font-size: 1.15rem;
    color: #fff;
    box-shadow: 0 10px 20px rgba(38,43,124,.28);
}
.stat-icon.green  { background: linear-gradient(135deg, #1b1f5c, #303896); }
.stat-icon.blue   { background: linear-gradient(135deg, #0ea5e9, #3b82f6); }
.stat-icon.amber  { background: var(--grad-accent); }
.stat-icon.rose   { background: linear-gradient(135deg, #e11d48, #f43f5e); }
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-sub { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* =========================================================
   TABEL
   ========================================================= */
.table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.table-responsive { border-radius: var(--radius); }
/* Semua tabel data (data grid): bisa scroll vertikal + header kolom TETAP terlihat saat di-scroll */
.table-wrap .table-responsive { max-height: 560px; overflow-y: auto; }
.table-wrap .table-responsive thead th { position: sticky; top: 0; z-index: 3; }

.table { margin-bottom: 0; border-color: var(--line); vertical-align: middle; }
.table > :not(caption) > * > * { border-color: var(--line); }
.table > thead > tr > th {
    background: #f1f5f9;
    color: #334155;
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
.table > tbody > tr { transition: background .18s; }
.table > tbody > tr:hover { background: var(--primary-50); }

.table-dark {
    --bs-table-bg: transparent;
}
.table > thead.table-dark > tr > th {
    background: var(--grad) !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* Baris masuk berurutan */
.stagger > tbody > tr { animation: rowIn .45s var(--ease) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* =========================================================
   FORM
   ========================================================= */
.form-label { font-size: .82rem; font-weight: 600; color: #475569; margin-bottom: 4px; }
.form-control,
.form-select {
    border-radius: 10px;
    border-color: #dbe2ea;
    padding: .5rem .75rem;
    font-size: .875rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(38,43,124,.15);
}
.form-control[readonly],
.form-control.bg-light,
.form-select.bg-light { background-color: #f8fafc !important; }

.input-icon { position: relative; }
.input-icon > i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: .9rem;
    pointer-events: none;
}
.input-icon .form-control { padding-left: 40px; }

/* Fieldset berjudul */
.fieldset-border {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    background: #fff;
    position: relative;
}
.fieldset-legend {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--primary);
    padding: 0 8px;
    width: auto;
    margin-bottom: 0;
}

/* =========================================================
   TOMBOL
   ========================================================= */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), filter .2s, background .2s;
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--grad);
    border: 0;
    box-shadow: 0 8px 18px rgba(38,43,124,.28);
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--grad-soft);
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(38,43,124,.36);
}

.btn-success { background: linear-gradient(135deg,#15803d,#22c55e); border: 0; }
.btn-danger  { background: linear-gradient(135deg,#be123c,#f43f5e); border: 0; }
.btn-warning { background: var(--grad-accent); border: 0; color: #fff; }
.btn-info    { background: linear-gradient(135deg,#0284c7,#38bdf8); border: 0; color: #fff; }

.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
    content: "";
    position: absolute;
    top: 0; left: -130%;
    width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
    transform: skewX(-20deg);
    transition: left .65s var(--ease);
}
.btn-shine:hover::after { left: 130%; }

/* =========================================================
   BADGE & ALERT
   ========================================================= */
.badge { font-weight: 600; letter-spacing: .02em; padding: .42em .7em; border-radius: 8px; }

.alert {
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.alert i { margin-top: 3px; }
.alert-info    { background: #e0f2fe; color: #075985; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger  { background: #ffe4e6; color: #9f1239; }
.alert-warning { background: #fef3c7; color: #92400e; }

.note-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: .82rem;
    color: #92400e;
}

/* =========================================================
   QUICK MENU (shortcut)
   ========================================================= */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}
.quick-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.quick-item i {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 1.05rem;
    transition: transform .3s var(--ease), background .3s, color .3s;
}
.quick-item:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.quick-item:hover i { background: var(--grad); color: #fff; transform: rotate(-8deg) scale(1.08); }

/* =========================================================
   LOGIN
   ========================================================= */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradientMove 18s ease infinite;
}
.auth-wrap .blob {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    filter: blur(2px);
    pointer-events: none;
}
.auth-wrap .blob.b1 { width: 320px; height: 320px; top: -100px; left: -80px; animation: floaty 8s ease-in-out infinite; }
.auth-wrap .blob.b2 { width: 240px; height: 240px; bottom: -80px; right: -60px; animation: floaty 10s ease-in-out infinite; }
.auth-wrap .blob.b3 { width: 160px; height: 160px; top: 40%; right: 15%; animation: floaty 12s ease-in-out infinite; }

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,.98);
    border-radius: 22px;
    padding: 38px 32px 32px;
    box-shadow: var(--shadow-lg);
    animation: fadeUpCard .7s var(--ease) both;
}
@keyframes fadeUpCard { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }

.auth-logo {
    width: 74px; height: 74px;
    margin: 0 auto 16px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(38,43,124,.32);
    animation: floaty 6s ease-in-out infinite;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-title { text-align: center; font-weight: 800; font-size: 1.4rem; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 26px; }

.auth-card .form-control { padding: .68rem .85rem; }
.auth-card .input-icon .form-control { padding-left: 42px; padding-right: 42px; }
.auth-card .btn-login {
    width: 100%;
    padding: .78rem;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
    background: var(--grad);
    background-size: 180% 180%;
    box-shadow: 0 14px 28px rgba(38,43,124,.32);
    transition: transform .25s var(--ease), box-shadow .25s, background-position .5s;
}
.auth-card .btn-login:hover { transform: translateY(-2px); background-position: 100% 50%; box-shadow: 0 18px 34px rgba(38,43,124,.40); }
.auth-card .btn-login i { margin-right: 8px; }

.auth-footer { text-align: center; font-size: .76rem; color: var(--muted); margin-top: 22px; }

.pass-toggle {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    border: 0; background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background .2s, color .2s;
}
.pass-toggle:hover { background: var(--primary-50); color: var(--primary); }

.alert-shake { animation: shake .6s; }
.pulse { animation: pulseRing 2.2s infinite; }

/* =========================================================
   PRINT BUTTON FLOATING
   ========================================================= */
.amount-card {
    border-radius: var(--radius);
    padding: 18px;
    background: linear-gradient(135deg, #eef2ff, #e0f2fe);
    border: 1px solid #c7d2fe;
}
.amount-card .amount { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; color: var(--primary-700); }

.total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    margin-top: 18px;
}
.total-bar .total-label { font-weight: 700; color: var(--muted); }
.total-bar .total-value { font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 800; }

/* Riwayat pembayaran scroll box */
.scroll-box { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.scroll-box .scroll-body { max-height: 380px; overflow-y: auto; }

/* =========================================================
   RESPONSIF
   ========================================================= */
@media (max-width: 991.98px) {
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .sidebar {
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        bottom: 0;
        height: auto;
        z-index: 1035;
        width: min(84vw, 300px);
        transform: translateX(-105%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .no-scroll { overflow: hidden; }
}

@media (max-width: 575.98px) {
    .brand-text small { display: none; }
    .user-meta { display: none; }
    .user-chip { padding: 6px; }
    .btn-logout span { display: none; }
    .btn-logout { padding: 9px 12px; }
}

/* Aksesibilitas: kurangi animasi bila diminta */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .js [data-reveal] { opacity: 1; transform: none; }
}

/* =========================================================
   HALAMAN PUBLIK — DAFTAR ONLINE
   ========================================================= */
.public-body {
    background: var(--bg);
    background-image:
        radial-gradient(900px 420px at 100% -10%, rgba(0,159,227,.12), transparent 60%),
        radial-gradient(800px 420px at -10% 110%, rgba(38,43,124,.12), transparent 55%);
    background-attachment: fixed;
}

.public-top {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--grad);
    background-size: 220% 220%;
    animation: gradientMove 16s ease infinite;
    box-shadow: 0 8px 26px rgba(27,31,92,.28);
}
.public-top-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}
.public-logo {
    display: block;
    width: 44px; height: 44px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    flex: 0 0 auto;
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.public-logo img { width: 100%; height: 100%; object-fit: cover; }
.public-brand { display: flex; flex-direction: column; line-height: 1.1; }
.public-brand strong { font-weight: 800; font-size: 1.02rem; }
.public-brand small { font-size: .74rem; opacity: .9; }
.btn-owner {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.3);
    transition: background .25s, transform .25s var(--ease);
}
.btn-owner:hover { background: #fff; color: var(--primary-700); transform: translateY(-2px); }

.public-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(16px, 3vw, 30px) clamp(14px, 3vw, 24px) 40px;
}

.public-hero {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeUpCard .6s var(--ease) both;
}
.public-hero h1 {
    font-size: clamp(1.3rem, 4vw, 1.9rem);
    font-weight: 800;
    margin-bottom: 8px;
}
.public-hero p { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: .92rem; }

.public-wrap .panel { animation: fadeUpCard .6s var(--ease) both; }

/* Input tagihan (angka besar tanpa border) */
.amount-field {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    font-weight: 800;
    color: var(--primary-700);
    padding: 0;
    outline: none;
}

/* Layar sukses */
.success-screen {
    text-align: center;
    padding: clamp(24px, 5vw, 40px);
    animation: fadeUpCard .6s var(--ease) both;
}
.success-screen h2 { font-weight: 800; margin-bottom: 6px; }
.success-check {
    width: 96px; height: 96px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    color: #fff;
    background: linear-gradient(135deg, #15803d, #22c55e);
    box-shadow: 0 16px 34px rgba(22,163,74,.4);
    animation: popIn .55s var(--ease) both;
}
@keyframes popIn {
    0%   { transform: scale(.3); opacity: 0; }
    60%  { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); }
}
.reg-number {
    font-size: clamp(1.4rem, 6vw, 2rem);
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--primary-700);
    background: var(--primary-50);
    border: 2px dashed var(--primary-600);
    border-radius: 14px;
    padding: 16px 12px;
    margin: 6px auto 0;
    word-break: break-all;
}

.public-foot {
    text-align: center;
    color: var(--muted);
    font-size: .78rem;
    margin-top: 8px;
    line-height: 1.6;
}

@media (max-width: 575.98px) {
    .btn-owner span { display: none; }
    .btn-owner { padding: 9px 12px; }
}

/* =========================================================
   CATATAN
   Tampilan halaman login sekarang memakai layout split-panel
   dan TIDAK lagi memakai background foto.
   Style-nya ada di: assets/css/login.css
   ========================================================= */

/* =========================================================
   FOOTER (panel cantik — Create by ...)
   ========================================================= */
.side-credit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 11px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f7ff 55%, #e0f2fe 100%);
    border: 1px solid rgba(38, 43, 124, .24);
    box-shadow: 0 4px 12px rgba(38, 43, 124, .10), inset 0 1px 0 #fff;
    color: var(--primary-700);
    font-size: .68rem;
    font-weight: 600;
    font-style: italic;
    line-height: 1.3;
    text-align: left;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.side-credit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(38, 43, 124, .18), inset 0 1px 0 #fff;
}
.side-credit i { color: var(--accent); font-style: normal; font-size: .7rem; }
.side-credit strong { font-weight: 800; }
/* =========================================================
   MODAL PILIH SISWA (TRANSAKSI KASIR)
   Dibuat lebih lebar + kolom "Aksi" menempel di kanan agar
   kasir tidak perlu scroll horizontal untuk klik "Pilih".
   ========================================================= */
.modal-pilih-siswa {
    --bs-modal-width: min(1200px, 96vw);
}

.modal-pilih-siswa .modal-body {
    padding: 14px 16px 18px;
}

.modal-pilih-siswa .table-wrap .table-responsive {
    max-height: 62vh;
    overflow: auto;
}

#tabelSiswaLookup {
    width: 100%;
    margin-bottom: 0;
}

#tabelSiswaLookup th,
#tabelSiswaLookup td {
    vertical-align: middle;
    white-space: nowrap;
}

/* Nama siswa boleh turun baris, asal sekolah dipotong elipsis */
#tabelSiswaLookup td:nth-child(3) {
    white-space: normal;
    min-width: 170px;
}
#tabelSiswaLookup td:nth-child(4) {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kolom kiri (No. Pendaftaran) & kanan (Aksi) selalu terlihat saat digeser */
#tabelSiswaLookup th:first-child,
#tabelSiswaLookup td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 8px 0 10px -8px rgba(0, 0, 0, .3);
}

#tabelSiswaLookup th:last-child,
#tabelSiswaLookup td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -8px 0 10px -8px rgba(0, 0, 0, .3);
}

/* Header memakai warna gelap (table-dark) agar seragam */
#tabelSiswaLookup thead th:first-child,
#tabelSiswaLookup thead th:last-child {
    background: #212529;
    z-index: 3;
}

/* Warna hover tetap terlihat pada kolom sticky */
#tabelSiswaLookup tbody tr:hover td:first-child,
#tabelSiswaLookup tbody tr:hover td:last-child {
    background: #eef2f6;
}

/* Tombol Pilih dibuat sedikit lebih lega */
#tabelSiswaLookup td:last-child .btn {
    padding: 4px 14px;
}

@media (max-width: 767.98px) {
    .modal-pilih-siswa { --bs-modal-width: 96vw; }
    .modal-pilih-siswa .table-wrap .table-responsive { max-height: 55vh; }
}

/* =========================================================
   THEME SWITCH (MODE GELAP / CERAH â€” MATAHARI, AWAN, BULAN, BINTANG)
   ========================================================= */
.switch {
    font-size: 17px;
    position: relative;
    display: inline-block;
    width: 4em;
    height: 2.2em;
    border-radius: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    flex: 0 0 auto;
    margin: 0;
}

.theme-switch-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040;
    font-size: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-switch-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.34);
}

@media (max-width: 575.98px) {
    .theme-switch-float {
        right: 14px;
        bottom: 14px;
        font-size: 14px;
    }
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2a2a2a;
    transition: 0.4s;
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.slider:before {
    position: absolute;
    content: "";
    height: 1.2em;
    width: 1.2em;
    border-radius: 20px;
    left: 0.5em;
    bottom: 0.45em;
    transition: 0.4s;
    transition-timing-function: cubic-bezier(0.81, -0.04, 0.38, 1.5);
    box-shadow: inset 8px -4px 0px 0px #fff;
}

.switch input:checked + .slider {
    background-color: #00a6ff;
}

.switch input:checked + .slider:before {
    transform: translateX(1.8em);
    box-shadow: inset 15px -4px 0px 15px #ffcf48;
}

.star {
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    width: 5px;
    transition: all 0.4s;
    height: 5px;
}

.star_1 {
    left: 2.5em;
    top: 0.5em;
}

.star_2 {
    left: 2.2em;
    top: 1.2em;
}

.star_3 {
    left: 3em;
    top: 0.9em;
}

.switch input:checked ~ .slider .star {
    opacity: 0;
}

.cloud {
    width: 3.5em;
    position: absolute;
    bottom: -1.4em;
    left: -1.1em;
    opacity: 0;
    transition: all 0.4s;
    pointer-events: none;
}

.switch input:checked ~ .slider .cloud {
    opacity: 1;
}

/* =========================================================
   DARK MODE GLOBAL (HALAMAN ADMIN & HALAMAN PUBLIK)
   ========================================================= */
html.dark-mode,
body.dark-mode {
    --ink:       #e2e8f0;
    --muted:     #94a3b8;
    --line:      #1e293b;
    --bg:        #0b1120;
    --card:      #111827;
    --primary-50: rgba(56, 189, 248, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .35);
    --shadow:    0 10px 30px rgba(0, 0, 0, .48);
    --shadow-lg: 0 22px 48px rgba(0, 0, 0, .62);
    color-scheme: dark;
}

body.dark-mode,
body.dark-mode.public-body {
    background-color: #0b1120;
    background-image:
        radial-gradient(1100px 520px at 100% -10%, rgba(0, 159, 227, .12), transparent 60%),
        radial-gradient(900px 480px at -10% 110%, rgba(38, 43, 124, .22), transparent 55%);
    color: var(--ink);
}

body.dark-mode .sidebar {
    background: rgba(17, 24, 39, 0.92);
    border-right-color: #1e293b;
}

body.dark-mode .side-link {
    color: #cbd5e1;
}

body.dark-mode .side-link .ico {
    background: #1e293b;
    color: #7dd3fc;
}

body.dark-mode .side-link:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #f8fafc;
}

body.dark-mode .side-link.sub {
    color: #94a3b8;
}

body.dark-mode .side-credit {
    background: linear-gradient(135deg, #162038 0%, #111827 60%, #0f2942 100%);
    border-color: #263554;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
    color: #bae6fd;
}

body.dark-mode .card,
body.dark-mode .panel,
body.dark-mode .stat-card,
body.dark-mode .quick-item,
body.dark-mode .total-bar,
body.dark-mode .fieldset-border,
body.dark-mode .table-wrap,
body.dark-mode .modal-content {
    background: #111827;
    border-color: #1e293b;
    color: #e2e8f0;
}

body.dark-mode .card-header,
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #1e293b;
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-mode .panel-title i,
body.dark-mode .fieldset-legend,
body.dark-mode .breadcrumb-nav a {
    color: #7dd3fc;
}

body.dark-mode .quick-item i {
    background: #1e293b;
    color: #7dd3fc;
}

body.dark-mode .table {
    --bs-table-bg: #111827;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: #1e293b;
    --bs-table-striped-bg: #151f32;
    --bs-table-striped-color: #e2e8f0;
    --bs-table-hover-bg: rgba(56, 189, 248, 0.10);
    --bs-table-hover-color: #f8fafc;
    color: #e2e8f0;
}

body.dark-mode .table > thead > tr > th {
    background: #1e293b;
    color: #cbd5e1;
    border-bottom-color: #334155;
}

body.dark-mode .form-label {
    color: #cbd5e1;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .form-control::placeholder {
    color: #64748b;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #0f172a;
    border-color: #38bdf8;
    color: #f8fafc;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

body.dark-mode .form-control[readonly],
body.dark-mode .form-control.bg-light,
body.dark-mode .form-select.bg-light {
    background-color: #162033 !important;
    color: #cbd5e1;
}

body.dark-mode .form-text,
body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

body.dark-mode .amount-card {
    background: linear-gradient(135deg, #16223b, #102a43);
    border-color: #274060;
}

body.dark-mode .amount-card .amount,
body.dark-mode .amount-field,
body.dark-mode .reg-number {
    color: #7dd3fc;
}

body.dark-mode .reg-number {
    background: #0f172a;
    border-color: #38bdf8;
}

body.dark-mode .note-box {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

body.dark-mode .alert-info    { background: rgba(14, 165, 233, 0.18); color: #bae6fd; }
body.dark-mode .alert-success { background: rgba(22, 163, 74, 0.18);  color: #bbf7d0; }
body.dark-mode .alert-danger  { background: rgba(225, 29, 72, 0.18);  color: #fecdd3; }
body.dark-mode .alert-warning { background: rgba(245, 158, 11, 0.18); color: #fde68a; }

body.dark-mode #tabelSiswaLookup th:first-child,
body.dark-mode #tabelSiswaLookup td:first-child,
body.dark-mode #tabelSiswaLookup th:last-child,
body.dark-mode #tabelSiswaLookup td:last-child {
    background: #111827;
}

body.dark-mode #tabelSiswaLookup tbody tr:hover td:first-child,
body.dark-mode #tabelSiswaLookup tbody tr:hover td:last-child {
    background: #1e293b;
}

/* Dark mode halaman login */
body.dark-mode .login-page {
    background: #0b1120;
}
body.dark-mode .login-panel {
    background: #0b1120;
    background-image: radial-gradient(circle at 100% 0, rgba(0, 159, 227, 0.14) 0, transparent 48%);
}
body.dark-mode .login-card {
    background: #111827;
    border-color: #1e293b;
}
body.dark-mode .login-badge {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.32);
    color: #7dd3fc;
}
body.dark-mode .login-loading {
    background: rgba(17, 24, 39, 0.9);
}
body.dark-mode .login-loading-text {
    color: #7dd3fc;
}