/* =========================================================
   EduNova ERP — Design System
   Soft blue/purple glassmorphism SaaS aesthetic
   ========================================================= */

:root {
    --primary: #6C4FE8;
    --primary-dark: #5132B8;
    --sky: #67D5F7;
    --lavender: #E7DDFF;
    --bg: #F8FAFF;
    --text: #20193B;
    --muted: #746D8B;
    --success: #35B879;
    --warning: #F2B84B;
    --danger: #E85D75;

    --radius-lg: 24px;
    --radius-xl: 28px;
    --shadow-soft: 0 20px 60px rgba(76, 60, 140, 0.12);
    --shadow-card: 0 10px 30px rgba(76, 60, 140, 0.08);
    --shadow-hover: 0 18px 40px rgba(76, 60, 140, 0.18);
    --transition-base: 0.2s ease;
    --font-main: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(108, 79, 232, 0.22); color: var(--text); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108, 79, 232, 0.25); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108, 79, 232, 0.42); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, .nav-item:focus-visible, .tab-link:focus-visible {
    outline: 2.5px solid var(--primary);
    outline-offset: 2px;
    border-radius: 8px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------- Background Orbs ---------------- */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
}
.orb-blue { width: 420px; height: 420px; background: var(--sky); top: -120px; left: -100px; }
.orb-purple { width: 500px; height: 500px; background: var(--primary); bottom: -160px; right: -140px; }
.orb-lavender { width: 340px; height: 340px; background: var(--lavender); top: 40%; left: 45%; opacity: 0.5; }

@media (prefers-reduced-motion: no-preference) {
    .orb { animation: float 14s ease-in-out infinite; }
    .orb-purple { animation-delay: -4s; }
    .orb-lavender { animation-delay: -8s; }
}
@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-24px) translateX(18px); }
}

/* ---------------- Glass Card ---------------- */
.glass-card {
    position: relative;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    transition: box-shadow var(--transition-base);
}

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.925rem;
    padding: 0.75rem 1.4rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
    width: 100%;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; opacity: 0.85; }

.btn-spinner {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    display: inline-block;
    animation: btn-spin 0.7s linear infinite;
}
.btn-secondary .btn-spinner,
.btn-icon .btn-spinner {
    border-color: rgba(108, 79, 232, 0.22);
    border-top-color: var(--primary);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-spinner { animation-duration: 1.4s; } }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 12px 28px rgba(108, 79, 232, 0.35);
}
.btn-primary:hover { box-shadow: 0 16px 34px rgba(108, 79, 232, 0.45); }

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(32, 25, 59, 0.08);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.95); }

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, var(--danger), #c94660);
}
.btn-danger:hover { box-shadow: 0 14px 30px rgba(232, 93, 117, 0.35); }

.btn-block { width: 100%; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 1.1rem; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
}
.form-input, .form-select {
    width: 100%;
    font-family: var(--font-main);
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1.5px solid rgba(32, 25, 59, 0.1);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:hover, .form-select:hover { border-color: rgba(108, 79, 232, 0.32); }
.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 79, 232, 0.12);
}
.form-help { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }

/* ---------------- Alerts ---------------- */
.alert {
    border-radius: 14px;
    padding: 0.85rem 1.1rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    animation: slideIn 0.25s ease;
}
.alert.flash-hide { opacity: 0; transform: translateY(-6px); transition: all 0.4s ease; }
.alert-success { background: rgba(53, 184, 121, 0.12); color: #1f7a4f; border: 1px solid rgba(53, 184, 121, 0.25); border-left: 3px solid var(--success); }
.alert-error { background: rgba(232, 93, 117, 0.1); color: #a83950; border: 1px solid rgba(232, 93, 117, 0.25); border-left: 3px solid var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   Auth Pages (Login / Register)
   ========================================================= */
body.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}
.auth-shell { position: relative; z-index: 1; width: 100%; max-width: 460px; }
.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 2.4rem 2.2rem;
}
@media (prefers-reduced-motion: no-preference) {
    .auth-card { animation: fadeInUp 0.4s ease; }
}
.auth-logo {
    width: 52px; height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--sky));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.3rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 10px 24px rgba(108, 79, 232, 0.35);
}
.auth-title { font-size: 1.6rem; margin-bottom: 0.35rem; }
.auth-subtitle { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.8rem; }
.auth-footer-text { text-align: center; font-size: 0.88rem; color: var(--muted); margin-top: 1.4rem; }
.auth-footer-text a { color: var(--primary); font-weight: 600; }
.auth-checkbox-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; font-size: 0.85rem; }

/* =========================================================
   Application Shell (Dashboard)
   ========================================================= */
.app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 272px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(32, 25, 59, 0.06);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 0.7rem; padding: 0 0.4rem 1.4rem; }
.sidebar-brand .auth-logo { margin: 0; width: 42px; height: 42px; font-size: 1.05rem; }
.sidebar-brand-name { font-weight: 800; font-size: 1.05rem; line-height: 1.1; }
.sidebar-brand-tag { font-size: 0.72rem; color: var(--muted); }

.sidebar-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 1.1rem 0.6rem 0.5rem;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(108, 79, 232, 0.14), rgba(103, 213, 247, 0.14));
    color: var(--primary-dark);
}
a.nav-item:hover { background: rgba(108, 79, 232, 0.08); transform: translateX(2px); }
.nav-item.disabled { color: var(--muted); cursor: default; }
.nav-item.disabled:hover { background: none; transform: none; }
.nav-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--lavender);
    color: var(--primary-dark);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(32, 25, 59, 0.08);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.avatar-circle {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--sky));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
}
.sidebar-user-name { font-size: 0.85rem; font-weight: 700; line-height: 1.1; }
.sidebar-user-role { font-size: 0.72rem; color: var(--muted); }
.logout-link { margin-left: auto; color: var(--muted); transition: color var(--transition-base); }
.logout-link:hover { color: var(--danger); }

.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(20, 15, 40, 0.4);
    z-index: 15;
    display: none;
}
.sidebar-overlay.active { display: block; }

/* Main Content */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.8rem;
    background: rgba(248, 250, 255, 0.6);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(32, 25, 59, 0.05);
}
.topbar-title { font-size: 1.15rem; font-weight: 700; }
.hamburger {
    display: none;
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(32, 25, 59, 0.1);
    background: rgba(255, 255, 255, 0.8);
    align-items: center; justify-content: center;
    cursor: pointer;
    transition: background var(--transition-base);
}
.hamburger:hover { background: rgba(255, 255, 255, 1); }
.topbar-right { display: flex; align-items: center; gap: 0.9rem; }
.badge-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
}
.badge-trial { background: rgba(242, 184, 75, 0.16); color: #a5721b; }
.badge-active { background: rgba(53, 184, 121, 0.14); color: #1f7a4f; }

.app-content { padding: 1.8rem; flex: 1; }
@media (prefers-reduced-motion: no-preference) {
    .app-content { animation: fadeInUp 0.35s ease; }
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin: 1.4rem 0 1.8rem;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; } }

.kpi-card {
    border-radius: var(--radius-lg);
    padding: 1.3rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.kpi-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.9rem;
    background: linear-gradient(135deg, var(--primary), var(--sky));
    color: #fff;
}
.kpi-icon-purple { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.kpi-icon-sky { background: linear-gradient(135deg, var(--sky), #3fb8de); }
.kpi-icon-success { background: linear-gradient(135deg, var(--success), #279960); }
.kpi-icon-warning { background: linear-gradient(135deg, var(--warning), #d99a2b); }
.kpi-icon-danger { background: linear-gradient(135deg, var(--danger), #c94660); }
.kpi-value { font-size: 1.7rem; font-weight: 800; margin-bottom: 0.15rem; }
.kpi-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.widget-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.2rem; }
@media (max-width: 980px) { .widget-grid { grid-template-columns: 1fr; } }

.roadmap-item {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(32, 25, 59, 0.06);
    font-size: 0.88rem;
}
.roadmap-item:last-child { border-bottom: none; }
.roadmap-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lavender); flex-shrink: 0; }
.roadmap-dot.done { background: var(--success); }
.roadmap-phase { font-weight: 700; margin-right: 0.4rem; }

.quick-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-top: 0.6rem; }
@media (max-width: 700px) { .quick-actions-grid { grid-template-columns: repeat(2, 1fr); } }
.quick-action {
    display: block;
    border-radius: 16px;
    padding: 1rem 0.8rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(32, 25, 59, 0.06);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    position: relative;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base), color var(--transition-base);
}
.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
}
.quick-action .qa-icon { font-size: 1.4rem; display: block; margin-bottom: 0.4rem; }
.quick-action .qa-badge {
    position: absolute; top: 0.5rem; right: 0.5rem;
    font-size: 0.6rem; font-weight: 700;
    background: var(--lavender); color: var(--primary-dark);
    padding: 0.1rem 0.4rem; border-radius: 999px;
}

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; flex-wrap: wrap; gap: 0.6rem; }
.muted { color: var(--muted); }

/* Responsive Sidebar Drawer */
@media (max-width: 960px) {
    .hamburger { display: flex; }
    .sidebar {
        position: fixed;
        left: -290px;
        top: 0;
        height: 100vh;
        z-index: 20;
        transition: left 0.25s ease;
        box-shadow: var(--shadow-soft);
    }
    .sidebar.sidebar-open { left: 0; }
    .app-content { padding: 1.2rem; }
    .topbar { padding: 1rem 1.2rem; }
}

@media (max-width: 430px) {
    .kpi-value { font-size: 1.4rem; }
    .auth-card { padding: 1.9rem 1.5rem; }
    .app-content { padding: 1rem; }
    .glass-card { padding: 1.1rem; }
}

/* ---------------- Tabs ---------------- */
.tabs-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.35rem;
    border-radius: 14px;
    width: fit-content;
}
.tab-link {
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    transition: background var(--transition-base), color var(--transition-base);
}
.tab-link:not(.active):hover { background: rgba(108, 79, 232, 0.08); color: var(--primary-dark); }
.tab-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

/* ---------------- Inline / Filter Forms ---------------- */
.inline-form, .filter-bar {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    align-items: center;
    margin: 0.6rem 0 1rem;
}
.inline-form .form-input, .filter-bar .form-input { width: auto; flex: 1; min-width: 180px; }

/* ---------------- Data Tables ---------------- */
.table-wrap { overflow-x: auto; border-radius: 16px; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.data-table thead th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 0.7rem 0.9rem;
    border-bottom: 1.5px solid rgba(32, 25, 59, 0.08);
    white-space: nowrap;
    background: rgba(248, 250, 255, 0.9);
}
.data-table tbody td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid rgba(32, 25, 59, 0.05);
    vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition-base); }
.data-table tbody tr:hover { background: rgba(108, 79, 232, 0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }

.row-actions { white-space: nowrap; display: flex; gap: 0.4rem; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 9px;
    border: 1px solid rgba(32, 25, 59, 0.08);
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background var(--transition-base), transform var(--transition-base);
}
.btn-icon:hover { background: rgba(108, 79, 232, 0.1); transform: translateY(-1px); }
.btn-icon-danger:hover { background: rgba(232, 93, 117, 0.14); }

.avatar-sm {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--sky));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

/* ---------------- Status Badges ---------------- */
.status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    display: inline-block;
}
.badge-status-active { background: rgba(53, 184, 121, 0.14); color: #1f7a4f; }
.badge-status-inactive { background: rgba(116, 109, 139, 0.14); color: var(--muted); }
.badge-status-alumni { background: rgba(103, 213, 247, 0.18); color: #1a7c96; }
.badge-status-danger { background: rgba(232, 93, 117, 0.14); color: #a83950; }
.badge-status-warning { background: rgba(242, 184, 75, 0.16); color: #a5721b; }
.badge-status-info { background: rgba(103, 213, 247, 0.18); color: #1a7c96; }
.badge-status-paid { background: rgba(53, 184, 121, 0.14); color: #1f7a4f; }
.badge-status-partial { background: rgba(242, 184, 75, 0.16); color: #a5721b; }
.badge-status-pending { background: rgba(116, 109, 139, 0.14); color: var(--muted); }
.badge-status-overdue { background: rgba(232, 93, 117, 0.14); color: #a83950; }
.badge-status-waived { background: rgba(103, 213, 247, 0.18); color: #1a7c96; }

/* ---------------- Pagination ---------------- */
.pagination {
    display: flex;
    gap: 0.4rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}
.pagination a {
    display: inline-flex;
    align-items: center; justify-content: center;
    min-width: 34px; height: 34px;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(32, 25, 59, 0.08);
    color: var(--text);
    transition: all var(--transition-base);
}
.pagination a:hover:not(.active) { background: rgba(108, 79, 232, 0.1); border-color: rgba(108, 79, 232, 0.25); }
.pagination a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
}

/* ---------------- Empty States ---------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}
.empty-state .empty-icon {
    font-size: 2.6rem;
    margin-bottom: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px; height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(108, 79, 232, 0.12), rgba(103, 213, 247, 0.12));
}
.empty-state h3 { margin-bottom: 0.4rem; }

/* ---------------- Form Actions ---------------- */
.form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

/* ---------------- Profile Grid ---------------- */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
    font-size: 0.88rem;
}
@media (max-width: 700px) { .profile-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- Skeleton Loaders (ready for async views) ---------------- */
.skeleton {
    background: linear-gradient(90deg, rgba(32, 25, 59, 0.06) 25%, rgba(32, 25, 59, 0.12) 37%, rgba(32, 25, 59, 0.06) 63%);
    background-size: 400% 100%;
    border-radius: 10px;
    animation: skeletonShimmer 1.4s ease infinite;
    display: block;
}
.skeleton-text { height: 14px; margin-bottom: 0.5rem; }
.skeleton-circle { border-radius: 50%; }
@keyframes skeletonShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Fee Summary Grid ---------------- */
.fee-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}
@media (max-width: 900px) { .fee-summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .fee-summary-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; } }

.fee-summary-card {
    border-radius: var(--radius-lg);
    padding: 1.3rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.fee-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.fee-amount { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.15rem; }
.fee-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

/* ---------------- Attendance Grid ---------------- */
.att-summary {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.att-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}
.att-dot-present { background: var(--success); }
.att-dot-absent { background: var(--danger); }
.att-dot-late { background: var(--warning); }
.att-dot-leave { background: var(--sky); }

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
}
.attendance-cell {
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.75);
    border: 2px solid rgba(32, 25, 59, 0.06);
    transition: border-color var(--transition-base), background var(--transition-base);
}
.att-present { border-color: rgba(53, 184, 121, 0.35); background: rgba(53, 184, 121, 0.06); }
.att-absent { border-color: rgba(232, 93, 117, 0.35); background: rgba(232, 93, 117, 0.06); }
.att-late { border-color: rgba(242, 184, 75, 0.35); background: rgba(242, 184, 75, 0.06); }
.att-leave { border-color: rgba(103, 213, 247, 0.35); background: rgba(103, 213, 247, 0.06); }
.att-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; }
.att-roll { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.5rem; }
.attendance-cell select {
    width: 100%;
    font-family: var(--font-main);
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(32, 25, 59, 0.1);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

/* ---------------- Receipt ---------------- */
.receipt-container {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(32, 25, 59, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 2rem;
}
.receipt-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid rgba(108, 79, 232, 0.15);
}
.receipt-header .receipt-logo {
    width: 52px; height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--sky));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.3rem;
    flex-shrink: 0;
}
.receipt-header h2 { margin-bottom: 0.2rem; }
.receipt-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, rgba(108, 79, 232, 0.08), rgba(103, 213, 247, 0.08));
    border-radius: 14px;
}
.receipt-title-bar h3 { margin: 0; font-size: 1rem; letter-spacing: 0.04em; }
.receipt-meta { text-align: right; font-size: 0.85rem; }
.receipt-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 520px) { .receipt-details-grid { grid-template-columns: 1fr; } }
.receipt-details-grid h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.5rem; }
.receipt-details-grid p { margin-bottom: 0.3rem; font-size: 0.9rem; }
.receipt-amount-box {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(53, 184, 121, 0.08), rgba(103, 213, 247, 0.08));
    border-radius: 16px;
    margin-bottom: 1.2rem;
}
.receipt-amount-box .muted { font-size: 0.82rem; display: block; margin-bottom: 0.3rem; }
.receipt-amount { font-size: 2rem; font-weight: 800; color: var(--success); }
.receipt-remarks { padding: 0.8rem 1rem; background: rgba(242, 184, 75, 0.08); border-radius: 10px; margin-bottom: 1.2rem; font-size: 0.88rem; }
.receipt-footer { text-align: center; padding-top: 1.2rem; border-top: 1px dashed rgba(32, 25, 59, 0.12); font-size: 0.8rem; }

@media print {
    .sidebar, .topbar, .sidebar-overlay, .bg-orbs { display: none !important; }
    .app-main { margin: 0; padding: 0; }
    .app-content { padding: 0; animation: none; }
    .receipt-container { box-shadow: none; border: none; padding: 1rem; }
    body { background: #fff; }
}

/* Error Pages */
.error-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: 2rem;
}
.error-code {
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--sky));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------------- Mobile Data Table → Card Conversion ---------------- */
@media (max-width: 700px) {
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .table-wrap { overflow-x: visible; }
    .data-table tr {
        margin-bottom: 0.9rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.78);
        border: 1px solid rgba(32, 25, 59, 0.06);
        box-shadow: var(--shadow-card);
        padding: 0.3rem 0.2rem;
    }
    .data-table tbody tr:hover { background: rgba(255, 255, 255, 0.78); }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.8rem;
        padding: 0.55rem 0.9rem;
        border-bottom: 1px solid rgba(32, 25, 59, 0.05);
        text-align: right;
    }
    .data-table td:last-child { border-bottom: none; }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--muted);
        text-align: left;
        margin-right: auto;
        flex-shrink: 0;
    }
    .data-table td.row-actions { justify-content: flex-end; }
    .data-table td.row-actions::before { content: ''; }
}