/* ============================================================
   GLOBAL DESIGN SYSTEM
   Brand: --primary-orange: #f57814 | --primary-yellow: #f8a101 | --primary-cyan: #27b5c9
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ──────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES
────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --primary-orange: #f57814;
    --primary-yellow: #f8a101;
    --primary-cyan: #27b5c9;

    /* Derived / Shades */
    --orange-light: #fde8d4;
    --orange-dark: #c45c08;
    --yellow-light: #fef3cc;
    --yellow-dark: #c47d00;
    --cyan-light: #d0f0f5;
    --cyan-dark: #1a8a9d;

    /* Neutrals */
    --neutral-50: #fafafa;
    --neutral-100: #f4f4f5;
    --neutral-200: #e4e4e7;
    --neutral-300: #d1d1d6;
    --neutral-400: #a1a1aa;
    --neutral-500: #71717a;
    --neutral-600: #52525b;
    --neutral-700: #3f3f46;
    --neutral-800: #27272a;
    --neutral-900: #18181b;

    /* Semantic Colors */
    --success: #16a34a;
    --success-light: #dcfce7;
    --success-dark: #14532d;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --warning-dark: #92400e;
    --error: #dc2626;
    --error-light: #fee2e2;
    --error-dark: #7f1d1d;
    --info: var(--primary-cyan);
    --info-light: var(--cyan-light);
    --info-dark: var(--cyan-dark);

    /* Surface / Background */
    --bg-base: #f7f8fa;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(24, 24, 27, 0.55);

    /* Text */
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --text-inverse: #ffffff;
    --text-brand: var(--primary-orange);

    /* Border */
    --border-subtle: #e4e4e7;
    --border-default: #d1d1d6;
    --border-strong: #a1a1aa;
    --border-brand: var(--primary-orange);

    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.25rem;
    /* 20px */
    --text-2xl: 1.5rem;
    /* 24px */
    --text-3xl: 1.875rem;
    /* 30px */
    --text-4xl: 2.25rem;
    /* 36px */

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

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

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-brand: 0 4px 14px rgba(245, 120, 20, 0.25);
    --shadow-cyan: 0 4px 14px rgba(39, 181, 201, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Z-index */
    --z-below: -1;
    --z-base: 0;
    --z-raised: 10;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* ──────────────────────────────────────────
   2. RESET & BASE
────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    background-color: var(--bg-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
video {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input,
textarea,
select {
    font-family: inherit;
}

ul,
ol {
    list-style: none;
}

/* ──────────────────────────────────────────
   3. TYPOGRAPHY
────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

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 {
    color: var(--text-secondary);
    line-height: 1.7;
}

.text-brand {
    color: var(--primary-orange);
}

.text-cyan {
    color: var(--primary-cyan);
}

.text-yellow {
    color: var(--primary-yellow);
}

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

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.font-display {
    font-family: var(--font-display);
}

/* ──────────────────────────────────────────
   4. BUTTONS
────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    transition: all var(--transition-base);
    white-space: nowrap;
    user-select: none;
    outline: none;
}

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

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary */
.btn-primary {
    background: var(--primary-orange);
    color: #fff;
    border-color: var(--primary-orange);
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    background: var(--orange-dark);
    border-color: var(--orange-dark);
    box-shadow: 0 6px 18px rgba(245, 120, 20, 0.35);
    transform: translateY(-1px);
}

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

/* Secondary */
.btn-secondary {
    background: transparent;
    color: var(--primary-orange);
    border-color: var(--primary-orange);
}

.btn-secondary:hover {
    background: var(--orange-light);
}

/* Cyan */
.btn-cyan {
    background: var(--primary-cyan);
    color: #fff;
    border-color: var(--primary-cyan);
    box-shadow: var(--shadow-cyan);
}

.btn-cyan:hover {
    background: var(--cyan-dark);
    border-color: var(--cyan-dark);
    transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

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

/* Danger */
.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}

.btn-danger:hover {
    background: var(--error-dark);
    border-color: var(--error-dark);
    transform: translateY(-1px);
}

/* Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    padding: var(--space-3);
    aspect-ratio: 1;
}

/* ──────────────────────────────────────────
   5. FORMS
────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.form-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.form-label .required {
    color: var(--error);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

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

.form-control:hover {
    border-color: var(--border-strong);
}

.form-control:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(245, 120, 20, 0.12);
}

textarea.form-control {
    height: auto;
    padding: var(--space-3) var(--space-4);
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-8);
    cursor: pointer;
}

/* Input with icon */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .form-control {
    padding-left: 2.75rem;
}

.input-wrapper .input-icon {
    position: absolute;
    left: var(--space-3);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

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

.input-wrapper .input-icon-right {
    position: absolute;
    right: var(--space-3);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.input-wrapper .input-icon-right:hover {
    color: var(--text-primary);
}

/* States */
.form-control.is-error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-control.is-success {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--error);
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-orange);
    cursor: pointer;
}

.form-check label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

/* Toggle / Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--neutral-300);
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
    cursor: pointer;
}

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

.toggle input:checked+.toggle-slider {
    background: var(--primary-orange);
}

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

/* Form row (inline) */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

/* Fieldset */
.fieldset {
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.fieldset legend {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--primary-orange);
    padding: 0 var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ──────────────────────────────────────────
   6. TABLES
────────────────────────────────────────── */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    background: var(--bg-surface);
}

.table thead {
    background: var(--neutral-50);
    border-bottom: 2px solid var(--border-subtle);
}

.table thead th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
}

.table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.table thead th.sortable:hover {
    color: var(--primary-orange);
}

.table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

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

.table tbody tr:hover {
    background: var(--neutral-50);
}

.table tbody td {
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

/* Table striped */
.table-striped tbody tr:nth-child(even) {
    background: var(--neutral-50);
}

/* Table action cell */
.table .td-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ──────────────────────────────────────────
   7. BADGES / CHIPS
────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-orange {
    background: var(--orange-light);
    color: var(--orange-dark);
}

.badge-yellow {
    background: var(--yellow-light);
    color: var(--yellow-dark);
}

.badge-cyan {
    background: var(--cyan-light);
    color: var(--cyan-dark);
}

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

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

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

.badge-neutral {
    background: var(--neutral-100);
    color: var(--neutral-600);
}

/* ──────────────────────────────────────────
   8. ALERTS / NOTIFICATIONS
────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border-left: 4px solid transparent;
    font-size: var(--text-sm);
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-body {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    margin-bottom: 2px;
}

.alert-message {
    color: inherit;
    opacity: 0.85;
    line-height: 1.5;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    padding: 2px;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

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

.alert-success {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success-dark);
}

.alert-error {
    background: var(--error-light);
    border-color: var(--error);
    color: var(--error-dark);
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning-dark);
}

.alert-info {
    background: var(--cyan-light);
    border-color: var(--primary-cyan);
    color: var(--cyan-dark);
}

.alert-brand {
    background: var(--orange-light);
    border-color: var(--primary-orange);
    color: var(--orange-dark);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: var(--z-toast);
    max-width: 360px;
    width: 100%;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--primary-orange);
    font-size: var(--text-sm);
    animation: slideInRight 0.3s ease forwards;
}

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

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

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

.toast.toast-info {
    border-left-color: var(--primary-cyan);
}

@keyframes slideInRight {
    from {
        transform: translateX(110%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ──────────────────────────────────────────
   9. MODALS / POPUPS
────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.22s ease;
    position: relative;
}

.modal-sm {
    max-width: 380px;
}

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

.modal-xl {
    max-width: 960px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6) var(--space-6) 0;
    gap: var(--space-4);
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--neutral-100);
    border: none;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

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

.modal-footer {
    padding: var(--space-4) var(--space-6) var(--space-6);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

/* Accent bar at top */
.modal::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-orange), var(--primary-yellow), var(--primary-cyan));
}

/* ──────────────────────────────────────────
   10. CARD
────────────────────────────────────────── */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.card-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

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

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    background: var(--neutral-50);
}

/* Stat card */
.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: var(--space-2);
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card .stat-change {
    font-size: var(--text-xs);
    margin-top: var(--space-2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up {
    color: var(--success);
}

.stat-change.down {
    color: var(--error);
}

/* ──────────────────────────────────────────
   11. DASHBOARD LAYOUT
────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--neutral-900);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: var(--z-sticky);
}

.sidebar-brand {
    padding: var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-brand .logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-yellow));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--text-lg);
    color: white;
}

.sidebar-brand .brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-lg);
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--neutral-600);
    padding: var(--space-4) var(--space-3) var(--space-2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--neutral-400);
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(245, 120, 20, 0.15);
    color: var(--primary-orange);
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--primary-orange);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--radius-full);
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top bar */
.topbar {
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    gap: var(--space-4);
    position: sticky;
    top: 0;
    z-index: var(--z-raised);
    box-shadow: var(--shadow-xs);
}

.topbar-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-spacer {
    flex: 1;
}

/* Page */
.page {
    padding: var(--space-8) var(--space-8);
    flex: 1;
}

.page-header {
    margin-bottom: var(--space-8);
}

.page-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

/* ──────────────────────────────────────────
   12. LOGIN PAGE
────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
}

.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: var(--bg-surface);
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.login-visual {
    flex: 1;
    background: var(--neutral-900);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ──────────────────────────────────────────
   13. DIVIDER
────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: var(--space-5) 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ──────────────────────────────────────────
   14. UTILITIES
────────────────────────────────────────── */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.w-full {
    width: 100%;
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rounded-full {
    border-radius: var(--radius-full);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-cyan {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Avatar */
.avatar {
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--orange-light);
    color: var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-display);
    flex-shrink: 0;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: var(--text-xs);
}

.avatar-md {
    width: 36px;
    height: 36px;
    font-size: var(--text-sm);
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: var(--text-lg);
}

/* ──────────────────────────────────────────
   15. ANIMATIONS
────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(16px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slideUp {
    animation: slideUp 0.35s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-spin {
    animation: spin 0.7s linear infinite;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(245, 120, 20, 0.2);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ──────────────────────────────────────────
   16. RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .page {
        padding: var(--space-6);
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: static;
    }

    .login-visual {
        display: none;
    }

    .page {
        padding: var(--space-4);
    }

    .table-container {
        font-size: var(--text-xs);
    }

    .modal {
        border-radius: var(--radius-xl);
    }

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

    .toast-container {
        right: var(--space-3);
        left: var(--space-3);
        top: var(--space-3);
    }

    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }
}