/* ============================================================
   CHARTER — Car Rental SaaS Platform Design System
   Premium, modern UI with glass-morphism and smooth animations
   Inspired by: Linear, Stripe, Vercel
   ============================================================ */

/* ============================================================
   1. CSS VARIABLES — DESIGN TOKENS
   ============================================================ */
:root {
  /* ── Colors: Primary (Violet/Indigo) ── */
  --primary-50: #f5f3ff;
  --primary-100: #ede9fe;
  --primary-200: #ddd6fe;
  --primary-300: #c4b5fd;
  --primary-400: #a78bfa;
  --primary-500: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-700: #6d28d9;
  --primary-800: #5b21b6;
  --primary-900: #4c1d95;
  --primary-950: #2e1065;

  /* ── Colors: Gray ── */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;

  /* ── Colors: Semantic ── */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-200: #bbf7d0;
  --success-300: #86efac;
  --success-400: #4ade80;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --success-800: #166534;
  --success-900: #14532d;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-200: #fde68a;
  --warning-300: #fcd34d;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  --warning-800: #92400e;
  --warning-900: #78350f;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-200: #fecaca;
  --danger-300: #fca5a5;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;
  --danger-800: #991b1b;
  --danger-900: #7f1d1d;

  --info-50: #eff6ff;
  --info-100: #dbeafe;
  --info-200: #bfdbfe;
  --info-300: #93c5fd;
  --info-400: #60a5fa;
  --info-500: #3b82f6;
  --info-600: #2563eb;
  --info-700: #1d4ed8;
  --info-800: #1e40af;
  --info-900: #1e3a8a;

  --white: #ffffff;
  --black: #000000;
  --surface: var(--white);

  /* ── Flat surface tokens (gradients removed from dashboards) ── */
  --gradient-primary: var(--primary-600);
  --gradient-primary-subtle: var(--primary-50);
  --gradient-hero: var(--primary-50);
  --gradient-card: var(--white);

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

  /* ── Box Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 4px 14px rgba(124, 58, 237, 0.25);
  --shadow-success: 0 4px 14px rgba(22, 163, 74, 0.25);
  --shadow-danger: 0 4px 14px rgba(220, 38, 38, 0.25);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);

  /* ── Spacing Scale ── */
  --space-0: 0;
  --space-0_5: 0.125rem;
  --space-1: 0.25rem;
  --space-1_5: 0.375rem;
  --space-2: 0.5rem;
  --space-2_5: 0.625rem;
  --space-3: 0.75rem;
  --space-3_5: 0.875rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ── Typography ── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 0.9375rem;
  --text-lg: 1rem;
  --text-xl: 1.125rem;
  --text-2xl: 1.25rem;
  --text-3xl: 1.5rem;
  --text-4xl: 1.875rem;
  --text-5xl: 2.25rem;
  --text-6xl: 3rem;
  --text-7xl: 3.75rem;

  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  --tracking-tight: -0.02em;
  --tracking-tighter: -0.03em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.08em;

  /* ── Layout ── */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;
  --topbar-height: 64px;
  --content-max: 1200px;
  --content-max-sm: 800px;
  --content-max-lg: 1400px;

  /* ── Z-Index Scale ── */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  /* ── Transitions ── */
  --transition-fast: 0.12s ease;
  --transition-base: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-page: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  /* ── Animation Durations ── */
  --duration-instant: 0.05s;
  --duration-fast: 0.12s;
  --duration-normal: 0.2s;
  --duration-slow: 0.35s;
  --duration-slower: 0.5s;

  /* ── Glass Overlay Colors ── */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-light: rgba(255, 255, 255, 0.5);
  --glass-bg-heavy: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-border-hover: rgba(255, 255, 255, 0.5);
  --glass-blur: 20px;
  --glass-blur-heavy: 30px;

  /* ── Ring/Outline ── */
  --ring-primary: 0 0 0 3px rgba(124, 58, 237, 0.12);
  --ring-danger: 0 0 0 3px rgba(239, 68, 68, 0.12);
  --ring-success: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

[data-theme="dark"] {
  --gray-50: #1a1a2e;
  --gray-100: #16213e;
  --gray-200: #0f3460;
  --gray-300: #334155;
  --gray-400: #64748b;
  --gray-500: #94a3b8;
  --gray-600: #cbd5e1;
  --gray-700: #e2e8f0;
  --gray-800: #f1f5f9;
  --gray-900: #f8fafc;
  --white: #0f172a;
  --primary-50: #1e1b4b;
  --primary-100: #312e81;
  --primary-500: #a78bfa;
  --primary-600: #8b5cf6;
  --primary-700: #7c3aed;
  --gray-950: #ffffff;
  --danger-50: #1f0a0a;
  --danger-100: #2d0b0b;
  --success-50: #0a1f0a;
  --success-100: #0b2d0b;
  --warning-50: #1f1a0a;
  --warning-100: #2d260b;
  --info-50: #0a1a2f;
  --info-100: #0b1e3d;
  background-color: var(--white);
}
.dark,
  --gray-50: #0f1117;
  --gray-100: #1a1d27;
  --gray-200: #262a36;
  --gray-300: #363b4a;
  --gray-400: #565d6f;
  --gray-500: #7b8396;
  --gray-600: #a0a8bc;
  --gray-700: #c5cad6;
  --gray-800: #e1e4eb;
  --gray-900: #f0f2f6;
  --gray-950: #f9fafb;

  --success-50: #052e16;
  --success-100: #14532d;
  --success-500: #22c55e;
  --success-600: #4ade80;
  --success-700: #86efac;

  --warning-50: #451a03;
  --warning-100: #78350f;
  --warning-500: #f59e0b;
  --warning-600: #fbbf24;
  --warning-700: #fcd34d;

  --danger-50: #450a0a;
  --danger-100: #7f1d1d;
  --danger-500: #ef4444;
  --danger-600: #f87171;
  --danger-700: #fca5a5;

  --info-50: #172554;
  --info-100: #1e3a8a;
  --info-500: #3b82f6;
  --info-600: #60a5fa;
  --info-700: #93c5fd;

  --white: #1a1d27;
  --black: #ffffff;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);

  --glass-bg: rgba(26, 29, 39, 0.7);
  --glass-bg-light: rgba(26, 29, 39, 0.5);
  --glass-bg-heavy: rgba(26, 29, 39, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.12);

  --ring-primary: 0 0 0 3px rgba(139, 111, 247, 0.2);
  --ring-danger: 0 0 0 3px rgba(239, 68, 68, 0.2);

  background: var(--gray-50);
  color: var(--gray-900);
}

.dark body,
/* ============================================================
   3. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: var(--leading-normal);
  overflow-x: hidden;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

ul,
ol {
  list-style: none;
}

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

svg,
video,
canvas {
  max-width: 100%;
}

table {
  max-width: 100%;
}

pre,
code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-all;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
}

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

::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */
h1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-snug);
}

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

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

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

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

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

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

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

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

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

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

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

.text-success {
  color: var(--success-600);
}

.text-warning {
  color: var(--warning-600);
}

.text-danger {
  color: var(--danger-600);
}

.text-info {
  color: var(--info-600);
}

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

.text-left {
  text-align: left;
}

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

.text-nowrap {
  white-space: nowrap;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

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

/* ============================================================
   5. PAGE TRANSITIONS
   ============================================================ */
.page-transition {
  animation: pageFadeIn var(--transition-page) both;
}

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

/* ============================================================
   6. LAYOUT
   ============================================================ */
.page,
.page-sm,
.page-lg,
.page-full {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-inline: 0;
}

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

.page-full {
  padding: var(--space-8);
  overflow: hidden;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-8);
}

.page-header:has(> div:first-child + *) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-4);
  row-gap: var(--space-3);
}

.page-header:has(> div:first-child + *) > :first-child {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
  min-width: 0;
}

.page-header:has(> div:first-child + *) > :not(:first-child) {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  margin-left: 0;
}

.page-header > :is(div, h1, h2):first-child:not(.page-header-actions):not(.page-actions) {
  flex: 1 1 auto;
  min-width: 0;
}

.page-header > h1 + p,
.page-header > h2 + p {
  flex: 1 1 100%;
  margin-top: calc(var(--space-1) * -1);
}

.page-header > :is(.btn, button, a.btn, .page-header-actions, .page-actions) {
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
}

.page-header > div:not(:first-child):has(:is(.btn, button, a.btn)) {
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.page-header-actions,
.page-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}

.page-header:has(> h1):has(> p):has(> :is(button, .btn, a.btn, .page-header-actions, .page-actions)) {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title actions"
    "subtitle actions";
  align-items: center;
}

.page-header:has(> h1):has(> p):has(> :is(button, .btn, a.btn, .page-header-actions, .page-actions)) > h1 {
  grid-area: title;
  margin-bottom: var(--space-1);
}

.page-header:has(> h1):has(> p):has(> :is(button, .btn, a.btn, .page-header-actions, .page-actions)) > p {
  grid-area: subtitle;
  margin-top: 0;
}

.page-header:has(> h1):has(> p):has(> :is(button, .btn, a.btn, .page-header-actions, .page-actions)) > :is(button, .btn, a.btn, .page-header-actions, .page-actions) {
  grid-area: actions;
  margin-left: 0;
  align-self: center;
}

.page-header:has(> a.btn-ghost:first-child, > .btn-ghost.btn-sm:first-child):not(:has(> .page-header-actions, > .page-actions)) {
  display: block;
}

.page-header:has(> a.btn-ghost:first-child, > .btn-ghost.btn-sm:first-child):not(:has(> .page-header-actions, > .page-actions)) > :is(a.btn, .btn) {
  margin-left: 0;
  display: inline-flex;
  margin-bottom: var(--space-2);
}

.page-header > :only-child {
  flex: 1 1 100%;
  width: 100%;
}

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

.page-header p {
  color: var(--gray-500);
  font-size: var(--text-base);
}

/* Flex utilities */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

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

.flex-wrap {
  flex-wrap: wrap;
}

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

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

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

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

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

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

.gap-0_5 {
  gap: var(--space-0_5);
}

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

.gap-1_5 {
  gap: var(--space-1_5);
}

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

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

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

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

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

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

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

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

.flex-1 {
  flex: 1;
}

.shrink-0 {
  flex-shrink: 0;
}

.min-w-0 {
  min-width: 0;
}

/* Grid */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

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

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

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

.grid-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

.grid-cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

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

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

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

.grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1024px) {
  .grid-3,
  .grid-4,
  .grid-5,
  .grid-6,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-5,
  .grid-cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5,
  .grid-6,
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-5,
  .grid-cols-6 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   7. SPACING
   ============================================================ */
.mt-0_5 {
  margin-top: var(--space-0_5);
}
.mt-1 {
  margin-top: var(--space-1);
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-3 {
  margin-top: var(--space-3);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-5 {
  margin-top: var(--space-5);
}
.mt-6 {
  margin-top: var(--space-6);
}
.mt-8 {
  margin-top: var(--space-8);
}
.mt-10 {
  margin-top: var(--space-10);
}
.mt-12 {
  margin-top: var(--space-12);
}
.mt-16 {
  margin-top: var(--space-16);
}

.mb-1 {
  margin-bottom: var(--space-1);
}
.mb-2 {
  margin-bottom: var(--space-2);
}
.mb-3 {
  margin-bottom: var(--space-3);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-6 {
  margin-bottom: var(--space-6);
}
.mb-8 {
  margin-bottom: var(--space-8);
}

.ml-1 {
  margin-left: var(--space-1);
}
.ml-2 {
  margin-left: var(--space-2);
}
.ml-3 {
  margin-left: var(--space-3);
}
.ml-auto {
  margin-left: auto;
}

.mr-1 {
  margin-right: var(--space-1);
}
.mr-2 {
  margin-right: var(--space-2);
}
.mr-3 {
  margin-right: var(--space-3);
}
.mr-auto {
  margin-right: auto;
}

.p-0 {
  padding: 0;
}
.p-1 {
  padding: var(--space-1);
}
.p-2 {
  padding: var(--space-2);
}
.p-3 {
  padding: var(--space-3);
}
.p-4 {
  padding: var(--space-4);
}
.p-6 {
  padding: var(--space-6);
}
.p-8 {
  padding: var(--space-8);
}

.py-0_5 {
  padding-top: var(--space-0_5);
  padding-bottom: var(--space-0_5);
}
.py-1 {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}
.py-2 {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.py-3 {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}
.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}
.py-6 {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.px-1 {
  padding-left: var(--space-1);
  padding-right: var(--space-1);
}
.px-2 {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.px-3 {
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}
.px-5 {
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}
.px-6 {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* ============================================================
   8. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2_5) var(--space-5);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.btn:hover {
  transform: scale(1.02);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn:disabled:hover {
  transform: none;
}

.btn:disabled::after {
  display: none;
}

.btn-sm {
  padding: var(--space-1_5) var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
  box-shadow: var(--shadow-primary);
}

.btn-primary:active {
  background: var(--primary-800);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
}

.btn-outline {
  background: transparent;
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  transform: scale(1.02);
}

.btn-outline.text-danger {
  color: var(--danger-600);
  border-color: var(--danger-200);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}

.btn-ghost:hover {
  background: var(--gray-100);
}

.btn-cancel {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  line-height: 1.4;
  text-align: center;
  justify-content: center;
}
.btn-cancel:hover {
  background: var(--gray-200);
  color: var(--gray-800);
  border-color: var(--gray-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-cancel:active {
  background: var(--gray-300);
  transform: translateY(0);
  box-shadow: none;
}

.btn-cancel.modal-close {
  width: auto;
  height: auto;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}
.btn-cancel:hover {
  background: var(--gray-50);
  color: var(--gray-800);
  border-color: var(--gray-300);
}
.btn-cancel:active {
  background: var(--gray-100);
}

  background: var(--danger-100);
  border-color: var(--danger-300);
  color: var(--danger-700);
}

/* Cancel buttons that are modal-close should not be tiny squares */
.btn-cancel.modal-close {
  width: auto;
  height: auto;
  font-size: 0.875rem;
}

.btn-success {
  background: var(--success-600);
  color: white;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.2);
}

.btn-success:hover {
  background: var(--success-700);
  box-shadow: var(--shadow-success);
}

.btn-danger {
  background: var(--danger-600);
  color: white;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
  background: var(--danger-700);
  box-shadow: var(--shadow-danger);
}

.btn-warning {
  background: var(--warning-600);
  color: white;
}

.btn-warning:hover {
  background: var(--warning-700);
}

.btn-white {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-200);
  box-shadow: var(--shadow-xs);
}

.btn-white:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-link {
  background: none;
  color: var(--primary-600);
  padding: 0;
  border: none;
  border-radius: 0;
  transform: none;
}

.btn-link:hover {
  text-decoration: underline;
  transform: none;
}

.btn-link::after {
  display: none;
}

.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon.btn-sm {
  width: 1.75rem;
  height: 1.75rem;
}

.btn-icon.btn-lg {
  width: 2.75rem;
  height: 2.75rem;
}

/* ============================================================
   9. BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1_5);
  padding: 0.125rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all var(--transition-base);
}

.badge-sm {
  padding: 0.0625rem 0.375rem;
  font-size: 0.6875rem;
}

.badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  display: inline-block;
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge-primary .badge-dot {
  background: var(--primary-500);
}

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

.badge-success .badge-dot {
  background: var(--success-500);
}

.badge-warning {
  background: var(--warning-100);
  color: var(--warning-700);
}

.badge-warning .badge-dot {
  background: var(--warning-500);
}

.badge-danger {
  background: var(--danger-100);
  color: var(--danger-700);
}

.badge-danger .badge-dot {
  background: var(--danger-500);
}

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

.badge-info .badge-dot {
  background: var(--info-500);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-700);
}

.badge-gray .badge-dot {
  background: var(--gray-400);
}

.badge-white {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

/* ============================================================
   10. CARDS
   ============================================================ */
.card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
}

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

.card-header {
  padding: var(--space-5) var(--space-6) 0 var(--space-6);
}

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

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.card-actions {
  display: flex;
  gap: var(--space-2);
}

/* ── Glass Cards ── */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

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

/* ── Stat Cards ── */
.stat-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}

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

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-1);
}

.stat-card .stat-value {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

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

.stat-card .stat-change.positive {
  color: var(--success-600);
}

.stat-card .stat-change.negative {
  color: var(--danger-600);
}

.stat-card .stat-change.neutral {
  color: var(--gray-500);
}

.stat-card .stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  transition: transform var(--transition-base);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1);
}

.stat-card .stat-icon.primary {
  background: var(--primary-100);
  color: var(--primary-600);
}

.stat-card .stat-icon.success {
  background: var(--success-100);
  color: var(--success-600);
}

.stat-card .stat-icon.warning {
  background: var(--warning-100);
  color: var(--warning-600);
}

.stat-card .stat-icon.danger {
  background: var(--danger-100);
  color: var(--danger-600);
}

.stat-card .stat-icon.info {
  background: var(--info-100);
  color: var(--info-600);
}

/* ============================================================
   11. FORMS
   ============================================================ */
.form-section {
  margin-bottom: var(--space-8);
}

.form-section-title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

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

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

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

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

.form-label {
  display: block;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--space-1_5);
}

.form-label .required {
  color: var(--danger-500);
  margin-left: 0.125rem;
}

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

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  max-width: 100%;
  padding: var(--space-2_5) var(--space-3);
  font-size: var(--text-base);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-900);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--gray-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: var(--ring-primary);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger-500);
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: var(--ring-danger);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: not-allowed;
}

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

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

.form-checkbox,
.form-radio {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.form-switch {
  position: relative;
  width: 2.5rem;
  height: 1.5rem;
  display: inline-block;
}

.form-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

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

.form-switch .slider::before {
  content: '';
  position: absolute;
  width: 1.125rem;
  height: 1.125rem;
  left: 0.1875rem;
  bottom: 0.1875rem;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.form-switch input:checked+.slider {
  background: var(--primary-600);
}

.form-switch input:checked+.slider::before {
  transform: translateX(1rem);
}

.input-group {
  display: flex;
}

.input-group .form-input:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .input-addon {
  display: flex;
  align-items: center;
  padding: var(--space-2_5) var(--space-3);
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  color: var(--gray-500);
  font-size: var(--text-base);
}

.input-group .input-addon:last-child {
  border-left: 0;
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.input-group .input-addon:first-child {
  border-right: 0;
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.input-group .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* ── Search Input ── */
.search-input-wrapper {
  position: relative;
}

.search-input-wrapper i,
.search-input-wrapper .search-icon {
  position: absolute;
  left: var(--space-3_5);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: var(--text-base);
  pointer-events: none;
  transition: color var(--transition-base);
}

.search-input-wrapper input {
  padding: var(--space-2_5) var(--space-3_5) var(--space-2_5) var(--space-10);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  background: var(--gray-50);
  min-width: 280px;
  width: 100%;
  transition: all var(--transition-base);
  color: var(--gray-900);
}

.search-input-wrapper input:hover {
  border-color: var(--gray-300);
  background: white;
}

.search-input-wrapper input:focus {
  outline: none;
  background: white;
  border-color: var(--primary-500);
  box-shadow: var(--ring-primary);
  min-width: 320px;
}

.search-input-wrapper input:focus~i,
.search-input-wrapper input:focus~.search-icon,
.search-input-wrapper input:focus+.search-icon {
  color: var(--primary-500);
}

.search-input-wrapper input::placeholder {
  color: var(--gray-400);
}

.search-input-wrapper .search-clear {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.search-input-wrapper .search-clear:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.filter-bar .filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-bar .filter-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  white-space: nowrap;
}

.filter-bar .filter-spacer {
  flex: 1;
  min-width: var(--space-4);
}

/* ── Compact filter controls in table filter bars ── */
.filter-bar .form-select,
.filter-bar .filter-select,
.filter-bar .table-filter {
  width: auto;
  min-width: 120px;
  flex-shrink: 1;
}
.filter-bar .search-input-wrapper input {
  min-width: 180px;
}
.filter-bar .search-input-wrapper input:focus {
  min-width: 220px;
}

/* ============================================================
   12. TABLES
   ============================================================ */
.table-container {
  border-radius: var(--radius-xl);
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.data-table {
  table-layout: fixed;
  width: 100%;
}

table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

table thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 500;
  color: var(--gray-500);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  background: var(--gray-50);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-200);
}

table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}

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

table tbody tr:hover td {
  background: var(--primary-50);
}

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

table .table-actions {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.table-toolbar .left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.table-toolbar .right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ── Beautiful modern page button ── */
.page-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.375rem;
  gap: 0.25rem;
  position: relative;
  user-select: none;
  line-height: 1;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: var(--gray-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
  box-shadow: var(--shadow-sm);
}

.page-btn:active:not(:disabled):not(.active) {
  box-shadow: none;
}

.page-btn.active {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
  font-weight: 600;
}

.page-btn.active:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

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

/* Icon buttons (prev/next) */
.page-btn:first-child,
.page-btn:last-child {
  font-size: 0.6875rem;
  min-width: 2rem;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-buttons .ellipsis {
  min-width: 1.75rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--gray-400);
  letter-spacing: 2px;
  user-select: none;
}

.pagination-per-page {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.pagination-per-page select {
  padding: 0.3125rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color var(--transition-base);
  appearance: auto;
}

.pagination-per-page select:hover {
  border-color: var(--gray-300);
}

.pagination-per-page select:focus {
  outline: none;
  border-color: var(--primary-500);
}

/* ── Pagination wrapper for JS-generated controls ── */
.pagination-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ── Icon sizing inside page buttons ── */
.page-btn .fas,
.page-btn .far,
.page-btn .fab {
  font-size: 0.75rem;
}

/* Legacy pagination classes — kept for backwards compat */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--gray-100);
  font-size: var(--text-sm);
  color: var(--gray-500);
}
  cursor: pointer;
}

.table-pagination .page-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.table-pagination .page-btn.active {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.table-pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   13. SIDEBAR LAYOUT (DASHBOARD)
   ============================================================ */
.dashboard-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
  max-width: 100vw;
}

.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--transition-base), transform var(--transition-base);
}

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

.sidebar-brand .brand-icon {
  width: 2rem;
  height: 2rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-lg);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.sidebar-brand .brand-text {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
}

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

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

.sidebar-nav .nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  padding: var(--space-2) var(--space-3);
  white-space: nowrap;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--gray-600);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.sidebar-nav .nav-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
  transform: translateX(2px);
}

.sidebar-nav .nav-item.active {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 500;
}

.sidebar-nav .nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--primary-600);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav .nav-item .nav-icon {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  font-size: var(--text-lg);
  transition: transform var(--transition-base);
}

.sidebar-nav .nav-item:hover .nav-icon {
  transform: scale(1.1);
}

.sidebar-nav .nav-item .nav-badge {
  margin-left: auto;
}

.sidebar-nav .nav-item .nav-chevron {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--gray-400);
  transition: transform var(--transition-base);
}

.sidebar-nav .nav-item.open .nav-chevron {
  transform: rotate(90deg);
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--gray-100);
}

/* ── Sidebar Overlay (Mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 90;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.open {
  display: block;
  animation: overlayIn var(--transition-base) both;
}

/* Main Content Area */
.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100vw;
  transition: margin-left var(--transition-base);
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
  overflow: hidden;
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 38px;
  padding: 0 var(--space-3) 0 var(--space-9);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--gray-400);
  transition: all var(--transition-base);
  position: relative;
  white-space: nowrap;
}

.topbar-search:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.topbar-search .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: var(--text-base);
  pointer-events: none;
}

[data-theme="dark"] .topbar-search { background: var(--white); color: var(--gray-600); border-color: var(--gray-300); }
[data-theme="dark"] .topbar-search:hover { background: var(--gray-100); }

.mobile-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  color: var(--gray-600);
  cursor: pointer;
  font-size: 1.125rem;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.mobile-hamburger:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

[data-theme="dark"] .mobile-hamburger {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

[data-theme="dark"] .mobile-hamburger:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}
[data-theme="dark"] .search-input-wrapper input { background: var(--white); color: var(--gray-800); border-color: var(--gray-300); }
[data-theme="dark"] .search-input-wrapper input:focus { background: var(--white); }
[data-theme="dark"] .search-input-wrapper input::placeholder { color: var(--gray-400); }

/* ============================================================
   33. FORM RESPONSIVE FIXES
   ============================================================ */
@media (max-width: 768px) {
  .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, 1fr) ; }
  .filter-bar .form-select { width: 100% ; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr ; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-select,
  .filter-bar .form-input { width: 100% ; }
  .search-input-wrapper { width: 100%; }
  .search-input-wrapper input { width: 100%; min-width: 0; }
  form[style*="grid"], div[style*="grid-template"] { grid-template-columns: 1fr ; }
}

.search-shortcut {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xs);
  background: var(--gray-100);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--gray-500);
  white-space: nowrap;
}

/* Topbar notification */
.topbar-notif {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--gray-500);
  cursor: pointer;
  font-size: var(--text-xl);
  transition: all var(--transition-base);
}

.topbar-notif:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.topbar-notif .notif-dot {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--danger-500);
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}


.topbar-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}

.topbar-avatar:hover {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.theme-toggle {
  width: 2.25rem; height: 2.25rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); color: var(--gray-400);
  cursor: pointer; transition: all 0.15s ease;
  background: transparent; border: none; font-size: 1rem;
  order: 2;
}
.theme-toggle:hover { background: var(--gray-100); color: var(--gray-600); }

[data-theme="dark"] {
  color-scheme: dark;
}
[data-theme="dark"] body { background: var(--gray-50); }
[data-theme="dark"] .sidebar,
[data-theme="dark"] .topbar,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-overlay .modal,
[data-theme="dark"] .cal-wrapper,
[data-theme="dark"] .cal-drawer,
[data-theme="dark"] .date-picker-dropdown,
[data-theme="dark"] .time-picker-dropdown,
[data-theme="dark"] .notif-panel,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .cal-cell,
[data-theme="dark"] .table-container,
[data-theme="dark"] .btn-cancel,
[data-theme="dark"] .page-btn,
[data-theme="dark"] .search-input-wrapper input,
[data-theme="dark"] .upload-area { background: var(--white); }
[data-theme="dark"] .main-content { background: var(--gray-50); }
[data-theme="dark"] .cal-cell.outside { background: #111827; }
[data-theme="dark"] .cal-cell.today { background: #064e3b; }
[data-theme="dark"] .cal-cell.today .cal-day-num { background: var(--primary-600); color: #fff; }
[data-theme="dark"] .cal-cell.available { background: #052e16; }
[data-theme="dark"] .cal-cell.available .cal-day-num { color: #4ade80; }
[data-theme="dark"] .cal-cell.available:hover { background: #064e3b; }
[data-theme="dark"] .cal-cell:hover { background: var(--gray-100); }
[data-theme="dark"] table th { background: var(--gray-50); }
[data-theme="dark"] table td { color: var(--gray-600); border-bottom-color: var(--gray-200); }
[data-theme="dark"] table tr:hover td { background: var(--gray-100); }
[data-theme="dark"] .sidebar-brand { border-bottom-color: var(--gray-200); }
[data-theme="dark"] .sidebar { border-right-color: var(--gray-200); }
[data-theme="dark"] .sidebar-nav .nav-item { color: var(--gray-500); }
[data-theme="dark"] .sidebar-nav .nav-item:hover { background: var(--gray-100); color: var(--gray-700); }
[data-theme="dark"] .sidebar-nav .nav-item.active { background: var(--primary-100); color: var(--primary-500); }
[data-theme="dark"] .sidebar-nav .nav-section-title { color: var(--gray-400); }
[data-theme="dark"] .topbar { border-bottom-color: var(--gray-200); }
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea { border-color: var(--gray-300); color: var(--gray-800); background: var(--white); }
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus { border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
[data-theme="dark"] .date-picker-input { background: var(--white); color: var(--gray-800); border-color: var(--gray-300); }
[data-theme="dark"] .time-picker-input { background: var(--white); color: var(--gray-800); border-color: var(--gray-300); }
[data-theme="dark"] .form-label { color: var(--gray-600); }
[data-theme="dark"] .page-btn { color: var(--gray-600); border-color: var(--gray-300); }
[data-theme="dark"] .page-btn:hover { background: var(--gray-100); }
[data-theme="dark"] .page-btn.active { background: var(--primary-600); color: #fff; }
[data-theme="dark"] .badge-gray { background: var(--gray-100); color: var(--gray-600); }
[data-theme="dark"] .badge-white { background: var(--white); color: var(--gray-600); border-color: var(--gray-300); }
[data-theme="dark"] .dropdown-item { color: var(--gray-600); }
[data-theme="dark"] .dropdown-item:hover { background: var(--gray-100); }
[data-theme="dark"] .dropdown-divider { background: var(--gray-200); }
[data-theme="dark"] .modal-header { border-bottom-color: var(--gray-200); }
[data-theme="dark"] .modal-footer { border-top-color: var(--gray-200); }
[data-theme="dark"] .chart-container { background: transparent; }
[data-theme="dark"] .pagination { border-top-color: var(--gray-200); }
[data-theme="dark"] .pagination-info { color: var(--gray-500); }
[data-theme="dark"] .pagination-per-page { color: var(--gray-500); }
[data-theme="dark"] .pagination-per-page select { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); }
[data-theme="dark"] .filter-bar { background: var(--gray-50); border-bottom-color: var(--gray-200); }
[data-theme="dark"] .notif-item { border-bottom-color: var(--gray-200); }
[data-theme="dark"] .notif-item:hover { background: var(--gray-100); }
[data-theme="dark"] .cal-cell { border-color: var(--gray-200); }
[data-theme="dark"] .cal-day-headers,
[data-theme="dark"] .cal-controls,
[data-theme="dark"] .cal-legend { border-color: var(--gray-200); }
[data-theme="dark"] .cal-nav-btn,
[data-theme="dark"] .cal-today-btn { background: var(--white); border-color: var(--gray-300); color: var(--gray-500); }
[data-theme="dark"] .spec-item { background: var(--gray-100); }
[data-theme="dark"] .spec-item .spec-icon { background: var(--white); }
[data-theme="dark"] .timeline::before { background: var(--gray-300); }
[data-theme="dark"] .pricing-card { background: var(--white); border-color: var(--gray-300); }
[data-theme="dark"] .pricing-card.featured { border-color: var(--primary-500); }
[data-theme="dark"] .pricing-card .pricing-name { color: var(--gray-800); }
[data-theme="dark"] .pricing-card .pricing-desc { color: var(--gray-500); }
[data-theme="dark"] .pricing-card .pricing-period { color: var(--gray-500); }
[data-theme="dark"] .pricing-card .pricing-features li { color: var(--gray-600); }
[data-theme="dark"] .addon-card { background: var(--white); border-color: var(--gray-300); }
[data-theme="dark"] .addon-card:hover { border-color: var(--primary-300); }
[data-theme="dark"] .addon-card.selected { background: var(--primary-100); border-color: var(--primary-500); }
[data-theme="dark"] .addon-card .addon-icon { background: var(--gray-100); }
[data-theme="dark"] .addon-card .addon-desc { color: var(--gray-500); }

.topbar-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.main-content {
  flex: 1;
  padding: var(--space-8);
  background: var(--gray-50);
}

/* Skip-to-content (Accessibility) */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  padding: var(--space-3) var(--space-6);
  background: var(--primary-600);
  color: white;
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) 0;
  transition: top var(--transition-base);
}

.skip-to-content:focus {
  top: 0;
}

/* ============================================================
   14. LANDING PAGE
   ============================================================ */
.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: all var(--transition-base);
  overflow: hidden;
}

.landing-header.scrolled {
  box-shadow: var(--shadow-md);
}

.landing-header .header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-header .logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.landing-header .logo-icon {
  width: 2rem;
  height: 2rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-lg);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.landing-header .logo-text {
  font-size: var(--text-xl);
  font-weight: 700;
}

.landing-header .nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.landing-header .nav-links a {
  font-size: var(--text-base);
  color: var(--gray-600);
  transition: color var(--transition-base);
  padding: var(--space-1) 0;
  position: relative;
}

.landing-header .nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-600);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.landing-header .nav-links a:hover {
  color: var(--primary-600);
}

.landing-header .nav-links a:hover::after {
  transform: scaleX(1);
}

.hero {
  padding: 8rem var(--space-8) var(--space-16);
  max-width: var(--content-max);
  margin: 0 auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero h1 {
  font-size: var(--text-7xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tighter);
  line-height: 1.1;
  margin-bottom: var(--space-4);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.hero h1 span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: var(--text-xl);
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
  position: relative;
}

.hero .hero-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.search-bar {
  max-width: 900px;
  margin: -2rem auto var(--space-12);
  position: relative;
  z-index: 10;
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-2xl);
  padding: var(--space-6);
}

.search-bar .search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: var(--space-3);
  align-items: end;
}

.search-bar .search-btn {
  height: 42px;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) var(--space-8);
  max-width: var(--content-max);
  margin: 0 auto;
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title h2 {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-3);
}

.section-title p {
  color: var(--gray-500);
  max-width: 550px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.feature-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  padding: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}

.feature-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: var(--primary-200);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card .feature-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--space-4);
  background: var(--primary-50);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-size: var(--text-3xl);
  transition: transform var(--transition-base);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(-5deg);
}

.feature-card h3 {
  margin-bottom: var(--space-2);
}

.feature-card p {
  color: var(--gray-500);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.vehicle-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition-base);
}

.vehicle-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.vehicle-card .vehicle-image {
  height: 200px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.vehicle-card .vehicle-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.vehicle-card:hover .vehicle-image img {
  transform: scale(1.05);
}

.vehicle-card .vehicle-image .vehicle-status {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}

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

.vehicle-card .vehicle-name {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.vehicle-card .vehicle-category {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-3);
}

.vehicle-card .vehicle-specs {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-3);
}

.vehicle-card .vehicle-specs span {
  display: flex;
  align-items: center;
  gap: var(--space-1_5);
}

.vehicle-card .vehicle-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.vehicle-card .vehicle-price .price {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.vehicle-card .vehicle-price .price span {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--gray-500);
}

.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-16) var(--space-8) var(--space-8);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.footer-brand .logo-text {
  color: white;
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.footer-brand p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  max-width: 300px;
}

.footer-col h4 {
  color: white;
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--gray-400);
  margin-bottom: var(--space-2);
  transition: color var(--transition-base);
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--gray-500);
}

/* ============================================================
   15. LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  overflow: hidden;
  position: relative;
}

.login-page__theme-toggle {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
}

.login-page__theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.login-left {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: white;
}

.login-right {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: white;
  position: relative;
  overflow: hidden;
}

.login-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
}

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

.login-form .logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.login-form .logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-2xl);
  box-shadow: var(--shadow-primary);
}

.login-form .logo-text {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.login-form h1 {
  margin-bottom: var(--space-2);
}

.login-form>p {
  color: var(--gray-500);
  margin-bottom: var(--space-8);
}

.demo-credentials {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.demo-credentials h4 {
  font-size: var(--text-sm);
  color: var(--primary-700);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.demo-credentials table {
  width: 100%;
  font-size: var(--text-xs);
}

.demo-credentials th,
.demo-credentials td {
  padding: var(--space-1_5) var(--space-2);
  border-bottom: 1px solid var(--primary-100);
  background: transparent;
}

.demo-credentials th {
  color: var(--primary-600);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.demo-credentials td {
  color: var(--primary-800);
}

.demo-credentials .role-badge {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  font-weight: 600;
  background: var(--primary-200);
  color: var(--primary-800);
}

.demo-credentials .click-login {
  cursor: pointer;
  color: var(--primary-600);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.demo-credentials .click-login:hover {
  color: var(--primary-800);
  text-decoration: underline;
}

.login-right-content {
  text-align: center;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.login-right-content .ill-icon {
  font-size: 4rem;
  margin-bottom: var(--space-6);
  opacity: 0.8;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.login-right-content h2 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
}

.login-right-content p {
  opacity: 0.8;
  line-height: var(--leading-relaxed);
}

[data-theme="dark"] .login-left,
.dark .login-left {
  background: var(--gray-100);
}

[data-theme="dark"] .login-form h1,
.dark .login-form h1 {
  color: var(--gray-900);
}

@media (max-width: 1024px) {
  .login-page__theme-toggle {
    color: var(--gray-500);
    background: var(--gray-100);
  }

  .login-page__theme-toggle:hover {
    background: var(--gray-200);
    color: var(--gray-700);
  }
}

/* ============================================================
   16. BOOKING WIZARD
   ============================================================ */
.wizard {
  max-width: 800px;
  margin: 0 auto;
}

.wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-8);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-sm);
}

.wizard-step {
  flex: 1;
  padding: var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--gray-400);
  position: relative;
  border-right: 1px solid var(--gray-100);
  transition: all var(--transition-base);
}

.wizard-step:last-child {
  border-right: none;
}

.wizard-step .step-number {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-500);
  margin-bottom: var(--space-1_5);
  transition: all var(--transition-base);
}

.wizard-step.active {
  color: var(--primary-600);
  font-weight: 500;
  background: var(--primary-50);
}

.wizard-step.active .step-number {
  background: var(--primary-600);
  color: white;
  box-shadow: var(--shadow-primary);
}

.wizard-step.completed {
  color: var(--success-600);
}

.wizard-step.completed .step-number {
  background: var(--success-600);
  color: white;
}

.wizard-step .step-label {
  display: block;
}

/* ============================================================
   17. TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: var(--space-6);
  gap: 0;
  overflow-x: auto;
  position: relative;
}

.tabs::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--primary-600);
  border-radius: 1px;
  transition: left var(--transition-slow), width var(--transition-slow);
}

.tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  position: relative;
  z-index: 1;
}

.tab:hover {
  color: var(--gray-700);
  background: var(--gray-50);
}

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

.tab-content {
  display: none;
  animation: tabFadeIn var(--transition-slow) both;
}

.tab-content.active {
  display: block;
}

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

/* ============================================================
   18. DETAIL HEADER
   ============================================================ */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.detail-header .detail-info h1 {
  margin-bottom: var(--space-1);
}

.detail-header .detail-info p {
  color: var(--gray-500);
  font-size: var(--text-base);
}

.detail-header .detail-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ============================================================
   19. TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: calc(1rem - 1px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-6);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item .timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  z-index: 1;
  background: white;
  border: 2px solid var(--primary-500);
  transition: all var(--transition-base);
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.timeline-item .timeline-dot.success {
  border-color: var(--success-500);
  background: var(--success-100);
}

.timeline-item:hover .timeline-dot.success {
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.timeline-item .timeline-dot.warning {
  border-color: var(--warning-500);
  background: var(--warning-100);
}

.timeline-item .timeline-dot.danger {
  border-color: var(--danger-500);
  background: var(--danger-100);
}

.timeline-item .timeline-dot.gray {
  border-color: var(--gray-400);
  background: var(--gray-100);
}

.timeline-item .timeline-time {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-bottom: 0.125rem;
}

.timeline-item .timeline-title {
  font-size: var(--text-base);
  font-weight: 500;
}

.timeline-item .timeline-desc {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

/* ============================================================
   20. KANBAN
   ============================================================ */
.kanban-board {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-4);
}

.kanban-column {
  min-width: 300px;
  max-width: 360px;
  flex-shrink: 0;
}

.kanban-column .column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  padding: 0 var(--space-2);
}

.kanban-column .column-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.kanban-column .column-count {
  font-size: var(--text-xs);
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 0.125rem var(--space-2);
  border-radius: var(--radius-full);
}

.kanban-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-base);
}

.kanban-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--gray-300);
  transform: translateY(-2px);
}

.kanban-card .card-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.kanban-card .card-sub {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.kanban-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
}

.kanban-card .card-meta .card-assignee {
  display: flex;
  align-items: center;
  gap: var(--space-1_5);
}

/* ============================================================
   21. MODALS
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-overlay.open {
  display: flex;
  animation: overlayIn var(--duration-normal) ease both;
}

.modal {
  background: white;
  border-radius: var(--radius-2xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
}

.modal.open {
  animation: modalIn var(--transition-slow) both;
}

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

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

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-100);
}

.modal-header h3 {
  font-size: var(--text-xl);
}

.modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--gray-400);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--gray-50);
  color: var(--gray-600);
  border-color: var(--gray-300);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-100);
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

/* ============================================================
   22. CONFIRMATION DIALOG
   ============================================================ */
.confirm-message {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2);
}

.confirm-warning {
  background: var(--warning-50);
  border: 1px solid var(--warning-100);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--warning-700);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

/* ============================================================
   23. DROPDOWNS
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  min-width: 200px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  padding: var(--space-1_5);
  transform-origin: top right;
}

.dropdown-menu.open {
  display: block;
  animation: dropdownIn var(--transition-base) both;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2_5);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--gray-50);
}

.dropdown-item.danger {
  color: var(--danger-600);
}

.dropdown-item.danger:hover {
  background: var(--danger-50);
}

.dropdown-divider {
  height: 1px;
  background: var(--gray-100);
  margin: var(--space-1) var(--space-2);
}

.dropdown-header {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdownInUp {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dropdown flip — open upward when near viewport bottom */
.dropdown-menu.open-up {
  top: auto !important;
  bottom: calc(100% + var(--space-1));
  transform-origin: bottom right;
  animation: dropdownInUp var(--transition-base) both;
}

/* Combobox dropdown — absolute positioned below input by default, flips above */
.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  margin-top: 0.25rem;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-gray-200, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 240px;
  overflow-y: auto;
  animation: dropdownIn var(--transition-base) both;
}

.combobox-dropdown.open-up {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 0.25rem;
  transform-origin: bottom center;
  animation: dropdownInUp var(--transition-base) both;
}

.combobox-empty {
  padding: 0.75rem 1rem;
  color: var(--gray-400, #9ca3af);
  font-size: 0.8125rem;
  text-align: center;
}

.combobox-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--color-text, #111827);
  transition: background 0.15s;
}

.combobox-option:hover,
.combobox-option.highlighted {
  background: var(--color-gray-50, #f9fafb);
}

.combobox-option.selected {
  font-weight: 600;
  color: var(--color-primary, #2563eb);
}

.combobox-option-label {
  flex: 1;
}

.combobox-option-sublabel {
  margin-left: 0.5rem;
  color: var(--gray-400, #9ca3af);
  font-size: 0.75rem;
}

/* Dark mode combobox */
[data-theme="dark"] .combobox-dropdown {
  background: var(--color-card, #1f2937);
  border-color: var(--color-gray-700, #374151);
}

[data-theme="dark"] .combobox-option:hover,
[data-theme="dark"] .combobox-option.highlighted {
  background: var(--color-gray-800, #1f2937);
}

[data-theme="dark"] .combobox-option.selected {
  color: var(--color-primary-400, #60a5fa);
}

[data-theme="dark"] .combobox-empty {
  color: var(--gray-500, #6b7280);
}

/* ============================================================
   24. ALERTS
   ============================================================ */
.alert {
  padding: var(--space-3_5) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.alert i {
  font-size: var(--text-lg);
  margin-top: 0.0625rem;
  flex-shrink: 0;
}

.alert-info {
  background: var(--info-50);
  border: 1px solid var(--info-100);
  color: var(--info-600);
}

.alert-success {
  background: var(--success-50);
  border: 1px solid var(--success-100);
  color: var(--success-700);
}

.alert-warning {
  background: var(--warning-50);
  border: 1px solid var(--warning-100);
  color: var(--warning-700);
}

.alert-danger,
.alert-error {
  background: var(--danger-50);
  border: 1px solid var(--danger-100);
  color: var(--danger-700);
}

/* ============================================================
   25. TOAST / SNACKBAR
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3_5) var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-base);
  min-width: 320px;
  max-width: 480px;
  pointer-events: auto;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  animation: toastIn var(--transition-spring) both;
}

.toast.toast-out {
  animation: toastOut var(--transition-base) both;
}

.toast-success {
  background: rgba(240, 253, 244, 0.95);
  border: 1px solid var(--success-100);
  color: var(--success-700);
}

.toast-error {
  background: rgba(254, 242, 242, 0.95);
  border: 1px solid var(--danger-100);
  color: var(--danger-700);
}

.toast-info {
  background: rgba(239, 246, 255, 0.95);
  border: 1px solid var(--info-100);
  color: var(--info-600);
}

.toast-warning {
  background: rgba(255, 251, 235, 0.95);
  border: 1px solid var(--warning-100);
  color: var(--warning-700);
}

.toast .toast-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-base);
}

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

@keyframes toastIn {
  from {
    transform: translateX(120%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateX(120%) scale(0.95);
    opacity: 0;
  }
}

/* ============================================================
   26. LOADING / EMPTY / ERROR STATES
   ============================================================ */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

.state-container .state-icon {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: var(--space-4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.state-container h3 {
  margin-bottom: var(--space-2);
}

.state-container p {
  color: var(--gray-500);
  font-size: var(--text-base);
  max-width: 350px;
  margin-bottom: var(--space-6);
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: var(--space-4);
}

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

.empty-state p {
  color: var(--gray-500);
  font-size: var(--text-base);
  margin-bottom: var(--space-6);
  max-width: 350px;
}

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

.skeleton-row {
  height: 2.5rem;
  margin-bottom: var(--space-3);
}

.error-state {
  text-align: center;
  padding: var(--space-12) var(--space-8);
}

.error-state .error-icon {
  font-size: 3rem;
  color: var(--danger-300);
  margin-bottom: var(--space-4);
}

/* ============================================================
   27. 404 / MAINTENANCE PAGE
   ============================================================ */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
}

.error-page .error-content {
  text-align: center;
  max-width: 500px;
  padding: var(--space-8);
}

.error-page .error-code {
  font-size: 8rem;
  font-weight: 800;
  color: var(--primary-600);
  line-height: 1;
  margin-bottom: var(--space-2);
  letter-spacing: -0.05em;
}

.maintenance-progress {
  height: 0.5rem;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-6) 0;
}

.maintenance-progress .progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  width: 35%;
  animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
  0%,
  100% {
    width: 35%;
  }
  50% {
    width: 65%;
  }
}

/* ============================================================
   28. IMAGE GALLERY
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-2);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.gallery-grid .main-img {
  height: 400px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 3rem;
  transition: all var(--transition-base);
}

.gallery-grid .main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-grid .side-imgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--space-2);
}

.gallery-grid .side-imgs .img {
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: var(--text-3xl);
  cursor: pointer;
  transition: opacity var(--transition-base);
}

.gallery-grid .side-imgs .img:hover {
  opacity: 0.85;
}

.gallery-grid .side-imgs .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   31. VEHICLE DETAIL LAYOUT
   ============================================================ */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
}
@media (max-width: 1024px) {
  .detail-layout {
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
  }
}
@media (max-width: 768px) {
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
@media (max-width: 480px) {
  .detail-layout {
    gap: 1rem;
  }
}

/* Search page layout */
.search-layout {
  display: flex;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}
.search-sidebar {
  width: 280px;
  flex-shrink: 0;
}
.search-results {
  flex: 1;
  min-width: 0;
}
@media (max-width: 768px) {
  .search-layout {
    flex-direction: column;
    padding: 1rem;
  }
  .search-sidebar {
    width: 100%;
  }
}
@media (max-width: 480px) {
  .search-layout {
    padding: 0.75rem;
  }
}

.filter-section {
  margin-bottom: 1.25rem;
}
.filter-section h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--gray-600);
  cursor: pointer;
}
.result-count {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}
.result-count strong {
  color: var(--gray-900);
}
.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--gray-600);
}
.map-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--primary-600);
  cursor: pointer;
  font-weight: 500;
}

/* Booking widget */
.booking-widget {
  position: sticky;
  top: 5rem;
}
@media (max-width: 768px) {
  .booking-widget {
    position: static;
  }
}

/* Booking wizard sidebar */
.wizard-sidebar {
  width: 320px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .wizard-sidebar {
    width: 100%;
  }
}

/* Gallery grid responsive */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid .main-img {
    height: 250px;
  }
  .gallery-grid .side-imgs {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .gallery-grid .main-img {
    height: 200px;
  }
  .gallery-grid .side-imgs .img {
    font-size: 1.25rem;
  }
}

/* Feature list responsive */
.key-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 480px) {
  .key-features {
    grid-template-columns: 1fr;
  }
}

/* Landing responsive additions */
@media (max-width: 768px) {
  .landing-header .header-inner {
    padding: 0 1rem;
  }
  .landing-header .nav-links {
    display: none;
  }
  .hero {
    padding: 5rem 1rem 2rem;
  }
  .hero h1 {
    font-size: 2.25rem;
  }
  .search-bar {
    margin: -1rem 1rem 2rem;
  }
}
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
  }
  .hero p {
    font-size: 0.9375rem;
  }
  .search-bar {
    margin: 0 0.5rem 1.5rem;
    padding: 0.75rem;
  }
}

/* Reviews grid */
@media (max-width: 640px) {
  .reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}

/* Footer responsive */
@media (max-width: 640px) {
  .footer {
    padding: 2rem 1rem 1.5rem;
  }
}
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.spec-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.spec-item:hover {
  background: var(--primary-50);
  border-color: var(--primary-100);
}

.spec-item .spec-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: var(--text-lg);
}

.spec-item .spec-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.spec-item .spec-value {
  font-size: var(--text-base);
  font-weight: 500;
}

/* ============================================================
   30. PRICING TABLE
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.pricing-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
}

.pricing-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.pricing-card.featured {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 1px var(--primary-500), var(--shadow-xl);
  transform: scale(1.03);
}

.pricing-card.featured:hover {
  transform: scale(1.03) translateY(-4px);
}

.pricing-card .pricing-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--gradient-primary);
  color: white;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  box-shadow: var(--shadow-primary);
}

.pricing-card .pricing-name {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.pricing-card .pricing-desc {
  font-size: var(--text-base);
  color: var(--gray-500);
  margin-bottom: var(--space-6);
}

.pricing-card .pricing-amount {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.pricing-card .pricing-period {
  font-size: var(--text-base);
  color: var(--gray-500);
  margin-bottom: var(--space-6);
}

.pricing-card .pricing-features {
  text-align: left;
  margin-bottom: var(--space-8);
}

.pricing-card .pricing-features li {
  padding: var(--space-2) 0;
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  gap: var(--space-2_5);
}

.pricing-card .pricing-features li i {
  color: var(--success-500);
  width: 1rem;
  text-align: center;
}

/* ============================================================
   31. CALENDAR / DATE PICKER
   ============================================================ */
/* ── Modern Calendar (FleetOS-inspired) ── */
.cal-wrapper {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.cal-render {
  min-width: 0;
}

.cal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.cal-controls-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cal-month-label {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  min-width: 180px;
  text-align: center;
}

.cal-nav-btn {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}
.cal-nav-btn:hover { background: var(--gray-50); color: var(--gray-800); border-color: var(--gray-300); }

.cal-today-btn {
  height: 2rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-today-btn:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-800); }

.cal-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--gray-100);
  padding: 0 0.25rem;
}

.cal-day-header {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.625rem 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, auto);
  min-height: 420px;
}

.cal-cell {
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 0.375rem;
  cursor: pointer;
  transition: background 0.12s ease;
  display: flex;
  flex-direction: column;
  min-height: 82px;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--gray-50); }
.cal-cell.outside { background: #fafafa; }
.cal-cell.outside .cal-day-num { color: var(--gray-300); font-weight: 400; }
.cal-cell.today { background: #f0fdf9; }
.cal-cell.today .cal-day-num { background: var(--gray-900); color: white; }
.cal-cell.available { background: #f0fdf4; }
.cal-cell.available .cal-day-num { color: var(--success-700); }
.cal-cell.available:hover { background: #dcfce7; }

.cal-day-top {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.cal-day-num {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-700);
  flex-shrink: 0;
}

.cal-day-count {
  font-size: 0.625rem;
  color: var(--gray-400);
  font-weight: 500;
}

.cal-pills {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow: hidden;
  flex: 1;
}

.cal-pill {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.5;
  max-width: 100%;
}

.cal-pill-dot {
  width: 0.3125rem;
  height: 0.3125rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cal-pill.booking     { background: #f5f3ff; color: #5b21b6; }
.cal-pill.maintenance { background: #fffbeb; color: #92400e; }
.cal-pill.inspection  { background: #eff6ff; color: #1e40af; }
.cal-pill.available   { background: #ecfdf5; color: #065f46; }
.cal-pill.pickup      { background: #ecfdf5; color: #065f46; }
.cal-pill.delivery    { background: #eff6ff; color: #1e40af; }
.cal-pill.transfer    { background: #fffbeb; color: #92400e; }

.cal-pill-dot.booking     { background: #8b5cf6; }
.cal-pill-dot.maintenance { background: #f59e0b; }
.cal-pill-dot.inspection  { background: #3b82f6; }
.cal-pill-dot.available   { background: #22c55e; }
.cal-pill-dot.pickup      { background: #22c55e; }
.cal-pill-dot.delivery    { background: #3b82f6; }
.cal-pill-dot.transfer    { background: #f59e0b; }

.cal-more {
  font-size: 0.625rem;
  color: var(--gray-400);
  font-weight: 500;
  padding: 0.125rem 0;
  cursor: pointer;
}
.cal-more:hover { color: var(--primary-600); }

.cal-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--gray-500);
  font-weight: 500;
}

.cal-legend-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-legend-dot.booking     { background: #8b5cf6; }
.cal-legend-dot.maintenance { background: #f59e0b; }
.cal-legend-dot.inspection  { background: #3b82f6; }
.cal-legend-dot.available   { background: #22c55e; }
.cal-legend-dot.pickup      { background: #22c55e; }
.cal-legend-dot.delivery    { background: #3b82f6; }
.cal-legend-dot.transfer    { background: #f59e0b; }

/* ── Calendar Drawer (FleetOS-inspired) ── */
.cal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 200;
  animation: overlayFadeIn 0.2s ease;
}
.cal-overlay.open { display: block; }

.cal-drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 420px;
  max-width: calc(100vw - 2rem);
  max-height: 85vh;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 201;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.cal-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.cal-drawer-head {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.cal-drawer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cal-drawer-date-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.cal-drawer-date-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.cal-drawer-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--gray-400);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.cal-drawer-close:hover {
  background: var(--gray-50);
  color: var(--gray-600);
  border-color: var(--gray-300);
}

.cal-drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.cal-drawer-stat {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.625rem;
  text-align: center;
}

.cal-drawer-stat-val {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.cal-drawer-stat-lbl {
  font-size: 0.5625rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.125rem;
}

.cal-drawer-body {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0 1.5rem;
}
.cal-drawer-body::-webkit-scrollbar { width: 4px; }
.cal-drawer-body::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }
.cal-drawer-body::-webkit-scrollbar-track { background: transparent; }

.cal-drawer-group-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gray-400);
  padding: 0.75rem 1.25rem 0.375rem;
}

.cal-drawer-event {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: background 0.1s ease;
}
.cal-drawer-event:hover { background: var(--gray-50); }

.cal-drawer-event-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  margin-top: 0.0625rem;
}

.cal-drawer-event-icon.booking     { background: #f5f3ff; color: #7c3aed; }
.cal-drawer-event-icon.maintenance { background: #fffbeb; color: #f59e0b; }
.cal-drawer-event-icon.inspection  { background: #eff6ff; color: #3b82f6; }
.cal-drawer-event-icon.available   { background: #ecfdf5; color: #22c55e; }
.cal-drawer-event-icon.pickup      { background: #ecfdf5; color: #22c55e; }
.cal-drawer-event-icon.delivery    { background: #eff6ff; color: #3b82f6; }
.cal-drawer-event-icon.transfer    { background: #fffbeb; color: #f59e0b; }

.cal-drawer-event-body { flex: 1; min-width: 0; }

.cal-drawer-event-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-drawer-event-sub {
  font-size: 0.6875rem;
  color: var(--gray-500);
  margin-top: 0.0625rem;
}

.cal-drawer-event-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  margin-top: 0.25rem;
}

.cal-drawer-event-badge.booking     { background: #f5f3ff; color: #5b21b6; }
.cal-drawer-event-badge.maintenance { background: #fffbeb; color: #92400e; }
.cal-drawer-event-badge.inspection  { background: #eff6ff; color: #1e40af; }
.cal-drawer-event-badge.available   { background: #ecfdf5; color: #065f46; }
.cal-drawer-event-badge.pickup      { background: #ecfdf5; color: #065f46; }
.cal-drawer-event-badge.delivery    { background: #eff6ff; color: #1e40af; }
.cal-drawer-event-badge.transfer    { background: #fffbeb; color: #92400e; }

.cal-drawer-event-time {
  font-size: 0.6875rem;
  color: var(--gray-400);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.cal-drawer-empty {
  text-align: center;
  padding: 3rem 1.25rem;
  color: var(--gray-400);
}

.cal-drawer-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.cal-drawer-empty-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
}

.cal-drawer-empty-sub {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive drawer */
@media (max-width: 640px) {
  .cal-drawer { width: calc(100vw - 1.5rem); max-height: 90vh; }
  .cal-drawer-head { padding: 1rem; }
  .cal-drawer-stat { padding: 0.375rem 0.5rem; }
  .cal-drawer-stat-val { font-size: 0.9375rem; }
  .cal-drawer-event { padding: 0.5rem 1rem; }
  .cal-drawer-event-title { font-size: 0.75rem; }
  .cal-drawer-event-sub { font-size: 0.625rem; }
}
@media (max-width: 480px) {
  .cal-drawer { width: calc(100vw - 1rem); max-height: 92vh; }
  .cal-drawer-stats { gap: 0.25rem; }
  .cal-drawer-stat-lbl { font-size: 0.5rem; }
}

/* ── Calendar Responsive ── */
@media (max-width: 768px) {
  .cal-cell { min-height: 64px; padding: 0.25rem; }
  .cal-day-num { width: 1.25rem; height: 1.25rem; font-size: 0.6875rem; }
  .cal-pill { font-size: 0.5625rem; padding: 0.0625rem 0.25rem; }
  .cal-pill-dot { width: 0.25rem; height: 0.25rem; }
  .cal-day-count { display: none; }
  .cal-more { font-size: 0.5625rem; }
  .cal-controls { padding: 1rem; }
  .cal-month-label { font-size: 0.9375rem; min-width: 140px; }
  .cal-day-header { font-size: 0.625rem; padding: 0.5rem 0; }
  .cal-grid { min-height: 320px; }
  .cal-drawer { width: 100%; }
  .cal-drawer-head { padding: 1rem; }
  .cal-drawer-event { padding: 0.375rem 1rem; }
}

@media (max-width: 640px) {
  .page { padding: var(--space-4); }
  .page-lg { padding: var(--space-4); }
  .main-content { padding: var(--space-3); }
  .cal-cell { min-height: 52px; padding: 0.1875rem; }
  .cal-day-num { width: 1.125rem; height: 1.125rem; font-size: 0.625rem; }
  .cal-pill { font-size: 0.5rem; padding: 0.0625rem 0.1875rem; border-radius: 0.125rem; gap: 0.125rem; }
  .cal-pill-dot { width: 0.1875rem; height: 0.1875rem; }
  .cal-pills { gap: 0.0625rem; }
  .cal-day-top { margin-bottom: 0.125rem; }
  .cal-controls { padding: 0.75rem; }
  .cal-controls-group { gap: 0.25rem; }
  .cal-month-label { font-size: 0.8125rem; min-width: 100px; }
  .cal-nav-btn { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; }
  .cal-today-btn { height: 1.75rem; padding: 0 0.625rem; font-size: 0.6875rem; }
  .cal-day-header { font-size: 0.5625rem; padding: 0.375rem 0; }
  .cal-grid { min-height: 240px; }
  .cal-legend { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .cal-legend-item { font-size: 0.625rem; }
  .cal-legend-dot { width: 0.375rem; height: 0.375rem; }
}

@media (max-width: 480px) {
  .cal-cell { min-height: 44px; padding: 0.125rem; }
  .cal-day-num { width: 1rem; height: 1rem; font-size: 0.5625rem; }
  .cal-pill { display: none; }
  .cal-more { display: none; }
  .cal-day-top { justify-content: center; }
  .cal-month-label { font-size: 0.75rem; min-width: 80px; }
  .cal-controls-group { gap: 0.125rem; }
  .cal-nav-btn { width: 1.5rem; height: 1.5rem; font-size: 0.6875rem; }
  .cal-today-btn { display: none; }
  .cal-day-header { font-size: 0.5rem; padding: 0.25rem 0; letter-spacing: 0.03em; }
  .cal-grid { min-height: 180px; }
  .cal-wrapper { border-radius: var(--radius-lg); }
  .cal-drawer { width: 100%; }
  .cal-drawer-date-val { font-size: 1rem; }
  .cal-drawer-stat-val { font-size: 0.9375rem; }
  .cal-drawer-stat { padding: 0.375rem 0.5rem; }
  .cal-drawer-event-title { font-size: 0.75rem; }
  .cal-drawer-event-sub { font-size: 0.625rem; }
  .cal-drawer-event-badge { font-size: 0.5625rem; padding: 0.0625rem 0.375rem; }
}

@media (max-width: 768px) {
  .cal-controls { flex-direction: column; gap: 0.5rem; align-items: stretch; }
  .cal-controls-group { justify-content: center; }
  .cal-legend { justify-content: center; }
  .cal-wrapper { border-radius: var(--radius-lg); }
}

/* ── Combobox ── */
.combobox-input {
  padding-right: 2rem !important;
}

.combobox-clear {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.125rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.combobox-clear:hover { color: var(--gray-600); }

.combobox-chevron {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 2px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-height: 240px;
  overflow: auto;
}

.combobox-empty {
  padding: 0.625rem 0.75rem;
  color: var(--gray-400);
  font-size: 0.8125rem;
  text-align: center;
}

.combobox-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.8125rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.1s ease;
}
.combobox-option:hover,
.combobox-option.highlighted { background: var(--gray-50); }
.combobox-option.selected { font-weight: 600; }

.combobox-option-label {
  font-weight: inherit;
  color: var(--gray-800);
}

.combobox-option-sublabel {
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-left: 0.5rem;
  white-space: nowrap;
}

[data-theme="dark"] .combobox-dropdown { background: var(--gray-50); border-color: var(--gray-300); }
[data-theme="dark"] .combobox-option:hover,
[data-theme="dark"] .combobox-option.highlighted { background: var(--gray-100); }
[data-theme="dark"] .combobox-option-label { color: var(--gray-700); }
[data-theme="dark"] .combobox-option-sublabel { color: var(--gray-500); }

/* ── Custom Date Picker ── */
.date-picker {
  position: relative;
  display: inline-block;
  width: 100%;
}

.date-picker-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-900);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-sans);
  line-height: 1.4;
}

.date-picker-input:focus,
.date-picker-input.active {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.date-picker-input::placeholder {
  color: var(--gray-400);
}

.date-picker-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.875rem;
  pointer-events: none;
  transition: color 0.15s ease;
}

.date-picker.active .date-picker-icon {
  color: var(--primary-500);
}

.date-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  width: auto;
  min-width: 260px;
  width: 300px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  padding: 1rem;
  animation: datePickerIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.date-picker-dropdown.open {
  display: block;
}

@keyframes datePickerIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.date-picker-header-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
}

.date-picker-nav {
  display: flex;
  gap: 0.25rem;
}

.date-picker-nav-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.date-picker-nav-btn:hover {
  background: var(--gray-50);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.date-picker-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.375rem;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.125rem;
}

.date-picker-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-700);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
  border: none;
  background: none;
}

.date-picker-day:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.date-picker-day.outside {
  color: var(--gray-300);
}

.date-picker-day.outside:hover {
  background: var(--gray-50);
  color: var(--gray-400);
}

.date-picker-day.today {
  font-weight: 700;
  color: var(--primary-600);
}

.date-picker-day.selected {
  background: var(--primary-600);
  color: white;
  font-weight: 600;
}

.date-picker-day.selected:hover {
  background: var(--primary-700);
}

.date-picker-day:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-picker-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
}

.date-picker-today-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-600);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.12s ease;
}

.date-picker-today-btn:hover {
  background: var(--primary-50);
}

/* ── Date Picker Responsive ── */
@media (max-width: 640px) {
  .date-picker-dropdown {
    left: 0;
    right: auto;
    min-width: 240px;
    max-width: calc(100vw - 1.5rem);
  }
}

@media (max-width: 480px) {
  .date-picker-input { font-size: 0.8125rem; padding: 0.5rem 0.625rem 0.5rem 2.25rem; }
  .date-picker-icon { font-size: 0.75rem; left: 0.625rem; }
  .date-picker-dropdown { padding: 0.75rem; min-width: 200px; }
  .date-picker-day { font-size: 0.6875rem; }
  .date-picker-header-title { font-size: 0.8125rem; }
}

/* ============================================================
   32. MODERN TIME PICKER
   ============================================================ */
.time-picker {
  position: relative;
  display: inline-block;
  width: 100%;
}

.time-picker-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-900);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-sans);
  line-height: 1.4;
  text-align: left;
}

.time-picker-input:focus,
.time-picker-input.active {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.time-picker-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.875rem;
  pointer-events: none;
  transition: color 0.15s ease;
}

.time-picker.active .time-picker-icon {
  color: var(--primary-500);
}

.time-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  width: 220px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  padding: 0.5rem;
  animation: datePickerIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.time-picker-dropdown.open {
  display: block;
}

.time-picker-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.time-picker-preset {
  padding: 0.4375rem 0.375rem;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--gray-700);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: center;
  font-family: var(--font-sans);
}

.time-picker-preset:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  border-color: var(--primary-200);
}

.time-picker-preset.selected {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
}

.time-picker-section-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.375rem 0.25rem 0.25rem;
}

.time-picker-custom {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0;
  border-top: 1px solid var(--gray-100);
}

.time-picker-custom-label {
  font-size: 0.6875rem;
  color: var(--gray-500);
  flex-shrink: 0;
}

.time-picker-custom-input {
  flex: 1;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  color: var(--gray-700);
}

.time-picker-custom-input:focus {
  outline: none;
  border-color: var(--primary-500);
}

.time-picker-custom-btn {
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-sm);
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: var(--font-sans);
}

.time-picker-custom-btn:hover {
  background: var(--primary-100);
}

/* Time picker responsive */
@media (max-width: 640px) {
  .time-picker-dropdown {
    left: 0;
    width: calc(100vw - 2rem);
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .time-picker-input { font-size: 0.8125rem; padding: 0.5rem 0.625rem 0.5rem 2.25rem; }
  .time-picker-icon { font-size: 0.75rem; left: 0.625rem; }
}

/* ============================================================
   32. CHAT / INBOX
   ============================================================ */
.inbox-layout {
  display: flex;
  gap: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: white;
  min-height: 500px;
  box-shadow: var(--shadow-sm);
}

.inbox-sidebar {
  width: 320px;
  border-right: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.inbox-sidebar .inbox-search {
  padding: var(--space-3);
  border-bottom: 1px solid var(--gray-100);
}

.inbox-sidebar .inbox-list {
  overflow-y: auto;
  max-height: 440px;
}

.inbox-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  border-bottom: 1px solid var(--gray-50);
  transition: all var(--transition-fast);
}

.inbox-item:hover {
  background: var(--gray-50);
}

.inbox-item.active {
  background: var(--primary-50);
}

.inbox-item .inbox-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-weight: 600;
  font-size: var(--text-base);
  flex-shrink: 0;
}

.inbox-item .inbox-content {
  flex: 1;
  min-width: 0;
}

.inbox-item .inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.125rem;
}

.inbox-item .inbox-name {
  font-size: var(--text-base);
  font-weight: 500;
}

.inbox-item .inbox-time {
  font-size: 0.6875rem;
  color: var(--gray-400);
}

.inbox-item .inbox-preview {
  font-size: var(--text-sm);
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.inbox-main .inbox-messages {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
  max-height: 380px;
}

.message {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  animation: staggeredIn var(--duration-slow) both;
}

.message.sent {
  flex-direction: row-reverse;
}

.message .msg-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.message .msg-content {
  max-width: 70%;
}

.message .msg-bubble {
  padding: var(--space-2_5) var(--space-3_5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.message.received .msg-bubble {
  background: var(--gray-100);
  border-bottom-left-radius: var(--radius-sm);
}

.message.sent .msg-bubble {
  background: var(--primary-600);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.message .msg-time {
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-top: 0.125rem;
}

.message.sent .msg-time {
  text-align: right;
}

.inbox-input {
  padding: var(--space-3);
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: var(--space-2);
}

.inbox-input input {
  flex: 1;
}

/* ============================================================
   33. NOTIFICATION PANEL
   ============================================================ */
.notif-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-1_5);
  width: 380px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
}

.notif-panel.open {
  display: block;
  animation: dropdownIn var(--transition-base) both;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--gray-100);
}

.notif-panel-header h4 {
  font-size: var(--text-md);
}

.notif-panel-list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3_5) var(--space-5);
  border-bottom: 1px solid var(--gray-50);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notif-item:hover {
  background: var(--gray-50);
}

.notif-item.unread {
  background: var(--primary-50);
  position: relative;
}

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

.notif-item .notif-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.notif-item .notif-icon.primary {
  background: var(--primary-100);
  color: var(--primary-600);
}

.notif-item .notif-icon.success {
  background: var(--success-100);
  color: var(--success-600);
}

.notif-item .notif-icon.warning {
  background: var(--warning-100);
  color: var(--warning-600);
}

.notif-item .notif-icon.danger {
  background: var(--danger-100);
  color: var(--danger-600);
}

.notif-item .notif-content {
  flex: 1;
  min-width: 0;
}

.notif-item .notif-title {
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: 0.125rem;
}

.notif-item .notif-desc {
  font-size: var(--text-xs);
  color: var(--gray-500);
  line-height: var(--leading-normal);
}

.notif-item .notif-time {
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-top: var(--space-1);
}

/* ============================================================
   34. FILE UPLOAD AREA
   ============================================================ */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.upload-area:hover {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.upload-area.drag-over {
  border-color: var(--primary-500);
  background: var(--primary-50);
  box-shadow: var(--ring-primary);
}

.upload-area .upload-icon {
  font-size: 2rem;
  color: var(--gray-300);
  margin-bottom: var(--space-3);
  transition: all var(--transition-base);
}

.upload-area:hover .upload-icon {
  color: var(--primary-400);
  transform: translateY(-4px);
}

.upload-area p {
  font-size: var(--text-base);
  color: var(--gray-500);
}

.upload-area .upload-hint {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: var(--space-2);
}

.upload-preview {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.upload-preview .file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1_5) var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid var(--gray-200);
}

.upload-preview .file i {
  color: var(--primary-500);
}

/* ============================================================
   35. STEPS / PROCESS FLOW
   ============================================================ */
.steps {
  display: flex;
  gap: 0;
  counter-reset: step;
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
  padding: 0 var(--space-2);
}

.step::after {
  content: '';
  position: absolute;
  top: 1rem;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
  transition: background var(--transition-base);
}

.step.completed::after {
  background: var(--success-500);
}

.step.active::after {
  background: linear-gradient(to right, var(--primary-500), var(--gray-200));
}

.step:last-child::after {
  display: none;
}

.step .step-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-2);
  transition: all var(--transition-base);
}

.step.active .step-circle {
  background: var(--primary-600);
  color: white;
  box-shadow: var(--shadow-primary);
}

.step.completed .step-circle {
  background: var(--success-600);
  color: white;
}

.step .step-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--gray-500);
  transition: color var(--transition-base);
}

.step.active .step-label {
  color: var(--gray-900);
  font-weight: 500;
}

/* ============================================================
   36. ADD-ON SELECTORS
   ============================================================ */
.addon-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  background: white;
}

.addon-card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.addon-card.selected {
  border-color: var(--primary-500);
  background: var(--primary-50);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.addon-card .addon-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: var(--text-xl);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.addon-card.selected .addon-icon {
  background: var(--primary-100);
  color: var(--primary-600);
}

.addon-card .addon-info {
  flex: 1;
}

.addon-card .addon-name {
  font-weight: 500;
  font-size: var(--text-base);
}

.addon-card .addon-desc {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.addon-card .addon-price {
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--primary-600);
  white-space: nowrap;
}

.addon-card input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--primary-600);
  cursor: pointer;
}

/* ============================================================
   37. MOBILE MENU BUTTON
   ============================================================ */
.mobile-menu-btn {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition-base);
}

.mobile-menu-btn:hover {
  background: var(--gray-100);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
    padding: 0;
  }
}

/* ============================================================
   38. CHART CONTAINERS
   ============================================================ */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}
.chart-container canvas {
  width: 100% ;
  height: 100% ;
}

.chart-container-sm {
  height: 200px;
}

/* ============================================================
   39. STAGGERED LIST ANIMATIONS
   ============================================================ */
.stagger-item {
  animation: staggerIn var(--duration-slow) ease both;
  opacity: 0;
}

.stagger-item:nth-child(1) {
  animation-delay: 0.05s;
}

.stagger-item:nth-child(2) {
  animation-delay: 0.1s;
}

.stagger-item:nth-child(3) {
  animation-delay: 0.15s;
}

.stagger-item:nth-child(4) {
  animation-delay: 0.2s;
}

.stagger-item:nth-child(5) {
  animation-delay: 0.25s;
}

.stagger-item:nth-child(6) {
  animation-delay: 0.3s;
}

.stagger-item:nth-child(7) {
  animation-delay: 0.35s;
}

.stagger-item:nth-child(8) {
  animation-delay: 0.4s;
}

.stagger-item:nth-child(9) {
  animation-delay: 0.45s;
}

.stagger-item:nth-child(10) {
  animation-delay: 0.5s;
}

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

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

/* ============================================================
   40. UTILITIES
   ============================================================ */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.hidden {
  display: none ;
}

.block {
  display: block;
}

.inline {
  display: inline;
}

.inline-block {
  display: inline-block;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.bg-white {
  background: white;
}

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

.bg-transparent {
  background: transparent;
}

.border {
  border: 1px solid var(--gray-200);
}

.border-b {
  border-bottom: 1px solid var(--gray-100);
}

.border-0 {
  border: none;
}

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

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

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

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

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

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

.shadow {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* Extended Utilities */
.w-6 {
  width: 1.5rem;
}
.w-8 {
  width: 2rem;
}
.w-10 {
  width: 2.5rem;
}
.w-12 {
  width: 3rem;
}
.w-16 {
  width: 4rem;
}
.w-20 {
  width: 5rem;
}
.w-24 {
  width: 6rem;
}

.h-6 {
  height: 1.5rem;
}
.h-8 {
  height: 2rem;
}
.h-10 {
  height: 2.5rem;
}
.h-12 {
  height: 3rem;
}
.h-16 {
  height: 4rem;
}

.max-w-sm {
  max-width: 24rem;
}
.max-w-md {
  max-width: 28rem;
}
.max-w-lg {
  max-width: 32rem;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

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

.opacity-0 {
  opacity: 0;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-100 {
  opacity: 1;
}

.no-print {}

/* ── Glass Utility ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

.glass-heavy {
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(var(--glass-blur-heavy));
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
  border: 1px solid var(--glass-border);
}

/* ── Hover lift ── */
.hover-lift {
  transition: all var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* ── Animated background gradient ── */
.bg-gradient-animate {
  background: var(--primary-600);
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ============================================================
   41. FOCUS VISIBLE (ACCESSIBILITY)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

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

  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   42. RESPONSIVE: TABLET (768px)
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.15);
    z-index: 100;
  }

  .sidebar-overlay.open {
    display: block;
    z-index: 90;
  }

  .sidebar .brand-text,
  .sidebar .nav-item span,
  .sidebar .nav-section-title {
    display: none;
  }

  .sidebar .nav-item {
    justify-content: center;
    padding: var(--space-3);
  }

  .sidebar.open .brand-text,
  .sidebar.open .nav-item span,
  .sidebar.open .nav-section-title {
    display: block;
  }

  .sidebar.open .nav-item {
    justify-content: flex-start;
    padding: 0.5rem 0.75rem;
  }

  .sidebar.open .sidebar-brand {
    padding: 1.25rem 1.5rem;
  }

  .main-area {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
  }
  .dashboard-layout {
    max-width: 100vw;
    overflow-x: hidden;
  }

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

  .mobile-hamburger { display: flex; }
  .sidebar-toggle { display: none; }

  .hero h1 {
    font-size: var(--text-5xl);
  }

  .feature-grid,
  .vehicle-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-right {
    display: none;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid .side-imgs {
    grid-template-columns: 1fr 1fr;
  }

  .search-bar .search-grid {
    grid-template-columns: 1fr 1fr;
  }

  .inbox-layout {
    flex-direction: column;
  }

  .inbox-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--gray-100);
  }

  .notif-panel {
    width: 320px;
    right: -4rem;
  }

  .kanban-board {
    flex-direction: column;
  }

  .kanban-column {
    max-width: 100%;
  }

  .detail-header {
    flex-direction: column;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-container {
    overflow-x: auto;
  }

  table th,
  table td {
    padding: var(--space-2) var(--space-3);
  }

  .topbar-search { width: auto; padding: 0 var(--space-3) 0 var(--space-8); font-size: 0.75rem; }
  .topbar-search span { font-size: 0.75rem; }
  .search-shortcut { display: none; }

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

  .toast {
    min-width: 0;
    max-width: none;
  }

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

  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }

  .pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   43. RESPONSIVE: MOBILE (640px)
   ============================================================ */
@media (max-width: 640px) {
/* ── Global form spacing baseline ── */
.form-group { margin-bottom: 1.25rem; }
[class*="grid"] { gap: 1rem; }
@media (max-width: 640px) {
  [class*="grid"] { gap: 0.75rem; }
  .form-group { margin-bottom: 1rem; }
}

.form-group {
    display: flex;
    flex-direction: column;
  }

  .form-input,
  .form-select,
  .form-textarea {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .page-header:has(> div:first-child + *) {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "actions";
  }

  .page-header:has(> div:first-child + *) > :first-child {
    grid-area: title;
    grid-row: auto;
  }

  .page-header:has(> div:first-child + *) > :not(:first-child) {
    grid-area: actions;
    grid-column: 1;
    justify-self: end;
  }

  .page-header > :is(.btn, button, a.btn, .page-header-actions, .page-actions),
  .page-header > div:not(:first-child):has(:is(.btn, button, a.btn)) {
    margin-left: 0;
    align-self: flex-end;
    max-width: 100%;
  }

  .page-header:has(> h1):has(> p):has(> :is(button, .btn, a.btn, .page-header-actions, .page-actions)) {
    grid-template-areas:
      "title"
      "subtitle"
      "actions";
    grid-template-columns: 1fr;
  }

  .page-header:has(> h1):has(> p):has(> :is(button, .btn, a.btn, .page-header-actions, .page-actions)) > :is(button, .btn, a.btn, .page-header-actions, .page-actions) {
    justify-self: end;
  }

  .detail-header .detail-actions {
    width: 100%;
  }

  .btn-block-mobile {
    width: 100%;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .pricing-card.featured {
    transform: none;
  }

  .pricing-card.featured:hover {
    transform: translateY(-4px);
  }

  .wizard-steps {
    flex-direction: column;
  }

  .wizard-step {
    border-right: none;
    border-bottom: 1px solid var(--gray-100);
  }

  .inbox-input {
    flex-direction: column;
  }

  .inbox-input .btn {
    width: 100%;
  }

  .search-input-wrapper input:focus {
    min-width: 100%;
  }

  .hero h1 {
    font-size: var(--text-4xl);
  }

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

  /* ── Booking wizard ── */
  .wizard-steps { flex-direction: column; gap: 0; }
  .wizard-sidebar { display: none; }

  /* ── Modals full width ── */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 90vh; }
  .modal-sm { max-width: 100%; }

  /* ── Detail header stacking ── */
  .detail-header { flex-direction: column; gap: 1rem; }
  .detail-header .detail-actions { flex-wrap: wrap; }

  /* ── Cards padding ── */
  .card-body { padding: 1rem; }
  .card-header { padding: 1rem 1rem 0; }
  .stat-card { padding: 1rem; }

  /* ── Buttons full width ── */
  .btn { white-space: normal; word-break: break-word; }
  .detail-header .detail-actions .btn { flex: 1; min-width: 0; }
  .modal-footer .btn { flex: 1; }

  /* ── Dropdown menus ── */
  .dropdown-menu { width: calc(100vw - 2rem); max-width: 260px; }
  .dropdown-menu { right: 0 ; left: auto ; }

  /* ── Tabs scrollable ── */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { flex-shrink: 0; }

  /* ── Topbar search ── */
  .topbar { padding: 0 0.75rem; gap: 0.5rem; }
  .topbar-search { width: 36px; padding: 0; justify-content: center; background: var(--gray-50); }
  .topbar-search .search-icon { position: static; transform: none; }
  .topbar-search span { display: none; }
  .search-shortcut { display: none; }
  .topbar-left { gap: 0.5rem; }
  .mobile-hamburger { display: flex; }

  /* ── Mini stat cards ── */
  .stat-card .stat-value { font-size: 1.375rem; }
  .stat-card .stat-icon { width: 2rem; height: 2rem; font-size: 1rem; }

  /* ── Timeline ── */
  .timeline { padding-left: 1.5rem; }

  /* ── Confirm modals ── */
  .confirm-warning { font-size: 0.75rem; }

  /* ── Chart containers ── */
  .chart-container { height: 250px; }

  /* ── Table horizontal scroll on mobile ── */
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .main-content table { min-width: 0; word-break: break-word; }
  .data-table { table-layout: auto; min-width: 100%; width: auto; }

  /* ── Grid auto-collapse ── */
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  /* Catch inline grids that override class-based collapse */
  [style*="display: grid"],
  [style*="display:grid"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Specs grid ── */
  .specs-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Login page ── */
  .login-page { flex-direction: column; height: 100vh; overflow: hidden; }
  .login-left { flex: 1; min-height: 0; padding: 2rem 1.5rem; overflow-y: auto; }
  .login-right { display: none; }

  /* ── Landing ── */
  .hero { padding: 4rem 1rem 2rem; overflow-x: auto; }
  .hero h1 { font-size: 2rem; }
  .hero .hero-actions { flex-direction: column ; }
  .hero .hero-actions .btn { width: 100% ; box-sizing: border-box; }
  .search-bar { max-width: 100vw ; overflow-x: hidden ; }
  .search-bar .search-grid { grid-template-columns: 1fr ; gap: 0.5rem ; }
  .search-bar .search-btn { width: 100% ; font-size: 0.8125rem ; }
  .detail-layout { grid-template-columns: 1fr ; }
  .detail-layout > * { max-width: 100%; overflow-x: auto; }
  .gallery-grid { grid-template-columns: 1fr ; }
  .gallery-grid .main-img { height: 200px ; }
  .gallery-grid .side-imgs { grid-template-columns: 1fr 1fr ; }
  .booking-widget { position: static ; }
  .wizard-progress { flex-wrap: wrap ; justify-content: center ; }
  .wp-connector { width: 1.5rem ; }
  .wp-label { display: none ; }
  .wp-circle { width: 2rem ; height: 2rem ; font-size: 0.6875rem ; }
  .step-panel { width: 100% ; overflow-x: hidden ; }
  .btn-nav { min-width: 0 ; font-size: 0.75rem ; padding: 0.5rem 0.75rem ; }
  .vehicle-card .vehicle-price { flex-direction: column ; align-items: flex-start ; gap: 0.25rem ; }
  .demo-credentials table { font-size: 0.625rem ; }
  .demo-credentials th, .demo-credentials td { padding: 0.125rem 0.25rem ; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; max-width: 100%; }
  .tab { flex-shrink: 0; white-space: nowrap; padding: 0.5rem 0.75rem ; font-size: 0.75rem ; }
  .tab-content { max-width: 100%; overflow-x: auto; }
  .landing-header .nav-links { gap: 1rem; }
  .landing-header .nav-links a { font-size: 0.75rem; }

  /* ── Vehicle search page ── */
  .search-bar { padding: 1rem; }
  .search-bar .search-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }

  /* ── Booking cards ── */
  .vehicle-card .vehicle-image { height: 160px; }

  /* ── Notification panel ── */
  .notif-panel { width: calc(100vw - 1.5rem); right: -0.5rem; }
  .topbar-notif .notif-panel { right: 0; }

  /* ── Toast ── */
  .toast { min-width: 0; max-width: calc(100vw - 2rem); }

  /* ── Filter bar ── */
  .filter-bar { gap: 0.5rem; }
  .filter-bar .form-select { min-width: 120px; }

  /* ── Stagger items speed up ── */
  .stagger-item { animation-duration: 0.25s; }
}

/* ============================================================
   44. RESPONSIVE: SMALL MOBILE (480px)
   ============================================================ */
@media (max-width: 480px) {
  .topbar { padding: 0 0.5rem; }
  .topbar-search { width: 32px; padding: 0; justify-content: center; }
  .topbar-search .search-icon { position: static; transform: none; font-size: 0.875rem; }
  .topbar-search span { display: none; }
  .search-shortcut { display: none; }
  .topbar-avatar { width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
  .topbar-notif { width: 1.75rem; height: 1.75rem; font-size: 0.875rem; }
  .topbar-left { gap: 0.375rem; }
  .topbar-right { gap: 0.25rem; }

  .main-content { padding: 0.75rem; }
  .page { padding: 0.75rem; }
  .card-body { padding: 0.75rem; }
  .card-header { padding: 0.75rem 0.75rem 0; }

  .table th, .table td { padding: 0.375rem 0.5rem; font-size: 0.6875rem; }
  .pagination { padding: 0.75rem; }
  .pagination-info { font-size: 0.6875rem; }
  .page-btn { min-width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }

  .stat-card .stat-value { font-size: 1.25rem; }
  .stat-card .stat-label { font-size: 0.6875rem; }

  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.0625rem; }

  .modal-header { padding: 0.875rem 1rem; }
  .modal-body { padding: 1rem; }
  .modal-footer { padding: 0.75rem 1rem; }

  .filter-bar { padding: 0.75rem; gap: 0.375rem; }
  .filter-bar .form-select { min-width: 100px; font-size: 0.6875rem; }
  .filter-bar .filter-label { font-size: 0.625rem; }
  .search-input-wrapper input { min-width: 0; width: 100%; font-size: 0.75rem; }

  .detail-header h1 { font-size: 1.25rem; }
  .detail-header .detail-actions { gap: 0.25rem; }
  .badge { font-size: 0.6875rem; padding: 0.0625rem 0.5rem; }

  .hero h1 { font-size: 1.625rem; }
  .hero p { font-size: 0.875rem; }
  .landing-header .header-inner { padding: 0 0.75rem; }

  .search-bar { padding: 0.75rem; border-radius: var(--radius-lg); }
  .search-bar .search-grid { grid-template-columns: 1fr; gap: 0.5rem; }

  .vehicle-card .vehicle-image { height: 140px; }
  .vehicle-card .vehicle-body { padding: 0.75rem; }
  .vehicle-card .vehicle-name { font-size: 0.9375rem; }

  .specs-grid { grid-template-columns: 1fr; }
  .spec-item { padding: 0.5rem; }

  .timeline { padding-left: 1.25rem; }
  .feature-grid { gap: 1rem; }
  .feature-card { padding: 1.25rem; }

  .pricing-card { padding: 1.25rem; }

  .form-grid { gap: 0.75rem; }

  .tab { padding: 0.5rem 0.75rem; font-size: 0.75rem; }

  .detail-header .detail-actions .btn { font-size: 0.6875rem; padding: 0.375rem 0.625rem; }

  .notif-panel { width: calc(100vw - 1rem); }

  .page-btn:first-child,
  .page-btn:last-child { min-width: 1.5rem; }
}

/* ============================================================
   45. RESPONSIVE: TINY MOBILE (360px)
   ============================================================ */
@media (max-width: 360px) {
  .topbar-search { display: none; }
  .topbar { padding: 0 0.375rem; justify-content: flex-end; }

  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.125rem; }

  .card-body { padding: 0.625rem; }
  .card-header { padding: 0.625rem 0.625rem 0; }
  .stat-card { padding: 0.75rem; }

  .table th, .table td { padding: 0.25rem 0.375rem; font-size: 0.625rem; }
  .badge { font-size: 0.625rem; }

  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-header { padding: 0.75rem; }
  .modal-body { padding: 0.75rem; }

  .page-btn { min-width: 1.625rem; height: 1.625rem; font-size: 0.625rem; }

  .detail-header .detail-actions .btn { padding: 0.3125rem 0.5rem; font-size: 0.625rem; }

  .search-bar .search-btn { width: 100%; }
  .hero h1 { font-size: 1.5rem; }

  .cal-cell { min-height: 40px; padding: 0.125rem; }
  .cal-day-num { width: 0.875rem; height: 0.875rem; font-size: 0.5rem; }
  .cal-day-header { font-size: 0.4375rem; }
  .cal-month-label { font-size: 0.6875rem; min-width: 60px; }
}

/* ============================================================
   46. PRINT STYLES
   ============================================================ */
@media print {
  .sidebar,
  .topbar,
  .no-print {
    display: none ;
  }

  .main-area {
    margin-left: 0 ;
  }

  .main-content {
    padding: 0 ;
  }

  .card {
    break-inside: avoid;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  body {
    font-size: 12pt;
  }

  .glass,
  .card-glass,
  .glass-heavy {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: white;
  }
}

/* ============================================================
   45. SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

/* ============================================================
   47. OVERFLOW SAFEGUARDS
   ============================================================ */

/* Force ALL form controls to stay within parent width */
input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box !important;
}

/* Form inputs in flex layouts — allow shrinking */
.flex > .form-input,
.flex > .form-select,
.flex > input,
.flex > select,
.flex > textarea {
  flex: 1;
  min-width: 0;
}

/* Chat input area */
.chat-input {
  flex: 1;
  min-width: 0;
}

/* Search inputs */
.table-search,
.topbar-search input,
.search-bar input[type="text"] {
  max-width: 100% !important;
  min-width: 0;
  width: 100%;
}

/* All form-groups constrain children */
.form-group {
  max-width: 100%;
}

/* Search bar grid */
@media (max-width: 768px) {
  .search-grid {
    grid-template-columns: 1fr !important;
  }
  .search-layout {
    grid-template-columns: 1fr !important;
  }
  .search-sidebar {
    position: static !important;
  }
}

/* Button containers — prevent overlap */
.modal-footer,
.detail-actions,
.table-actions,
.card-actions,
.btn-group {
  flex-wrap: wrap;
}

/* All buttons in grids and flex layouts wrap text */
.btn {
  white-space: normal;
  word-break: break-word;
}
.btn-icon, .btn-xs, .btn-sm, .btn.btn-ghost:not(.btn-block) {
  white-space: nowrap;
}
.btn-block {
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
}

/* Kanban board columns bounded */
.dispatch-col {
  max-width: 100%;
}
.dispatch-col-body {
  overflow: hidden;
}
.dispatch-board {
  max-width: 100%;
}

/* Prevent any single unbreakable element from forcing overflow */
pre, code, kbd, samp {
  overflow-x: auto;
  max-width: 100%;
}

/* Table container overflow for mobile */
.table-container {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Card body tables */
.card-body {
  max-width: 100%;
}

/* All images and media bounded */
img, video, iframe, embed, object {
  max-width: 100%;
}

/* Public page wrappers with header offset */
div[style*="padding-top:64px"],
div[style*="padding-top: 64px"] {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ── Responsive table stacking (mobile card layout) ── */
@media (max-width: 768px) {
  .table-container.table-labeled table,
  .table-container.table-labeled thead,
  .table-container.table-labeled tbody,
  .table-container.table-labeled tr,
  .table-container.table-labeled th,
  .table-container.table-labeled td {
    display: block;
  }
  .table-container.table-labeled thead {
    display: none;
  }
  .table-container.table-labeled tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    background: white;
  }
  .table-container.table-labeled td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    border: none;
    border-bottom: 1px solid var(--gray-100);
    min-width: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow: hidden;
  }
  .table-container.table-labeled td > * {
    max-width: 100%;
    overflow-wrap: break-word;
  }
  .table-container td .table-actions {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .table-container.table-labeled td:last-child {
    border-bottom: none;
  }
  .table-container.table-labeled td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
  }
  .table-container.table-labeled .table-actions {
    justify-content: flex-end;
  }
}

/* Rich Text Editor (TipTap) */
.rich-editor-content { outline: none; }
.rich-editor-content h2 { font-size: 1.25rem; font-weight: 600; margin: 0.75rem 0 0.25rem; }
.rich-editor-content h3 { font-size: 1.0625rem; font-weight: 600; margin: 0.5rem 0 0.25rem; }
.rich-editor-content p { margin: 0.25rem 0; }
.rich-editor-content ul, .rich-editor-content ol { padding-left: 1.5rem; margin: 0.25rem 0; }
.rich-editor-content blockquote { border-left: 3px solid var(--primary-400); padding-left: 1rem; color: var(--gray-500); margin: 0.5rem 0; }
.rich-editor-content pre { background: var(--gray-100); padding: 0.75rem; border-radius: var(--radius-sm); font-size: 0.8125rem; overflow-x: auto; }
.rich-editor-content code { background: var(--gray-100); padding: 0.125rem 0.375rem; border-radius: 3px; font-size: 0.8125rem; }
.rich-editor-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 0.5rem 0; }
.rich-editor-content p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--gray-400);
  float: left;
  pointer-events: none;
  height: 0;
}

/* Prose styling for rendered HTML descriptions */
.prose h2 { font-size: 1.25rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.prose h3 { font-size: 1.0625rem; font-weight: 600; margin: 0.75rem 0 0.375rem; }
.prose p { margin: 0.5rem 0; line-height: 1.6; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin: 0.5rem 0; }
.prose ol { list-style: decimal; padding-left: 1.5rem; margin: 0.5rem 0; }
.prose blockquote { border-left: 3px solid var(--primary-400); padding-left: 1rem; color: var(--gray-500); margin: 0.75rem 0; }
.prose img { max-width: 100%; border-radius: var(--radius-sm); margin: 0.75rem 0; }
