/**
 * 369 Tesla Online Test Series
 * Premium Black-Gold Theme
 * KalviYogi Nagarajan - Edunivra Pvt Ltd
 */

/* =====================================================
   CSS VARIABLES - BLACK GOLD THEME
   ===================================================== */
:root {
    /* Background Colors */
    --bg-primary: #0B0B0F;
    --bg-secondary: #0F0F14;
    --bg-card: #15151D;
    --bg-card-hover: #1A1A24;
    --bg-elevated: #1E1E28;
    --bg-input: #12121A;
    
    /* Gold Accent Colors */
    --gold-primary: #D4AF37;
    --gold-light: #F5D76E;
    --gold-dark: #B8960C;
    --gold-muted: #8B7355;
    --gold-glow: rgba(212, 175, 55, 0.3);
    
    /* Text Colors */
    --text-primary: #EAEAF2;
    --text-secondary: #A0A0B0;
    --text-muted: #6B6B7B;
    --text-on-gold: #0B0B0F;
    
    /* Border Colors */
    --border-default: #2A2A35;
    --border-light: #3A3A45;
    --border-gold: rgba(212, 175, 55, 0.3);
    
    /* Status Colors */
    --success: #2ECC71;
    --success-bg: rgba(46, 204, 113, 0.15);
    --error: #E74C3C;
    --error-bg: rgba(231, 76, 60, 0.15);
    --warning: #F39C12;
    --warning-bg: rgba(243, 156, 18, 0.15);
    --info: #3498DB;
    --info-bg: rgba(52, 152, 219, 0.15);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.15);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Noto Sans Tamil', 'Latha', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 64px;
    --content-max-width: 1400px;
}

/* =====================================================
   BASE RESET & TYPOGRAPHY
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tamil text support */
.tamil, [lang="ta"] {
    font-family: 'Noto Sans Tamil', 'Latha', 'Vijaya', 'Tamil MN', var(--font-family);
    line-height: var(--leading-relaxed);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: var(--leading-tight);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold-light);
}

/* Selection */
::selection {
    background-color: var(--gold-primary);
    color: var(--text-on-gold);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-muted);
}

/* =====================================================
   LAYOUT
   ===================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
}

.page-content {
    flex: 1;
    padding: var(--spacing-xl);
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-normal);
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--text-on-gold);
    flex-shrink: 0;
}

.sidebar-brand {
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand h1 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--gold-primary);
    margin: 0;
}

.sidebar-brand p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}

.sidebar-collapsed .sidebar-brand {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--spacing-lg);
}

.nav-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
}

.sidebar-collapsed .nav-section-title {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), transparent);
    color: var(--gold-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--gold-primary);
    border-radius: var(--radius-full);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-collapsed .nav-text {
    display: none;
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-default);
}

.sidebar-toggle {
    width: 100%;
    padding: var(--spacing-sm);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

/* =====================================================
   HEADER
   ===================================================== */
.header {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.page-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--gold-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-search {
    position: relative;
}

.header-search input {
    width: 280px;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-left: 40px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--bg-input);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.header-icon-btn:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--gold-primary);
    color: var(--text-on-gold);
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.user-dropdown-trigger:hover {
    background-color: var(--bg-card-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-on-gold);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.dropdown-item:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

.dropdown-item.danger {
    color: var(--error);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-default);
    margin: var(--spacing-xs) 0;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-default);
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    opacity: 0.5;
}

.stat-card .card-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.stat-info h3 {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-info p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-primary);
}

.stat-trend {
    margin-top: var(--spacing-md);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.stat-trend.positive {
    color: var(--success);
}

.stat-trend.negative {
    color: var(--error);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--text-on-gold);
    border-color: var(--gold-primary);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
    box-shadow: var(--shadow-gold);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-outline {
    background-color: transparent;
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--gold-primary);
    color: var(--text-on-gold);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--error);
    color: white;
    border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
    background-color: #c0392b;
    border-color: #c0392b;
}

.btn-success {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--text-base);
}

.btn-icon {
    padding: var(--spacing-sm);
    width: 36px;
    height: 36px;
}

.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn:not(:last-child) {
    border-right: none;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.form-label.required::after {
    content: ' *';
    color: var(--error);
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background-color: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-control.is-invalid {
    border-color: var(--error);
}

.form-control.is-valid {
    border-color: var(--success);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A0A0B0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--error);
    margin-top: var(--spacing-xs);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-primary);
    cursor: pointer;
}

.form-check-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

/* Switch */
.form-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.form-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.form-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.form-switch-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.form-switch input:checked + .form-switch-slider {
    background-color: var(--gold-primary);
    border-color: var(--gold-primary);
}

.form-switch input:checked + .form-switch-slider::before {
    transform: translateX(20px);
    background-color: var(--text-on-gold);
}

/* Input Group */
.input-group {
    display: flex;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-text {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.input-group-text:first-child {
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group-text:last-child {
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* =====================================================
   TABLES
   ===================================================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-elevated);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

.table td {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-default);
    color: var(--text-primary);
}

.table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: var(--spacing-xs);
}

/* =====================================================
   BADGES & TAGS
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--spacing-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    background-color: var(--bg-elevated);
    color: var(--text-secondary);
}

.badge-primary {
    background-color: var(--gold-glow);
    color: var(--gold-primary);
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-error {
    background-color: var(--error-bg);
    color: var(--error);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px var(--spacing-sm);
    font-size: var(--text-xs);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.tag-remove {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.tag-remove:hover {
    opacity: 1;
}

/* =====================================================
   ALERTS & TOASTS
   ===================================================== */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.alert-message {
    font-size: var(--text-sm);
    margin: 0;
}

.alert-success {
    background-color: var(--success-bg);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: var(--success);
}

.alert-error {
    background-color: var(--error-bg);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: var(--error);
}

.alert-warning {
    background-color: var(--warning-bg);
    border: 1px solid rgba(243, 156, 18, 0.3);
    color: var(--warning);
}

.alert-info {
    background-color: var(--info-bg);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: var(--info);
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.toast-close:hover {
    opacity: 1;
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: transform var(--transition-fast);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1100px;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border-color: var(--gold-primary);
    color: var(--text-on-gold);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0 var(--spacing-md);
}

/* =====================================================
   LOADING & SPINNER
   ===================================================== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-default);
    border-top-color: var(--gold-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(11, 11, 15, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--spacing-sm);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--spacing-md);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--text-xl);
    margin-bottom: var(--spacing-sm);
}

.empty-state-message {
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

/* =====================================================
   GRID SYSTEM
   ===================================================== */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1200px) {
    .lg-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .md-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md-cols-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sm-cols-1 { grid-template-columns: 1fr; }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }
.flex-1 { flex: 1; }

/* =====================================================
   UTILITIES
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold-primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.m-0 { margin: 0; }
.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-collapsed .main-content {
        margin-left: 0;
    }
    
    .header {
        padding: 0 var(--spacing-md);
    }
    
    .page-content {
        padding: var(--spacing-md);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .header-search {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .table {
        font-size: var(--text-xs);
    }
    
    .table th,
    .table td {
        padding: var(--spacing-sm);
    }
}

/* Mobile bottom navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-default);
    z-index: 100;
    padding: var(--spacing-sm);
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        justify-content: space-around;
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: var(--spacing-xs);
        color: var(--text-muted);
        font-size: var(--text-xs);
        text-decoration: none;
    }
    
    .mobile-nav-item.active {
        color: var(--gold-primary);
    }
    
    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }
}

/* =====================================================
   MATHJAX STYLING
   ===================================================== */
.math-content {
    line-height: 1.8;
}

.MathJax {
    color: var(--text-primary) !important;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .sidebar,
    .header,
    .mobile-nav,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}


