/* ============================================
   ShikshaMahal Admin – Design System & Styles
   ============================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
    /* Backgrounds */
    --bg-primary: #0a0a1a;
    --bg-secondary: #10102a;
    --bg-tertiary: #161640;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-sidebar: #0c0c22;

    /* Accent Colors */
    --accent-primary: #6c5ce7;
    --accent-primary-light: #a855f7;
    --accent-secondary: #00cec9;
    --gradient-primary: linear-gradient(135deg, #6c5ce7, #a855f7);
    --gradient-accent: linear-gradient(135deg, #00cec9, #6c5ce7);
    --gradient-warm: linear-gradient(135deg, #e17055, #fdcb6e);
    --gradient-cool: linear-gradient(135deg, #0984e3, #00cec9);
    --gradient-bg: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0a0a1a 100%);

    /* Status Colors */
    --success: #00b894;
    --success-bg: rgba(0, 184, 148, 0.12);
    --warning: #fdcb6e;
    --warning-bg: rgba(253, 203, 110, 0.12);
    --danger: #e17055;
    --danger-bg: rgba(225, 112, 85, 0.12);
    --info: #74b9ff;
    --info-bg: rgba(116, 185, 255, 0.12);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.35);
    --text-accent: #a855f7;

    /* Borders */
    --border-default: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-accent: rgba(108, 92, 231, 0.4);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
    --shadow-glow-accent: 0 0 20px rgba(168, 85, 247, 0.3);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Typography */
    --font-family: 'Inter', 'Nirmala UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-base: 0.9rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.2rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

a {
    color: var(--accent-primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--accent-primary); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

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

/* ---------- Utility Classes ---------- */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--text-accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

/* ---------- Layout: App Shell ---------- */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.page-content {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeIn 0.3s ease;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base);
    position: relative;
    z-index: 50;
    flex-shrink: 0;
}

.sidebar-header {
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border-bottom: 1px solid var(--border-default);
    min-height: 72px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    font-size: var(--font-size-md);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-sm);
    overflow-y: auto;
}

.sidebar-section-title {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: var(--space-md) var(--space-md) var(--space-sm);
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
    text-decoration: none;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.sidebar-link.active {
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.15);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
}

.sidebar-link i {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link .badge {
    margin-left: auto;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-default);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--bg-card-hover);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

/* ---------- Top Header ---------- */
.top-header {
    height: var(--header-height);
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-default);
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: var(--glass-blur);
    flex-shrink: 0;
    z-index: 40;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-page-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.header-breadcrumb {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-search {
    position: relative;
}

.header-search input {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    padding: 8px 16px 8px 36px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    width: 220px;
    transition: all var(--transition-base);
    outline: none;
}

.header-search input::placeholder {
    color: var(--text-tertiary);
}

.header-search input:focus {
    border-color: var(--accent-primary);
    width: 280px;
    background: rgba(108, 92, 231, 0.08);
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    position: relative;
}

.header-icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.header-icon-btn .notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

/* ---------- Login Page ---------- */
.login-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-bg);
    position: relative;
    overflow: hidden;
}

.login-bg-orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg-orbs .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbFloat 15s ease-in-out infinite;
}

.login-bg-orbs .orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.login-bg-orbs .orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    bottom: -80px;
    left: -80px;
    animation-delay: -5s;
}

.login-bg-orbs .orb-3 {
    width: 200px;
    height: 200px;
    background: var(--accent-primary-light);
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: scaleIn 0.5s var(--transition-spring);
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin: 0 auto var(--space-lg);
    box-shadow: var(--shadow-glow-accent);
}

.login-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--space-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-xl);
}

.login-form { display: flex; flex-direction: column; gap: var(--space-md); }

.login-error {
    background: var(--danger-bg);
    border: 1px solid rgba(225, 112, 85, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--danger);
    font-size: var(--font-size-sm);
    display: none;
    align-items: center;
    gap: var(--space-sm);
    animation: shake 0.4s ease;
}

.login-error.show {
    display: flex;
}

/* ---------- Form Elements ---------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 11px var(--space-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    outline: none;
    width: 100%;
}

.form-input:focus {
    border-color: var(--accent-primary);
    background: rgba(108, 92, 231, 0.06);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

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

.form-input-icon-wrapper {
    position: relative;
}

.form-input-icon-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 1rem;
    transition: color var(--transition-fast);
}

.form-input-icon-wrapper:focus-within i {
    color: var(--accent-primary);
}

.form-input-icon-wrapper .form-input {
    padding-left: 40px;
}

.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 11px var(--space-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    outline: none;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5L6 8L9 5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

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

.form-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 11px var(--space-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    outline: none;
    width: 100%;
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.form-check input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.form-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn i { font-size: 1.1rem; }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

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

.btn-success:hover {
    background: #00a88a;
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background: #d35f48;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: #1a1a2e;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--font-size-base);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: var(--font-size-md);
    font-weight: 700;
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ---------- Stats Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.stat-card:hover::before {
    opacity: 1;
}

.stat-card-info { flex: 1; }

.stat-card-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.stat-card-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.stat-card-change {
    font-size: var(--font-size-xs);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.stat-card-change.positive {
    color: var(--success);
    background: var(--success-bg);
}

.stat-card-change.negative {
    color: var(--danger);
    background: var(--danger-bg);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon-purple {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-primary-light);
}

.stat-icon-teal {
    background: rgba(0, 206, 201, 0.15);
    color: var(--accent-secondary);
}

.stat-icon-green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon-orange {
    background: rgba(225, 112, 85, 0.15);
    color: var(--danger);
}

/* ---------- Data Table ---------- */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.table-title {
    font-size: var(--font-size-md);
    font-weight: 700;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.table-search {
    position: relative;
}

.table-search input {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 7px 14px 7px 34px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    width: 200px;
    outline: none;
    transition: all var(--transition-fast);
}

.table-search input:focus {
    border-color: var(--accent-primary);
    width: 250px;
}

.table-search input::placeholder {
    color: var(--text-tertiary);
}

.table-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px var(--space-lg);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast);
    user-select: none;
}

.data-table th:hover {
    color: var(--text-secondary);
}

.data-table th i {
    margin-left: 4px;
    font-size: 0.7rem;
}

.data-table td {
    padding: 12px var(--space-lg);
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-default);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.table-info {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-purple {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-primary-light);
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ---------- Avatar ---------- */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    color: white;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 28px; height: 28px; font-size: var(--font-size-xs); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--font-size-md); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--font-size-lg); }

.user-cell {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-cell-info { display: flex; flex-direction: column; }
.user-cell-name { font-weight: 600; font-size: var(--font-size-sm); }
.user-cell-email { font-size: var(--font-size-xs); color: var(--text-tertiary); }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: var(--space-lg);
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal-lg { max-width: 720px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-default);
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 320px;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.4s var(--transition-spring);
    position: relative;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast-info .toast-icon { background: var(--info-bg); color: var(--info); }

.toast-content { flex: 1; }

.toast-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--text-primary); }

.toast-exit {
    animation: slideOutRight 0.3s ease forwards;
}

/* ---------- Charts ---------- */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.chart-card canvas {
    width: 100% !important;
    max-height: 300px;
}

/* ---------- Activity Feed ---------- */
.activity-feed { display: flex; flex-direction: column; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-default);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.page-header-info h1 {
    font-size: var(--font-size-xl);
    font-weight: 800;
}

.page-header-info p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

.page-header-actions {
    display: flex;
    gap: var(--space-sm);
}

/* ---------- Tab Navigation ---------- */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: var(--space-lg);
    width: fit-content;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    border-color: var(--accent-primary);
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent-primary-light);
}

/* ---------- Course Card View ---------- */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-md);
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
}

.course-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.course-card-thumb {
    height: 160px;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.course-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-card-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
}

.course-card-body {
    padding: var(--space-md);
}

.course-card-category {
    font-size: var(--font-size-xs);
    color: var(--accent-primary-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.course-card-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.course-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-top: 1px solid var(--border-default);
}

.course-card-price {
    font-size: var(--font-size-md);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Quiz Specific ---------- */
.quiz-question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
}

.quiz-question-card:hover {
    border-color: var(--border-hover);
}

.quiz-question-number {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--accent-primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.quiz-question-text {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-md);
    font-family: 'Nirmala UI', sans-serif;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    font-family: 'Nirmala UI', sans-serif;
}

.quiz-option.correct {
    border-color: var(--success);
    background: var(--success-bg);
}

.quiz-explanation {
    margin-top: 12px;
    padding: 12px;
    background: var(--info-bg);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--info);
    font-family: 'Nirmala UI', sans-serif;
    line-height: 1.6;
    border-left: 3px solid var(--info);
}

.quiz-option-marker {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.quiz-option.correct .quiz-option-marker {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

/* ---------- Settings ---------- */
.settings-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-lg);
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    text-align: left;
    width: 100%;
}

.settings-nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent-primary-light);
}

.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.settings-section {
    margin-bottom: var(--space-xl);
}

.settings-section:last-child { margin-bottom: 0; }

.settings-section-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-default);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-default);
}

.setting-row:last-child { border-bottom: none; }

.setting-info { flex: 1; }

.setting-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.setting-desc {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* ---------- Dropdown ---------- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    min-width: 180px;
    padding: var(--space-xs);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    animation: fadeInDown 0.15s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-default);
    margin: var(--space-xs) 0;
}

/* ---------- Confirm Dialog ---------- */
.confirm-body {
    text-align: center;
    padding: var(--space-md);
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--danger-bg);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto var(--space-lg);
}

.confirm-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* ---------- Grid Layouts ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-md);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(10px, -10px) scale(1.05); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-default);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 100;
        transition: left var(--transition-base);
    }
    .sidebar.open {
        left: 0;
    }
    .page-content {
        padding: var(--space-md);
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .course-grid {
        grid-template-columns: 1fr;
    }
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Mobile Responsiveness ---------- */
@media (max-width: 768px) {
    /* Hide search bar by default to save space */
    .header-search { display: none; }
    
    /* Make mobile menu button visible */
    #mobile-menu-btn { display: inline-flex !important; }
    
    /* Header tweaks */
    .header-page-title {
        font-size: 1.15rem;
    }
    
    .mode-badge-inline {
        padding: 4px 10px !important;
        font-size: 0.65rem !important;
        gap: 4px !important;
    }
    
    /* Reposition sidebar off-canvas */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Smaller page content padding */
    .page-content {
        padding: var(--space-md);
    }
    
    /* Dashboard tweaks */
    .hero-stat-value { font-size: 2rem; }
    
    /* Table overflow */
    .table-container {
        padding: var(--space-sm);
    }
    
    .data-table th, .data-table td {
        padding: 10px;
    }
    
    /* Filter bar */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar > div {
        margin-left: 0 !important;
        margin-top: var(--space-sm);
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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