/* ============================================================
   EduPlatform Design System v1.0
   Clean, professional design system for educational ERP.
   ============================================================ */

/* ------------------------------------------------------------
   COLOR TOKENS — Light Mode
   ------------------------------------------------------------ */
:root,
[data-theme="light"] {
    /* Backgrounds */
    --bg: #F0F2F5;
    --surface: #FFFFFF;
    --surface-alt: #F7F8FA;
    --surface-hover: #F0F2F5;
    --border: #E4E7EC;
    --border-light: #F0F2F5;

    /* Text */
    --text: #111827;
    --text-muted: #9CA3AF;

    /* Primary — EduPlatform Navy Blue (brand) */
    --primary: #2E7BC4;
    --primary-hover: #1E5799;
    --primary-light: rgba(46, 123, 196, 0.08);
    --primary-text: #1E5799;
    --primary-gradient: linear-gradient(135deg, #2E7BC4, #1E5799);

    /* Accent — EduPlatform Green (brand) */
    --accent: #27AE60;
    --accent-hover: #1D8348;

    /* Success */
    --success: #27AE60;
    --success-text: #1D8348;
    --success-light: rgba(39, 174, 96, 0.08);
    --success-bg: rgba(39, 174, 96, 0.05);

    /* Warning */
    --warning: #F59E0B;
    --warning-text: #D97706;
    --warning-light: rgba(245, 158, 11, 0.08);
    --warning-bg: rgba(245, 158, 11, 0.05);

    /* Danger */
    --danger: #EF4444;
    --danger-text: #DC2626;
    --danger-light: rgba(239, 68, 68, 0.08);
    --danger-bg: rgba(239, 68, 68, 0.05);

    /* Sidebar — EduPlatform Navy (brand) */
    --sidebar-bg: #0E2442;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: rgba(255, 255, 255, 0.6);
    --sidebar-text-active: #ffffff;
    --sidebar-active-bg: rgba(46, 123, 196, 0.2);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-width: 260px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-base: 0.15s ease;
    --transition-slow: 0.25s ease;
}

/* ------------------------------------------------------------
   COLOR TOKENS — Dark Mode
   ------------------------------------------------------------ */
[data-theme="dark"] {
    /* Backgrounds — true dark, no warm cast */
    --bg: #0F1117;
    --surface: #1A1D24;
    --surface-alt: #22262E;
    --surface-hover: #2A2F38;
    --border: #2E3440;

    /* Text — crisp white */
    --text: #E2E8F0;
    --text-muted: #94A3B8;

    /* Primary — EduPlatform Blue (brand, lightened for dark bg) */
    --primary: #4A9BE8;
    --primary-hover: #7CB9F0;
    --primary-light: rgba(74, 155, 232, 0.15);
    --primary-text: #4A9BE8;

    /* Success — EduPlatform Green (brand, lightened) */
    --success: #58D68D;
    --success-text: #58D68D;
    --success-light: rgba(74, 222, 128, 0.15);

    /* Warning */
    --warning: #FBBF24;
    --warning-text: #FBBF24;
    --warning-light: rgba(251, 191, 36, 0.15);

    /* Danger */
    --danger: #F87171;
    --danger-text: #F87171;
    --danger-light: rgba(248, 113, 113, 0.15);

    /* Sidebar */
    --sidebar-bg: #070B14;
    --sidebar-border: #1E293B;

    /* Status backgrounds */
    --success-bg: rgba(88, 214, 141, 0.08);
    --danger-bg: rgba(248, 113, 113, 0.08);
    --warning-bg: rgba(251, 191, 36, 0.08);

    /* Borders */
    --border-light: #2E3440;

    /* Shadows — darker for dark mode */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------
   TYPOGRAPHY
   ------------------------------------------------------------ */
body {
    font-family: var(--font-family);
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.88rem; }
h6 { font-size: 0.82rem; }

/* Typography utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.82rem; }
.text-base { font-size: 0.88rem; }
.text-lg { font-size: 1rem; }
.text-xl { font-size: 1.15rem; }

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-text); }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-danger { color: var(--danger-text); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }

/* ------------------------------------------------------------
   SPACING UTILITIES
   ------------------------------------------------------------ */
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 16px; }
.gap-xl { gap: 24px; }
.gap-xxl { gap: 48px; }

.p-0 { padding: 0; }
.p-xs { padding: 4px; }
.p-sm { padding: 8px; }
.p-md { padding: 12px; }
.p-lg { padding: 16px; }
.p-xl { padding: 32px; }

.m-0 { margin: 0; }
.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 12px; }
.mb-lg { margin-bottom: 16px; }
.mt-lg { margin-top: 16px; }

/* ------------------------------------------------------------
   LAYOUT UTILITIES
   ------------------------------------------------------------ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

/* ------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    line-height: 1;
    white-space: nowrap;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.btn i,
.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Button variants */
.btn-primary {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

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

.btn-secondary {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--surface-alt);
    border-color: var(--primary);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--surface);
    color: var(--text);
}

.btn-danger {
    background-color: var(--danger-light);
    color: var(--danger-text);
    border-color: transparent;
}

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

.btn-outline {
    background-color: transparent;
    color: var(--primary-text);
    border-color: var(--border);
}

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

/* Button sizes */
.btn-sm {
    padding: 7px 12px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-sm i,
.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* Icon-only button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

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

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background-color: var(--surface-alt);
}

/* Compact card variant */
.card-compact {
    padding: 12px;
}

.card-compact .card-header {
    padding: 10px 12px;
}

.card-compact .card-body {
    padding: 12px;
}

/* Stat card */
.stat-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-light);
    color: var(--primary-text);
    flex-shrink: 0;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

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

/* ------------------------------------------------------------
   FORMS
   ------------------------------------------------------------ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-required::after {
    content: " \2022";
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    box-sizing: border-box;
}

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

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background-color: var(--surface-alt);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Select with custom chevron */
.form-select {
    appearance: none;
    -webkit-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'%3E%3Cpath fill='%238E9BAA' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

/* Textarea */
.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Global form element styling — ensures ALL inputs look consistent without needing classes */
.main-content input[type="text"],
.main-content input[type="number"],
.main-content input[type="email"],
.main-content input[type="tel"],
.main-content input[type="date"],
.main-content input[type="time"],
.main-content input[type="password"],
.main-content input[type="search"],
.main-content input[type="url"],
.main-content select,
.main-content textarea {
    padding: 10px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    box-sizing: border-box;
}
.main-content input[type="text"]:focus,
.main-content input[type="number"]:focus,
.main-content input[type="email"]:focus,
.main-content input[type="tel"]:focus,
.main-content input[type="date"]:focus,
.main-content input[type="time"]:focus,
.main-content input[type="password"]:focus,
.main-content input[type="search"]:focus,
.main-content input[type="url"]:focus,
.main-content select:focus,
.main-content textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}
.main-content select {
    appearance: none;
    -webkit-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'%3E%3Cpath fill='%238E9BAA' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}
.main-content input::placeholder,
.main-content textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}
.main-content textarea {
    resize: vertical;
    min-height: 60px;
}

/* Hint and error text */
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger-text);
    margin-top: 4px;
}

.form-input.error {
    border-color: var(--danger);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px var(--danger-light);
}

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

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

@media (max-width: 600px) {
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* Form sections */
.form-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ------------------------------------------------------------
   TABLES
   ------------------------------------------------------------ */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background-color: var(--surface-alt);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.table-hover tbody tr:hover {
    background-color: var(--primary-light);
}

.table-striped tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .table-striped tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
}

/* ------------------------------------------------------------
   BADGES
   ------------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background-color: var(--surface-alt);
    color: var(--text-muted);
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-text);
}

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

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

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

/* ------------------------------------------------------------
   TABS
   ------------------------------------------------------------ */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-base);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab:hover {
    color: var(--text);
    background-color: var(--surface);
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
}

.tab.active {
    color: var(--primary-text);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab i,
.tab svg {
    width: 16px;
    height: 16px;
}

/* Pills */
.pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.pill {
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background-color: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
}

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

.pill.active {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ------------------------------------------------------------
   MODALS & PANELS
   ------------------------------------------------------------ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    animation: fadeInScale 0.2s ease;
}

.modal-lg .modal-content,
.modal-content.modal-lg {
    max-width: 900px;
}

.modal-xl .modal-content,
.modal-content.modal-xl {
    max-width: 95vw;
}

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

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--surface);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background-color: var(--danger-light);
    color: var(--danger-text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Modal form elements — design system styling */
.modal .form-group label,
.modal form label {
    display: block; font-size: 0.82rem; font-weight: 500;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.3px; margin-bottom: 6px;
}
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="date"],
.modal input[type="email"],
.modal input[type="tel"],
.modal select,
.modal textarea {
    width: 100%; padding: 10px 14px; font-size: 0.85rem;
    font-family: inherit; background-color: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    box-sizing: border-box;
}
.modal input[type="text"]:focus,
.modal input[type="number"]:focus,
.modal input[type="date"]:focus,
.modal input[type="email"]:focus,
.modal input[type="tel"]:focus,
.modal select:focus,
.modal textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); outline: none;
}
.modal select {
    appearance: none; -webkit-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'%3E%3Cpath fill='%238E9BAA' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
    padding-right: 36px;
}
.modal textarea { resize: vertical; min-height: 60px; }
.modal .form-group { margin-bottom: 16px; }
.modal .form-group small {
    display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px;
}

/* Side panel */
.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    width: 550px;
    background-color: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    transform: translateX(0);
}

.side-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.side-panel-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.side-panel-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 600px) {
    .side-panel {
        width: 100%;
    }
}

/* ------------------------------------------------------------
   TOAST
   ------------------------------------------------------------ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    min-width: 280px;
    max-width: 420px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--text-muted);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .toast {
        bottom: 72px;
        right: 12px;
        left: 12px;
        min-width: 0;
    }
}

/* ------------------------------------------------------------
   EMPTY STATE
   ------------------------------------------------------------ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 12px;
}

.empty-state-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.empty-state-text {
    font-size: 0.82rem;
}

/* ------------------------------------------------------------
   SKELETON LOADING
   ------------------------------------------------------------ */
@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.skeleton {
    background-color: var(--surface-alt);
    border-radius: var(--radius-sm);
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-card {
    height: 100px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.skeleton-row > * {
    flex: 1;
    height: 16px;
}

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

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
}

.anim-fade-in {
    animation: fadeIn 0.2s ease;
}

.anim-slide-right {
    animation: slideInRight 0.25s ease;
}

.anim-slide-left {
    animation: slideInLeft 0.25s ease;
}

.anim-shake {
    animation: shake 0.3s ease;
}

/* ------------------------------------------------------------
   FOCUS VISIBLE
   ------------------------------------------------------------ */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ------------------------------------------------------------
   SCROLLBAR
   ------------------------------------------------------------ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* ------------------------------------------------------------
   PRINT
   ------------------------------------------------------------ */
@page {
    margin: 1.5cm;
}

/* ------------------------------------------------------------
   ANIMATIONS
   ------------------------------------------------------------ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.3s ease forwards; }

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .sidebar,
    .bottom-nav,
    .top-header,
    .toast,
    .modal,
    .btn,
    [data-no-print] {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .table {
        font-size: 9pt;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }
}
