/* ====== GLOBAL ====== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #f4e9ff, #fdf3ff);
    margin: 0;
    color: #111827;
    min-height: 100vh;
}

/* ====== AUTH (LOGIN) ====== */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-container {
    background: rgba(255, 255, 255, 0.96);
    padding: 2.5rem 3rem;
    border-radius: 18px;
    box-shadow: 0 20px 45px rgba(91, 33, 182, 0.18);
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.auth-container h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #4c1d95;
}

.auth-container h2 {
    margin-top: 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
}

.auth-form {
    margin-top: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.auth-form label {
    text-align: left;
    font-size: 0.85rem;
    color: #4b5563;
}

.auth-form input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-top: 0.25rem;
    outline: none;
    font-size: 0.9rem;
    background: #f9fafb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
    background: #ffffff;
}

.btn-primary {
    margin-top: 0.3rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 22px rgba(79, 70, 229, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px rgba(79, 70, 229, 0.4);
    opacity: 0.95;
}

.alert {
    padding: 0.65rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
}

.alert-success {
    background: #ecfdf3;
    color: #15803d;
}

/* ====== TOP NAVBAR ====== */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    color: #111827;
    padding: 0.65rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(209, 213, 219, 0.6);
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-nav a {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.top-nav a:hover {
    color: #4f46e5;
}

.logo {
    font-weight: 700;
    margin-right: 0.5rem;
    font-size: 1.1rem;
    color: #4c1d95;
}

.menu-toggle {
    display: none;          /* mobile only (hoos ayaan ku furayaa) */
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.45);
}

/* ====== LAYOUT + SIDEBAR ====== */
.layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #111827, #1f2937 50%, #4c1d95 100%);
    color: #e5e7eb;
    padding: 1.4rem 0.75rem 1.5rem;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.35);
}

.sidebar-header {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.6;
    letter-spacing: 0.08em;
}

/* sidebar-ka hore (admin iwm) */
.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
}

.sidebar li {
    margin-bottom: 0.25rem;
}

.sidebar li a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    text-decoration: none;
    color: #e5e7eb;
    font-size: 0.9rem;
    transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.sidebar li a span.icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(243, 244, 246, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.sidebar li a:hover {
    background: rgba(129, 140, 248, 0.16);
    transform: translateX(2px);
}

.sidebar li a.active {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
}

/* ====== NEW SIDEBAR LINK STYLE (student portal) ====== */
.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    text-decoration: none;
    color: #e5e7eb;
    font-size: 0.9rem;
    transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
    white-space: nowrap;
}

.sidebar-link .icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(243, 244, 246, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
}

.sidebar-link .label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link:hover {
    background: rgba(129, 140, 248, 0.16);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
}

.sidebar-separator {
    margin: 0.4rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

/* overlay-ga madow marka sidebar-ka mobile la furo */
.sidebar-overlay {
    display: none;
}

/* ====== MAIN CONTENT ====== */
.main-content {
    flex: 1;
    padding: 1.5rem 1.75rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
}

.page-header small {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
}

.page-header .actions {
    display: flex;
    gap: 0.5rem;
}

.btn-ghost {
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: #4b5563;
}

.btn-ghost:hover {
    border-color: #c4b5fd;
}

/* ====== CARDS & GRIDS ====== */
.container {
    padding: 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: rgba(255, 255, 255, 0.96);
    padding: 1.2rem 1.3rem;
    border-radius: 18px;
    box-shadow: 0 18px 35px rgba(148, 163, 184, 0.25);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(167, 139, 250, 0.14), transparent 60%);
    opacity: 0.8;
    pointer-events: none;
}

.card h3 {
    font-size: 0.9rem;
    color: #6b21a8;
    font-weight: 600;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
}

.card p {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    position: relative;
    z-index: 1;
}

.card span.badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    position: relative;
    z-index: 1;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 45px rgba(148, 163, 184, 0.35);
}

/* ====== TABLES ====== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-top: 0.85rem;
}

.table th,
.table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.55rem 0.4rem;
}

.table th {
    background: #f3f4ff;
    color: #4b5563;
    text-align: left;
    font-size: 0.8rem;
}

/* ====== FORMS (GENERAL) ====== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: flex-start;
}

label {
    display: block;
    text-align: left;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #4b5563;
}

label input,
label select {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.25rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

label input:focus,
label select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: #ffffff;
}

/* ====== STAT CARDS EXTRA STYLE ====== */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    position: relative;
    z-index: 1;
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 10px 22px rgba(148, 163, 184, 0.6);
}

.bg-purple {
    background: linear-gradient(135deg, #6366f1, #a855f7);
}

.bg-pink {
    background: linear-gradient(135deg, #ec4899, #f97316);
}

.bg-blue {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 0.2rem;
    margin-bottom: 0.15rem;
}

.stat-sub {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ====== CHART CARDS ====== */
.charts-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.3fr);
    gap: 1rem;
    margin-top: 1.4rem;
}

.chart-card {
    padding-bottom: 1.2rem;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 1;
}

.chart-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.chart-sub {
    font-size: 0.78rem;
    color: #6b7280;
}

.chart-card canvas {
    width: 100% !important;
    height: 230px !important;
}

/* Activity table card */
.activity-card {
    margin-top: 1.4rem;
}

/* ====== ANIMATIONS ====== */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in.delay-1 { transition-delay: 0.08s; }
.fade-in.delay-2 { transition-delay: 0.15s; }
.fade-in.delay-3 { transition-delay: 0.22s; }
.fade-in.delay-4 { transition-delay: 0.30s; }
.fade-in.delay-5 { transition-delay: 0.38s; }

/* ====== RESPONSIVE ====== */
@media (max-width: 992px) {

    .layout {
        min-height: calc(100vh - 56px);
    }

    /* tus menu toggle button */
    .menu-toggle {
        display: inline-flex;
    }

    /* sidebar ka dhigo off-canvas (slide from left) */
    .sidebar {
        position: fixed;
        top: 56px;              /* dhererka top-nav */
        left: 0;
        height: calc(100vh - 56px);
        max-width: 260px;
        width: 78%;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 50;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 40;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        padding: 1rem 1.2rem 1.5rem;
    }

    .charts-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .auth-container {
        padding: 1.75rem 1.5rem;
    }
}

/* =========================================================
   MODERN AUTH LAYOUT (Qaboojiye login sida Horyaal style)
   ========================================================= */

/* override auth-body for login page */
.auth-body {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at top left, #fce7ff 0, #f3e8ff 35%, #ede9fe 70%, #f5f3ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* wrapper + card */
.auth-wrapper {
    width: 100%;
    max-width: 1100px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 24px;
    box-shadow:
        0 24px 60px rgba(124, 58, 237, 0.20),
        0 0 0 1px rgba(148, 163, 184, 0.18);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    overflow: hidden;
}

/* LEFT SIDE */
.auth-side-info {
    padding: 32px 32px 28px 32px;
    background: radial-gradient(circle at top left, #7c3aed 0, #a855f7 35%, #6366f1 100%);
    color: #f9fafb;
    position: relative;
}

.auth-logo-circle {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.auth-title {
    font-size: 2rem;
    margin: 0;
    letter-spacing: 0.04em;
}

.auth-subtitle {
    margin: 4px 0 18px;
    opacity: 0.9;
    font-size: 0.95rem;
}

.auth-highlights {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    font-size: 0.9rem;
}

.auth-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.auth-highlights .dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    margin-top: 5px;
}

.auth-footer-text {
    font-size: 0.8rem;
    opacity: 0.85;
    position: absolute;
    left: 32px;
    bottom: 20px;
}

/* RIGHT SIDE */
.auth-side-form {
    padding: 32px 32px 28px 32px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-header h2 {
    margin: 0 0 4px;
    font-size: 1.4rem;
    color: #0f172a;
}

.auth-form-header .auth-form-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.auth-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(129, 140, 248, 0.12);
    color: #4f46e5;
    margin-bottom: 10px;
}

.auth-form-modern {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form-modern .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: #374151;
}

/* inputs with icons */
.input-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 8px 14px;
    border: 1px solid transparent;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-icon .icon {
    font-size: 0.95rem;
    opacity: 0.8;
}

.input-with-icon input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.9rem;
    color: #111827;
}

.input-with-icon:focus-within {
    border-color: #7c3aed;
    background: #eef2ff;
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.5);
}

/* auth button re-use .btn-primary but tweak spacing */
.auth-btn {
    width: 100%;
    margin-top: 4px;
}

/* note text */
.auth-note {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #6b7280;
}

/* error inside auth layout */
.auth-error {
    width: 100%;
    margin-top: 14px;
    margin-bottom: 4px;
    border-radius: 999px;
}

/* School hint */
.field-hint {
    min-height: 18px;
    font-size: 0.78rem;
    margin-top: 2px;
    color: #6b7280;
}

.field-hint.hint-ok {
    color: #16a34a;
}

.field-hint.hint-error {
    color: #dc2626;
}

/* Responsive tweaks for auth layout */
@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-side-info {
        padding-bottom: 80px;
    }

    .auth-footer-text {
        position: static;
        margin-top: 18px;
    }
}

@media (max-width: 640px) {
    .auth-card {
        border-radius: 18px;
    }

    .auth-side-info,
    .auth-side-form {
        padding: 22px 20px 20px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-body {
        padding: 16px;
    }
}
