/* =====================================================================
   APLIKASI ADMINISTRASI GURU MA NURUL AMIN
   Tema: Putih dasar + Aksen Biru, kartu warna-warni, futuristik elegan
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --biru-utama: #2563eb;
    --biru-tua: #1e3a8a;
    --biru-muda: #60a5fa;
    --biru-bg: #eff6ff;
    --putih: #ffffff;
    --abu-teks: #475569;
    --abu-gelap: #1e293b;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-soft: 0 8px 30px rgba(37, 99, 235, 0.08);
    --shadow-hover: 0 16px 40px rgba(37, 99, 235, 0.18);

    /* Palet kartu warna-warni */
    --c1-a: #6366f1; --c1-b: #818cf8;
    --c2-a: #06b6d4; --c2-b: #22d3ee;
    --c3-a: #f59e0b; --c3-b: #fbbf24;
    --c4-a: #ec4899; --c4-b: #f472b6;
    --c5-a: #10b981; --c5-b: #34d399;
    --c6-a: #8b5cf6; --c6-b: #a78bfa;
}

* { box-sizing: border-box; }

html { view-transition-name: root; }

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
    background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 40%);
    color: var(--abu-gelap);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===================== MORPH TRANSITIONS ===================== */
.morph-in {
    animation: morphIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes morphIn {
    0% { opacity: 0; transform: scale(0.96) translateY(14px); border-radius: 26px; filter: blur(6px); }
    60% { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); border-radius: var(--radius-lg); }
}
.morph-card {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.45s ease;
}
.morph-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: var(--shadow-hover);
    border-radius: 26px;
}
.morph-btn {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.morph-btn:hover { transform: translateY(-2px) scale(1.03); }
.morph-btn:active { transform: scale(0.96); }

.page-fade { animation: pageFade 0.5s ease; }
@keyframes pageFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-item {
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 14px;
}
.sidebar-item:hover {
    background: var(--biru-bg);
    transform: translateX(4px);
    border-radius: 20px;
}
.sidebar-item.active {
    background: linear-gradient(135deg, var(--biru-utama), var(--biru-tua));
    color: #fff;
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
    border-radius: 18px;
}
.sidebar-item.active svg { stroke: #fff; }

.tab-item {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 999px;
}
.tab-item.active {
    background: #fff;
    color: var(--biru-utama);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    border-radius: 999px;
    font-weight: 700;
}

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

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #edf2f9;
    padding: 22px 16px;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    z-index: 40;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar.closed { transform: translateX(-100%); }

.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    padding-bottom: 40px;
    transition: margin-left 0.4s ease;
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,0.15); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

.topbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid #edf2f9;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 14px 22px;
}

.tabs-nav {
    display: flex;
    gap: 6px;
    background: var(--biru-bg);
    padding: 6px;
    border-radius: 999px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }
.tabs-nav a {
    white-space: nowrap;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--abu-teks);
    text-decoration: none;
    display: inline-block;
}

/* ===================== CARDS ===================== */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 22px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    isolation: isolate;
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    z-index: -1;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: -20px; bottom: -40px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.10);
    z-index: -1;
}
.card-c1 { background: linear-gradient(135deg, var(--c1-a), var(--c1-b)); }
.card-c2 { background: linear-gradient(135deg, var(--c2-a), var(--c2-b)); }
.card-c3 { background: linear-gradient(135deg, var(--c3-a), var(--c3-b)); }
.card-c4 { background: linear-gradient(135deg, var(--c4-a), var(--c4-b)); }
.card-c5 { background: linear-gradient(135deg, var(--c5-a), var(--c5-b)); }
.card-c6 { background: linear-gradient(135deg, var(--c6-a), var(--c6-b)); }

.panel {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 22px;
    border: 1px solid #f1f5fb;
}

.btn-primary {
    background: linear-gradient(135deg, var(--biru-utama), var(--biru-tua));
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(37,99,235,0.3);
}
.btn-secondary {
    background: #fff;
    border: 1.5px solid #e2e8f5;
    color: var(--abu-teks);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
    background: var(--biru-bg);
    color: var(--biru-tua);
    text-align: left;
    padding: 12px 14px;
    font-weight: 700;
    position: sticky; top: 0;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid #f1f5fb; }
table.tbl tr:hover td { background: #fafcff; }

.badge { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-block; }
.badge-H { background: #dcfce7; color: #15803d; }
.badge-S { background: #fef9c3; color: #a16207; }
.badge-I { background: #dbeafe; color: #1d4ed8; }
.badge-A { background: #fee2e2; color: #b91c1c; }
.badge-admin { background: #ede9fe; color: #6d28d9; }
.badge-guru { background: #dbeafe; color: #1d4ed8; }
.badge-wali { background: #fce7f3; color: #be185d; }

.input-field {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f5;
    border-radius: 12px;
    font-size: 14px;
    background: #fbfdff;
    transition: border 0.25s ease, box-shadow 0.25s ease;
}
.input-field:focus {
    outline: none;
    border-color: var(--biru-utama);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
    background: #fff;
}
label.form-label { font-size: 13px; font-weight: 700; color: var(--abu-teks); margin-bottom: 6px; display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd8f0; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===================== UTILITIES ===================== */
.container-app { max-width: 1280px; margin: 0 auto; padding: 22px 22px 10px; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr);} }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }
.text-sm { font-size: 13px; } .text-xs { font-size: 11.5px; }
.font-bold { font-weight: 700; } .font-extra { font-weight: 800; }
.text-muted { color: #64748b; }
.text-blue { color: var(--biru-utama); }
.w-full { width: 100%; }
.rounded-full { border-radius: 999px; }
.overflow-auto { overflow: auto; }
.hidden { display: none !important; }
.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 35;
    backdrop-filter: blur(2px);
}
.avatar-sm { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; background:#e2e8f5; }
.section-title { font-size: 22px; font-weight: 800; color: #1e293b; margin: 0 0 4px; }
.section-sub { font-size: 13.5px; color: #64748b; margin: 0 0 20px; font-weight: 500; }
@media (max-width: 640px) { .hide-mobile { display: none !important; } }
