/* ═══════════════════════════════════════════════════════════════
   VIP WOWSTORE — Design System v3.0
   Modern, clean, consistent. PHP 8.2+ / AJAX-first
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    /* Brand */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #a5b4fc;
    --primary-bg: #eef2ff;

    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-hover: var(--gray-50);
    --sidebar-active: var(--primary-bg);
    --sidebar-text: var(--gray-500);
    --sidebar-text-active: var(--primary);
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;

    /* States */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Text */
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* 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;

    /* Borders & Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --border-color: #e2e8f0;

    /* 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: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

    /* Transitions */
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index */
    --z-sidebar: 40;
    --z-header: 30;
    --z-overlay: 50;
    --z-modal: 60;
    --z-toast: 70;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::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: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

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

/* ── Typography ────────────────────────────────────────────── */
h1 { font-size: 1.875rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Layout: Sidebar + Content ─────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow), transform var(--transition-slow);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand-text span {
    display: block;
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-200) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }

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

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-text);
    padding: 0 var(--space-3);
    margin-bottom: var(--space-2);
    white-space: nowrap;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4) var(--space-3);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    transition: background var(--transition);
}

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

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

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

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    background: transparent;
    border: none;
    transition: all var(--transition);
    flex-shrink: 0;
    text-decoration: none;
}

.sidebar-logout:hover {
    background: rgba(239,68,68,0.1);
    color: var(--error);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

.content-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-5) var(--space-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}

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

.content-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
}

.content-header p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--gray-50);
    color: var(--text);
}

.content-body {
    padding: var(--space-8);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

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

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-5);
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

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

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

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

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: var(--space-2);
}

.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--error); }
.stat-card-trend.neutral { color: var(--text-muted); }

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

.stat-card-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-card-icon.success { background: var(--success-bg); color: var(--success); }
.stat-card-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-card-icon.error { background: var(--error-bg); color: var(--error); }
.stat-card-icon.info { background: var(--info-bg); color: var(--info); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

.btn:disabled, .btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

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

.btn-secondary {
    background: #fff;
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.btn-secondary:hover { background: var(--gray-50); color: var(--text); border-color: var(--gray-300); }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }

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

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--text); }

.btn-sm {
    padding: 4px var(--space-3);
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius);
}

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

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-2);
}

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

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

.form-input.error { border-color: var(--error); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }

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

.form-select {
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
}

.input-group {
    display: flex;
    gap: var(--space-2);
}

.input-group .form-input { flex: 1; }

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

.toggle input { display: none; }

.toggle-track {
    width: 44px;
    height: 24px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition);
    flex-shrink: 0;
}

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

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: var(--shadow-xs);
}

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

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

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

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

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

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: #065f46; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-error { background: var(--error-bg); color: #991b1b; }
.badge-info { background: var(--info-bg); color: #1e40af; }
.badge-neutral { background: var(--gray-100); color: var(--gray-600); }

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

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid;
}

.alert i { margin-top: 2px; flex-shrink: 0; }

.alert-success { background: var(--success-bg); color: #065f46; border-color: var(--success-border); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: var(--warning-border); }
.alert-error { background: var(--error-bg); color: #991b1b; border-color: var(--error-border); }
.alert-info { background: var(--info-bg); color: #1e40af; border-color: var(--info-border); }

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

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-5);
    background: var(--gray-100);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-2);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
    max-width: 360px;
    margin: 0 auto;
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: fadeIn 200ms ease;
}

.modal {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    animation: scaleIn 200ms cubic-bezier(0.4, 0, 0.2, 1);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.modal-header {
    padding: var(--space-6);
    text-align: center;
}

.modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-4);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

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

.modal-header h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-2);
}

.modal-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.modal-footer {
    padding: 0 var(--space-6) var(--space-6);
    display: flex;
    gap: var(--space-3);
}

.modal-footer .btn { flex: 1; }

/* ── Toast Container ───────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: slideInRight 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-content {
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

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

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

.toast-body { flex: 1; padding-top: 4px; }

.toast-body p {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 0;
    cursor: pointer;
    transition: color var(--transition);
    flex-shrink: 0;
    line-height: 1;
}

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

.toast-progress {
    height: 2px;
    background: var(--primary);
    animation: progress linear forwards;
    transform-origin: left;
}

.toast-success .toast-progress { background: var(--success); }
.toast-error .toast-progress { background: var(--error); }
.toast-warning .toast-progress { background: var(--warning); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-3);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.pagination-btn:hover { background: var(--gray-50); color: var(--text); border-color: var(--gray-300); }
.pagination-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-6);
}

.tab {
    padding: var(--space-3) var(--space-5);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

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

/* ── 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; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.flex-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }

.m-0 { margin: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.text-center { text-align: center; }
.text-right { text-align: right; }

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

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

.border { border: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }

.bg-white { background: #fff; }
.bg-gray-50 { background: var(--gray-50); }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

.relative { position: relative; }

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8125rem;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text);
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes scaleOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.95); opacity: 0; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes progress { from { width: 100%; } to { width: 0%; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.animate-fadeIn { animation: fadeIn 300ms ease; }
.animate-slideUp { animation: slideUp 300ms ease; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: flex;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: calc(var(--z-sidebar) - 1);
    }
    .sidebar-overlay.active {
        display: block;
    }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .content-body { padding: var(--space-5); }
    .content-header { padding: var(--space-4) var(--space-5); }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .content-body { padding: var(--space-4); }
    .content-header { padding: var(--space-3) var(--space-4); }
    .card-body { padding: var(--space-4); }
    .card-header { padding: var(--space-4); }
    .table { font-size: 0.8125rem; }
    .table th, .table td { padding: var(--space-2) var(--space-3); }
    .btn { padding: var(--space-2) var(--space-3); font-size: 0.8125rem; }
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
    .sidebar, .content-header, .sidebar-toggle, #toast-container { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-body { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
