/* ===== Reset & base ===== */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #050418;
    --bg-2: #0b0a2a;
    --text: #e8e7ff;
    --muted: #a3a1c7;
    --primary: #6366f1;
    --violet: #a855f7;
    --cyan: #06b6d4;
    --pink: #f472b6;
    --border: rgba(255,255,255,.08);
    --glass-bg: rgba(255,255,255,.04);
    --glass-brd: rgba(255,255,255,.10);
    --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
    --radius: 20px;
    --radius-sm: 12px;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-head: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background:
        radial-gradient(1200px 800px at 80% -10%, #1e1b4b 0%, transparent 60%),
        radial-gradient(900px 600px at -10% 30%, #312e81 0%, transparent 60%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1,h2,h3,h4 {
    font-family: var(--font-head);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.container { width: min(1200px, 92vw); margin-inline: auto; }
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-brd);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}
.grad {
    background: linear-gradient(90deg,var(--primary),var(--violet),var(--cyan));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 999px;
    font-weight: 600; font-size: 15px;
    border: 1px solid transparent; cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    white-space: nowrap;
}
.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary {
    background: linear-gradient(135deg,var(--primary),var(--violet));
    color: #fff;
    box-shadow: 0 10px 30px -10px rgba(99,102,241,.7);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px -12px rgba(168,85,247,.8);
}
.btn-ghost {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--glass-brd);
    color: var(--text);
}
.btn-ghost:hover {
    background: rgba(255,255,255,.08);
    transform: translateY(-2px);
}

/* ===== Navbar ===== */
.nav {
    position: sticky; top: 16px; z-index: 50;
    margin: 16px auto 0;
    width: min(1200px, 94vw);
    border-radius: 999px;
    padding: 12px 24px;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo {
    font-family: var(--font-head); font-weight: 800; font-size: 20px;
    display: flex; align-items: center; gap: 8px; color: #fff;
}
.logo span:not(.logo-dot) { color: var(--violet); }
.logo-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: linear-gradient(135deg,var(--primary),var(--cyan));
    box-shadow: 0 0 20px rgba(99,102,241,.8);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-size: 14px; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: #fff; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.nav-burger {
    display: none; background: transparent; border: 0;
    flex-direction: column; gap: 4px; cursor: pointer; padding: 8px;
}
.nav-burger span {
    width: 22px; height: 2px; background: #fff; border-radius: 2px;
    transition: .3s;
}

/* ===== Grid ===== */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 16px;
}
.alert-error {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.35);
    color: #fecaca;
}
.alert-success {
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.35);
    color: #a7f3d0;
}

/* ===== Forms ===== */
.field { display: block; margin-bottom: 14px; }
.field span {
    display: block; font-size: 13px; color: var(--muted);
    margin-bottom: 6px; font-weight: 500;
}
.field input, .field select, .field textarea {
    width: 100%; padding: 12px 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--glass-brd);
    border-radius: var(--radius-sm);
    color: #fff; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

/* ===== Auth pages ===== */
.auth-body {
    display: grid; place-items: center;
    min-height: 100vh; padding: 24px;
}
.auth-wrap { width: 100%; max-width: 440px; }
.auth-card { padding: 36px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.auth-back {
    display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 12px;
}
.auth-back:hover { color: #fff; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--cyan); font-weight: 600; }
.auth-hint { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.auth-hint code {
    background: rgba(255,255,255,.06);
    padding: 2px 6px; border-radius: 6px;
}

/* ===== Dashboard ===== */
.dash-main { padding: 32px 0; display: grid; gap: 24px; }
.dash-hero {
    padding: 28px;
    display: flex; justify-content: space-between;
    align-items: center; gap: 20px; flex-wrap: wrap;
}
.dash-hero h1 { font-size: clamp(22px, 3vw, 32px); }
.dash-hero p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.dash-date {
    font-size: 13px; color: var(--muted);
    background: rgba(255,255,255,.04);
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--glass-brd);
}
.stat { padding: 24px; text-align: center; }
.stat-num {
    font-family: var(--font-head); font-weight: 800;
    font-size: clamp(28px, 4vw, 44px);
    background: linear-gradient(135deg,var(--primary),var(--violet),var(--cyan));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label {
    color: var(--muted); font-size: 13px; margin-top: 4px;
    text-transform: uppercase; letter-spacing: .05em;
}
.user-chip {
    display: flex; flex-direction: column; align-items: flex-end; font-size: 13px;
}
.user-chip small { color: var(--muted); text-transform: capitalize; }
.table-card { padding: 24px; }
.table-card h2 { font-size: 18px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th {
    color: var(--muted); font-weight: 600;
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
}
.empty { text-align: center; color: var(--muted); padding: 20px; }

/* ===== Reveal animation ===== */
.reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 1023px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 70px; left: 16px; right: 16px;
        background: rgba(10,8,40,.95); padding: 20px;
        border-radius: var(--radius);
        border: 1px solid var(--glass-brd);
    }
    .nav-burger { display: flex; }
    .nav-actions .btn-ghost { display: none; }
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .dash-hero { flex-direction: column; align-items: flex-start; }
    .auth-card { padding: 24px; }
    .nav { top: 8px; padding: 10px 18px; }
}
@media (max-width: 480px) {
    .btn-lg { padding: 14px 22px; font-size: 15px; }
    .nav-actions .btn-primary { padding: 10px 16px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ============================================
   Logo & Brand Customization (MA Nurul Qur'an)
   ============================================ */

/* Logo di Sidebar */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-head);
    text-decoration: none;
    padding: 16px 20px;
}
.sidebar-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    padding: 2px;
}
.sidebar-brand-text {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
}
.sidebar-brand-text span {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
html[data-theme="light"] .sidebar-brand-text { color: #1a1a2e; }

/* Logo di Navbar Landing */
.nav-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}
.nav-brand-text {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.nav-brand-text span {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
html[data-theme="light"] .nav-brand-text { color: #1a1a2e; }

/* Adjust existing logo-dot (jika masih dipakai) */
.logo-dot { display: none; }
/* ============================================
   Custom Modal (Glassmorphism)
   ============================================ */
.ep-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 4, 24, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    padding: 20px;
}
.ep-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ep-modal {
    background: rgba(15, 12, 45, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px -12px rgba(0,0,0,0.8);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}
html[data-theme="light"] .ep-modal {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 24px 60px -12px rgba(60, 60, 120, 0.2);
}
.ep-modal-overlay.active .ep-modal {
    transform: scale(1) translateY(0);
}

.ep-modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.ep-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 24px;
    flex-shrink: 0;
}
.ep-modal-icon.warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.ep-modal-icon.danger  { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.ep-modal-icon.info    { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }

.ep-modal-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
}

.ep-modal-body {
    padding: 16px 24px 24px 88px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.ep-modal-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
html[data-theme="light"] .ep-modal-footer {
    background: rgba(0, 0, 0, 0.02);
    border-top-color: rgba(0, 0, 0, 0.05);
}

.ep-modal-footer .btn {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 10px;
}
.ep-modal-footer .btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(239, 68, 68, 0.6);
}
.ep-modal-footer .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -10px rgba(239, 68, 68, 0.8);
}