/**
 * باکلاس — Design System (shared UI)
 * یکپارچه‌سازی ظاهر پنل‌ها، دکمه‌ها، کارت‌ها و ناوبری
 */

:root {
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-soft: #f1f5f9;
    --surface: #ffffff;
    --canvas: #f8fafc;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #059669;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --nav-height: 72px;
    --font: 'Vazirmatn', 'Vazir', Tahoma, Arial, sans-serif;

    /* Role accents — overridden by body[data-role] */
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.1);
    --accent-soft-hover: rgba(37, 99, 235, 0.08);
    --header-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

body[data-role="teacher"] {
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.1);
    --accent-soft-hover: rgba(37, 99, 235, 0.08);
    --header-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

body[data-role="student"] {
    --accent: #10b981;
    --accent-dark: #059669;
    --accent-soft: rgba(16, 185, 129, 0.12);
    --accent-soft-hover: rgba(16, 185, 129, 0.08);
    --header-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

body[data-role="admin"] {
    --accent: #dc2626;
    --accent-dark: #b91c1c;
    --accent-soft: rgba(220, 38, 38, 0.1);
    --accent-soft-hover: rgba(220, 38, 38, 0.08);
    --header-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    background-color: var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

body.panel-app {
    padding-bottom: calc(var(--nav-height) + 28px);
    min-height: 100vh;
}

a {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

/* Focus — accessible, not removed */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
}

.card-hover {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-hover:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

@media (max-width: 640px) {
    .card {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .card-title,
    .card h2 {
        font-size: 16px;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, color 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--line-soft);
    color: var(--ink-soft);
}

.btn-secondary:hover {
    background: var(--line);
    color: var(--ink);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #047857;
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    color: #fff;
}

.btn-purple {
    background: #7c3aed;
    color: #fff;
}

.btn-purple:hover {
    background: #6d28d9;
    color: #fff;
}

.btn-yellow {
    background: #eab308;
    color: #fff;
}

.btn-yellow:hover {
    background: #ca8a04;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
}

.btn-ghost:hover {
    background: var(--line-soft);
    color: var(--ink-soft);
}

.btn-block {
    width: 100%;
}

@media (max-width: 640px) {
    .btn {
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 6px;
    }
}

/* Forms */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 0.4rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        gap: 10px;
        margin-bottom: 16px;
    }
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

@media (max-width: 640px) {
    .stat-card {
        padding: 12px;
        border-radius: 10px;
    }

    .stat-number {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }
}

/* Panel header */
.panel-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 30;
}

.panel-header .jalali-date,
.panel-header .header-accent {
    background: var(--header-gradient);
    color: #fff;
    padding: 14px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s ease;
}

/* ==========================================================================
   تم‌های فصلی هوشمند نوار تاریخ (پاییز، زمستان، بهار، تابستان)
   ========================================================================== */

/* ۱. تم پاییز (Fall / Autumn) - مهر، آبان، آذر */
.panel-header .jalali-date.season-fall,
.jalali-date.season-fall {
    background: linear-gradient(135deg, #7c2d12 0%, #c2410c 45%, #d97706 100%) !important;
    border-bottom: 1px solid rgba(254, 215, 170, 0.25);
    box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.12);
}

/* ۲. تم زمستان برفی (Winter / Snowy) - دی، بهمن، اسفند */
.panel-header .jalali-date.season-winter,
.jalali-date.season-winter {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #0284c7 100%) !important;
    border-bottom: 1px solid rgba(186, 230, 253, 0.3);
    box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.2);
}

/* ۳. تم بهار (Spring) - فروردین، اردیبهشت، خرداد */
.panel-header .jalali-date.season-spring,
.jalali-date.season-spring {
    background: linear-gradient(135deg, #064e3b 0%, #059669 45%, #10b981 100%) !important;
    border-bottom: 1px solid rgba(167, 243, 208, 0.25);
    box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.12);
}

/* ۴. تم تابستان (Summer) - تیر، مرداد، شهریور */
.panel-header .jalali-date.season-summer,
.jalali-date.season-summer {
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 45%, #f59e0b 100%) !important;
    border-bottom: 1px solid rgba(254, 240, 138, 0.3);
    box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.12);
}

/* بج مینیمال وضعیت فصل */
.season-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* دکمه‌های شیشه‌ای مدرن هدر */
.season-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.season-header-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.season-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.26);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.season-icon-button:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

/* انیمیشن ذرات محیطی فصلی (بدون تداخل با کلیک و متن) */
.season-ambient-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.season-ambient-particles .particle {
    position: absolute;
    user-select: none;
    line-height: 1;
    pointer-events: none;
}

/* ۱. انیمیشن بارش ملایم برف (زمستان) */
.snowflake-p {
    color: rgba(255, 255, 255, 0.8);
    animation: snowfall linear infinite;
}
.snowflake-p.p1 { left: 8%; top: -14px; font-size: 15px; animation-duration: 5.5s; animation-delay: 0s; }
.snowflake-p.p2 { left: 24%; top: -14px; font-size: 11px; animation-duration: 7s; animation-delay: 2s; opacity: 0.6; }
.snowflake-p.p3 { left: 45%; top: -14px; font-size: 17px; animation-duration: 6s; animation-delay: 1s; }
.snowflake-p.p4 { left: 65%; top: -14px; font-size: 12px; animation-duration: 8s; animation-delay: 3s; opacity: 0.65; }
.snowflake-p.p5 { left: 82%; top: -14px; font-size: 16px; animation-duration: 5.5s; animation-delay: 1.5s; }
.snowflake-p.p6 { left: 94%; top: -14px; font-size: 13px; animation-duration: 6.5s; animation-delay: 2.5s; opacity: 0.55; }

@keyframes snowfall {
    0% {
        transform: translateY(-14px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 0.85;
    }
    85% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(85px) translateX(16px) rotate(180deg);
        opacity: 0;
    }
}

/* ۲. انیمیشن برگ‌ریزان ملایم (پاییز) */
.fall-leaf-p {
    font-size: 15px;
    opacity: 0.7;
    animation: fallLeaves linear infinite;
}
.fall-leaf-p.p1 { left: 10%; top: -14px; animation-duration: 6.5s; animation-delay: 0s; }
.fall-leaf-p.p2 { left: 30%; top: -14px; animation-duration: 8.5s; animation-delay: 2.5s; font-size: 13px; }
.fall-leaf-p.p3 { left: 55%; top: -14px; animation-duration: 7s; animation-delay: 1s; font-size: 17px; }
.fall-leaf-p.p4 { left: 75%; top: -14px; animation-duration: 9s; animation-delay: 3.5s; }
.fall-leaf-p.p5 { left: 90%; top: -14px; animation-duration: 6.8s; animation-delay: 1.8s; font-size: 14px; }

@keyframes fallLeaves {
    0% {
        transform: translateY(-14px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    50% {
        transform: translateY(35px) translateX(-18px) rotate(60deg);
    }
    80% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(90px) translateX(14px) rotate(140deg);
        opacity: 0;
    }
}

/* ۳. انیمیشن شکوفه‌های نسیم بهاری (بهار) */
.spring-bloom-p {
    font-size: 14px;
    opacity: 0.65;
    animation: springDrift linear infinite;
}
.spring-bloom-p.p1 { left: 12%; top: -12px; animation-duration: 7s; animation-delay: 0s; }
.spring-bloom-p.p2 { left: 35%; top: -12px; animation-duration: 9s; animation-delay: 2s; font-size: 12px; }
.spring-bloom-p.p3 { left: 60%; top: -12px; animation-duration: 6.5s; animation-delay: 1.2s; font-size: 16px; }
.spring-bloom-p.p4 { left: 80%; top: -12px; animation-duration: 8.5s; animation-delay: 3s; }
.spring-bloom-p.p5 { left: 92%; top: -12px; animation-duration: 7.5s; animation-delay: 1.5s; font-size: 13px; }

@keyframes springDrift {
    0% {
        transform: translateY(-12px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.75;
    }
    50% {
        transform: translateY(32px) translateX(20px) rotate(45deg);
    }
    80% {
        opacity: 0.65;
    }
    100% {
        transform: translateY(85px) translateX(36px) rotate(100deg);
        opacity: 0;
    }
}

/* ۴. انیمیشن پرتوهای آفتاب و درخشش تابستانی (تابستان) */
.summer-sunburst {
    position: absolute;
    top: -45px;
    left: 22%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(254, 240, 138, 0.45) 0%, rgba(253, 224, 71, 0.15) 50%, transparent 75%);
    filter: blur(12px);
    animation: sunPulse 4s ease-in-out infinite alternate;
}

@keyframes sunPulse {
    0% { transform: scale(0.9); opacity: 0.45; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

.summer-sparkle-p {
    font-size: 13px;
    opacity: 0.55;
    animation: summerSparkle 3s ease-in-out infinite alternate;
}
.summer-sparkle-p.p1 { left: 25%; top: 12px; animation-delay: 0s; }
.summer-sparkle-p.p2 { left: 68%; top: 18px; animation-delay: 1.2s; font-size: 16px; }
.summer-sparkle-p.p3 { left: 85%; top: 10px; animation-delay: 2s; }

@keyframes summerSparkle {
    0% { transform: scale(0.8) rotate(0deg); opacity: 0.3; }
    50% { transform: scale(1.15) rotate(15deg); opacity: 0.8; }
    100% { transform: scale(0.9) rotate(-10deg); opacity: 0.4; }
}

.panel-header .header-body {
    padding: 12px 16px;
}

.panel-header .date-bar {
    background: var(--surface);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

body[data-role="student"] .panel-header {
    background: var(--header-gradient);
    border-bottom: none;
}

body[data-role="student"] .panel-header .date-bar {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Bottom navigation */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 560px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
    z-index: 50;
    padding: 8px;
}

@supports (backdrop-filter: blur(20px)) {
    .bottom-nav {
        background: rgba(255, 255, 255, 0.78);
    }
}

@media (max-width: 640px) {
    .bottom-nav {
        width: calc(100% - 20px);
        bottom: 12px;
        border-radius: 20px;
        padding: 6px;
    }
}

.bottom-nav .nav-row,
.bottom-nav > .flex {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--muted);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    flex: 1;
    min-height: 56px;
    border-radius: var(--radius-lg);
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav .nav-item.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.bottom-nav .nav-item.active .nav-icon {
    transform: scale(1.1);
}

.bottom-nav .nav-item:hover {
    color: var(--accent);
    background: var(--accent-soft-hover);
}

.bottom-nav .nav-item:active {
    transform: scale(0.97);
}

.bottom-nav .nav-item:focus {
    outline: none;
    box-shadow: none;
}

.bottom-nav .nav-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.bottom-nav .nav-icon {
    font-size: 18px;
    margin-bottom: 3px;
    transition: transform 0.2s ease;
}

.bottom-nav .nav-text {
    font-size: 11px;
    font-weight: 600;
}

/* Drawer menu */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 120px));
    width: calc(100% - 28px);
    max-width: 560px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow-lg);
    z-index: 45;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 16px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, visibility 0.25s ease;
    opacity: 0;
    visibility: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.drawer::-webkit-scrollbar {
    width: 6px;
}

.drawer::-webkit-scrollbar-track {
    background: transparent;
}

.drawer::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 6px;
}

.drawer::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6);
}

@supports (backdrop-filter: blur(20px)) {
    .drawer {
        background: rgba(255, 255, 255, 0.88);
    }
}

@media (max-width: 640px) {
    .drawer {
        width: calc(100% - 20px);
        bottom: 92px;
        border-radius: 20px;
        max-height: calc(85vh - 112px);
    }
}

.drawer.open {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.drawer-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    cursor: grab;
}

.drawer-handle-bar {
    width: 40px;
    height: 4px;
    background: rgba(148, 163, 184, 0.55);
    border-radius: 2px;
}

.drawer-header {
    padding: 4px 24px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 0;
}

.drawer-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.drawer-section {
    padding: 18px 24px 20px;
}

.drawer-section:not(:last-child) {
    border-bottom: 1px solid rgba(226, 232, 240, 0.65);
}

.drawer-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 14px;
    padding: 0 4px;
}

.drawer-section-title i {
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.drawer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0;
}

@media (max-width: 640px) {
    .drawer-header {
        padding: 2px 20px 12px;
    }
    .drawer-section {
        padding: 16px 20px 18px;
    }
    .drawer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0;
    }
    .drawer-section-title {
        font-size: 12.5px;
        margin-bottom: 12px;
        padding: 0 2px;
    }
}

.drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 6px;
    text-decoration: none;
    color: #334155;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    min-height: 92px;
    position: relative;
    text-align: center;
}

.drawer-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

.drawer-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.drawer-text {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    line-height: 1.35;
}

.drawer-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--danger);
    color: #fff;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    padding: 0 4px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Date picker (teacher) */
.date-picker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.15);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 60;
    padding: 20px;
}

.date-picker.open {
    transform: translateY(0);
}

.date-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 55;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.date-picker-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Empty / soft states */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
}

.empty-state .empty-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Badges / chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.chip-success { background: #d1fae5; color: #065f46; }
.chip-warning { background: #fef3c7; color: #92400e; }
.chip-danger  { background: #fee2e2; color: #991b1b; }
.chip-info    { background: #dbeafe; color: #1e40af; }
.chip-muted   { background: var(--line-soft); color: var(--muted); }

/* Toast notifications */
.toast-host {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(420px, calc(100% - 24px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: toastIn 0.28s ease;
}

.toast.success { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.toast.error   { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.toast.info    { border-color: #bfdbfe; background: #eff6ff; color: #1e40af; }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Legacy notification class */
.notification {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    padding: 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tabs */
.tab-button {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    color: var(--muted);
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab-button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Page shell helpers */
.page-shell {
    padding: 16px;
    max-width: 960px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .page-shell {
        padding: 12px;
    }
}

/* Soft surface cards used in dashboards */
.surface-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.surface-card:hover {
    box-shadow: var(--shadow-md);
}

/* Quick action grid */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 768px) {
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
