:root {
    --bg: #ffffff;
    --grid: #e5e7eb;
    --card: #ffffff;
    --card2: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #cbd5e1;
    --blue: #2563eb;
    --blue2: #1e40af;
    --chip: #f1f5f9;
    --shadow: 0 10px 24px rgba(2,6,23,.10);
    --barMaxW: 52px;
    --drawerW: 520px;
    --drawerGap: 14px;
}


[data-theme="dark"] {
    --bg: #0b1220;
    --grid: #142036;
    --card: #050b18;
    --card2: #070f22;
    --text: #e5e7eb;
    --muted: #9aa4b2;
    --border: #22304a;
    --blue: #2f6cf6;
    --blue2: #1f55d6;
    --chip: #0b1630;
    --shadow: 0 18px 40px rgba(0,0,0,.45);
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background: radial-gradient(circle at 20% 20%, #eef2ff 0%, #f7f9ff 40%, #e5e7eb 100%);
    color: #1f2933;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.actions-container {
    margin-left: auto;
}

.select2 {
    border: 1px solid #cfcfcf;
    height: 37px;
    border-radius: 5px;
}


/* Limit Select2 dropdown height and enable scrolling */
.select2-container .select2-results__options {
    max-height: 350px; /* adjust as needed */
    overflow-y: auto;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    padding-top: 8px;
}


.k-svg-icon.k-icon-xs {
    width: 24px !important;
    height: 24px !important;
}

.blurred {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
}

/* html2pdf uses print-like rules; these help pagination */
.pdf-page-break {
    break-after: page;
    page-break-after: always;
}

/* avoid splitting a card across pages */
.pdf-card {
    break-inside: avoid;
    page-break-inside: avoid;
}

.k-splitbar {
    background-color: #e5e7eb !important;
    border-radius: 10px !important;
    max-width: 15px !important;
    min-width: 15px !important;
}

.k-splitter{
    background-color:transparent !important;
    border:none !important;
    color:transparent !important;
}
.splitter-pane {
    background-color: transparent !important;
    border: none !important;
}

.next-prev-button-container {
    display: flex;
    justify-content: flex-end; /* move to the right */
    align-items: center;
    gap: 8px; /* space between buttons */
    margin-right: 10px;
}

.btn-circle {
    width: 37px;
    height: 37px;
    border-radius: 50%;
    border: 1px solid #d0d5dd;
    background: #ffffff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(16,24,40,0.05);
    padding: 0;
}

    .btn-circle svg {
        width: 22px !important;
        height: 22px !important;
        transition: transform 0.25s ease;
    }

    .btn-circle[aria-expanded="true"] svg {
        transform: rotate(90deg);
    }

    .btn-circle:hover {
        border-color: #2563eb;
        color: #2563eb;
        box-shadow: 0 4px 10px rgba(37,99,235,0.15);
    }

.nav-count {
    display: inline-flex;
    min-width: 72px;
    height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.2px;
    margin-top: -5px;
}

    .nav-count .slash {
        margin: 0 6px;
        color: #64748b;
        font-weight: 700;
    }

button {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card2);
    font-weight: 900;
    cursor: pointer;
    color: var(--text);
}

.primary {
    background: rgba(47,108,246,.16);
    border-color: rgba(47,108,246,.45);
}

.danger {
    background: rgba(239,68,68,.14);
    border-color: rgba(239,68,68,.45);
}

select {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(24, 39, 75, 0.12);
}

.cardHeader {
    padding: 10px 12px;
    font-weight: 900;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* ── Navbar Student Search ─────────────────────────────────────────── */
.student-search-wrapper {
    position: relative;
}

.student-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 22px;
    padding: 5px 12px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    min-width: 220px;
}

.student-search-input-wrap:focus-within {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.student-search-icon {
    color: #94a3b8;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.student-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    color: #0f172a;
    width: 100%;
    min-width: 0;
}

.student-search-input::placeholder {
    color: #94a3b8;
}

.student-search-shortcut {
    font-size: 0.72rem;
    color: #94a3b8;
    background: #e2e8f0;
    border-radius: 6px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: monospace;
}

.student-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 340px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    z-index: 2000;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.15);
}

.ss-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
}

.ss-item:last-child {
    border-bottom: none;
}

.ss-item:hover,
.ss-item.active {
    background: #eff6ff;
}

.ss-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
}

.ss-meta {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.ss-empty {
    padding: 14px 16px;
    color: #94a3b8;
    font-size: 0.875rem;
    text-align: center;
}
}

/* HOME PAGE DASHBOARD */
.home-dashboard {
    padding: 1rem clamp(0.75rem, 2vw, 2rem) 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    background:
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.15), transparent 40%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: auto -6rem -8rem auto;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.home-hero__content,
.home-hero__panel {
    position: relative;
    z-index: 1;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #bfdbfe;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-hero h1 {
    max-width: 640px;
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.home-hero p {
    max-width: 580px;
    margin: 0.35rem 0 0;
    color: #dbeafe;
    font-size: clamp(0.875rem, 1.2vw, 0.95rem);
    line-height: 1.4;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.7rem;
}

.home-primary-action,
.home-secondary-action,
.home-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-primary-action {
    min-height: 40px;
    padding: 0.6rem 1rem;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.home-secondary-action {
    min-height: 40px;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.26);
    color: #ffffff;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
}

.home-primary-action:hover,
.home-secondary-action:hover,
.home-card-link:hover {
    transform: translateY(-1px);
}

.home-primary-action:hover {
    color: #1e40af;
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.24);
}

.home-secondary-action:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.home-hero__panel {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
}

.home-progress-ring {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        linear-gradient(#0f172a, #0f172a) padding-box,
        conic-gradient(#3b82f6, #60a5fa, #93c5fd, #3b82f6) border-box;
    border: 6px solid transparent;
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.home-progress-ring span {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.home-panel-label {
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-panel-title {
    margin-top: 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.home-panel-note {
    margin-top: 0.25rem;
    color: #dbeafe;
    font-size: 0.82rem;
}

.home-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.home-summary-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 90px;
    padding: 0.9rem;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
}

.home-summary-icon {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    font-size: 1rem;
}

.home-summary-icon--blue {
    color: #1d4ed8;
    background: #dbeafe;
}

.home-summary-icon--green {
    color: #047857;
    background: #d1fae5;
}

.home-summary-icon--amber {
    color: #b45309;
    background: #fef3c7;
}

.home-summary-icon--purple {
    color: #6d28d9;
    background: #ede9fe;
}

.home-summary-value {
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.home-summary-label {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.home-section-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.2rem, 1.8vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.home-section-heading p {
    margin: 0.3rem 0 0;
    color: #64748b;
}

.home-section-pill {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 800;
}

.home-assignment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-assignment-card {
    display: flex;
    flex-direction: column;
    min-height: 280px;
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-assignment-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.14);
}

.home-assignment-card__header,
.home-assignment-card__body {
    padding: 1.15rem;
}

.home-assignment-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.home-assignment-title {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.home-assignment-title > span {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    background: #eff6ff;
    color: #2563eb;
}

.home-assignment-title h3 {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.home-status-badge {
    flex: 0 0 auto;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.72rem;
    font-weight: 900;
}

.home-assignment-card.is-steady .home-status-badge {
    background: #fef3c7;
    color: #92400e;
}

.home-assignment-card.is-strong .home-status-badge {
    background: #d1fae5;
    color: #047857;
}

.home-assignment-card__body {
    flex: 1 1 auto;
}

.home-assignment-percent {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.home-assignment-percent strong {
    color: #0f172a;
    font-size: 2.35rem;
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 1;
}

.home-assignment-percent span {
    color: #64748b;
    font-weight: 800;
}

.home-progress-track {
    height: 10px;
    margin-top: 1rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.home-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.home-assignment-card.is-steady .home-progress-fill {
    background: linear-gradient(90deg, #f59e0b, #facc15);
}

.home-assignment-card.is-strong .home-progress-fill {
    background: linear-gradient(90deg, #10b981, #22c55e);
}

.home-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1.15rem;
}

.home-metric-grid > div {
    padding: 0.8rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.home-metric-grid span {
    display: block;
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1;
}

.home-metric-grid small {
    display: block;
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-card-link {
    margin: 0 1.15rem 1.15rem;
    padding: 0.75rem 1rem;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
}

.home-card-link:hover {
    border-color: #93c5fd;
    color: #1e40af;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.16);
}

.home-empty-state {
    max-width: 640px;
    margin: 2.5rem auto;
    padding: 2.4rem;
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    text-align: center;
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.1);
}

.home-empty-state__icon {
    width: 72px;
    height: 72px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 24px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.8rem;
}

.home-empty-state h2 {
    margin: 0;
    color: #0f172a;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.home-empty-state p {
    max-width: 440px;
    margin: 0.6rem auto 1.4rem;
    color: #64748b;
}

@media (max-width: 1200px) {
    .home-summary-grid,
    .home-assignment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .home-hero {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .home-hero__panel {
        justify-content: center;
    }
}

@media (max-width: 700px) {
    .home-summary-grid,
    .home-assignment-grid {
        grid-template-columns: 1fr;
    }

    .home-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-metric-grid {
        grid-template-columns: 1fr;
    }
}