/* ============================================================
   DLIT Corporate UI Design System v2.0
   Centralized Theme & Layout Configuration
   ============================================================ */

/* Alpine.js cloak — hide elements until Alpine boots */
[x-cloak] { display: none !important; }

:root {
  /* ==================== BRAND COLORS ==================== */
  /* Primary Brand - DUALAYER Blue */
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-primary-light: #dbeafe;
  --brand-primary-dark: #1e40af;
  
  /* Secondary Brand - Gold Accent */
  --brand-accent: #f59e0b;
  --brand-accent-hover: #d97706;
  --brand-accent-light: #fef3c7;
  
  /* ==================== SEMANTIC COLORS ==================== */
  /* Success - Green */
  --color-success: #16a34a;
  --color-success-light: #dcfce7;
  --color-success-dark: #15803d;
  --color-success-text: #166534;
  
  /* Danger/Error - Red */
  --color-danger: #dc2626;
  --color-danger-light: #fee2e2;
  --color-danger-dark: #b91c1c;
  --color-danger-text: #991b1b;
  
  /* Warning - Amber */
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-warning-dark: #b45309;
  --color-warning-text: #92400e;
  
  /* Info - Blue */
  --color-info: #0284c7;
  --color-info-light: #e0f2fe;
  --color-info-dark: #0369a1;
  --color-info-text: #075985;
  
  /* ==================== NEUTRAL COLORS ==================== */
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-slate-950: #020617;
  
  /* ==================== SPACING SCALE ==================== */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  
  /* ==================== BORDER RADIUS ==================== */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;
  
  /* ==================== SHADOWS ==================== */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.12);
  
  /* ==================== TYPOGRAPHY ==================== */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  
  /* ==================== HEADING SIZES (centralised) ==================== */
  --heading-page: 1.375rem;     /* 22px — main page titles */
  --heading-card: 1rem;         /* 16px — card/section headings (was 18px text-lg) */
  --heading-sub: 0.9375rem;     /* 15px — sub-section headings */
  --heading-modal: 1rem;        /* 16px — modal/dialog headings */
  
  /* ==================== TRANSITIONS ==================== */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* ==================== LAYOUT - RESPONSIVE ==================== */
  --content-max-width: 1400px;
  --content-padding: 1.5rem;
  --sidebar-width: 16rem;
  --sidebar-collapsed-width: 5rem;
  --header-height: 5rem;
  
  /* Legacy UI Variables (backwards compatibility) */
  --ui-radius: var(--radius-lg);
  --ui-radius-lg: var(--radius-xl);
  --ui-border: var(--color-slate-200);
  --ui-border-dark: var(--color-slate-700);
  --ui-surface: #ffffff;
  --ui-surface-dark: var(--color-slate-900);
  --ui-muted: var(--color-slate-500);
  --ui-muted-dark: var(--color-slate-400);
  --ui-shadow: var(--shadow-card);
  --ui-shadow-soft: var(--shadow-soft);
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  :root {
    --content-max-width: 1400px;
    --content-padding: 2rem;
  }
}

/* 2K Displays (1920px+) */
@media (min-width: 1920px) {
  :root {
    --content-max-width: 1600px;
    --content-padding: 2.5rem;
  }
}

/* Ultra-wide / 4K Displays (2560px+) */
@media (min-width: 2560px) {
  :root {
    --content-max-width: 1920px;
    --content-padding: 3rem;
  }
}

/* ==================== DARK MODE OVERRIDES ==================== */
html.dark {
  --ui-border: var(--color-slate-700);
  --ui-surface: var(--color-slate-900);
  --ui-muted: var(--color-slate-400);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.2), 0 6px 18px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== BASE STYLES ==================== */
body {
  background: var(--color-slate-50);
  font-family: var(--font-sans);
}

html.dark body {
  background: var(--color-slate-950);
}

/* ==================== PAGE LAYOUT ==================== */
.page-shell {
  min-height: 100%;
  padding: var(--content-padding);
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 45%),
              radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 45%);
}

html.dark .page-shell {
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 50%),
              radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 45%);
}

.page-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

.page-shell .flex.items-start.justify-between,
.page-shell .flex.items-center.justify-between {
  flex-wrap: wrap;
  row-gap: var(--space-3);
}

/* Tablet and below */
@media (max-width: 1024px) {
  :root {
    --content-padding: 1.25rem;
  }
  .page-container {
    max-width: 100%;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --content-padding: 1rem;
  }

  /* ── Responsive table → cards ── */
  .responsive-table thead { display: none; }
  .responsive-table tbody tr {
    display: block;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    background: white;
  }
  html.dark .responsive-table tbody tr {
    border-color: rgb(51 65 85);
    background: rgb(30 41 59);
  }
  .responsive-table tbody tr.empty-row {
    border: none;
    margin: 0;
    padding: 0;
  }
  .responsive-table tbody tr.empty-row td {
    display: block;
    padding: 3rem 1rem;
  }
  .responsive-table tbody tr.empty-row td::before { display: none; }
  .responsive-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border: none;
    text-align: right;
  }
  .responsive-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.7rem;
    color: rgb(100 116 139);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    text-align: left;
    white-space: nowrap;
  }
  html.dark .responsive-table tbody td::before {
    color: rgb(148 163 184);
  }
  .responsive-table .mobile-hide,
  .responsive-table thead .mobile-hide { display: none !important; }
  .responsive-table tbody td[data-label=""]::before,
  .responsive-table tbody td:not([data-label])::before { display: none; }
  .responsive-table tbody td.mobile-full {
    display: block;
    text-align: left;
    padding: 0.25rem 0;
  }
  .responsive-table tbody td.mobile-full::before { display: none; }
  /* Override overflow-x-auto parent so cards aren't clipped */
  .overflow-x-auto:has(.responsive-table) { overflow-x: visible; }
}

/* ============================================================
   COMPONENT CLASSES - Reusable UI Components
   ============================================================ */

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  line-height: 1.25rem;
}

.btn-md {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.25rem;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  line-height: 1.5rem;
}

.btn-icon {
  padding: var(--space-2);
  line-height: 1;
}

.btn-icon.btn-sm {
  padding: var(--space-1);
}

.btn-icon.btn-lg {
  padding: var(--space-3);
}

/* Primary Button */
.btn-primary {
  background: var(--brand-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: var(--shadow-md);
}

html.dark .btn-primary {
  background: #3b82f6;
}

html.dark .btn-primary:hover {
  background: var(--brand-primary);
}

/* Secondary Button */
.btn-secondary {
  background: var(--color-slate-100);
  color: var(--color-slate-700);
  border: 1px solid var(--color-slate-300);
}

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

html.dark .btn-secondary {
  background: var(--color-slate-700);
  color: var(--color-slate-100);
  border-color: var(--color-slate-600);
}

html.dark .btn-secondary:hover {
  background: var(--color-slate-600);
}

/* Success Button */
.btn-success {
  background: var(--color-success);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-success:hover {
  background: var(--color-success-dark);
}

/* Danger Button */
.btn-danger {
  background: var(--color-danger);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
  background: var(--color-danger-dark);
}

/* Warning Button */
.btn-warning {
  background: var(--color-warning);
  color: white;
  box-shadow: var(--shadow-sm);
}

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

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--color-slate-600);
}

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

html.dark .btn-ghost {
  color: var(--color-slate-400);
}

html.dark .btn-ghost:hover {
  background: var(--color-slate-800);
}

/* ==================== CARDS ==================== */
.card {
  background: white;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

html.dark .card {
  background: var(--color-slate-800);
  border-color: var(--color-slate-700);
}

.card-hover {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-slate-200);
}

html.dark .card-header {
  border-color: var(--color-slate-700);
}

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

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-slate-200);
  background: var(--color-slate-50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

html.dark .card-footer {
  border-color: var(--color-slate-700);
  background: var(--color-slate-800);
}

/* ==================== PAGE HEADERS ==================== */
.page-header {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-2xl);
  border: 1px solid;
  margin-bottom: var(--space-3);
}

.page-header-icon {
  font-size: var(--text-4xl);
  flex-shrink: 0;
}

.page-header-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.page-header-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-slate-900);
}

html.dark .page-header-title {
  color: var(--color-slate-50);
}

/* Page Header Color Variants */
.page-header-blue {
  background: linear-gradient(to right, #eff6ff, #dbeafe);
  border-color: #bfdbfe;
}

.page-header-blue .page-header-label {
  color: var(--brand-primary);
}

html.dark .page-header-blue {
  background: linear-gradient(to right, rgba(30, 64, 175, 0.3), rgba(29, 78, 216, 0.2));
  border-color: rgba(59, 130, 246, 0.5);
}

html.dark .page-header-blue .page-header-label {
  color: #60a5fa;
}

.page-header-indigo {
  background: linear-gradient(to right, #eef2ff, #e0e7ff);
  border-color: #c7d2fe;
}

.page-header-indigo .page-header-label {
  color: #4f46e5;
}

html.dark .page-header-indigo {
  background: linear-gradient(to right, rgba(67, 56, 202, 0.3), rgba(79, 70, 229, 0.2));
  border-color: rgba(99, 102, 241, 0.5);
}

html.dark .page-header-indigo .page-header-label {
  color: #a5b4fc;
}

.page-header-emerald {
  background: linear-gradient(to right, #ecfdf5, #d1fae5);
  border-color: #a7f3d0;
}

.page-header-emerald .page-header-label {
  color: #059669;
}

html.dark .page-header-emerald {
  background: linear-gradient(to right, rgba(6, 95, 70, 0.3), rgba(4, 120, 87, 0.2));
  border-color: rgba(16, 185, 129, 0.5);
}

html.dark .page-header-emerald .page-header-label {
  color: #34d399;
}

.page-header-amber {
  background: linear-gradient(to right, #fffbeb, #fef3c7);
  border-color: #fde68a;
}

.page-header-amber .page-header-label {
  color: #d97706;
}

html.dark .page-header-amber {
  background: linear-gradient(to right, rgba(146, 64, 14, 0.3), rgba(180, 83, 9, 0.2));
  border-color: rgba(245, 158, 11, 0.5);
}

html.dark .page-header-amber .page-header-label {
  color: #fbbf24;
}

.page-header-rose {
  background: linear-gradient(to right, #fff1f2, #ffe4e6);
  border-color: #fecdd3;
}

.page-header-rose .page-header-label {
  color: #e11d48;
}

html.dark .page-header-rose {
  background: linear-gradient(to right, rgba(159, 18, 57, 0.3), rgba(190, 18, 60, 0.2));
  border-color: rgba(244, 63, 94, 0.5);
}

html.dark .page-header-rose .page-header-label {
  color: #fb7185;
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.badge-lg {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.badge-primary {
  background: var(--brand-primary-light);
  color: var(--brand-primary-dark);
}

html.dark .badge-primary {
  background: rgba(37, 99, 235, 0.3);
  color: #93c5fd;
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success-text);
}

html.dark .badge-success {
  background: rgba(22, 163, 74, 0.3);
  color: #86efac;
}

.badge-danger {
  background: var(--color-danger-light);
  color: var(--color-danger-text);
}

html.dark .badge-danger {
  background: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}

.badge-warning {
  background: var(--color-warning-light);
  color: var(--color-warning-text);
}

html.dark .badge-warning {
  background: rgba(217, 119, 6, 0.3);
  color: #fcd34d;
}

.badge-info {
  background: var(--color-info-light);
  color: var(--color-info-text);
}

html.dark .badge-info {
  background: rgba(2, 132, 199, 0.3);
  color: #7dd3fc;
}

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

html.dark .badge-neutral {
  background: var(--color-slate-700);
  color: var(--color-slate-300);
}

/* ==================== FORM INPUTS ==================== */
.input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border: 1px solid var(--color-slate-300);
  border-radius: var(--radius-lg);
  background: white;
  color: var(--color-slate-900);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

html.dark .input {
  background: var(--color-slate-700);
  border-color: var(--color-slate-600);
  color: var(--color-slate-50);
}

html.dark .input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.input-lg {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
}

/* ==================== ALERTS ==================== */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
}

.alert-success {
  background: var(--color-success-light);
  border-color: var(--color-success);
  color: var(--color-success-text);
}

html.dark .alert-success {
  background: rgba(22, 163, 74, 0.2);
  color: #86efac;
}

.alert-danger {
  background: var(--color-danger-light);
  border-color: var(--color-danger);
  color: var(--color-danger-text);
}

html.dark .alert-danger {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

.alert-warning {
  background: var(--color-warning-light);
  border-color: var(--color-warning);
  color: var(--color-warning-text);
}

html.dark .alert-warning {
  background: rgba(217, 119, 6, 0.2);
  color: #fcd34d;
}

.alert-info {
  background: var(--color-info-light);
  border-color: var(--color-info);
  color: var(--color-info-text);
}

html.dark .alert-info {
  background: rgba(2, 132, 199, 0.2);
  color: #7dd3fc;
}

/* ==================== STAT CARDS ==================== */
.stat-card {
  background: white;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

html.dark .stat-card {
  background: var(--color-slate-800);
  border-color: var(--color-slate-700);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-slate-900);
}

html.dark .stat-card-value {
  color: var(--color-slate-50);
}

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

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
}

.modal-content {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow: hidden;
}

html.dark .modal-content {
  background: var(--color-slate-800);
  border: 1px solid var(--color-slate-700);
}

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

html.dark .modal-header {
  border-color: var(--color-slate-700);
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-slate-200);
  background: var(--color-slate-50);
}

html.dark .modal-footer {
  border-color: var(--color-slate-700);
  background: var(--color-slate-800);
}

/* ==================== DIVIDERS ==================== */
.divider {
  border-top: 1px solid var(--color-slate-200);
  margin: var(--space-4) 0;
}

html.dark .divider {
  border-color: var(--color-slate-700);
}

/* ============================================================
   LEGACY STYLES (maintaining backwards compatibility)
   ============================================================ */

/* Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  border-radius: var(--ui-radius);
  border-color: var(--ui-border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="tel"],
html.dark input[type="url"],
html.dark input[type="number"],
html.dark input[type="password"],
html.dark input[type="datetime-local"],
html.dark select,
html.dark textarea {
  border-color: var(--ui-border-dark);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Buttons */
button,
.btn,
a[role="button"] {
  border-radius: var(--ui-radius);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

button:active,
.btn:active,
a[role="button"]:active {
  transform: translateY(1px);
}

/* Cards */
.bg-white,
.dark\:bg-slate-800 {
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-soft);
}

header.bg-white,
footer.bg-white,
header.dark\:bg-slate-900,
footer.dark\:bg-slate-800 {
  border-radius: 0 !important;
  box-shadow: none !important;
}

#sidebar,
#sidebarWrapper {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.shadow-sm {
  box-shadow: var(--ui-shadow-soft) !important;
}

/* Tables */
table thead {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

table tbody tr:hover {
  background-color: rgba(15, 23, 42, 0.03);
}

html.dark table tbody tr:hover {
  background-color: rgba(148, 163, 184, 0.08);
}

/* Badges */
.badge {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

/* Compact contact modal form */
.contact-form-compact {
  font-size: 0.875rem;
}

.contact-form-compact label {
  font-size: 0.75rem;
}

.contact-form-compact input[type="text"],
.contact-form-compact input[type="email"],
.contact-form-compact input[type="tel"],
.contact-form-compact input[type="url"],
.contact-form-compact input[type="number"],
.contact-form-compact input[type="password"],
.contact-form-compact input[type="datetime-local"],
.contact-form-compact select,
.contact-form-compact textarea {
  font-size: 0.875rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.contact-form-compact .rounded-xl,
.contact-form-compact .rounded-lg {
  border-radius: 0.6rem;
}

/* ==================== CENTRALISED HEADING SIZES ==================== */
/* Card / section headings — controlled via --heading-card variable */
.card-heading,
.section-heading {
  font-size: var(--heading-card) !important;
  line-height: 1.4;
}

/* Modal / dialog headings */
.modal-heading {
  font-size: var(--heading-modal) !important;
  line-height: 1.4;
}

/* Page titles */
.page-heading {
  font-size: var(--heading-page) !important;
  line-height: 1.3;
}

/* ==================== UTILITY HELPERS ==================== */
/* Truncate text with ellipsis */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Monospace text (uses loaded JetBrains Mono) */
.font-mono,
code,
pre,
.mono {
  font-family: var(--font-mono);
}

/* Focus ring utility — consistent focus style */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
  border-color: var(--brand-primary);
}

html.dark .focus-ring:focus-visible {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

/* Smooth hover transition for interactive elements */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* Empty state container */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--color-slate-400);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

/* Section divider with label */
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-slate-400);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: var(--space-6) 0;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--color-slate-200);
}

html.dark .divider-label::before,
html.dark .divider-label::after {
  border-color: var(--color-slate-700);
}

/* ============================================================
   SIDEBAR COLLAPSE BEHAVIOUR
   (consolidated from base.html inline styles)
   ============================================================ */
#sidebar.collapsed {
  width: 5rem;
}

#sidebar.collapsed .nav-label {
  display: none;
}

#sidebar.collapsed .nav-collapsed {
  display: flex !important;
}

#sidebar.collapsed #logoCollapsed {
  display: flex !important;
}

#sidebar.collapsed #logoCollapsedImg {
  display: block !important;
}

#sidebar.collapsed nav a,
#sidebar.collapsed .nav-theme {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#sidebar.collapsed .px-5 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#sidebar.collapsed > div:last-child {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* Submenu items: remove indent, center icons, match parent icon size */
#sidebar.collapsed .submenu a {
  margin-left: 0;
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#sidebar.collapsed .submenu a i,
#sidebar.collapsed .submenu button i {
  font-size: 1.125rem;
}

/* Hide submenu dividers when collapsed */
#sidebar.collapsed .submenu .border-t {
  display: none;
}

/* Also target nav buttons (submenu parent toggles) */
#sidebar.collapsed nav button {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* App Settings menu transitions */
#appSettingsMenu.no-transition {
  transition: none !important;
}

#appSettingsMenu {
  transition: max-height 300ms ease-in-out;
}

/* ============================================================
   ARTICLE DARK MODE FORCE
   (consolidated from base.html inline styles)
   ============================================================ */
html.dark #article-content,
html.dark #article-content *:not(a):not(code):not(pre) {
  color: #e2e8f0 !important;
}

html.dark #article-content h1,
html.dark #article-content h2,
html.dark #article-content h3,
html.dark #article-content h4,
html.dark #article-content h5,
html.dark #article-content h6 {
  color: #f1f5f9 !important;
}

html.dark #article-content a {
  color: #60a5fa !important;
}

/* ============================================================
   BASE TYPOGRAPHY & SCROLL
   (consolidated from base.html inline styles)
   ============================================================ */
html {
  overflow-y: scroll;
}

/* Default paragraph leading */
p {
  line-height: 1.625;
}

/* ============================================================
   ARTICLE PROSE TYPOGRAPHY
   (consolidated from article-prose.css)
   ============================================================ */

/* Article Content Styling (Prose) */
.prose {
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.75;
}

.prose-slate {
  color: #334155;
}

html.dark .prose-invert {
  color: #e2e8f0 !important;
}

html.dark .prose-invert *:not(code):not(pre) {
  color: #e2e8f0 !important;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 2em;
  margin-bottom: 1em;
  font-weight: 700;
  line-height: 1.25;
  scroll-margin-top: 2rem;
}

.prose h1 {
  font-size: 2.25em;
  color: #0f172a;
}

.prose h2 {
  font-size: 1.875em;
  color: #0f172a;
}

.prose h3 {
  font-size: 1.5em;
  color: #0f172a;
}

.prose h4 {
  font-size: 1.25em;
  color: #0f172a;
}

.prose h5 {
  font-size: 1.125em;
  color: #0f172a;
}

.prose h6 {
  font-size: 1em;
  color: #0f172a;
}

.dark .prose-invert h1,
.dark .prose-invert h2,
.dark .prose-invert h3,
.dark .prose-invert h4,
.dark .prose-invert h5,
.dark .prose-invert h6 {
  color: #f1f5f9 !important;
}

html.dark .prose-invert h1,
html.dark .prose-invert h2,
html.dark .prose-invert h3,
html.dark .prose-invert h4,
html.dark .prose-invert h5,
html.dark .prose-invert h6 {
  color: #f1f5f9 !important;
}

.prose p {
  margin-bottom: 1.25em;
  color: inherit;
}

.dark .prose-invert p {
  color: #e2e8f0 !important;
}

html.dark .prose-invert p {
  color: #e2e8f0 !important;
}

.prose a {
  color: var(--brand-primary);
  text-decoration: underline;
  font-weight: 500;
}

.prose a:hover {
  color: var(--brand-primary-hover);
}

.dark .prose-invert a {
  color: #60a5fa;
}

.dark .prose-invert a:hover {
  color: #93c5fd;
}

.prose strong {
  font-weight: 600;
  color: #0f172a;
}

.dark .prose-invert strong {
  color: #f1f5f9;
}

.prose em {
  font-style: italic;
}

.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose ul > li::marker {
  color: #64748b;
}

.dark .prose-invert ul > li::marker {
  color: #94a3b8;
}

.prose ol > li::marker {
  color: #64748b;
  font-weight: 600;
}

.dark .prose-invert ol > li::marker {
  color: #94a3b8;
}

.prose blockquote {
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  padding-left: 1em;
  border-left: 4px solid #e2e8f0;
  font-style: italic;
  color: #64748b;
}

.dark .prose-invert blockquote {
  border-left-color: #334155;
  color: #94a3b8;
}

.prose code {
  background-color: #f1f5f9;
  color: #0f172a;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.dark .prose-invert code {
  background-color: #1e293b;
  color: #f1f5f9;
}

.prose pre {
  margin-top: 1.7em;
  margin-bottom: 1.7em;
  padding: 1em;
  border-radius: 0.5rem;
  background-color: #0f172a;
  overflow-x: auto;
}

.dark .prose-invert pre {
  background-color: #0f172a;
}

.prose pre code {
  background-color: transparent;
  color: #e2e8f0;
  padding: 0;
  font-weight: 400;
  font-size: 0.875em;
}

.dark .prose-invert pre code {
  color: #e2e8f0;
}

.prose table {
  width: 100%;
  margin-top: 2em;
  margin-bottom: 2em;
  border-collapse: collapse;
  font-size: 0.875em;
  line-height: 1.7;
}

.prose thead {
  border-bottom: 2px solid #cbd5e1;
}

.dark .prose-invert thead {
  border-bottom-color: #475569;
}

.prose thead th {
  color: #0f172a;
  font-weight: 600;
  vertical-align: bottom;
  padding: 0.5714em;
  text-align: left;
}

.dark .prose-invert thead th {
  color: #f1f5f9;
}

.prose tbody tr {
  border-bottom: 1px solid #e2e8f0;
}

.dark .prose-invert tbody tr {
  border-bottom-color: #334155;
}

.prose tbody td {
  padding: 0.5714em;
  vertical-align: top;
}

.prose hr {
  margin-top: 3em;
  margin-bottom: 3em;
  border: 0;
  border-top: 1px solid #e2e8f0;
}

.dark .prose-invert hr {
  border-top-color: #334155;
}

.prose img {
  margin-top: 2em;
  margin-bottom: 2em;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.prose figure {
  margin-top: 2em;
  margin-bottom: 2em;
}

.prose figcaption {
  color: #64748b;
  font-size: 0.875em;
  margin-top: 0.8571em;
  text-align: center;
}

.dark .prose-invert figcaption {
  color: #94a3b8;
}

/* Max width utilities */
.max-w-none {
  max-width: none;
}
