/* ══════════════════════════════════════════════════════════
   ArchieTech Nexus — Design System v5.0
   Premium SaaS Dashboard Theme
   ══════════════════════════════════════════════════════════ */

/* ── Google Fonts ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg-primary: #09090b;
    --bg-secondary: #0c0c0f;
    --bg-sidebar: #0e0e12;
    --bg-card: rgba(17, 17, 21, 0.85);
    --bg-card-solid: #111115;
    --bg-header: rgba(12, 12, 15, 0.85);
    --bg-elevated: #16161a;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-active: rgba(255, 255, 255, 0.06);
    --bg-input: #111115;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    /* Brand */
    --brand-primary: #25D366;
    --brand-primary-hover: #1fba58;
    --brand-primary-muted: rgba(37, 211, 102, 0.12);
    --brand-primary-glow: rgba(37, 211, 102, 0.25);
    --brand-secondary: #7c5cfc;
    --brand-secondary-hover: #6a4ae8;
    --brand-secondary-muted: rgba(124, 92, 252, 0.12);
    --brand-gradient: linear-gradient(135deg, #25D366, #1fba58);
    --brand-gradient-alt: linear-gradient(135deg, #7c5cfc, #25D366);

    /* Text */
    --text-primary: #f0f0f3;
    --text-secondary: #a0a0ab;
    --text-muted: #5c5c6b;
    --text-disabled: #3a3a45;
    --text-inverse: #09090b;
    --text-link: #7c5cfc;
    --text-brand: #25D366;

    /* Borders */
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-focus: #7c5cfc;
    --border-brand: rgba(37, 211, 102, 0.3);

    /* Status */
    --success: #22c55e;
    --success-muted: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-muted: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-muted: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-muted: rgba(59, 130, 246, 0.12);

    /* Gradients for stat cards */
    --grad-green: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    --grad-blue: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    --grad-purple: linear-gradient(135deg, rgba(124, 92, 252, 0.15), rgba(124, 92, 252, 0.05));
    --grad-amber: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    --grad-rose: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(244, 63, 94, 0.05));

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow-brand: 0 0 20px rgba(37, 211, 102, 0.2);
    --shadow-glow-purple: 0 0 20px rgba(124, 92, 252, 0.2);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 68px;
    --header-height: 56px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-normal: 250ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);

    /* Z-index scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 500;
    --z-modal: 600;
    --z-toast: 700;
    --z-sidebar: 800;
    --z-header: 900;
    --z-max: 9999;
}

:root[data-theme="light-disabled"] {
    /* Backgrounds */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-solid: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.9);
    --bg-elevated: #eef2f7;
    --bg-hover: rgba(2, 6, 23, 0.05);
    --bg-active: rgba(2, 6, 23, 0.08);
    --bg-input: #ffffff;
    --bg-overlay: rgba(15, 23, 42, 0.35);

    /* Brand */
    --brand-primary-muted: rgba(37, 211, 102, 0.14);
    --brand-secondary-muted: rgba(124, 92, 252, 0.12);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-disabled: #94a3b8;
    --text-inverse: #ffffff;
    --text-link: #6d4dff;

    /* Borders */
    --border-primary: rgba(15, 23, 42, 0.12);
    --border-secondary: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.2);
    --border-brand: rgba(37, 211, 102, 0.35);

    /* Gradients for stat cards */
    --grad-green: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.04));
    --grad-blue: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.04));
    --grad-purple: linear-gradient(135deg, rgba(124, 92, 252, 0.12), rgba(124, 92, 252, 0.04));
    --grad-amber: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
    --grad-rose: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(244, 63, 94, 0.04));

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 35px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 28px 50px rgba(15, 23, 42, 0.16);
    --shadow-glow-brand: 0 0 18px rgba(37, 211, 102, 0.24);
    --shadow-glow-purple: 0 0 18px rgba(124, 92, 252, 0.2);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    font-size: 0.875rem;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text-link); }

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

/* ── Typography ──────────────────────────────────────────── */
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; font-weight: 800; letter-spacing: -0.025em; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.text-xl  { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; }
.text-lg  { font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
.text-base { font-size: 0.875rem; line-height: 1.5rem; }
.text-sm  { font-size: 0.8125rem; line-height: 1.25rem; }
.text-xs  { font-size: 0.75rem; line-height: 1rem; }
.text-xxs { font-size: 0.6875rem; line-height: 0.875rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--text-brand); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--border-focus);
}

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

.btn-primary {
    background: var(--brand-gradient);
    color: var(--text-inverse);
    border-color: transparent;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-brand);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--brand-secondary);
    color: #fff;
}
.btn-secondary:hover {
    background: var(--brand-secondary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-purple);
}

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

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-sm { padding: 6px 12px; font-size: 0.75rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 0.9375rem; border-radius: var(--radius-lg); }
.btn-icon {
    width: 36px; height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon-sm { width: 30px; height: 30px; font-size: 0.8125rem; }

/* ── Inputs ──────────────────────────────────────────────── */
.input, .textarea, .select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

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

.input:focus, .textarea:focus, .select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.input-sm { padding: 7px 10px; font-size: 0.8125rem; }
.input-lg { padding: 12px 16px; font-size: 1rem; }

.textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235c5c6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i { color: var(--brand-primary); font-size: 0.95rem; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 22px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
}

.stat-card.accent-green::before { background: var(--brand-gradient); }
.stat-card.accent-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.accent-purple::before { background: linear-gradient(90deg, #7c5cfc, #a78bfa); }
.stat-card.accent-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.accent-rose::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 14px;
}

.accent-green .stat-icon { background: var(--success-muted); color: var(--success); }
.accent-blue .stat-icon { background: var(--info-muted); color: var(--info); }
.accent-purple .stat-icon { background: var(--brand-secondary-muted); color: var(--brand-secondary); }
.accent-amber .stat-icon { background: var(--warning-muted); color: var(--warning); }
.accent-rose .stat-icon { background: var(--danger-muted); color: var(--danger); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

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

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.stat-trend.up { background: var(--success-muted); color: var(--success); }
.stat-trend.down { background: var(--danger-muted); color: var(--danger); }

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

.badge-success { background: var(--success-muted); color: var(--success); }
.badge-warning { background: var(--warning-muted); color: var(--warning); }
.badge-danger { background: var(--danger-muted); color: var(--danger); }
.badge-info { background: var(--info-muted); color: var(--info); }
.badge-brand { background: var(--brand-primary-muted); color: var(--brand-primary); }
.badge-purple { background: var(--brand-secondary-muted); color: var(--brand-secondary); }
.badge-neutral { background: var(--bg-hover); color: var(--text-secondary); }

.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.badge-dot.success { background: var(--success); box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.badge-dot.danger { background: var(--danger); }
.badge-dot.warning { background: var(--warning); }
.badge-dot.info { background: var(--info); }

/* Count badges (sidebar, nav) */
.count-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #3a3a45;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all var(--transition-fast);
}
.toggle input:checked + .toggle-slider { background: var(--brand-primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle input:focus-visible + .toggle-slider { box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2); }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-primary); }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-primary);
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-secondary);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }

/* ── Modals ──────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(6px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn var(--transition-fast) forwards;
}

.modal {
    width: min(540px, 100%);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-normal) forwards;
}

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

.modal-title { font-size: 1.1rem; font-weight: 700; }

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-primary);
}

/* ── Toast / Notifications ───────────────────────────────── */
#toast-container {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: 16px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 380px;
}

.toast {
    pointer-events: auto;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight var(--transition-normal) forwards;
}

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

.toast-out { animation: slideOutRight var(--transition-fast) forwards; }

/* ── Skeleton Loaders ────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-elevated) 25%,
        rgba(255,255,255,0.06) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.empty-state-text { color: var(--text-muted); max-width: 360px; font-size: 0.875rem; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Utility ─────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; min-width: 0; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }

.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); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

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

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }

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

.hidden { display: none !important; }
.opacity-50 { opacity: 0.5; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.text-center { text-align: center; }
.text-right { text-align: right; }

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

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

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

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

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

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

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

.animate-fade-in { animation: fadeIn var(--transition-normal) forwards; }
.animate-slide-up { animation: slideUp var(--transition-normal) forwards; }
.animate-pulse { animation: pulseGlow 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

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

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    padding: 4px;
    display: none;
    animation: slideUp var(--transition-fast) forwards;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.dropdown-item i { width: 16px; text-align: center; font-size: 0.875rem; }

.dropdown-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 4px 0;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 18px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

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

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

/* ── Search Bar ──────────────────────────────────────────── */
.search-bar {
    position: relative;
    width: 100%;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 9px 12px 9px 36px;
    color: var(--text-primary);
    font-size: 0.8125rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.search-bar .shortcut-hint {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    font-size: 0.625rem;
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .grid-auto { grid-template-columns: 1fr; }
    .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
    .card { padding: 16px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 1.5rem; }
}
