/* ============================================================================
   DIWALI CHEMISTRY ASSIGNMENT PORTAL 2026
   Mobile-First Educational App UI (Supports 320px to Desktop + A4 Print)
   Color Palette: Navy (#0f2942), Royal Blue (#0284c7), Teal (#0d9488), Orange (#ea580c)
   ============================================================================ */

:root {
    --navy-900: #0f2942;
    --navy-800: #163a5f;
    --royal-600: #0284c7;
    --royal-700: #0369a1;
    --teal-600: #0d9488;
    --orange-500: #ea580c;
    --gold-500: #d97706;
    --green-600: #16a34a;
    --red-600: #dc2626;
    --bg-soft: #f1f5f9;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #cbd5e1;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-sm: 0 2px 8px rgba(15, 41, 66, 0.07);
    --shadow-md: 0 8px 24px rgba(15, 41, 66, 0.12);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans Devanagari', 'Mukta', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-soft);
    color: var(--text-main);
    line-height: 1.55;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.student-portal-body {
    padding-bottom: 76px; /* Space for mobile bottom navigation */
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 0.85rem;
}

/* Topbar */
.app-topbar {
    background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease, box-shadow 0.28s ease;
    will-change: transform;
}

.app-topbar.is-hidden {
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: none;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    gap: 0.5rem;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #ffffff;
    text-decoration: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.school-short {
    font-size: 0.72rem;
    color: #bae6fd;
    line-height: 1.2;
}

.portal-name {
    font-size: 0.98rem;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.std-pill {
    display: inline-block;
    background: rgba(56, 189, 248, 0.2);
    color: #0369a1;
    border: 1px solid #7dd3fc;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.app-topbar .std-pill {
    color: #e0f2fe;
}

.btn-logout-mini, .btn-outline-light, .btn-teacher-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.desktop-subnav {
    display: none;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.desktop-subnav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.desktop-subnav a.active, .desktop-subnav a:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.demo-banner {
    background: #fef3c7;
    color: #92400e;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid #fde68a;
}

.app-main {
    flex: 1;
    padding-top: 1rem;
    padding-bottom: 1.5rem;
}

.help-float-btn {
    position: fixed;
    right: 12px;
    bottom: 92px;
    z-index: 220;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.72rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(18, 140, 126, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.help-float-btn:hover {
    transform: translateY(-1px);
    color: #ffffff;
}

.help-float-btn span {
    width: 1.3rem;
    height: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.92rem;
}

/* Cards & Common Elements */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

.auth-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 180px);
}

.auth-card {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.school-crest {
    margin-bottom: 0.5rem;
}

.school-heading {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--navy-800);
}

.campaign-title {
    font-size: 1.38rem;
    font-weight: 800;
    color: var(--navy-900);
    margin: 0.25rem 0;
}

.campaign-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Forms & Mobile Inputs */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-label-lg {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--navy-900);
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--royal-600);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.mobile-input-group {
    display: flex;
    align-items: stretch;
}

.country-prefix {
    background: #e2e8f0;
    color: var(--navy-900);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0 0.9rem;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.mobile-number-field {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.pin-input-field {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.4rem;
    font-weight: 700;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.1rem;
    font-size: 0.98rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.99);
}

.btn-lg {
    padding: 0.9rem 1.25rem;
    font-size: 1.08rem;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.84rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--royal-600);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--royal-700);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--navy-900);
}

.btn-success {
    background: var(--green-600);
    color: #ffffff;
}

.btn-warning {
    background: var(--orange-500);
    color: #ffffff;
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
}

.btn-disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

.btn-link-subtle {
    background: none;
    border: none;
    color: var(--royal-600);
    font-size: 0.88rem;
    text-decoration: underline;
    cursor: pointer;
}

/* Info Pills & Demo Box */
.info-pills {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 1.1rem;
}

.info-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.demo-credentials-box {
    margin-top: 1.1rem;
    background: #f0f9ff;
    border: 1px dashed #38bdf8;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-size: 0.82rem;
    text-align: left;
}

/* Dashboard & Progress */
.welcome-banner {
    background: linear-gradient(135deg, #0f2942, #1e40af);
    color: #ffffff;
    margin-bottom: 1rem;
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.welcome-title {
    font-size: 1.35rem;
    margin-top: 0.3rem;
}

.student-meta {
    color: #bae6fd;
    font-size: 0.9rem;
}

.announcements-box {
    margin-bottom: 1rem;
    background: #fffbeb;
    border-color: #fde68a;
}

.announcement-item {
    padding: 0.4rem 0;
    border-bottom: 1px dashed #fde68a;
    font-size: 0.92rem;
}

.announcement-item:last-child {
    border-bottom: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.stat-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stat-title {
    font-weight: 700;
    color: var(--navy-900);
}

.stat-highlight {
    font-size: 1.2rem;
    color: var(--royal-600);
}

.progress-track {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--royal-600), var(--teal-600));
    border-radius: 999px;
    transition: width 0.25s ease;
}

.stat-metrics-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    margin-top: 0.4rem;
}

.marks-big-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.marks-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy-900);
}

.marks-slash {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Assignment Cards & Status Colors */
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.section-heading {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy-900);
}

.assignment-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
}

.assignment-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 5px solid var(--royal-600);
}

.assignment-card.status-completed { border-left-color: var(--green-600); }
.assignment-card.status-available { border-left-color: var(--royal-600); }
.assignment-card.status-progress  { border-left-color: var(--orange-500); }
.assignment-card.status-locked    { border-left-color: #94a3b8; opacity: 0.92; }

.asg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}

.asg-number-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.status-pill {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.status-pill.status-completed { background: #dcfce7; color: #15803d; }
.status-pill.status-available { background: #dbeafe; color: #1d4ed8; }
.status-pill.status-progress  { background: #ffedd5; color: #c2410c; }
.status-pill.status-locked    { background: #f1f5f9; color: #475569; }

.asg-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.asg-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.asg-meta-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.score-chip {
    background: #dcfce7;
    color: #166534;
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
}

.asg-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

/* Single-Question Mobile Quiz Interface */
.quiz-shell {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.quiz-meta-row, .quiz-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sync-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.sync-ok      { background: #dcfce7; color: #15803d; }
.sync-saving  { background: #fef3c7; color: #b45309; }
.sync-offline { background: #fee2e2; color: #b91c1c; }

.question-Jump-pills {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.35rem 0;
}

.q-pill-btn {
    min-width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.q-pill-btn.answered {
    background: #dcfce7;
    border-color: #16a34a;
    color: #166534;
}

.q-pill-btn.current {
    background: var(--navy-900);
    color: #ffffff;
    border-color: var(--navy-900);
}

.question-stage {
    padding: 1.25rem;
}

.question-chip {
    display: inline-block;
    background: #f1f5f9;
    color: var(--navy-900);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.question-prompt {
    font-size: 1.18rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--navy-900);
}

.options-stack {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    cursor: pointer;
    font-size: 1.02rem;
    font-weight: 600;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
}

.option-card:hover {
    border-color: #38bdf8;
    background: #f8fafc;
}

.option-card.selected {
    border-color: var(--royal-600);
    background: #e0f2fe;
    color: var(--navy-900);
}

.opt-letter {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--navy-900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.option-card.selected .opt-letter {
    background: var(--royal-600);
    color: #ffffff;
}

.quiz-nav-bar {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
}

.quiz-nav-bar .btn {
    flex: 1;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 250;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.modal-title {
    font-size: 1.25rem;
    margin: 0.4rem 0;
}

.modal-body-text {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.modal-summary-pill {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--navy-900);
}

.modal-actions {
    display: flex;
    gap: 0.65rem;
}

.modal-actions .btn {
    flex: 1;
}

/* Celebration & Review */
.celebration-banner {
    text-align: center;
    background: linear-gradient(135deg, #f0fdf4, #e0f2fe);
    border: 2px solid #86efac;
}

.celebration-icon {
    font-size: 3rem;
}

.score-highlight {
    font-size: 1.65rem;
    color: var(--green-600);
}

.review-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.review-item {
    padding: 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.review-correct { background: #f0fdf4; border-color: #bbf7d0; }
.review-wrong   { background: #fef2f2; border-color: #fecaca; }

.review-q-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.explanation-box {
    margin-top: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    font-size: 0.88rem;
}

/* Tables & Merit Lists */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.portal-table th, .portal-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.portal-table th {
    background: #f8fafc;
    color: var(--navy-900);
    font-weight: 700;
    white-space: nowrap;
}

.highlight-my-row {
    background: #fef9c3 !important;
}

.rank-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 800;
    background: #e2e8f0;
}

.rank-1 { background: #fef08a; color: #854d0e; }
.rank-2 { background: #e2e8f0; color: #1e293b; }
.rank-3 { background: #fed7aa; color: #9a3412; }

.demo-tag {
    font-size: 0.68rem;
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.25rem;
}

.class-switch-tabs {
    display: flex;
    gap: 0.5rem;
}

.class-tab {
    flex: 1;
    text-align: center;
    padding: 0.65rem;
    border-radius: var(--radius-md);
    background: #f1f5f9;
    color: var(--navy-900);
    text-decoration: none;
    font-weight: 700;
}

.class-tab.active {
    background: var(--navy-900);
    color: #ffffff;
}

.asg-filter-pills {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.asg-pill-btn {
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.asg-pill-btn.active {
    background: var(--royal-600);
    color: #ffffff;
}

/* Certificate A4 Landscape Design */
.cert-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.certificate-sheet {
    background: #ffffff;
    max-width: 980px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.certificate-outer-border {
    padding: 14px;
    background: linear-gradient(135deg, #0f2942, #b45309, #0f2942);
}

.certificate-inner-border {
    position: relative;
    background: #fffdf7;
    border: 3px double #d97706;
    padding: 2rem 1.75rem;
    text-align: center;
}

.cert-corner {
    position: absolute;
    font-size: 1.5rem;
    color: #d97706;
}
.cert-tl { top: 10px; left: 14px; }
.cert-tr { top: 10px; right: 14px; }
.cert-bl { bottom: 10px; left: 14px; }
.cert-br { bottom: 10px; right: 14px; }

.cert-gov-line {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b45309;
}

.cert-school-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--navy-900);
}

.cert-school-loc {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy-800);
}

.cert-campaign-ribbon {
    display: inline-block;
    background: var(--navy-900);
    color: #fef08a;
    padding: 0.3rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    margin: 0.65rem 0;
}

.cert-main-heading {
    font-size: 1.9rem;
    color: #b45309;
    letter-spacing: 2px;
}

.cert-student-name {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--royal-700);
    border-bottom: 2px solid #d97706;
    display: inline-block;
    padding: 0 1.5rem;
    margin: 0.4rem 0;
}

.cert-score-box {
    display: inline-block;
    margin-top: 0.65rem;
    padding: 0.45rem 1.25rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    font-size: 1.1rem;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 1.75rem;
    gap: 1rem;
    flex-wrap: wrap;
    text-align: left;
}

.cert-qr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.72rem;
}

.cert-sign-col {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.sign-line {
    width: 180px;
    border-bottom: 1.5px solid var(--navy-900);
    margin-bottom: 0.35rem;
}

/* Mobile Bottom Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 150;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    flex: 1;
    height: 100%;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--royal-600);
}

.nav-icon {
    font-size: 1.15rem;
    line-height: 1.1;
}

/* Alerts & Helpers */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.92rem;
}
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.text-center  { text-align: center; }
.text-success { color: var(--green-600); }
.text-warning { color: var(--orange-500); }
.text-danger  { color: var(--red-600); }

.grid-2, .grid-3, .grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.app-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Admin Layout */
.admin-layout {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.admin-sidebar {
    background: var(--navy-900);
    color: #ffffff;
    padding: 1rem;
}

.admin-brand {
    display: flex;
    flex-direction: column;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 0.75rem;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.admin-nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-size: 0.86rem;
}

.admin-nav a.active, .admin-nav a:hover {
    background: var(--royal-600);
    color: #ffffff;
}

.admin-main {
    flex: 1;
    padding: 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.kpi-card span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.kpi-card strong {
    font-size: 1.5rem;
}

.admin-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Tablet & Desktop Breakpoints */
@media (max-width: 767px) {
    .app-topbar {
        max-height: 100vh;
        overflow: hidden;
    }

    .app-topbar.is-hidden {
        transform: translateY(-115%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@media (min-width: 768px) {
    .student-portal-body { padding-bottom: 0; }
    .mobile-bottom-nav { display: none; }
    .desktop-subnav { display: flex; }
    .stats-grid, .assignment-cards-grid, .grid-2, .admin-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4, .admin-kpi-grid { grid-template-columns: repeat(4, 1fr); }
    .admin-layout { flex-direction: row; }
    .admin-sidebar { width: 250px; flex-shrink: 0; }
    .admin-nav { flex-direction: column; }
}

/* Print Styles for Certificate & Reports */
@media print {
    @page { size: A4 landscape; margin: 8mm; }
    .app-topbar, .mobile-bottom-nav, .no-print, .demo-banner, .app-footer, .admin-sidebar {
        display: none !important;
    }
    body, .app-main, .container {
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    .certificate-sheet {
        box-shadow: none !important;
        width: 100% !important;
    }
}