/**
 * Contact Central V2 - Design System 2026
 * Version: 1.1.0
 *
 * Design Specification: docs/design/DESIGN-001-Redesign.md
 *
 * 2026 Design Trends Applied:
 * - Softer Dark Mode: Mid-tone backgrounds (#0f172a, #1e293b) instead of pure black
 * - Typography-First: Variable fonts, clear hierarchy, reduced icon dependency
 * - Bento Grid: Modular, asymmetric layouts
 * - Purposeful Micro-interactions: Motion as guidance, not decoration
 * - Accessibility-First: WCAG AA compliant, motion controls, cognitive support
 * - Labels-Left Forms: Form labels positioned left of inputs (stacked on mobile)
 *
 * Note: Liquid Glass effects available but NOT used on sidebar (too grey).
 * Sidebar uses solid dark background with subtle purple gradient overlay.
 */

/* ===========================================
   CSS CUSTOM PROPERTIES
   =========================================== */

:root {
    /* --- Color Palette --- */

    /* Primary - Deep violet with luminous quality */
    --ds-primary-50: #f3f1ff;
    --ds-primary-100: #e9e5ff;
    --ds-primary-200: #d5ceff;
    --ds-primary-300: #b8a8ff;
    --ds-primary-400: #9678ff;
    --ds-primary-500: #7c4dff;
    --ds-primary-600: #6d28d9;
    --ds-primary-700: #5b21b6;
    --ds-primary-800: #4c1d95;
    --ds-primary-900: #3b1578;

    /* Secondary - Warm coral/terracotta */
    --ds-secondary-50: #fff5f3;
    --ds-secondary-100: #ffe8e3;
    --ds-secondary-200: #ffd5cc;
    --ds-secondary-300: #ffb4a3;
    --ds-secondary-400: #ff8a70;
    --ds-secondary-500: #f97066;
    --ds-secondary-600: #e14d42;
    --ds-secondary-700: #c03a30;
    --ds-secondary-800: #9d322a;
    --ds-secondary-900: #822e28;

    /* Accent - Luminous teal */
    --ds-accent-50: #edfffe;
    --ds-accent-100: #c2fffc;
    --ds-accent-200: #85fff8;
    --ds-accent-300: #40fff3;
    --ds-accent-400: #0df5e7;
    --ds-accent-500: #00d9cb;
    --ds-accent-600: #00b0a7;
    --ds-accent-700: #008c86;
    --ds-accent-800: #006f6b;
    --ds-accent-900: #005b58;

    /* Semantic Colors */
    --ds-success: #10b981;
    --ds-success-light: #d1fae5;
    --ds-success-dark: #059669;

    --ds-warning: #f59e0b;
    --ds-warning-light: #fef3c7;
    --ds-warning-dark: #d97706;

    --ds-error: #ef4444;
    --ds-error-light: #fee2e2;
    --ds-error-dark: #dc2626;

    --ds-info: #3b82f6;
    --ds-info-light: #dbeafe;
    --ds-info-dark: #2563eb;

    /* Neutrals - Softer dark mode palette */
    --ds-neutral-0: #ffffff;
    --ds-neutral-50: #f8fafc;
    --ds-neutral-100: #f1f5f9;
    --ds-neutral-200: #e2e8f0;
    --ds-neutral-300: #cbd5e1;
    --ds-neutral-400: #94a3b8;
    --ds-neutral-500: #64748b;
    --ds-neutral-600: #475569;
    --ds-neutral-700: #334155;
    --ds-neutral-800: #1e293b;
    --ds-neutral-900: #0f172a;

    /* Dark Mode Surfaces (Softer, not pure black) */
    --ds-dark-bg: #0f172a;
    --ds-dark-surface: #1e293b;
    --ds-dark-elevated: #334155;
    --ds-dark-border: rgba(148, 163, 184, 0.2);

    /* --- Typography --- */

    /* Font Families */
    --ds-font-sans: 'Inter Variable', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ds-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --ds-font-display: 'Plus Jakarta Sans', var(--ds-font-sans);

    /* Font Sizes - Fluid scale */
    --ds-text-xs: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);
    --ds-text-sm: clamp(0.8125rem, 0.775rem + 0.15vw, 0.875rem);
    --ds-text-base: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
    --ds-text-lg: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
    --ds-text-xl: clamp(1.1875rem, 1.1rem + 0.35vw, 1.25rem);
    --ds-text-2xl: clamp(1.375rem, 1.25rem + 0.5vw, 1.5rem);
    --ds-text-3xl: clamp(1.625rem, 1.4rem + 0.9vw, 1.875rem);
    --ds-text-4xl: clamp(2rem, 1.7rem + 1.2vw, 2.25rem);
    --ds-text-5xl: clamp(2.5rem, 2rem + 2vw, 3rem);

    /* Line Heights */
    --ds-leading-none: 1;
    --ds-leading-tight: 1.25;
    --ds-leading-snug: 1.375;
    --ds-leading-normal: 1.5;
    --ds-leading-relaxed: 1.625;
    --ds-leading-loose: 2;

    /* Font Weights */
    --ds-font-light: 300;
    --ds-font-normal: 400;
    --ds-font-medium: 500;
    --ds-font-semibold: 600;
    --ds-font-bold: 700;

    /* Letter Spacing */
    --ds-tracking-tighter: -0.05em;
    --ds-tracking-tight: -0.025em;
    --ds-tracking-normal: 0;
    --ds-tracking-wide: 0.025em;
    --ds-tracking-wider: 0.05em;
    --ds-tracking-widest: 0.1em;

    /* --- Spacing Scale --- */
    --ds-space-0: 0;
    --ds-space-px: 1px;
    --ds-space-0-5: 0.125rem;
    --ds-space-1: 0.25rem;
    --ds-space-1-5: 0.375rem;
    --ds-space-2: 0.5rem;
    --ds-space-2-5: 0.625rem;
    --ds-space-3: 0.75rem;
    --ds-space-3-5: 0.875rem;
    --ds-space-4: 1rem;
    --ds-space-5: 1.25rem;
    --ds-space-6: 1.5rem;
    --ds-space-7: 1.75rem;
    --ds-space-8: 2rem;
    --ds-space-9: 2.25rem;
    --ds-space-10: 2.5rem;
    --ds-space-12: 3rem;
    --ds-space-14: 3.5rem;
    --ds-space-16: 4rem;
    --ds-space-20: 5rem;
    --ds-space-24: 6rem;
    --ds-space-32: 8rem;

    /* --- Border Radius --- */
    --ds-radius-none: 0;
    --ds-radius-sm: 0.25rem;
    --ds-radius-md: 0.5rem;
    --ds-radius-lg: 0.75rem;
    --ds-radius-xl: 1rem;
    --ds-radius-2xl: 1.5rem;
    --ds-radius-3xl: 2rem;
    --ds-radius-full: 9999px;

    /* --- Shadows --- */
    --ds-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --ds-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --ds-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --ds-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --ds-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --ds-shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

    /* Glow shadows for Liquid Glass */
    --ds-glow-primary: 0 0 20px rgba(109, 40, 217, 0.3);
    --ds-glow-accent: 0 0 20px rgba(0, 217, 203, 0.3);
    --ds-glow-soft: 0 8px 32px rgba(0, 0, 0, 0.12);

    /* --- Transitions --- */
    --ds-duration-instant: 50ms;
    --ds-duration-fast: 100ms;
    --ds-duration-normal: 200ms;
    --ds-duration-slow: 300ms;
    --ds-duration-slower: 500ms;

    --ds-ease-default: cubic-bezier(0.4, 0, 0.2, 1);
    --ds-ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ds-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ds-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ds-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ds-ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* --- Z-Index Scale --- */
    --ds-z-dropdown: 1000;
    --ds-z-sticky: 1020;
    --ds-z-fixed: 1030;
    --ds-z-modal-backdrop: 1040;
    --ds-z-modal: 1050;
    --ds-z-popover: 1060;
    --ds-z-tooltip: 1070;
    --ds-z-toast: 1080;

    /* --- Breakpoints (for reference in JS) --- */
    --ds-bp-sm: 640px;
    --ds-bp-md: 768px;
    --ds-bp-lg: 1024px;
    --ds-bp-xl: 1280px;
    --ds-bp-2xl: 1536px;

    /* --- Liquid Glass --- */
    --ds-glass-bg: rgba(255, 255, 255, 0.7);
    --ds-glass-bg-dark: rgba(30, 41, 59, 0.8);
    --ds-glass-border: rgba(255, 255, 255, 0.3);
    --ds-glass-border-dark: rgba(148, 163, 184, 0.2);
    --ds-glass-blur: 16px;
    --ds-glass-blur-heavy: 24px;

    /* --- Layout --- */
    --ds-sidebar-width: 280px;
    --ds-sidebar-collapsed: 72px;
    --ds-header-height: 64px;
    --ds-content-max-width: 1400px;
}

/* ===========================================
   LIQUID GLASS EFFECTS
   =========================================== */

.glass {
    background: var(--ds-glass-bg);
    backdrop-filter: blur(var(--ds-glass-blur));
    -webkit-backdrop-filter: blur(var(--ds-glass-blur));
    border: 1px solid var(--ds-glass-border);
}

.glass-dark {
    background: var(--ds-glass-bg-dark);
    backdrop-filter: blur(var(--ds-glass-blur));
    -webkit-backdrop-filter: blur(var(--ds-glass-blur));
    border: 1px solid var(--ds-glass-border-dark);
}

.glass-heavy {
    backdrop-filter: blur(var(--ds-glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--ds-glass-blur-heavy));
}

.glass-surface {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(var(--ds-glass-blur));
    -webkit-backdrop-filter: blur(var(--ds-glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(var(--ds-glass-blur));
    -webkit-backdrop-filter: blur(var(--ds-glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--ds-radius-xl);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Dark mode glass */
[data-theme="dark"] .glass,
.dark .glass {
    background: var(--ds-glass-bg-dark);
    border-color: var(--ds-glass-border-dark);
}

/* ===========================================
   TYPOGRAPHY
   =========================================== */

.ds-text-display {
    font-family: var(--ds-font-display);
    font-weight: var(--ds-font-bold);
    line-height: var(--ds-leading-tight);
    letter-spacing: var(--ds-tracking-tight);
}

.ds-text-heading {
    font-family: var(--ds-font-sans);
    font-weight: var(--ds-font-semibold);
    line-height: var(--ds-leading-snug);
    letter-spacing: var(--ds-tracking-tight);
}

.ds-text-body {
    font-family: var(--ds-font-sans);
    font-weight: var(--ds-font-normal);
    line-height: var(--ds-leading-relaxed);
}

.ds-text-label {
    font-family: var(--ds-font-sans);
    font-size: var(--ds-text-sm);
    font-weight: var(--ds-font-medium);
    letter-spacing: var(--ds-tracking-wide);
    text-transform: uppercase;
}

.ds-text-mono {
    font-family: var(--ds-font-mono);
    font-size: 0.9em;
}

/* Type scale */
.ds-h1 { font-size: var(--ds-text-5xl); }
.ds-h2 { font-size: var(--ds-text-4xl); }
.ds-h3 { font-size: var(--ds-text-3xl); }
.ds-h4 { font-size: var(--ds-text-2xl); }
.ds-h5 { font-size: var(--ds-text-xl); }
.ds-h6 { font-size: var(--ds-text-lg); }

/* ===========================================
   BUTTONS
   =========================================== */

.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    padding: var(--ds-space-2-5) var(--ds-space-5);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-text-sm);
    font-weight: var(--ds-font-medium);
    line-height: var(--ds-leading-tight);
    border-radius: var(--ds-radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--ds-duration-normal) var(--ds-ease-default);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.ds-btn:focus-visible {
    outline: 2px solid var(--ds-primary-500);
    outline-offset: 2px;
}

.ds-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary */
.ds-btn-primary {
    background: linear-gradient(135deg, var(--ds-primary-600) 0%, var(--ds-primary-700) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25);
}

.ds-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--ds-primary-500) 0%, var(--ds-primary-600) 100%);
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.35);
    transform: translateY(-1px);
}

.ds-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary */
.ds-btn-secondary {
    background: var(--ds-neutral-100);
    color: var(--ds-neutral-700);
    border: 1px solid var(--ds-neutral-200);
}

.ds-btn-secondary:hover:not(:disabled) {
    background: var(--ds-neutral-200);
    border-color: var(--ds-neutral-300);
}

/* Ghost */
.ds-btn-ghost {
    background: transparent;
    color: var(--ds-neutral-600);
}

.ds-btn-ghost:hover:not(:disabled) {
    background: var(--ds-neutral-100);
    color: var(--ds-neutral-900);
}

/* Glass Button */
.ds-btn-glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ds-btn-glass:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Sizes */
.ds-btn-sm {
    padding: var(--ds-space-1-5) var(--ds-space-3);
    font-size: var(--ds-text-xs);
    border-radius: var(--ds-radius-md);
}

.ds-btn-lg {
    padding: var(--ds-space-3-5) var(--ds-space-7);
    font-size: var(--ds-text-base);
    border-radius: var(--ds-radius-xl);
}

/* Icon Button */
.ds-btn-icon {
    padding: var(--ds-space-2-5);
    aspect-ratio: 1;
}

.ds-btn-icon.ds-btn-sm { padding: var(--ds-space-1-5); }
.ds-btn-icon.ds-btn-lg { padding: var(--ds-space-3-5); }

/* ===========================================
   INPUTS
   =========================================== */

.ds-input {
    width: 100%;
    padding: var(--ds-space-2-5) var(--ds-space-4);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-text-sm);
    line-height: var(--ds-leading-normal);
    color: var(--ds-neutral-900);
    background: var(--ds-neutral-0);
    border: 1px solid var(--ds-neutral-300);
    border-radius: var(--ds-radius-lg);
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
}

.ds-input::placeholder {
    color: var(--ds-neutral-400);
}

.ds-input:hover:not(:disabled) {
    border-color: var(--ds-neutral-400);
}

.ds-input:focus {
    outline: none;
    border-color: var(--ds-primary-500);
    box-shadow: 0 0 0 3px var(--ds-primary-100);
}

.ds-input:disabled {
    background: var(--ds-neutral-100);
    cursor: not-allowed;
}

/* Glass Input */
.ds-input-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Input with icon */
.ds-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.ds-input-icon {
    position: absolute;
    left: var(--ds-space-3);
    color: var(--ds-neutral-400);
    pointer-events: none;
}

.ds-input-group .ds-input {
    padding-left: var(--ds-space-10);
}

/* ===========================================
   CARDS
   =========================================== */

.ds-card {
    background: var(--ds-neutral-0);
    border-radius: var(--ds-radius-xl);
    border: 1px solid var(--ds-neutral-200);
    box-shadow: var(--ds-shadow-sm);
    overflow: hidden;
}

.ds-card-glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(var(--ds-glass-blur));
    -webkit-backdrop-filter: blur(var(--ds-glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--ds-glow-soft);
}

.ds-card-header {
    padding: var(--ds-space-5) var(--ds-space-6);
    border-bottom: 1px solid var(--ds-neutral-100);
}

.ds-card-body {
    padding: var(--ds-space-6);
}

.ds-card-footer {
    padding: var(--ds-space-4) var(--ds-space-6);
    background: var(--ds-neutral-50);
    border-top: 1px solid var(--ds-neutral-100);
}

/* Interactive Card */
.ds-card-interactive {
    cursor: pointer;
    transition: all var(--ds-duration-normal) var(--ds-ease-default);
}

.ds-card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow-lg);
    border-color: var(--ds-neutral-300);
}

/* ===========================================
   BENTO GRID
   =========================================== */

.ds-bento {
    display: grid;
    gap: var(--ds-space-4);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ds-bento-item {
    min-height: 200px;
}

.ds-bento-item-lg {
    grid-column: span 2;
}

.ds-bento-item-tall {
    grid-row: span 2;
}

@media (max-width: 768px) {
    .ds-bento-item-lg,
    .ds-bento-item-tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* ===========================================
   BADGES & TAGS
   =========================================== */

.ds-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--ds-space-1);
    padding: var(--ds-space-1) var(--ds-space-2-5);
    font-size: var(--ds-text-xs);
    font-weight: var(--ds-font-medium);
    line-height: var(--ds-leading-none);
    border-radius: var(--ds-radius-full);
    white-space: nowrap;
}

.ds-badge-primary {
    background: var(--ds-primary-100);
    color: var(--ds-primary-700);
}

.ds-badge-success {
    background: var(--ds-success-light);
    color: var(--ds-success-dark);
}

.ds-badge-warning {
    background: var(--ds-warning-light);
    color: var(--ds-warning-dark);
}

.ds-badge-error {
    background: var(--ds-error-light);
    color: var(--ds-error-dark);
}

.ds-badge-neutral {
    background: var(--ds-neutral-100);
    color: var(--ds-neutral-600);
}

/* Pill badge with dot */
.ds-badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ===========================================
   AVATARS
   =========================================== */

.ds-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ds-radius-full);
    font-weight: var(--ds-font-semibold);
    color: white;
    background: linear-gradient(135deg, var(--ds-primary-500) 0%, var(--ds-primary-700) 100%);
    flex-shrink: 0;
    overflow: hidden;
}

.ds-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ds-avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.ds-avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.ds-avatar-md { width: 40px; height: 40px; font-size: 14px; }
.ds-avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.ds-avatar-xl { width: 64px; height: 64px; font-size: 20px; }
.ds-avatar-2xl { width: 96px; height: 96px; font-size: 28px; }

/* Avatar group */
.ds-avatar-group {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.ds-avatar-group .ds-avatar {
    margin-left: -8px;
    border: 2px solid var(--ds-neutral-0);
    box-shadow: var(--ds-shadow-sm);
}

.ds-avatar-group .ds-avatar:last-child {
    margin-left: 0;
}

/* ===========================================
   TABLES
   =========================================== */

.ds-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.ds-table th,
.ds-table td {
    padding: var(--ds-space-3) var(--ds-space-4);
    text-align: left;
    border-bottom: 1px solid var(--ds-neutral-100);
}

.ds-table th {
    font-size: var(--ds-text-xs);
    font-weight: var(--ds-font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ds-tracking-wider);
    color: var(--ds-neutral-500);
    background: var(--ds-neutral-50);
}

.ds-table tbody tr {
    transition: background var(--ds-duration-fast) var(--ds-ease-default);
}

.ds-table tbody tr:hover {
    background: var(--ds-neutral-50);
}

/* ===========================================
   ALERTS
   =========================================== */

.ds-alert {
    display: flex;
    gap: var(--ds-space-3);
    padding: var(--ds-space-4);
    border-radius: var(--ds-radius-lg);
    border: 1px solid transparent;
}

.ds-alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.ds-alert-content {
    flex: 1;
    min-width: 0;
}

.ds-alert-title {
    font-weight: var(--ds-font-semibold);
    margin-bottom: var(--ds-space-1);
}

.ds-alert-success {
    background: var(--ds-success-light);
    border-color: var(--ds-success);
    color: var(--ds-success-dark);
}

.ds-alert-warning {
    background: var(--ds-warning-light);
    border-color: var(--ds-warning);
    color: var(--ds-warning-dark);
}

.ds-alert-error {
    background: var(--ds-error-light);
    border-color: var(--ds-error);
    color: var(--ds-error-dark);
}

.ds-alert-info {
    background: var(--ds-info-light);
    border-color: var(--ds-info);
    color: var(--ds-info-dark);
}

/* ===========================================
   SIDEBAR NAVIGATION
   =========================================== */

.ds-sidebar {
    width: var(--ds-sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ds-dark-bg);
    background-image: linear-gradient(135deg, rgba(109, 40, 217, 0.1) 0%, transparent 50%);
    border-right: 1px solid var(--ds-dark-border);
    color: var(--ds-neutral-300);
    transition: width var(--ds-duration-slow) var(--ds-ease-default);
    overflow: hidden;
}

.ds-sidebar.collapsed {
    width: var(--ds-sidebar-collapsed);
}

/* Sidebar Brand */
.ds-sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-5);
    border-bottom: 1px solid var(--ds-dark-border);
}

.ds-sidebar-brand-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.ds-sidebar-brand-text {
    font-size: var(--ds-text-lg);
    font-weight: var(--ds-font-bold);
    color: white;
    white-space: nowrap;
    overflow: hidden;
}

/* Sidebar Navigation */
.ds-sidebar-nav {
    flex: 1;
    padding: var(--ds-space-3);
    overflow-y: auto;
    overflow-x: hidden;
}

.ds-sidebar-section {
    margin-bottom: var(--ds-space-6);
}

.ds-sidebar-section-label {
    padding: var(--ds-space-2) var(--ds-space-3);
    font-size: var(--ds-text-xs);
    font-weight: var(--ds-font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ds-tracking-wider);
    color: var(--ds-neutral-500);
    white-space: nowrap;
}

.ds-sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-2-5) var(--ds-space-3);
    margin-bottom: var(--ds-space-1);
    border-radius: var(--ds-radius-lg);
    color: var(--ds-neutral-400);
    text-decoration: none;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
    cursor: pointer;
}

.ds-sidebar-item:hover {
    background: var(--ds-dark-elevated);
    color: white;
}

.ds-sidebar-item.active {
    background: linear-gradient(135deg, var(--ds-primary-600) 0%, var(--ds-primary-700) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.3);
}

.ds-sidebar-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-sidebar-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--ds-text-sm);
    font-weight: var(--ds-font-medium);
}

.ds-sidebar-item-badge {
    padding: var(--ds-space-0-5) var(--ds-space-2);
    font-size: var(--ds-text-xs);
    font-weight: var(--ds-font-semibold);
    background: var(--ds-primary-600);
    color: white;
    border-radius: var(--ds-radius-full);
}

/* Nested Items */
.ds-sidebar-subnav {
    margin-left: var(--ds-space-8);
    margin-top: var(--ds-space-1);
}

.ds-sidebar-subnav .ds-sidebar-item {
    padding: var(--ds-space-2) var(--ds-space-3);
    font-size: var(--ds-text-sm);
}

/* Sidebar Footer */
.ds-sidebar-footer {
    padding: var(--ds-space-4);
    border-top: 1px solid var(--ds-dark-border);
}

.ds-sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-2);
    border-radius: var(--ds-radius-lg);
    transition: background var(--ds-duration-fast) var(--ds-ease-default);
    cursor: pointer;
}

.ds-sidebar-user:hover {
    background: var(--ds-dark-elevated);
}

.ds-sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.ds-sidebar-user-name {
    font-size: var(--ds-text-sm);
    font-weight: var(--ds-font-medium);
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-sidebar-user-role {
    font-size: var(--ds-text-xs);
    color: var(--ds-neutral-500);
}

/* Collapsed State */
.ds-sidebar.collapsed .ds-sidebar-brand-text,
.ds-sidebar.collapsed .ds-sidebar-section-label,
.ds-sidebar.collapsed .ds-sidebar-item-text,
.ds-sidebar.collapsed .ds-sidebar-item-badge,
.ds-sidebar.collapsed .ds-sidebar-user-info {
    display: none;
}

.ds-sidebar.collapsed .ds-sidebar-brand,
.ds-sidebar.collapsed .ds-sidebar-item,
.ds-sidebar.collapsed .ds-sidebar-user {
    justify-content: center;
}

.ds-sidebar.collapsed .ds-sidebar-item {
    padding: var(--ds-space-3);
}

.ds-sidebar.collapsed .ds-sidebar-subnav {
    margin-left: 0;
}

/* ===========================================
   MODALS
   =========================================== */

.ds-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--ds-z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ds-space-4);
}

.ds-modal {
    background: var(--ds-neutral-0);
    border-radius: var(--ds-radius-2xl);
    box-shadow: var(--ds-shadow-2xl);
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - var(--ds-space-8));
    overflow: hidden;
    z-index: var(--ds-z-modal);
}

.ds-modal-glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(var(--ds-glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--ds-glass-blur-heavy));
}

.ds-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ds-space-5) var(--ds-space-6);
    border-bottom: 1px solid var(--ds-neutral-100);
}

.ds-modal-title {
    font-size: var(--ds-text-lg);
    font-weight: var(--ds-font-semibold);
    color: var(--ds-neutral-900);
}

.ds-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ds-radius-md);
    color: var(--ds-neutral-400);
    cursor: pointer;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
}

.ds-modal-close:hover {
    background: var(--ds-neutral-100);
    color: var(--ds-neutral-600);
}

.ds-modal-body {
    padding: var(--ds-space-6);
    overflow-y: auto;
}

.ds-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--ds-space-3);
    padding: var(--ds-space-4) var(--ds-space-6);
    border-top: 1px solid var(--ds-neutral-100);
    background: var(--ds-neutral-50);
}

/* ===========================================
   LOADERS & SPINNERS
   =========================================== */

.ds-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--ds-neutral-200);
    border-top-color: var(--ds-primary-600);
    border-radius: 50%;
    animation: ds-spin 0.8s linear infinite;
}

.ds-spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.ds-spinner-lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes ds-spin {
    to { transform: rotate(360deg); }
}

/* Skeleton loader */
.ds-skeleton {
    background: linear-gradient(
        90deg,
        var(--ds-neutral-200) 25%,
        var(--ds-neutral-100) 50%,
        var(--ds-neutral-200) 75%
    );
    background-size: 200% 100%;
    animation: ds-shimmer 1.5s infinite;
    border-radius: var(--ds-radius-md);
}

@keyframes ds-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===========================================
   TOOLTIPS
   =========================================== */

.ds-tooltip {
    position: relative;
}

.ds-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: var(--ds-space-1-5) var(--ds-space-3);
    font-size: var(--ds-text-xs);
    font-weight: var(--ds-font-medium);
    color: white;
    background: var(--ds-neutral-900);
    border-radius: var(--ds-radius-md);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
    z-index: var(--ds-z-tooltip);
}

.ds-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */

/* Flex utilities */
.ds-flex { display: flex; }
.ds-flex-col { flex-direction: column; }
.ds-flex-wrap { flex-wrap: wrap; }
.ds-items-center { align-items: center; }
.ds-items-start { align-items: flex-start; }
.ds-items-end { align-items: flex-end; }
.ds-justify-center { justify-content: center; }
.ds-justify-between { justify-content: space-between; }
.ds-justify-end { justify-content: flex-end; }
.ds-gap-1 { gap: var(--ds-space-1); }
.ds-gap-2 { gap: var(--ds-space-2); }
.ds-gap-3 { gap: var(--ds-space-3); }
.ds-gap-4 { gap: var(--ds-space-4); }
.ds-gap-6 { gap: var(--ds-space-6); }
.ds-gap-8 { gap: var(--ds-space-8); }

/* ===========================================
   FORM LAYOUT - Labels Left of Inputs
   =========================================== */

.ds-form-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--ds-space-2) var(--ds-space-4);
    align-items: center;
    margin-bottom: var(--ds-space-3);
}

.ds-form-row label,
.ds-form-row .ds-form-label {
    font-size: var(--ds-text-sm);
    font-weight: var(--ds-font-medium);
    color: var(--ds-neutral-600);
    text-align: right;
    white-space: nowrap;
}

.ds-form-row .ds-input,
.ds-form-row input,
.ds-form-row select,
.ds-form-row textarea {
    width: 100%;
}

/* Wider label variant */
.ds-form-row-wide {
    grid-template-columns: 160px 1fr;
}

/* Narrow label variant */
.ds-form-row-narrow {
    grid-template-columns: 90px 1fr;
}

/* Full-width input (label above) - use sparingly */
.ds-form-row-stacked {
    grid-template-columns: 1fr;
}

.ds-form-row-stacked label,
.ds-form-row-stacked .ds-form-label {
    text-align: left;
    margin-bottom: var(--ds-space-1);
}

/* Form group for multiple rows */
.ds-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-1);
}

/* Multi-column form layout */
.ds-form-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--ds-space-6);
}

/* Responsive: Stack labels above inputs on mobile */
@media (max-width: 640px) {
    .ds-form-row {
        grid-template-columns: 1fr;
    }

    .ds-form-row label,
    .ds-form-row .ds-form-label {
        text-align: left;
        margin-bottom: var(--ds-space-1);
    }

    .ds-form-row-wide,
    .ds-form-row-narrow {
        grid-template-columns: 1fr;
    }
}

/* Text utilities */
.ds-text-center { text-align: center; }
.ds-text-right { text-align: right; }
.ds-text-muted { color: var(--ds-neutral-500); }
.ds-text-primary { color: var(--ds-primary-600); }
.ds-text-success { color: var(--ds-success); }
.ds-text-warning { color: var(--ds-warning-dark); }
.ds-text-error { color: var(--ds-error); }

/* Background utilities */
.ds-bg-primary { background-color: var(--ds-primary-600); }
.ds-bg-primary-light { background-color: var(--ds-primary-100); }
.ds-bg-muted { background-color: var(--ds-neutral-100); }

/* Spacing utilities */
.ds-p-0 { padding: 0; }
.ds-p-2 { padding: var(--ds-space-2); }
.ds-p-4 { padding: var(--ds-space-4); }
.ds-p-6 { padding: var(--ds-space-6); }
.ds-p-8 { padding: var(--ds-space-8); }

.ds-m-0 { margin: 0; }
.ds-mb-2 { margin-bottom: var(--ds-space-2); }
.ds-mb-4 { margin-bottom: var(--ds-space-4); }
.ds-mb-6 { margin-bottom: var(--ds-space-6); }
.ds-mb-8 { margin-bottom: var(--ds-space-8); }
.ds-mt-auto { margin-top: auto; }

/* Border utilities */
.ds-rounded { border-radius: var(--ds-radius-md); }
.ds-rounded-lg { border-radius: var(--ds-radius-lg); }
.ds-rounded-xl { border-radius: var(--ds-radius-xl); }
.ds-rounded-full { border-radius: var(--ds-radius-full); }
.ds-border { border: 1px solid var(--ds-neutral-200); }

/* Shadow utilities */
.ds-shadow-sm { box-shadow: var(--ds-shadow-sm); }
.ds-shadow-md { box-shadow: var(--ds-shadow-md); }
.ds-shadow-lg { box-shadow: var(--ds-shadow-lg); }
.ds-shadow-xl { box-shadow: var(--ds-shadow-xl); }

/* ===========================================
   ACCESSIBILITY
   =========================================== */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .ds-skeleton {
        animation: none;
        background: var(--ds-neutral-200);
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--ds-primary-500);
    outline-offset: 2px;
}

/* Skip link */
.ds-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: var(--ds-space-2) var(--ds-space-4);
    background: var(--ds-primary-600);
    color: white;
    z-index: 9999;
    transition: top var(--ds-duration-fast) var(--ds-ease-default);
}

.ds-skip-link:focus {
    top: 0;
}

/* Screen reader only */
.ds-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===========================================
   DARK MODE
   =========================================== */

[data-theme="dark"],
.dark {
    --ds-neutral-0: #0f172a;
    --ds-neutral-50: #1e293b;
    --ds-neutral-100: #334155;
    --ds-neutral-200: #475569;
    --ds-neutral-300: #64748b;
    --ds-neutral-400: #94a3b8;
    --ds-neutral-500: #cbd5e1;
    --ds-neutral-600: #e2e8f0;
    --ds-neutral-700: #f1f5f9;
    --ds-neutral-800: #f8fafc;
    --ds-neutral-900: #ffffff;

    color-scheme: dark;
}

[data-theme="dark"] .ds-card,
.dark .ds-card {
    background: var(--ds-dark-surface);
    border-color: var(--ds-dark-border);
}

[data-theme="dark"] .ds-input,
.dark .ds-input {
    background: var(--ds-dark-surface);
    border-color: var(--ds-dark-border);
    color: var(--ds-neutral-900);
}

[data-theme="dark"] .ds-btn-secondary,
.dark .ds-btn-secondary {
    background: var(--ds-dark-surface);
    border-color: var(--ds-dark-border);
    color: var(--ds-neutral-300);
}

/* ===========================================
   PAGE HEADERS
   =========================================== */

.ds-page-header {
    background: linear-gradient(135deg, var(--ds-primary-600) 0%, var(--ds-primary-800) 100%);
    color: white;
    margin: calc(var(--ds-space-4) * -1);
    margin-bottom: var(--ds-space-6);
    padding: var(--ds-space-6);
    border-radius: 0 0 var(--ds-radius-2xl) var(--ds-radius-2xl);
}

.ds-page-header .ds-avatar {
    background: rgba(255, 255, 255, 0.2);
}

.ds-page-header .ds-text-muted {
    color: rgba(255, 255, 255, 0.8);
}

.ds-page-header .ds-mb-0,
.ds-page-header h1,
.ds-page-header h2,
.ds-page-header h3 {
    color: white;
}

.ds-page-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--ds-text-sm);
}

@media (max-width: 640px) {
    .ds-page-header {
        margin: -1rem;
        margin-bottom: var(--ds-space-4);
        padding: var(--ds-space-4);
    }
}

/* ===========================================
   BUTTON GROUPS
   =========================================== */

.ds-btn-group {
    display: flex;
    border-radius: var(--ds-radius-lg);
    overflow: hidden;
}

.ds-btn-group .ds-btn {
    border-radius: 0;
}

.ds-btn-group .ds-btn:first-child {
    border-radius: var(--ds-radius-lg) 0 0 var(--ds-radius-lg);
}

.ds-btn-group .ds-btn:last-child {
    border-radius: 0 var(--ds-radius-lg) var(--ds-radius-lg) 0;
}

/* ===========================================
   STAT CARDS
   =========================================== */

.ds-stat-card {
    text-decoration: none;
    border-left: 4px solid var(--ds-primary-600);
}

.ds-stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--ds-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.ds-stat-icon-primary {
    background: linear-gradient(135deg, var(--ds-primary-100) 0%, var(--ds-primary-200) 100%);
    color: var(--ds-primary-600);
}

.ds-stat-icon-secondary {
    background: linear-gradient(135deg, var(--ds-secondary-100) 0%, var(--ds-secondary-200) 100%);
    color: var(--ds-secondary-600);
}

.ds-stat-icon-neutral {
    background: var(--ds-neutral-100);
    color: var(--ds-neutral-600);
}

.ds-stat-secondary {
    color: var(--ds-secondary-600);
}

/* ===========================================
   ACTIVITY LIST
   =========================================== */

.ds-activity-list {
    display: flex;
    flex-direction: column;
}

.ds-activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-3);
    padding: var(--ds-space-4) var(--ds-space-6);
    border-bottom: 1px solid var(--ds-neutral-100);
    transition: background var(--ds-duration-fast) var(--ds-ease-default);
}

.ds-activity-item:hover {
    background: var(--ds-neutral-50);
}

.ds-activity-item:last-child {
    border-bottom: none;
}

.ds-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ds-activity-icon.created {
    background: var(--ds-success-light);
    color: var(--ds-success-dark);
}

.ds-activity-icon.updated {
    background: var(--ds-info-light);
    color: var(--ds-info-dark);
}

.ds-activity-icon.deleted {
    background: var(--ds-error-light);
    color: var(--ds-error-dark);
}

.ds-activity-icon.login {
    background: var(--ds-primary-100);
    color: var(--ds-primary-600);
}

.ds-activity-icon.other {
    background: var(--ds-neutral-100);
    color: var(--ds-neutral-600);
}

.ds-activity-content {
    flex: 1;
    min-width: 0;
}

.ds-activity-title {
    font-weight: var(--ds-font-medium);
    color: var(--ds-neutral-900);
}

.ds-activity-time {
    font-size: var(--ds-text-xs);
    color: var(--ds-neutral-400);
    white-space: nowrap;
    margin-left: var(--ds-space-2);
}

.ds-activity-user {
    font-size: var(--ds-text-sm);
    color: var(--ds-neutral-500);
    display: block;
    margin-top: var(--ds-space-1);
}

/* ===========================================
   EMPTY STATES
   =========================================== */

.ds-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ds-space-8);
    color: var(--ds-neutral-400);
}

.ds-empty-state i {
    font-size: 2.5rem;
    margin-bottom: var(--ds-space-3);
    opacity: 0.5;
}

.ds-empty-state p {
    margin: 0;
}

/* ===========================================
   RECENT ITEMS
   =========================================== */

.ds-recent-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ds-space-6);
}

.ds-recent-list {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-1);
}

.ds-recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--ds-space-2) var(--ds-space-3);
    border-radius: var(--ds-radius-md);
    text-decoration: none;
    color: var(--ds-neutral-900);
    transition: background var(--ds-duration-fast) var(--ds-ease-default);
}

.ds-recent-item:hover {
    background: var(--ds-neutral-100);
}

.ds-recent-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ds-recent-time {
    font-size: var(--ds-text-xs);
    color: var(--ds-neutral-400);
    margin-left: var(--ds-space-2);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .ds-recent-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   TABS
   =========================================== */

.ds-tabs {
    display: flex;
    border-bottom: 1px solid var(--ds-neutral-200);
    margin-bottom: var(--ds-space-4);
}

.ds-tab {
    padding: var(--ds-space-3) var(--ds-space-4);
    color: var(--ds-neutral-600);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
    cursor: pointer;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}

.ds-tab:hover {
    color: var(--ds-primary-600);
}

.ds-tab.active {
    color: var(--ds-primary-600);
    border-bottom-color: var(--ds-primary-600);
    font-weight: var(--ds-font-semibold);
}

/* ===========================================
   SORTABLE TABLE HEADERS
   =========================================== */

.sortable-header {
    cursor: pointer;
    user-select: none;
    font-weight: var(--ds-font-semibold);
    font-size: var(--ds-text-xs);
    text-transform: uppercase;
    letter-spacing: var(--ds-tracking-wider);
    color: var(--ds-neutral-600);
    padding: var(--ds-space-3);
    transition: color var(--ds-duration-fast) var(--ds-ease-default);
}

.sortable-header:hover {
    color: var(--ds-primary-600);
}

/* ===========================================
   COMPACT FORMS (Label-Left)
   =========================================== */

.compact-form {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-1);
}

.compact-form .form-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: center;
    gap: var(--ds-space-2);
}

.compact-form .form-row label {
    font-size: 0.75rem;
    color: var(--ds-neutral-500);
    text-align: right;
    padding-right: var(--ds-space-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-form.readonly .form-row span {
    font-weight: 500;
}

.compact-form .form-control-sm,
.compact-form .form-select-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    height: auto;
    min-height: 1.75rem;
}

@media (max-width: 640px) {
    .compact-form .form-row {
        grid-template-columns: 1fr;
    }
    .compact-form .form-row label {
        text-align: left;
        margin-bottom: var(--ds-space-1);
    }
}

/* ===========================================
   ADDITIONAL MARGIN UTILITIES
   =========================================== */

.ds-mt-0 { margin-top: 0; }
.ds-mt-2 { margin-top: var(--ds-space-2); }
.ds-mt-4 { margin-top: var(--ds-space-4); }
.ds-mt-6 { margin-top: var(--ds-space-6); }

.ds-mb-0 { margin-bottom: 0; }
.ds-mb-1 { margin-bottom: var(--ds-space-1); }
.ds-mb-3 { margin-bottom: var(--ds-space-3); }

.ds-flex-1 { flex: 1; }
.ds-min-w-0 { min-width: 0; }

/* ===========================================
   BOOTSTRAP OVERRIDES
   Apply design system tokens to Bootstrap components
   =========================================== */

/* Cards */
.card {
    border: 1px solid var(--ds-neutral-200);
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-sm);
}

.card-header {
    border-bottom: 1px solid var(--ds-neutral-100);
}

/* Buttons */
.btn-outline-primary {
    border-color: var(--ds-primary-600);
    color: var(--ds-primary-600);
}

.btn-outline-primary:hover {
    background-color: var(--ds-primary-600);
    border-color: var(--ds-primary-600);
    color: white;
}

/* Form controls */
.form-check-input:checked {
    background-color: var(--ds-primary-600);
    border-color: var(--ds-primary-600);
}

/* Table */
.table-primary {
    --bs-table-bg: var(--ds-primary-100);
}

.table > tbody > tr > td {
    padding: var(--ds-space-3);
    vertical-align: middle;
}

/* Compact table variant - reduced row height */
.table-compact > tbody > tr > td {
    padding: var(--ds-space-2);
}

.table-compact > thead > tr > th {
    padding: var(--ds-space-2);
}

/* Clickable table row */
.clickable-row {
    cursor: pointer;
}

/* Table row hover state */
.contact-row {
    transition: background-color var(--ds-duration-fast) var(--ds-ease-default);
}

.contact-row:hover {
    background-color: var(--ds-neutral-50);
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--ds-primary-600);
    border-color: var(--ds-primary-600);
}

.page-link {
    color: var(--ds-primary-600);
    border-radius: var(--ds-radius-md);
}

.page-link:hover {
    color: var(--ds-primary-600);
    background-color: var(--ds-neutral-100);
}

/* Nav Tabs */
.nav-tabs .nav-link {
    color: var(--ds-neutral-600);
    border: none;
    border-bottom: 2px solid transparent;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
}

.nav-tabs .nav-link:hover {
    color: var(--ds-primary-600);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--ds-primary-600);
    border-color: var(--ds-primary-600);
    font-weight: var(--ds-font-semibold);
}

/* Visibility Badge */
.visibility-badge {
    font-size: var(--ds-text-xs);
    padding: var(--ds-space-1) var(--ds-space-2);
    border-radius: var(--ds-radius-full);
}

/* Disabled fieldset styling (read-only forms) */
fieldset[disabled] .form-control,
fieldset[disabled] .form-select {
    background-color: transparent;
    border-color: transparent;
    padding-left: 0;
    cursor: default;
}

fieldset[disabled] .form-control:focus,
fieldset[disabled] .form-select:focus {
    box-shadow: none;
}

/* Top bar elements */
.profile-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--ds-radius-md);
}

.logout-btn {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: transparent;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
}

.logout-btn:hover {
    background-color: var(--ds-primary-700);
    border-color: var(--ds-primary-700);
    color: white;
}

/* Table row hover states */
.account-row,
.user-row,
.group-row,
.audit-row {
    transition: background-color var(--ds-duration-fast) var(--ds-ease-default);
}

.account-row:hover,
.user-row:hover,
.group-row:hover,
.audit-row:hover {
    background-color: rgba(64, 31, 113, 0.03);
}

/* Table header styling */
.table > thead > tr > th {
    font-weight: var(--ds-font-semibold);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--ds-neutral-800);
    padding: 0.875rem 0.75rem;
}

/* Role badges */
.badge.role-admin {
    background-color: var(--ds-primary-600);
}

.badge.role-manager {
    background-color: var(--ds-secondary-400);
    color: var(--ds-neutral-800);
}

.badge.role-user {
    background-color: var(--ds-neutral-100);
    color: var(--ds-neutral-800);
}

/* Audit event badges */
.badge.event-auth-success { background-color: #107c10; }
.badge.event-auth-fail { background-color: #d13438; }
.badge.event-auth-logout { background-color: #6c757d; }
.badge.event-create { background-color: #0078d4; }
.badge.event-update { background-color: #f7630c; }
.badge.event-delete { background-color: #d13438; }
.badge.event-import { background-color: #5c2d91; }
.badge.event-export { background-color: #00b294; }
.badge.event-exchange { background-color: #00a4ef; }

/* Upload zones */
.upload-zone {
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
}

.upload-zone:hover {
    background-color: rgba(64, 31, 113, 0.03);
}

/* Selectable cards (import wizard) */
.selectable-card {
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
    border: 2px solid transparent;
}

.selectable-card:hover {
    border-color: var(--ds-primary-600);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.selectable-card.selected {
    border-color: var(--ds-primary-600) !important;
    background-color: rgba(64, 31, 113, 0.03);
}

/* Pagination disabled state */
.page-item.disabled .page-link {
    color: #6c757d;
    background-color: var(--ds-neutral-100);
}

.page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(64, 31, 113, 0.25);
}

/* Login card */
.login-card {
    background: white;
    border-radius: var(--ds-radius-xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
}

/* Input group focus state */
.input-group-text {
    border-right: none;
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--ds-primary-600);
}

.input-group:focus-within .form-control {
    border-color: var(--ds-primary-600);
    box-shadow: none;
}

/* ===========================================
   STANDARDIZED CLASSES (Unprefixed Aliases)
   These provide consistent naming across the app
   =========================================== */

/* Page Header - Purple Gradient (ALL PAGES) */
.page-header {
    background: linear-gradient(135deg, var(--ds-primary-600) 0%, var(--ds-primary-800) 100%);
    color: white;
    margin: -1.25rem -1.25rem 1.25rem -1.25rem;
    padding: 1.25rem;
    border-radius: 0 0 var(--ds-radius-2xl) var(--ds-radius-2xl);
}

.page-header .page-title,
.page-header h1,
.page-header h2,
.page-header h3,
.page-header h4 {
    color: white;
    margin-bottom: 0;
    font-weight: 600;
}

.page-header .page-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.page-header .avatar {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.page-header .btn-glass {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(4px);
}

.page-header .btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.page-header .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

@media (max-width: 640px) {
    .page-header {
        margin: -1rem -1rem 1rem -1rem;
        padding: 1rem;
    }
}

/* Avatar - Standard Sizes */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ds-radius-full);
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--ds-primary-500) 0%, var(--ds-primary-700) 100%);
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xs { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.875rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.25rem; }
.avatar-2xl { width: 80px; height: 80px; font-size: 1.5rem; }

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
}

.table-header,
.data-table thead tr {
    background-color: var(--ds-neutral-100);
}

.table-header th,
.data-table thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--ds-neutral-600);
    border-bottom: 1px solid var(--ds-neutral-200);
}

.data-row {
    transition: background-color var(--ds-duration-fast) var(--ds-ease-default);
}

.data-row:hover {
    background-color: rgba(64, 31, 113, 0.03);
}

.col-checkbox {
    width: 40px;
    padding-left: 1rem !important;
}

.col-actions {
    width: 120px;
    text-align: center;
}

/* Modal Overlay */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Search Input Group */
.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group .search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--ds-neutral-400);
    pointer-events: none;
    z-index: 1;
}

.search-input-group .form-control {
    padding-left: 2.5rem;
}

/* Spinner Variants */
.spinner-primary {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--ds-neutral-200);
    border-top-color: var(--ds-primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-primary-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.spinner-primary-lg {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Icon Utilities */
.icon-primary { color: var(--ds-primary-600); }
.icon-secondary { color: var(--ds-secondary-500); }
.icon-success { color: #107c10; }
.icon-warning { color: #f7630c; }
.icon-danger { color: #d13438; }
.icon-muted { color: var(--ds-neutral-400); }

.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--ds-radius-lg);
}

.icon-box-primary {
    background: linear-gradient(135deg, var(--ds-primary-100) 0%, var(--ds-primary-200) 100%);
    color: var(--ds-primary-600);
}

.icon-box-secondary {
    background: linear-gradient(135deg, var(--ds-secondary-100) 0%, var(--ds-secondary-200) 100%);
    color: var(--ds-secondary-600);
}

.icon-box-success {
    background: var(--ds-success-light);
    color: #107c10;
}

.icon-box-neutral {
    background: var(--ds-neutral-100);
    color: var(--ds-neutral-600);
}

/* Wizard Components */
.wizard-container {
    max-width: 800px;
    margin: 0 auto;
}

.wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wizard-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.wizard-progress-line {
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background-color: var(--ds-neutral-200);
    z-index: 0;
}

.wizard-progress-line-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--ds-primary-600);
    transition: width var(--ds-duration-normal) var(--ds-ease-default);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.wizard-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background-color: var(--ds-neutral-100);
    color: var(--ds-neutral-400);
    border: 2px solid var(--ds-neutral-200);
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
}

.wizard-step-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--ds-neutral-500);
    text-align: center;
    max-width: 80px;
}

.wizard-step-active .wizard-step-circle {
    background-color: var(--ds-primary-600);
    border-color: var(--ds-primary-600);
    color: white;
}

.wizard-step-active .wizard-step-label {
    color: var(--ds-primary-600);
    font-weight: 600;
}

.wizard-step-completed .wizard-step-circle {
    background-color: #107c10;
    border-color: #107c10;
    color: white;
}

.wizard-step-completed .wizard-step-label {
    color: #107c10;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--ds-neutral-300);
    border-radius: var(--ds-radius-xl);
    padding: 2rem;
    text-align: center;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
    cursor: pointer;
    background-color: var(--ds-neutral-50);
}

.upload-zone:hover {
    border-color: var(--ds-primary-600);
    background-color: rgba(64, 31, 113, 0.03);
}

.upload-zone-active,
.upload-zone.active {
    border-color: var(--ds-primary-600);
    border-style: solid;
    background-color: rgba(64, 31, 113, 0.05);
}

.upload-zone-success {
    border-color: #107c10;
    background-color: rgba(16, 124, 16, 0.05);
}

.upload-zone-icon {
    font-size: 3rem;
    color: var(--ds-neutral-400);
    margin-bottom: 1rem;
}

.upload-zone:hover .upload-zone-icon {
    color: var(--ds-primary-600);
}

/* Stat Cards */
.stat-card {
    text-decoration: none;
    border-left: 4px solid var(--ds-primary-600);
    transition: transform var(--ds-duration-fast) var(--ds-ease-default),
                box-shadow var(--ds-duration-fast) var(--ds-ease-default);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow-lg);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--ds-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.stat-icon-primary {
    background: linear-gradient(135deg, var(--ds-primary-100) 0%, var(--ds-primary-200) 100%);
    color: var(--ds-primary-600);
}

.stat-icon-secondary {
    background: linear-gradient(135deg, var(--ds-secondary-100) 0%, var(--ds-secondary-200) 100%);
    color: var(--ds-secondary-600);
}

.stat-icon-success {
    background: rgba(16, 124, 16, 0.1);
    color: #107c10;
}

.stat-icon-neutral {
    background: var(--ds-neutral-100);
    color: var(--ds-neutral-600);
}

.stat-card-success { border-left-color: #107c10; }
.stat-card-warning { border-left-color: #f7630c; }
.stat-card-danger { border-left-color: #d13438; }
.stat-card-info { border-left-color: #0078d4; }

/* Config Card (Import Wizard) */
.config-card {
    background-color: var(--ds-neutral-100);
    border: none;
    border-radius: var(--ds-radius-xl);
}

.config-card .card-body {
    padding: 1.5rem;
}

/* Metric Card */
.metric-card {
    text-align: center;
    padding: 1rem;
}

.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ds-neutral-800);
}

.metric-card .metric-label {
    font-size: 0.75rem;
    color: var(--ds-neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Settings Panel */
.settings-panel {
    margin-bottom: 1.5rem;
}

.settings-panel .card-header {
    background: transparent;
    border-bottom: 1px solid var(--ds-neutral-100);
    padding: 1rem 1.5rem;
}

.settings-panel .card-body {
    padding: 1.5rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--ds-neutral-300);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ds-neutral-600);
    margin-bottom: 0.5rem;
}

.empty-state-message {
    color: var(--ds-neutral-500);
    margin-bottom: 1.5rem;
    max-width: 300px;
}

/* Activity List (unprefixed) */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--ds-neutral-100);
    transition: background var(--ds-duration-fast) var(--ds-ease-default);
}

.activity-item:hover {
    background: var(--ds-neutral-50);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.created { background: var(--ds-success-light); color: #107c10; }
.activity-icon.updated { background: var(--ds-info-light); color: #0078d4; }
.activity-icon.deleted { background: var(--ds-error-light); color: #d13438; }
.activity-icon.login { background: var(--ds-primary-100); color: var(--ds-primary-600); }
.activity-icon.other { background: var(--ds-neutral-100); color: var(--ds-neutral-600); }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 500;
    color: var(--ds-neutral-800);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--ds-neutral-400);
    white-space: nowrap;
}

.activity-user {
    font-size: 0.875rem;
    color: var(--ds-neutral-500);
    margin-top: 0.25rem;
}

/* Recent List (unprefixed) */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--ds-radius-md);
    text-decoration: none;
    color: var(--ds-neutral-800);
    transition: background var(--ds-duration-fast) var(--ds-ease-default);
}

.recent-item:hover {
    background: var(--ds-neutral-100);
}

.recent-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-time {
    font-size: 0.75rem;
    color: var(--ds-neutral-400);
    margin-left: 0.5rem;
}

/* Bento Grid (unprefixed) */
.bento-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.bento-grid-2-1 {
    grid-template-columns: 2fr 1fr;
}

.bento-grid-1-2 {
    grid-template-columns: 1fr 2fr;
}

@media (max-width: 768px) {
    .bento-grid-2-1,
    .bento-grid-1-2 {
        grid-template-columns: 1fr;
    }
}

/* Chart Container */
.chart-container {
    max-height: 250px;
    position: relative;
}

/* Form Row (unprefixed) */
.form-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-row label {
    font-size: 0.75rem;
    color: var(--ds-neutral-500);
    text-align: right;
    padding-right: 0.5rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row label {
        text-align: left;
        margin-bottom: 0.25rem;
    }
}

/* Tabs (unprefixed) */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--ds-neutral-200);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1rem;
    color: var(--ds-neutral-600);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
    cursor: pointer;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}

.tab:hover {
    color: var(--ds-primary-600);
}

.tab.active {
    color: var(--ds-primary-600);
    border-bottom-color: var(--ds-primary-600);
    font-weight: 600;
}

/* Success Icon (completion states) */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #107c10;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

/* Not Found Page */
.not-found-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.not-found-title {
    font-size: 6rem;
    font-weight: 700;
    color: var(--ds-primary-600);
    line-height: 1;
    margin-bottom: 1rem;
}

.not-found-message {
    font-size: 1.25rem;
    color: var(--ds-neutral-600);
    margin-bottom: 2rem;
}

/* Error Page */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

/* Selectable Card (import wizard) */
.selectable-card {
    cursor: pointer;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
    border: 2px solid transparent;
}

.selectable-card:hover {
    border-color: var(--ds-primary-600);
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow-lg);
}

.selectable-card.selected {
    border-color: var(--ds-primary-600);
    background-color: rgba(64, 31, 113, 0.03);
}

/* Preview Table */
.preview-table {
    max-height: 350px;
    overflow-y: auto;
}

.preview-table .table {
    margin-bottom: 0;
}

.preview-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Color Picker Option */
.color-picker-option {
    width: 24px;
    height: 24px;
    border-radius: var(--ds-radius-full);
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform var(--ds-duration-fast) var(--ds-ease-default);
}

.color-picker-option:hover {
    transform: scale(1.1);
}

.color-picker-option.selected {
    border-color: var(--ds-neutral-800);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--ds-neutral-800);
}

/* ===========================================
   GLOBAL STYLES (merged from app.css)
   =========================================== */

html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: var(--ds-primary-600);
}

.btn-primary {
    color: #fff;
    background-color: var(--ds-primary-600);
    border-color: var(--ds-primary-600);
}

.btn-primary:hover {
    background-color: var(--ds-primary-700);
    border-color: var(--ds-primary-700);
}

.btn-secondary {
    color: #fff;
    background-color: var(--ds-neutral-800);
    border-color: var(--ds-neutral-800);
}

.btn-danger {
    color: #fff;
    background-color: #d13438;
    border-color: #d13438;
}

.btn-danger:hover {
    background-color: #b02a2d;
    border-color: #b02a2d;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--ds-primary-600);
}

.table-dark {
    background-color: var(--ds-primary-600);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--ds-primary-600) 0%, var(--ds-neutral-800) 100%);
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--ds-radius-xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--ds-primary-600);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--ds-neutral-600);
}

.empty-layout {
    min-height: 100vh;
}

/* ===========================================
   SIDEBAR NAVIGATION
   =========================================== */

.sidebar {
    background: var(--ds-dark-bg);
    background-image: linear-gradient(135deg, rgba(109, 40, 217, 0.1) 0%, transparent 50%);
    border-right: 1px solid var(--ds-dark-border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    padding-bottom: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.tagline {
    color: var(--ds-secondary-400);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    margin-left: 3.25rem;
}

.brand-divider {
    height: 2px;
    background: linear-gradient(to right, var(--ds-secondary-500), transparent);
    margin-top: 1rem;
    width: 60px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1rem;
}

.nav-section-title {
    color: var(--ds-neutral-400);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--ds-neutral-300);
    text-decoration: none;
    border-radius: var(--ds-radius-lg);
    margin-bottom: 0.25rem;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
}

.sidebar-nav .nav-link:hover {
    background-color: var(--ds-dark-elevated);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--ds-primary-600) 0%, var(--ds-primary-700) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.3);
}

.sidebar-nav .nav-link .bi {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.nav-text {
    font-size: 0.9375rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--ds-dark-border);
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--ds-radius-lg);
    transition: background var(--ds-duration-fast) var(--ds-ease-default);
    flex: 1;
    min-width: 0;
    color: inherit;
}

.sidebar-user:hover {
    background: var(--ds-dark-elevated);
}

.sidebar-logout-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--ds-radius-lg);
    border: none;
    background: transparent;
    color: var(--ds-neutral-400);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ds-duration-fast) var(--ds-ease-default);
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.sidebar-logout-btn i {
    font-size: 1.125rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--ds-primary-500), var(--ds-primary-700));
    border-radius: var(--ds-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: var(--ds-neutral-400);
    font-size: 0.75rem;
}

/* Top Row - Removed, user info moved to sidebar footer */

/* ===========================================
   RESPONSIVE UTILITIES
   =========================================== */

/* Mobile visibility */
@media (max-width: 767.98px) {
    .d-mobile-none {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .d-mobile-only {
        display: none !important;
    }
}

/* Touch-friendly buttons */
@media (max-width: 767.98px) {
    .btn-touch {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-group-touch > .btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
}

/* Responsive table */
@media (max-width: 767.98px) {
    .table th.d-none-mobile,
    .table td.d-none-mobile {
        display: none !important;
    }

    .table-mobile-compact td,
    .table-mobile-compact th {
        padding: 0.5rem 0.25rem !important;
    }

    .table .btn-sm {
        padding: 0.375rem 0.5rem;
    }
}

/* Responsive cards */
@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }
}

/* Page content padding */
@media (max-width: 640.98px) {
    .mx-n4 {
        margin-left: -1rem !important;
        margin-right: -1rem !important;
    }

    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Responsive pagination */
@media (max-width: 575.98px) {
    .pagination .page-item.d-none-xs {
        display: none !important;
    }

    .pagination .page-link {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Responsive modal */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* Top row mobile */
@media (max-width: 640.98px) {
    .top-row {
        min-height: 56px;
    }

    .top-row .profile-link span:not(.rounded-circle):not([class*="bi-"]) {
        display: none;
    }
}

/* ===== FEAT-009: Search Match Highlighting ===== */
.search-matches {
    font-size: 0.85rem;
    line-height: 1.4;
}

.search-match-item {
    margin-bottom: 0.25rem;
}

.search-match-item:last-child {
    margin-bottom: 0;
}

.match-field {
    font-weight: 500;
    margin-right: 0.25rem;
}

.match-snippet {
    word-break: break-word;
}

.search-highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 500;
}

/* Dark mode support */
[data-bs-theme="dark"] .search-highlight {
    background-color: #664d03;
    color: #fff3cd;
}

/* ===========================================
   BADGE SELECT INPUT (FEAT-006)
   =========================================== */

.badge-select-container {
    position: relative;
}

.badge-select-input {
    min-height: calc(1.5em + 0.5rem + 2px);
    height: auto;
    cursor: text;
    padding: 0.15rem 0.25rem;
}

.badge-select-text-input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1 1 60px;
    min-width: 60px;
    font-size: 0.875rem;
    padding: 0.1rem 0.25rem;
}

.badge-remove {
    font-size: 0.5rem;
    padding: 0.15rem;
    opacity: 0.8;
}

.badge-remove:hover {
    opacity: 1;
}

.badge-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.badge-select-item {
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.05));
}

.badge-select-item:last-child {
    border-bottom: none;
}

.badge-select-item:hover,
.badge-select-item.selected {
    background-color: var(--bs-primary-bg-subtle, #e7f1ff);
}

.badge-select-item.no-results {
    color: var(--bs-secondary, #6c757d);
    cursor: default;
}

.badge-select-item.no-results:hover {
    background-color: transparent;
}
