/* ============================================================
   EduMaster ERP — Brand System & Design Tokens
   COLORFUL LIGHT THEME inspired by reference designs
   ============================================================ */
:root {
    /* Brand Colors */
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #3730A3;
    --bg-deep: #F0F4FF;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FFFFFF;
    --accent: #06B6D4;
    --accent-glow: rgba(6, 182, 212, 0.25);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border-glass: rgba(0, 0, 0, 0.06);
    --border-glow: rgba(79, 70, 229, 0.25);

    /* Pastel Card Colors */
    --pastel-blue: #DBEAFE;
    --pastel-indigo: #E0E7FF;
    --pastel-purple: #EDE9FE;
    --pastel-pink: #FCE7F3;
    --pastel-rose: #FFE4E6;
    --pastel-orange: #FFEDD5;
    --pastel-amber: #FEF3C7;
    --pastel-yellow: #FEF9C3;
    --pastel-green: #D1FAE5;
    --pastel-teal: #CCFBF1;
    --pastel-cyan: #CFFAFE;
    --pastel-sky: #E0F2FE;

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Poppins', 'Inter', sans-serif;

    /* Spacing */
    --sidebar-width: 260px;
    --topnav-height: 72px;
    --page-padding: 28px;
    --card-radius: 18px;
    --card-padding: 24px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(79, 70, 229, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #3730A3 0%, #4F46E5 50%, #6366F1 100%);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--transition-smooth);
    box-shadow: 4px 0 24px rgba(79, 70, 229, 0.15);
    overflow: hidden;
}

.sidebar-logo {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #FFFFFF;
    -webkit-text-fill-color: #FFFFFF;
    background: none;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Enable scroll while keeping flex layout */
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.8;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: #FFFFFF;
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease, transform 0.15s ease;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.sidebar-user:hover::after {
    content: '✏️';
    font-size: 0.75rem;
    margin-left: auto;
    opacity: 0.7;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #FFFFFF;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFFFFF;
}

.user-role {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* ============================================================
   Top Navigation
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topnav {
    height: var(--topnav-height);
    padding: 0 var(--page-padding);
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.topnav-left {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.topnav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F1F5F9;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 8px 16px;
    transition: all var(--transition-fast);
    position: relative;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: #FFFFFF;
}

.search-box svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    width: 200px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.topnav-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.topnav-icon svg {
    width: 18px;
    height: 18px;
}

.topnav-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 2px solid #FFFFFF;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ============================================================
   Page Container
   ============================================================ */
.page-container {
    padding: var(--page-padding);
    flex: 1;
}

/* ============================================================
   Card Base — Colorful cards
   ============================================================ */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    will-change: transform;
}

.glass-card::before {
    display: none;
}

.glass-card:hover {
    transform: translateY(-3px) !important;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.08),
        0 4px 10px rgba(0, 0, 0, 0.04);
    border-color: rgba(79, 70, 229, 0.12);
}

/* Card glow removed for light theme */
.glass-card .card-glow {
    display: none;
}

/* Colorful stat cards */
.glass-card.stat-card:nth-child(1) {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    border-color: rgba(139, 92, 246, 0.15);
}
.glass-card.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #CFFAFE 0%, #A5F3FC 100%);
    border-color: rgba(6, 182, 212, 0.15);
}
.glass-card.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-color: rgba(16, 185, 129, 0.15);
}
.glass-card.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-color: rgba(245, 158, 11, 0.15);
}

/* Extra stat card colors for pages with more than 4 */
.glass-card.stat-card:nth-child(5) {
    background: linear-gradient(135deg, #FCE7F3 0%, #FBCFE8 100%);
    border-color: rgba(236, 72, 153, 0.15);
}
.glass-card.stat-card:nth-child(6) {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    border-color: rgba(59, 130, 246, 0.15);
}
.glass-card.stat-card:nth-child(7) {
    background: linear-gradient(135deg, #FFEDD5 0%, #FED7AA 100%);
    border-color: rgba(249, 115, 22, 0.15);
}
.glass-card.stat-card:nth-child(8) {
    background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
    border-color: rgba(99, 102, 241, 0.15);
}

/* ============================================================
   Smooth Stagger-In Animation
   ============================================================ */
.stagger-in {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    animation: staggerIn 0.5s var(--stagger-delay, 0s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes staggerIn {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Legacy gravity-fall — now redirects to stagger-in */
.gravity-fall {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    animation: staggerIn 0.5s var(--fall-delay, 0s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Hidden — floating particles removed */
.gravity-particles {
    display: none;
}
.gravity-particle {
    display: none;
}

/* ============================================================
   Dashboard Grid
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* ============================================================
   Stat Cards (Top Row)
   ============================================================ */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-card .stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon.indigo {
    background: rgba(79, 70, 229, 0.2);
    color: #4F46E5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}
.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.2);
    color: #0891B2;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}
.stat-icon.green {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
.stat-icon.amber {
    background: rgba(245, 158, 11, 0.2);
    color: #D97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.stat-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 50px;
    font-weight: 600;
}

.stat-badge.up {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}
.stat-badge.down {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-trend {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================================
   Chart Containers
   ============================================================ */
.chart-card {
    min-height: 300px;
}

.chart-card .card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.chart-card .card-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* SVG Chart Styles */
.chart-container {
    width: 100%;
    height: 220px;
    position: relative;
}

/* Donut Chart */
.donut-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.donut-svg {
    width: 160px;
    height: 160px;
    transform: rotate(-90deg);
}

.donut-segment {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    transition: all var(--transition-smooth);
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: calc(50% - 40px);
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Ring Chart */
.ring-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ring-svg {
    width: 180px;
    height: 180px;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: #E2E8F0;
    stroke-width: 12;
}

.ring-progress {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease-out;
}

.ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ring-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 180px;
    padding-top: 20px;
    gap: 8px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bar-wrapper {
    width: 100%;
    max-width: 50px;
    height: 150px;
    display: flex;
    align-items: flex-end;
}

.bar {
    width: 100%;
    border-radius: 8px 8px 2px 2px;
    min-height: 8px;
    transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    cursor: pointer;
}

.bar:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: scaleX(1.1);
}

.bar-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.bar-value-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================================
   Timetable
   ============================================================ */
.timetable-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.timetable-grid th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 2px solid #E2E8F0;
}

.timetable-grid td {
    padding: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #F1F5F9;
    vertical-align: top;
}

.timetable-grid tr:hover td {
    background: #F8FAFC;
}

.tt-subject {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.76rem;
}

.tt-time {
    color: var(--text-muted);
    font-size: 0.68rem;
}

/* ============================================================
   Exam Schedule List
   ============================================================ */
.exam-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exam-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 12px;
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    transition: all var(--transition-fast);
}

.exam-item:hover {
    background: #EFF6FF;
    border-color: rgba(79, 70, 229, 0.15);
    transform: translateX(4px);
}

.exam-date-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #EDE9FE, #DDD6FE);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.exam-date-day {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
}

.exam-date-month {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.exam-info {
    flex: 1;
}

.exam-subject {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.exam-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.exam-class-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 50px;
    background: #EDE9FE;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   LMS Card
   ============================================================ */
.lms-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.lms-stat-item {
    padding: 14px;
    border-radius: 12px;
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    text-align: center;
}

.lms-stat-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.lms-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ============================================================
   Module Pages — Common
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.35);
    animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(79, 70, 229, 0.35); }
    50% { box-shadow: 0 4px 30px rgba(79, 70, 229, 0.5), 0 0 40px rgba(79, 70, 229, 0.15); }
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid #E2E8F0;
}

.btn-outline:hover {
    background: #F1F5F9;
    border-color: var(--primary);
    color: var(--primary);
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   Form Controls
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select option {
    background: #FFFFFF;
    color: var(--text-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ============================================================
   Progress Stepper
   ============================================================ */
.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
}

.stepper-step {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.stepper-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    border: 2px solid #E2E8F0;
    color: var(--text-muted);
    background: #FFFFFF;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.stepper-step.active .stepper-circle {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.stepper-step.completed .stepper-circle {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.stepper-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.stepper-step.active .stepper-label {
    color: var(--primary);
    font-weight: 600;
}

.stepper-line {
    flex: 1;
    height: 2px;
    background: #E2E8F0;
    margin: 0 10px;
}

.stepper-line.completed {
    background: linear-gradient(90deg, var(--success), var(--primary));
}

/* ============================================================
   Data Tables
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #E2E8F0;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #F1F5F9;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: #F8FAFC;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
}

.status-badge.approved {
    background: #D1FAE5;
    color: #059669;
}

.status-badge.pending {
    background: #FEF3C7;
    color: #D97706;
}

.status-badge.rejected {
    background: #FFE4E6;
    color: #DC2626;
}

/* ============================================================
   Attendance Grid
   ============================================================ */
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}

.attendance-cell {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    cursor: default;
}

.attendance-cell.present {
    background: #D1FAE5;
    color: #059669;
    border-color: #A7F3D0;
}

.attendance-cell.absent {
    background: #FFE4E6;
    color: #DC2626;
    border-color: #FECACA;
}

.attendance-cell.late {
    background: #FEF3C7;
    color: #D97706;
    border-color: #FDE68A;
}

.attendance-cell .cell-roll {
    font-size: 0.74rem;
    font-weight: 700;
}

.attendance-cell .cell-status {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Class selector tabs */
.class-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.class-tab {
    padding: 8px 18px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.class-tab:hover {
    background: #F1F5F9;
    border-color: var(--primary);
    color: var(--primary);
}

.class-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ============================================================
   Report Card
   ============================================================ */
.report-card {
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: var(--card-radius);
    padding: 28px;
    max-width: 520px;
}

.report-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #EDE9FE;
}

.report-school {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.report-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.report-student-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.82rem;
}

.report-student-info dt {
    color: var(--text-muted);
}

.report-student-info dd {
    color: var(--text-primary);
    font-weight: 600;
}

.grade-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

.grade-table th {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #E2E8F0;
}

.grade-table td {
    padding: 10px 12px;
    font-size: 0.84rem;
    border-bottom: 1px solid #F1F5F9;
    color: var(--text-primary);
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
}

.grade-badge.grade-a-plus {
    background: #D1FAE5;
    color: #059669;
}
.grade-badge.grade-a {
    background: #CFFAFE;
    color: #0891B2;
}
.grade-badge.grade-b-plus {
    background: #EDE9FE;
    color: #7C3AED;
}
.grade-badge.grade-b {
    background: #FEF3C7;
    color: #D97706;
}

/* ============================================================
   LMS Page
   ============================================================ */
.live-class-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.live-class-card:hover {
    background: #EFF6FF;
    border-color: rgba(79, 70, 229, 0.15);
    transform: translateX(4px);
}

.live-thumbnail {
    width: 80px;
    height: 56px;
    border-radius: 10px;
    background: linear-gradient(135deg, #EDE9FE, #DDD6FE);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-thumbnail svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
    opacity: 0.8;
}

.live-class-info {
    flex: 1;
}

.live-class-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.live-class-teacher {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.assignment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assignment-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
}

.assignment-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assignment-icon svg {
    width: 18px;
    height: 18px;
}

.assignment-info {
    flex: 1;
}

.assignment-title {
    font-weight: 600;
    font-size: 0.86rem;
    margin-bottom: 3px;
    color: var(--text-primary);
}

.assignment-due {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.progress-bar {
    height: 6px;
    border-radius: 3px;
    background: #E2E8F0;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease-out;
}

/* ============================================================
   Photo Upload
   ============================================================ */
.photo-upload {
    width: 120px;
    height: 140px;
    border: 2px dashed #CBD5E1;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-muted);
    margin: 0 auto;
}

.photo-upload:hover {
    border-color: var(--primary);
    background: #EDE9FE;
    color: var(--primary);
}

.photo-upload svg {
    width: 28px;
    height: 28px;
}

.photo-upload span {
    font-size: 0.7rem;
}

/* ============================================================
   Fee Module
   ============================================================ */
.fee-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.fee-summary-item {
    text-align: center;
    padding: 18px;
    border-radius: 14px;
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
}

.fee-amount {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.fee-label {
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* ============================================================
   Section title
   ============================================================ */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.section-title .title-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }

    .topnav {
        padding: 0 16px;
    }

    .page-container {
        padding: 16px;
    }

    .search-box {
        display: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .fee-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-student-info {
        grid-template-columns: 1fr;
    }

    .stepper {
        flex-wrap: wrap;
        gap: 8px;
    }

    .stepper-line {
        display: none;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .lms-stats {
        grid-template-columns: 1fr;
    }
}
