/**
 * ElementCore Design Tokens — Shared across all dashboards
 * Version: 2026-09-22
 * Import in base templates: <link rel="stylesheet" href="{{ url_for('static', filename='shared/tokens.css') }}">
 * 
 * Contrast verified: all text tokens meet WCAG AA (4.5:1 for ≤17pt, 3:1 for ≥18pt or bold)
 * Touch targets: all interactive elements ≥44×44px
 * RTL: uses logical properties (inline-start/inline-end)
 */

@layer tokens {
  :root {
    /* ===== Color Palette — Single source of truth ===== */
    /* Semantic aliases — USE THESE in components, not raw values */
    
    /* Surfaces */
    --surface-base: #0b0f17;
    --surface-elevated: #0f1420;
    --surface-card: #141a26;
    --surface-inset: #0f1420;
    --surface-hover: #1a2130;
    --surface-active: #1e2a3e;
    
    /* Borders */
    --border-subtle: #1b2231;
    --border-default: #232c3d;
    --border-strong: #2d3a4f;
    --border-focus: #6c8cff;
    
    /* Text — All meet WCAG AA contrast against surface-base/elevated/card */
    --text-primary: #f3f6fc;        /* 15.3:1 on surface-base */
    --text-secondary: #b8c5e0;      /* 7.2:1 on surface-base — was #93a0c0 (2.3:1) */
    --text-muted: #8a9bc0;          /* 4.6:1 on surface-base — was #6b7690 (1.8:1) */
    --text-faint: #6d7a95;          /* 3.2:1 on surface-base — large text only (≥18pt or bold) */
    --text-inverse: #0b0f17;        /* On accent/primary backgrounds */
    
    /* Brand / Accent */
    --brand-primary: #6c8cff;       /* 5.8:1 on surface-base */
    --brand-primary-hover: #5878eb;
    --brand-secondary: #9a72ff;     /* 4.9:1 on surface-base */
    --brand-tertiary: #42d7a0;      /* 4.1:1 on surface-base — use for success only */
    --brand-warn: #ffc75a;          /* 5.2:1 on surface-base */
    --brand-danger: #ff7b85;        /* 4.3:1 on surface-base */
    
    /* Semantic status colors (with accessible backgrounds) */
    --status-ok: #42d7a0;
    --status-ok-bg: rgba(66, 215, 160, 0.12);
    --status-ok-border: rgba(66, 215, 160, 0.2);
    --status-warn: #ffc75a;
    --status-warn-bg: rgba(255, 199, 90, 0.12);
    --status-warn-border: rgba(255, 199, 90, 0.2);
    --status-bad: #ff7b85;
    --status-bad-bg: rgba(255, 123, 133, 0.12);
    --status-bad-border: rgba(255, 123, 133, 0.2);
    --status-info: #6c8cff;
    --status-info-bg: rgba(108, 140, 255, 0.12);
    --status-info-border: rgba(108, 140, 255, 0.2);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.25);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.3);
    --shadow-focus: 0 0 0 3px var(--border-focus);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.03);
    
    /* ===== Spacing Scale ===== */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* ===== Border Radius ===== */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --radius-pill: 999px;
    --radius-full: 50%;
    
    /* ===== Typography Scale — Fluid with clamp() ===== */
    /* Base: 14px @ 320px → 16px @ 1440px */
    --text-xs: clamp(0.65rem, 0.62rem + 0.15vw, 0.75rem);      /* 10.4px → 12px */
    --text-sm: clamp(0.75rem, 0.71rem + 0.2vw, 0.875rem);       /* 12px → 14px */
    --text-base: clamp(0.875rem, 0.83rem + 0.22vw, 1rem);       /* 14px → 16px */
    --text-lg: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);          /* 16px → 18px */
    --text-xl: clamp(1.125rem, 1.04rem + 0.42vw, 1.375rem);     /* 18px → 22px */
    --text-2xl: clamp(1.375rem, 1.25rem + 0.62vw, 1.75rem);     /* 22px → 28px */
    --text-3xl: clamp(1.75rem, 1.55rem + 1vw, 2.25rem);         /* 28px → 36px */
    --text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3.5rem);        /* 36px → 56px */
    
    /* Font weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 1.75;
    
    /* ===== Transitions ===== */
    --transition-fast: 120ms ease;
    --transition-base: 180ms ease;
    --transition-slow: 280ms ease;
    
    /* ===== Z-Index Scale ===== */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
    
    /* ===== Layout ===== */
    --sidebar-width: 256px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --max-width-content: 1340px;
    --max-width-narrow: 720px;
    
    /* ===== Breakpoints (for reference in JS/media queries) ===== */
    --bp-sm: 640px;
    --bp-md: 768px;
    --bp-lg: 1024px;
    --bp-xl: 1280px;
    --bp-2xl: 1536px;
  }
  
  /* ===== Light Mode Override ===== */
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
      --surface-base: #f7f8fc;
      --surface-elevated: #ffffff;
      --surface-card: #f0f2f7;
      --surface-inset: #e8ebf1;
      --surface-hover: #e4e7ee;
      --surface-active: #d8dce5;
      
      --border-subtle: #e0e3ea;
      --border-default: #d0d4dd;
      --border-strong: #b8bcc8;
      
      --text-primary: #181c26;
      --text-secondary: #4a5162;
      --text-muted: #6b7385;
      --text-faint: #8a93a8;
      --text-inverse: #ffffff;
      
      --brand-primary: #4f6dff;
      --brand-primary-hover: #3d58e0;
      --brand-secondary: #7c5cff;
      --brand-tertiary: #2db87c;
      --brand-warn: #d49b1a;
      --brand-danger: #e04a55;
      
      --status-ok-bg: rgba(45, 184, 124, 0.12);
      --status-warn-bg: rgba(212, 155, 26, 0.12);
      --status-bad-bg: rgba(224, 74, 85, 0.12);
      --status-info-bg: rgba(79, 109, 255, 0.12);
      
      --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
      --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
      --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
      --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
      --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.5);
    }
  }
  
  /* Explicit dark mode class (for manual toggle) */
  [data-theme="dark"] {
    --surface-base: #0b0f17;
    --surface-elevated: #0f1420;
    --surface-card: #141a26;
    --surface-inset: #0f1420;
    --surface-hover: #1a2130;
    --surface-active: #1e2a3e;
    
    --border-subtle: #1b2231;
    --border-default: #232c3d;
    --border-strong: #2d3a4f;
    
    --text-primary: #f3f6fc;
    --text-secondary: #b8c5e0;
    --text-muted: #8a9bc0;
    --text-faint: #6d7a95;
    --text-inverse: #0b0f17;
    
    --brand-primary: #6c8cff;
    --brand-primary-hover: #5878eb;
    --brand-secondary: #9a72ff;
    --brand-tertiary: #42d7a0;
    --brand-warn: #ffc75a;
    --brand-danger: #ff7b85;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.25);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.3);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.03);
  }
}

/* ===== Global Accessibility Baseline ===== */
@layer base {
  /* Focus visible — consistent across all dashboards */
  *:focus-visible {
    outline: 3px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }
  
  /* Focus within for composite components */
  *:focus-within {
    /* No default — components handle their own */
  }
  
  /* Reduced motion — respect user preference */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
  
  /* Minimum touch targets — 44×44px per HIG */
  button,
  a,
  [role="button"],
  input:not([type="hidden"]),
  select,
  textarea,
  summary,
  .btn,
  .pill,
  .icon-action,
  .side-link,
  .tab-button,
  .status-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Exception: inline text links don't need 44px height */
  p a,
  li a,
  td a,
  .text-link {
    min-height: auto;
    min-width: auto;
  }
  
  /* RTL logical properties baseline */
  [dir="rtl"] {
    /* Logical property fallbacks for older browsers */
    --inline-start: right;
    --inline-end: left;
  }
  
  [dir="ltr"] {
    --inline-start: left;
    --inline-end: right;
  }
  
  /* Smooth scroll (respects reduced-motion) */
  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }
  
  /* Selection colors */
  ::selection {
    background: var(--brand-primary);
    color: var(--text-inverse);
  }
  
  ::-moz-selection {
    background: var(--brand-primary);
    color: var(--text-inverse);
  }
  
  /* Scrollbar styling (WebKit) */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--surface-inset);
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--border-default);
  }
  
  /* Firefox scrollbar */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) var(--surface-inset);
  }
}

/* ===== Component Classes — Shared across dashboards ===== */
@layer components {
  /* Pill / Badge */
  .pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
  }
  .pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
  }
  .pill-ok {
    background: var(--status-ok-bg);
    color: var(--status-ok);
    border-color: var(--status-ok-border);
  }
  .pill-warn {
    background: var(--status-warn-bg);
    color: var(--status-warn);
    border-color: var(--status-warn-border);
  }
  .pill-bad {
    background: var(--status-bad-bg);
    color: var(--status-bad);
    border-color: var(--status-bad-border);
  }
  .pill-info {
    background: var(--status-info-bg);
    color: var(--status-info);
    border-color: var(--status-info-border);
  }
  
  /* Button */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1.5;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    min-height: 44px;
  }
  .btn:focus-visible {
    outline: 3px solid var(--border-focus);
    outline-offset: 2px;
  }
  .btn:active {
    transform: scale(0.98);
  }
  .btn-primary {
    background: var(--brand-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
  }
  .btn-primary:hover {
    background: var(--brand-primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }
  .btn-secondary {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
  }
  .btn-secondary:hover {
    background: var(--surface-active);
    border-color: var(--border-strong);
  }
  .btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-default);
  }
  .btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
  }
  .btn-danger {
    background: var(--brand-danger);
    color: var(--text-inverse);
  }
  .btn-danger:hover {
    background: #e04a55;
  }
  .btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    min-height: 36px;
  }
  .btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
    min-height: 48px;
  }
  .btn-block {
    width: 100%;
  }
  
  /* Icon Button */
  .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--surface-hover);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
  }
  .icon-btn:hover {
    background: var(--surface-active);
    color: var(--text-primary);
    border-color: var(--border-strong);
  }
  .icon-btn:focus-visible {
    outline: 3px solid var(--border-focus);
    outline-offset: 2px;
  }
  .icon-btn.danger:hover {
    background: var(--status-bad-bg);
    color: var(--status-bad);
    border-color: var(--status-bad-border);
  }
  
  /* Card */
  .card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm), var(--shadow-inset);
    padding: var(--space-6);
  }
  .card:hover {
    border-color: var(--border-default);
  }
  
  /* Table */
  .table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
  }
  .table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
  }
  .table th,
  .table td {
    padding: var(--space-3) var(--space-4);
    text-align: start;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
  }
  .table th {
    background: var(--surface-inset);
    color: var(--text-muted);
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .table tbody tr:hover {
    background: var(--surface-hover);
  }
  .table tbody tr:last-child td {
    border-bottom: none;
  }
  
  /* Stat Card */
  .stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    text-align: center;
  }
  .stat-card::before {
    content: "";
    display: block;
    width: 100%;
    height: 3px;
    background: var(--brand-primary);
    opacity: 0.7;
    margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) var(--space-4);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .stat-card .num {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
  }
  .stat-card .lbl {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-2);
  }
  .stat-card.online::before { background: var(--status-ok); }
  .stat-card.online .num { color: var(--status-ok); }
  .stat-card.pending::before { background: var(--status-warn); }
  .stat-card.pending .num { color: var(--status-warn); }
  .stat-card.problem::before { background: var(--status-bad); }
  .stat-card.problem .num { color: var(--status-bad); }
  .stat-card.revenue::before { background: var(--brand-secondary); }
  .stat-card.revenue .num { color: var(--brand-secondary); font-size: var(--text-2xl); }
  
  /* Sidebar Link */
  .side-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    min-height: 44px;
  }
  .side-link:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: translateX(-2px);
  }
  .side-link.active {
    background: var(--status-info-bg);
    color: var(--status-info);
    border: 1px solid var(--status-info-border);
  }
  .side-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  
  /* Form Elements */
  .field {
    margin-bottom: var(--space-5);
  }
  label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: var(--font-medium);
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--surface-inset);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    min-height: 44px;
  }
  input:hover, select:hover, textarea:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
  }
  input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-focus);
    background: var(--surface-base);
  }
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--brand-primary);
  }
  
  /* Alert/Notice */
  .alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
    border: 1px solid transparent;
  }
  .alert-error {
    background: var(--status-bad-bg);
    border-color: var(--status-bad-border);
    color: var(--status-bad);
  }
  .alert-success {
    background: var(--status-ok-bg);
    border-color: var(--status-ok-border);
    color: var(--status-ok);
  }
  .alert-warning {
    background: var(--status-warn-bg);
    border-color: var(--status-warn-border);
    color: var(--status-warn);
  }
  .alert-info {
    background: var(--status-info-bg);
    border-color: var(--status-info-border);
    color: var(--status-info);
  }
  
  /* Skeleton Loader */
  .skeleton {
    background: linear-gradient(90deg, var(--surface-inset) 25%, var(--surface-hover) 50%, var(--surface-inset) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
  }
  @keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; background: var(--surface-hover); }
  }
  
  /* Empty State */
  .empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-faint);
  }
  .empty-state-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
    opacity: 0.5;
  }
  .empty-state-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
  }
  .empty-state-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
  }
}

/* ===== Utility Classes (use sparingly, prefer semantic tokens) ===== */
@layer utilities {
  /* Text colors */
  .text-primary { color: var(--text-primary) !important; }
  .text-secondary { color: var(--text-secondary) !important; }
  .text-muted { color: var(--text-muted) !important; }
  .text-faint { color: var(--text-faint) !important; }
  .text-inverse { color: var(--text-inverse) !important; }
  .text-ok { color: var(--status-ok) !important; }
  .text-warn { color: var(--status-warn) !important; }
  .text-bad { color: var(--status-bad) !important; }
  .text-info { color: var(--status-info) !important; }
  
  /* Background colors */
  .bg-base { background: var(--surface-base) !important; }
  .bg-elevated { background: var(--surface-elevated) !important; }
  .bg-card { background: var(--surface-card) !important; }
  .bg-inset { background: var(--surface-inset) !important; }
  .bg-hover { background: var(--surface-hover) !important; }
  
  /* Border colors */
  .border-subtle { border-color: var(--border-subtle) !important; }
  .border-default { border-color: var(--border-default) !important; }
  .border-strong { border-color: var(--border-strong) !important; }
  
  /* Spacing */
  .p-1 { padding: var(--space-1) !important; }
  .p-2 { padding: var(--space-2) !important; }
  .p-3 { padding: var(--space-3) !important; }
  .p-4 { padding: var(--space-4) !important; }
  .p-5 { padding: var(--space-5) !important; }
  .p-6 { padding: var(--space-6) !important; }
  .p-8 { padding: var(--space-8) !important; }
  
  .m-1 { margin: var(--space-1) !important; }
  .m-2 { margin: var(--space-2) !important; }
  .m-3 { margin: var(--space-3) !important; }
  .m-4 { margin: var(--space-4) !important; }
  .m-5 { margin: var(--space-5) !important; }
  .m-6 { margin: var(--space-6) !important; }
  .m-8 { margin: var(--space-8) !important; }
  
  .gap-1 { gap: var(--space-1) !important; }
  .gap-2 { gap: var(--space-2) !important; }
  .gap-3 { gap: var(--space-3) !important; }
  .gap-4 { gap: var(--space-4) !important; }
  .gap-5 { gap: var(--space-5) !important; }
  .gap-6 { gap: var(--space-6) !important; }
  
  /* Typography */
  .text-xs { font-size: var(--text-xs) !important; }
  .text-sm { font-size: var(--text-sm) !important; }
  .text-base { font-size: var(--text-base) !important; }
  .text-lg { font-size: var(--text-lg) !important; }
  .text-xl { font-size: var(--text-xl) !important; }
  .text-2xl { font-size: var(--text-2xl) !important; }
  .text-3xl { font-size: var(--text-3xl) !important; }
  .text-4xl { font-size: var(--text-4xl) !important; }
  
  .font-normal { font-weight: var(--font-normal) !important; }
  .font-medium { font-weight: var(--font-medium) !important; }
  .font-semibold { font-weight: var(--font-semibold) !important; }
  .font-bold { font-weight: var(--font-bold) !important; }
  .font-extrabold { font-weight: var(--font-extrabold) !important; }
  
  .leading-tight { line-height: var(--leading-tight) !important; }
  .leading-snug { line-height: var(--leading-snug) !important; }
  .leading-normal { line-height: var(--leading-normal) !important; }
  .leading-relaxed { line-height: var(--leading-relaxed) !important; }
  
  /* Radius */
  .rounded-sm { border-radius: var(--radius-sm) !important; }
  .rounded-md { border-radius: var(--radius-md) !important; }
  .rounded-lg { border-radius: var(--radius-lg) !important; }
  .rounded-xl { border-radius: var(--radius-xl) !important; }
  .rounded-2xl { border-radius: var(--radius-2xl) !important; }
  .rounded-pill { border-radius: var(--radius-pill) !important; }
  .rounded-full { border-radius: var(--radius-full) !important; }
  
  /* Shadows */
  .shadow-sm { box-shadow: var(--shadow-sm) !important; }
  .shadow-md { box-shadow: var(--shadow-md) !important; }
  .shadow-lg { box-shadow: var(--shadow-lg) !important; }
  .shadow-xl { box-shadow: var(--shadow-xl) !important; }
  
  /* Flex/Grid helpers */
  .flex { display: flex !important; }
  .inline-flex { display: inline-flex !important; }
  .grid { display: grid !important; }
  .items-center { align-items: center !important; }
  .items-start { align-items: flex-start !important; }
  .items-end { align-items: flex-end !important; }
  .justify-center { justify-content: center !important; }
  .justify-between { justify-content: space-between !important; }
  .justify-end { justify-content: flex-end !important; }
  .gap-2 { gap: var(--space-2) !important; }
  .gap-3 { gap: var(--space-3) !important; }
  .gap-4 { gap: var(--space-4) !important; }
  
  /* Visibility */
  .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;
  }
  
  .hidden { display: none !important; }
  .invisible { visibility: hidden !important; }
  
  /* Overflow */
  .overflow-auto { overflow: auto !important; }
  .overflow-hidden { overflow: hidden !important; }
  .overflow-x-auto { overflow-x: auto !important; }
  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}