*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

/* ==========================================================================
   Google Fonts: Inter (Professional Business Typography)
   ========================================================================== */

/* ==========================================================================
   DESIGN TOKENS — Professional Business Theme
   ========================================================================== */

:root,
:root[data-theme="light"] {
  /* Canvas & Surfaces */
  --shell-bg: #f8fafc;
  /* Slate-50 clean canvas */
  --shell-surface: #ffffff;
  /* Pure white container surface */
  --shell-surface-hover: #f1f5f9;
  /* Slate-100 interactive hover */
  --shell-surface-active: #e2e8f0;
  /* Slate-200 active click */
  --shell-sidebar-bg: #ffffff;
  --shell-sidebar-active: rgba(37, 99, 235, 0.08);
  --shell-topbar-bg: rgba(255, 255, 255, 0.90);
  /* Borders & Dividers */
  --shell-border: #e2e8f0;
  /* Slate-200 crisp border */
  --shell-border-subtle: #f1f5f9;
  /* Slate-100 divider */
  --shell-border-focus: #2563eb;
  /* Slate-900 / Primary focus */
  /* Text & Typography */
  --shell-text: #0f172a;
  /* Slate-900 primary heading & text */
  --shell-text-muted: #64748b;
  /* Slate-500 secondary / label text */
  --shell-text-subtle: #94a3b8;
  /* Slate-400 placeholder / subtle text */
  /* Primary Accent (Corporate Enterprise Blue) */
  --shell-accent: #2563eb;
  /* Blue-600 */
  --shell-accent-hover: #1d4ed8;
  /* Blue-700 */
  --shell-accent-text: #ffffff;
  --shell-accent-subtle: rgba(37, 99, 235, 0.08);
  --shell-accent-subtle-hover: rgba(37, 99, 235, 0.14);
  /* Card tokens */
  --shell-card-bg: #ffffff;
  --shell-card-border: #e2e8f0;
  --shell-card-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shell-card-shadow-hover: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  /* Input tokens */
  --shell-input-bg: #ffffff;
  --shell-input-border: #cbd5e1;
  /* Slate-300 accessible input border */
  --shell-input-focus-border: #2563eb;
  --shell-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);
  /* Button tokens */
  --shell-btn-primary-bg: #2563eb;
  --shell-btn-primary-text: #ffffff;
  --shell-btn-primary-hover: #1d4ed8;
  --shell-btn-secondary-bg: #ffffff;
  --shell-btn-secondary-border: #cbd5e1;
  --shell-btn-secondary-text: #334155;
  --shell-btn-secondary-hover: #f8fafc;
  /* Status Colors (Enterprise Refined) */
  --shell-success: #059669;
  /* Emerald-600 */
  --shell-success-hover: #047857;
  --shell-success-bg: rgba(5, 150, 105, 0.10);
  --shell-success-border: rgba(5, 150, 105, 0.25);
  --shell-warning: #d97706;
  /* Amber-600 */
  --shell-warning-hover: #b45309;
  --shell-warning-bg: rgba(217, 119, 6, 0.10);
  --shell-warning-border: rgba(217, 119, 6, 0.25);
  --shell-danger: #dc2626;
  /* Red-600 */
  --shell-danger-hover: #b91c1c;
  --shell-danger-bg: rgba(220, 38, 38, 0.10);
  --shell-danger-border: rgba(220, 38, 38, 0.25);
  --shell-info: #0284c7;
  /* Sky-600 */
  --shell-info-hover: #0369a1;
  --shell-info-bg: rgba(2, 132, 199, 0.10);
  --shell-info-border: rgba(2, 132, 199, 0.25);
  /* Neutral Badges & Pills */
  --shell-neutral: #475569;
  --shell-neutral-bg: #f1f5f9;
  --shell-neutral-border: #e2e8f0;
  /* Modal Backdrop */
  --shell-backdrop-bg: rgba(15, 23, 42, 0.55);
}

:root[data-theme="dark"] {
  /* Canvas & Surfaces */
  --shell-bg: #09090b;
  /* Zinc-950 deep canvas */
  --shell-surface: #18181b;
  /* Zinc-900 surface cards */
  --shell-surface-hover: #27272a;
  /* Zinc-800 interactive hover */
  --shell-surface-active: #3f3f46;
  /* Zinc-700 active */
  --shell-sidebar-bg: #111114;
  --shell-sidebar-active: rgba(59, 130, 246, 0.14);
  --shell-topbar-bg: rgba(24, 24, 27, 0.90);
  /* Borders & Dividers */
  --shell-border: #27272a;
  /* Zinc-800 */
  --shell-border-subtle: #1f1f23;
  --shell-border-focus: #3b82f6;
  /* Text & Typography */
  --shell-text: #f8fafc;
  /* Slate-50 high contrast text */
  --shell-text-muted: #94a3b8;
  /* Slate-400 */
  --shell-text-subtle: #64748b;
  /* Slate-500 */
  /* Primary Accent */
  --shell-accent: #3b82f6;
  /* Blue-500 */
  --shell-accent-hover: #60a5fa;
  /* Blue-400 */
  --shell-accent-text: #ffffff;
  --shell-accent-subtle: rgba(59, 130, 246, 0.15);
  --shell-accent-subtle-hover: rgba(59, 130, 246, 0.22);
  /* Card tokens */
  --shell-card-bg: #18181b;
  --shell-card-border: #27272a;
  --shell-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shell-card-shadow-hover: 0 4px 10px rgba(0, 0, 0, 0.45);
  /* Input tokens */
  --shell-input-bg: #09090b;
  --shell-input-border: #3f3f46;
  --shell-input-focus-border: #3b82f6;
  --shell-focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.25);
  /* Button tokens */
  --shell-btn-primary-bg: #3b82f6;
  --shell-btn-primary-text: #ffffff;
  --shell-btn-primary-hover: #60a5fa;
  --shell-btn-secondary-bg: #18181b;
  --shell-btn-secondary-border: #3f3f46;
  --shell-btn-secondary-text: #f8fafc;
  --shell-btn-secondary-hover: #27272a;
  /* Status Colors */
  --shell-success: #10b981;
  --shell-success-hover: #34d399;
  --shell-success-bg: rgba(16, 185, 129, 0.15);
  --shell-success-border: rgba(16, 185, 129, 0.30);
  --shell-warning: #f59e0b;
  --shell-warning-hover: #fbbf24;
  --shell-warning-bg: rgba(245, 158, 11, 0.15);
  --shell-warning-border: rgba(245, 158, 11, 0.30);
  --shell-danger: #ef4444;
  --shell-danger-hover: #f87171;
  --shell-danger-bg: rgba(239, 68, 68, 0.15);
  --shell-danger-border: rgba(239, 68, 68, 0.30);
  --shell-info: #38bdf8;
  --shell-info-hover: #7dd3fc;
  --shell-info-bg: rgba(56, 189, 248, 0.15);
  --shell-info-border: rgba(56, 189, 248, 0.30);
  /* Neutral Badges & Pills */
  --shell-neutral: #cbd5e1;
  --shell-neutral-bg: #27272a;
  --shell-neutral-border: #3f3f46;
  /* Modal Backdrop */
  --shell-backdrop-bg: rgba(0, 0, 0, 0.75);
}

/* ==========================================================================
   BASE RESET & TYPOGRAPHY
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--shell-bg);
  color: var(--shell-text);
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* ==========================================================================
   COMPONENT SUITE
   ========================================================================== */

/* 1. App Shell In-App Sub Navigation Bar (`.appshell-top-nav`) */

.appshell-top-nav {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--shell-border);
  margin-bottom: 24px;
  margin-top: -10px;
}

.appshell-top-nav .appshell-nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 24px;
}

.appshell-top-nav .appshell-nav-item {
  position: relative;
}

.appshell-top-nav a.appshell-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--shell-text-muted);
  text-decoration: none;
  padding: 12px 4px;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.appshell-top-nav .appshell-nav-item:hover > a.appshell-nav-link {
  color: var(--shell-text);
}

.appshell-top-nav .appshell-nav-item.active > a.appshell-nav-link {
  color: var(--shell-accent);
  border-bottom-color: var(--shell-accent);
  font-weight: 600;
}

.appshell-top-nav .appshell-nav-item.dropdown > a::after,
.appshell-dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;
  -webkit-mask-size: contain;
  transition: transform 0.2s ease;
  margin-left: 2px;
  opacity: 0.8;
}

.appshell-top-nav .appshell-nav-item.dropdown:hover > a::after {
  transform: rotate(180deg);
}

.appshell-top-nav .appshell-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 170px;
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  padding: 6px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 100;
}

.appshell-top-nav .appshell-nav-item.dropdown:hover .appshell-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.appshell-top-nav .appshell-dropdown-menu li a {
  padding: 8px 16px;
  display: block;
  color: var(--shell-text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.appshell-top-nav .appshell-dropdown-menu li a:hover {
  background: var(--shell-surface-hover);
}

.appshell-mobile-nav-toggle {
  display: none;
}

.appshell-nav-drawer-overlay {
  display: none;
}

.appshell-nav-drawer-header {
  display: none;
}

@media (max-width: 640px) {
  .appshell-top-nav {
    border-bottom: none;
    margin-bottom: 16px;
  }

  .appshell-mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--shell-text);
    cursor: pointer;
  }

  .appshell-mobile-nav-toggle::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='21' y2='18'%3E%3C/line%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='21' y2='18'%3E%3C/line%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
    flex-shrink: 0;
  }

  .appshell-nav-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--shell-backdrop-bg);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  .appshell-nav-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .appshell-top-nav .appshell-nav-list {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--shell-surface);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 1001;
    flex-direction: column;
    gap: 0;
    padding: 0 0 20px 0;
    transition: right 0.25s ease;
    overflow-y: auto;
  }

  .appshell-top-nav .appshell-nav-list.open {
    right: 0;
  }

  .appshell-nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--shell-border);
    margin-bottom: 6px;
    background: var(--shell-surface);
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .appshell-nav-drawer-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--shell-text);
  }

  .appshell-nav-close {
    background: transparent;
    border: none;
    color: var(--shell-text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
  }

  .appshell-nav-close:hover {
    background: var(--shell-surface-hover);
    color: var(--shell-text);
  }

  .appshell-nav-close::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
  }

  .appshell-top-nav a.appshell-nav-link {
    padding: 14px 20px;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .appshell-top-nav .appshell-nav-item.active > a.appshell-nav-link {
    border-left-color: var(--shell-accent);
    background: var(--shell-surface-hover);
  }
}

/* 2. Page Header & Breadcrumbs */

.shell-page-header,
.page-header {
  margin-bottom: 24px;
}

.shell-page-header h1,
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--shell-text);
  line-height: 1.25;
}

.shell-page-header p,
.page-header p {
  font-size: 0.875rem;
  color: var(--shell-text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.shell-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--shell-text-muted);
  margin-bottom: 12px;
  list-style: none;
}

.shell-breadcrumbs a {
  color: var(--shell-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.shell-breadcrumbs a:hover {
  color: var(--shell-accent);
}

.shell-breadcrumbs .separator {
  color: var(--shell-text-subtle);
}

.shell-breadcrumbs .active {
  color: var(--shell-text);
  font-weight: 600;
}

/* 3. Cards & Stat Cards */

.shell-card {
  background: var(--shell-card-bg);
  border: 1px solid var(--shell-card-border);
  border-radius: 12px;
  box-shadow: var(--shell-card-shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.shell-card-interactive:hover {
  box-shadow: var(--shell-card-shadow-hover);
  border-color: var(--shell-accent);
  cursor: pointer;
}

.shell-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--shell-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shell-card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--shell-text);
}

.shell-card-subtitle {
  font-size: 0.8125rem;
  color: var(--shell-text-muted);
  margin-top: 2px;
}

.shell-card-body {
  padding: 20px;
}

.shell-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--shell-border);
  background: var(--shell-surface-hover);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Stat Card (KPI Metric) */

.shell-stat-card,
.stat-card {
  background: var(--shell-card-bg);
  border: 1px solid var(--shell-card-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shell-card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.shell-stat-card:hover,
.stat-card:hover {
  box-shadow: var(--shell-card-shadow-hover);
}

.shell-stat-card .shell-stat-icon,
.shell-stat-card .stat-icon,
.stat-card .shell-stat-icon,
.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.shell-stat-card .shell-stat-value,
.shell-stat-card .stat-value,
.stat-card .shell-stat-value,
.stat-card .stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--shell-text);
  line-height: 1.15;
}

.shell-stat-card .shell-stat-label,
.shell-stat-card .stat-label,
.stat-card .shell-stat-label,
.stat-card .stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--shell-text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shell-stat-card .shell-stat-change,
.shell-stat-card .stat-change,
.stat-card .shell-stat-change,
.stat-card .stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  width: -moz-fit-content;
  width: fit-content;
}

.stat-change.positive,
.shell-stat-change.positive {
  color: var(--shell-success);
  background: var(--shell-success-bg);
}

.stat-change.negative,
.shell-stat-change.negative {
  color: var(--shell-danger);
  background: var(--shell-danger-bg);
}

.stat-change.neutral,
.shell-stat-change.neutral {
  color: var(--shell-neutral);
  background: var(--shell-neutral-bg);
}

/* 4. Buttons */

.shell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  white-space: nowrap;
}

.shell-btn:focus-visible {
  outline: none;
  box-shadow: var(--shell-focus-ring);
}

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

.shell-btn-primary {
  background: var(--shell-btn-primary-bg);
  color: var(--shell-btn-primary-text);
}

.shell-btn-primary:hover:not(:disabled) {
  background: var(--shell-btn-primary-hover);
}

.shell-btn-secondary {
  background: var(--shell-btn-secondary-bg);
  color: var(--shell-btn-secondary-text);
  border-color: var(--shell-btn-secondary-border);
}

.shell-btn-secondary:hover:not(:disabled) {
  background: var(--shell-btn-secondary-hover);
  border-color: var(--shell-text-muted);
}

.shell-btn-danger {
  background: var(--shell-danger);
  color: #ffffff;
}

.shell-btn-danger:hover:not(:disabled) {
  background: var(--shell-danger-hover);
}

.shell-btn-success {
  background: var(--shell-success);
  color: #ffffff;
}

.shell-btn-success:hover:not(:disabled) {
  background: var(--shell-success-hover);
}

.shell-btn-warning {
  background: var(--shell-warning);
  color: #ffffff;
}

.shell-btn-warning:hover:not(:disabled) {
  background: var(--shell-warning-hover);
}

.shell-btn-outline {
  background: transparent;
  color: var(--shell-accent);
  border-color: var(--shell-accent);
}

.shell-btn-outline:hover:not(:disabled) {
  background: var(--shell-accent-subtle);
}

.shell-btn-ghost {
  background: transparent;
  color: var(--shell-text-muted);
}

.shell-btn-ghost:hover:not(:disabled) {
  background: var(--shell-surface-hover);
  color: var(--shell-text);
}

.shell-btn-sm {
  padding: 5px 10px;
  font-size: 0.8125rem;
  border-radius: 6px;
  gap: 5px;
}

.shell-btn-lg {
  padding: 11px 22px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  gap: 10px;
}

.shell-btn-icon {
  padding: 8px;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
}

.shell-btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.shell-btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: shell-spin 0.65s linear infinite;
  color: var(--shell-text);
}

.shell-btn-primary.shell-btn-loading::after {
  color: #ffffff;
}

/* 5. Form Controls */

.shell-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.shell-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--shell-text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.shell-label-required::after {
  content: "*";
  color: var(--shell-danger);
  font-weight: bold;
}

.shell-input,
.shell-select,
.shell-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--shell-text);
  background-color: var(--shell-input-bg);
  border: 1px solid var(--shell-input-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shell-input:focus,
.shell-select:focus,
.shell-textarea:focus {
  border-color: var(--shell-input-focus-border);
  box-shadow: var(--shell-focus-ring);
}

.shell-input::-moz-placeholder, .shell-textarea::-moz-placeholder {
  color: var(--shell-text-subtle);
}

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

.shell-input:disabled,
.shell-select:disabled,
.shell-textarea:disabled {
  background-color: var(--shell-surface-hover);
  color: var(--shell-text-subtle);
  cursor: not-allowed;
  opacity: 0.7;
}

.shell-input-sm {
  padding: 5px 10px;
  font-size: 0.8125rem;
  border-radius: 6px;
}

.shell-input-lg {
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 10px;
}

.shell-input-error {
  border-color: var(--shell-danger) !important;
}

.shell-input-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}

.shell-hint {
  font-size: 0.75rem;
  color: var(--shell-text-muted);
}

.shell-error-msg {
  font-size: 0.75rem;
  color: var(--shell-danger);
  font-weight: 500;
}

.shell-input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.shell-input-group > .shell-input {
  border-radius: 0;
}

.shell-input-group > .shell-input:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.shell-input-group > .shell-input:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.shell-input-addon {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--shell-surface-hover);
  border: 1px solid var(--shell-input-border);
  color: var(--shell-text-muted);
  font-size: 0.875rem;
}

.shell-input-addon:first-child {
  border-right: none;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.shell-input-addon:last-child {
  border-left: none;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.shell-checkbox,
.shell-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--shell-text);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.shell-checkbox input,
.shell-radio input {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--shell-input-border);
  border-radius: 4px;
  background: var(--shell-input-bg);
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 0.15s;
  margin: 0;
}

.shell-radio input {
  border-radius: 50%;
}

.shell-checkbox input:checked,
.shell-radio input:checked {
  background-color: var(--shell-accent);
  border-color: var(--shell-accent);
}

.shell-checkbox input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.shell-radio input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

.shell-checkbox input:focus-visible,
.shell-radio input:focus-visible {
  box-shadow: var(--shell-focus-ring);
}

.shell-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.shell-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.shell-switch-slider {
  position: relative;
  width: 38px;
  height: 22px;
  background-color: var(--shell-input-border);
  border-radius: 22px;
  transition: 0.2s;
  display: inline-block;
}

.shell-switch-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.shell-switch input:checked + .shell-switch-slider {
  background-color: var(--shell-accent);
}

.shell-switch input:checked + .shell-switch-slider::before {
  transform: translateX(16px);
}

.shell-switch input:focus-visible + .shell-switch-slider {
  box-shadow: var(--shell-focus-ring);
}

/* 6. Data Tables */

.shell-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.shell-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  text-align: left;
}

.shell-table thead th {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--shell-text-muted);
  border-bottom: 1px solid var(--shell-border);
  background: var(--shell-surface-hover);
  white-space: nowrap;
}

.shell-table thead th:first-child {
  border-top-left-radius: 8px;
}

.shell-table thead th:last-child {
  border-top-right-radius: 8px;
}

.shell-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--shell-border);
  color: var(--shell-text);
  vertical-align: middle;
  transition: background 0.15s;
}

.shell-table tbody tr:hover td {
  background: var(--shell-surface-hover);
}

.shell-table-striped tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.015);
}

:root[data-theme="dark"] .shell-table-striped tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

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

.shell-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--shell-border);
  font-size: 0.8125rem;
  color: var(--shell-text-muted);
}

.shell-pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shell-pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--shell-border);
  background: var(--shell-surface);
  color: var(--shell-text);
  border-radius: 6px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}

.shell-pagination-btn:hover:not(:disabled) {
  background: var(--shell-surface-hover);
  border-color: var(--shell-text-muted);
}

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

.shell-pagination-btn.active {
  background: var(--shell-accent);
  color: #ffffff;
  border-color: var(--shell-accent);
  font-weight: 600;
}

/* 7. Badges */

.shell-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.shell-badge-pill {
  border-radius: 9999px;
  padding: 3px 10px;
}

.shell-badge.success {
  color: var(--shell-success);
  background: var(--shell-success-bg);
  border: 1px solid var(--shell-success-border);
}

.shell-badge.warning {
  color: var(--shell-warning);
  background: var(--shell-warning-bg);
  border: 1px solid var(--shell-warning-border);
}

.shell-badge.danger {
  color: var(--shell-danger);
  background: var(--shell-danger-bg);
  border: 1px solid var(--shell-danger-border);
}

.shell-badge.info {
  color: var(--shell-info);
  background: var(--shell-info-bg);
  border: 1px solid var(--shell-info-border);
}

.shell-badge.accent {
  color: var(--shell-accent);
  background: var(--shell-accent-subtle);
  border: 1px solid var(--shell-accent);
}

.shell-badge.neutral {
  color: var(--shell-neutral);
  background: var(--shell-neutral-bg);
  border: 1px solid var(--shell-neutral-border);
}

.shell-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background-color: currentColor;
}

/* 8. Alerts */

.shell-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.shell-alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.shell-alert-content {
  flex-grow: 1;
}

.shell-alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.shell-alert-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 2px;
}

.shell-alert-close:hover {
  opacity: 1;
}

.shell-alert-info {
  background: var(--shell-info-bg);
  border-color: var(--shell-info-border);
  color: var(--shell-info);
}

.shell-alert-success {
  background: var(--shell-success-bg);
  border-color: var(--shell-success-border);
  color: var(--shell-success);
}

.shell-alert-warning {
  background: var(--shell-warning-bg);
  border-color: var(--shell-warning-border);
  color: var(--shell-warning);
}

.shell-alert-danger {
  background: var(--shell-danger-bg);
  border-color: var(--shell-danger-border);
  color: var(--shell-danger);
}

/* 9. Modals */

.shell-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--shell-backdrop-bg);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.shell-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.shell-modal {
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.shell-modal-overlay.open .shell-modal {
  transform: scale(1) translateY(0);
}

.shell-modal-sm {
  max-width: 380px;
}

.shell-modal-lg {
  max-width: 720px;
}

.shell-modal-xl {
  max-width: 960px;
}

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

.shell-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--shell-text);
}

.shell-modal-close {
  background: transparent;
  border: none;
  color: var(--shell-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shell-modal-close:hover {
  background: var(--shell-surface-hover);
  color: var(--shell-text);
}

.shell-modal-body {
  padding: 22px;
  overflow-y: auto;
  font-size: 0.875rem;
  color: var(--shell-text);
  line-height: 1.5;
}

.shell-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--shell-border);
  background: var(--shell-surface-hover);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* 10. Tabs */

.shell-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--shell-border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.shell-tab {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--shell-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

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

.shell-tab.active {
  color: var(--shell-accent);
  border-bottom-color: var(--shell-accent);
  font-weight: 600;
}

.shell-tabs-pills {
  border-bottom: none;
  background: var(--shell-surface-hover);
  padding: 4px;
  border-radius: 8px;
  display: inline-flex;
  width: -moz-fit-content;
  width: fit-content;
}

.shell-tabs-pills .shell-tab {
  border-radius: 6px;
  border-bottom: none;
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.shell-tabs-pills .shell-tab.active {
  background: var(--shell-surface);
  color: var(--shell-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* 11. Avatars */

.shell-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--shell-surface-hover);
  color: var(--shell-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  position: relative;
  flex-shrink: 0;
  border: 2px solid var(--shell-surface);
}

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

.shell-avatar-xs {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}

.shell-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.shell-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
}

.shell-avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 1.35rem;
}

.shell-avatar-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
  border: 2px solid var(--shell-surface);
}

.shell-avatar-status.online {
  background: var(--shell-success);
}

.shell-avatar-status.offline {
  background: var(--shell-text-subtle);
}

.shell-avatar-status.busy {
  background: var(--shell-danger);
}

.shell-avatar-group {
  display: flex;
  align-items: center;
}

.shell-avatar-group .shell-avatar {
  margin-left: -10px;
}

.shell-avatar-group .shell-avatar:first-child {
  margin-left: 0;
}

/* 12. Progress, Spinner, Skeletons */

.shell-progress {
  width: 100%;
  height: 8px;
  background: var(--shell-surface-hover);
  border-radius: 9999px;
  overflow: hidden;
}

.shell-progress-bar {
  height: 100%;
  background: var(--shell-accent);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.shell-progress-bar.success {
  background: var(--shell-success);
}

.shell-progress-bar.warning {
  background: var(--shell-warning);
}

.shell-progress-bar.danger {
  background: var(--shell-danger);
}

.shell-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--shell-border);
  border-top-color: var(--shell-accent);
  border-radius: 50%;
  animation: shell-spin 0.65s linear infinite;
  display: inline-block;
}

.shell-spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.shell-spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3.5px;
}

@keyframes shell-spin {
  to {
    transform: rotate(360deg);
  }
}

.shell-skeleton {
  background: linear-gradient(90deg, var(--shell-surface-hover) 25%, var(--shell-border) 50%, var(--shell-surface-hover) 75%);
  background-size: 200% 100%;
  animation: shell-skeleton-pulse 1.5s infinite;
  border-radius: 6px;
}

.shell-skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.shell-skeleton-circle {
  border-radius: 50%;
}

@keyframes shell-skeleton-pulse {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* 13. Empty State */

.shell-empty {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.shell-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--shell-surface-hover);
  color: var(--shell-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.shell-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--shell-text);
  margin-bottom: 4px;
}

.shell-empty-desc {
  font-size: 0.875rem;
  color: var(--shell-text-muted);
  max-width: 360px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* 14. Scrollbar */

.shell-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.shell-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.shell-scrollbar::-webkit-scrollbar-thumb {
  background: var(--shell-border);
  border-radius: 3px;
}

.shell-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--shell-text-subtle);
}

/* ==========================================================================
   PRECOMPILED UTILITY CLASSES (`.shell-*`)
   ========================================================================== */

/* Display */

.shell-flex {
  display: flex !important;
}

.shell-inline-flex {
  display: inline-flex !important;
}

.shell-grid {
  display: grid !important;
}

.shell-block {
  display: block !important;
}

.shell-inline-block {
  display: inline-block !important;
}

.shell-inline {
  display: inline !important;
}

.shell-hidden {
  display: none !important;
}

/* Flex Direction & Wrap */

.shell-flex-row {
  flex-direction: row !important;
}

.shell-flex-row-reverse {
  flex-direction: row-reverse !important;
}

.shell-flex-col {
  flex-direction: column !important;
}

.shell-flex-col-reverse {
  flex-direction: column-reverse !important;
}

.shell-flex-wrap {
  flex-wrap: wrap !important;
}

.shell-flex-nowrap {
  flex-wrap: nowrap !important;
}

/* Flex Alignment */

.shell-items-start {
  align-items: flex-start !important;
}

.shell-items-center {
  align-items: center !important;
}

.shell-items-end {
  align-items: flex-end !important;
}

.shell-items-baseline {
  align-items: baseline !important;
}

.shell-items-stretch {
  align-items: stretch !important;
}

.shell-justify-start {
  justify-content: flex-start !important;
}

.shell-justify-center {
  justify-content: center !important;
}

.shell-justify-end {
  justify-content: flex-end !important;
}

.shell-justify-between {
  justify-content: space-between !important;
}

.shell-justify-around {
  justify-content: space-around !important;
}

.shell-justify-evenly {
  justify-content: space-evenly !important;
}

.shell-grow {
  flex-grow: 1 !important;
}

.shell-grow-0 {
  flex-grow: 0 !important;
}

.shell-shrink {
  flex-shrink: 1 !important;
}

.shell-shrink-0 {
  flex-shrink: 0 !important;
}

/* Grid Columns (1-12) */

.shell-grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

.shell-grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.shell-grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.shell-grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.shell-grid-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.shell-grid-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

.shell-grid-cols-7 {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}

.shell-grid-cols-8 {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
}

.shell-grid-cols-9 {
  grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
}

.shell-grid-cols-10 {
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
}

.shell-grid-cols-11 {
  grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
}

.shell-grid-cols-12 {
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
}

.shell-grid-cols-auto {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

/* Grid Column Spans (1-12) */

.shell-col-span-1 {
  grid-column: span 1 / span 1 !important;
}

.shell-col-span-2 {
  grid-column: span 2 / span 2 !important;
}

.shell-col-span-3 {
  grid-column: span 3 / span 3 !important;
}

.shell-col-span-4 {
  grid-column: span 4 / span 4 !important;
}

.shell-col-span-5 {
  grid-column: span 5 / span 5 !important;
}

.shell-col-span-6 {
  grid-column: span 6 / span 6 !important;
}

.shell-col-span-7 {
  grid-column: span 7 / span 7 !important;
}

.shell-col-span-8 {
  grid-column: span 8 / span 8 !important;
}

.shell-col-span-9 {
  grid-column: span 9 / span 9 !important;
}

.shell-col-span-10 {
  grid-column: span 10 / span 10 !important;
}

.shell-col-span-11 {
  grid-column: span 11 / span 11 !important;
}

.shell-col-span-12 {
  grid-column: span 12 / span 12 !important;
}

.shell-col-span-full {
  grid-column: 1 / -1 !important;
}

/* Spacing: Gap */

.shell-gap-0 {
  gap: 0px !important;
}

.shell-gap-1 {
  gap: 4px !important;
}

.shell-gap-2 {
  gap: 8px !important;
}

.shell-gap-3 {
  gap: 12px !important;
}

.shell-gap-4 {
  gap: 16px !important;
}

.shell-gap-5 {
  gap: 20px !important;
}

.shell-gap-6 {
  gap: 24px !important;
}

.shell-gap-8 {
  gap: 32px !important;
}

.shell-gap-10 {
  gap: 40px !important;
}

.shell-gap-12 {
  gap: 48px !important;
}

/* Spacing: Padding */

.shell-p-0 {
  padding: 0px !important;
}

.shell-p-1 {
  padding: 4px !important;
}

.shell-p-2 {
  padding: 8px !important;
}

.shell-p-3 {
  padding: 12px !important;
}

.shell-p-4 {
  padding: 16px !important;
}

.shell-p-5 {
  padding: 20px !important;
}

.shell-p-6 {
  padding: 24px !important;
}

.shell-p-8 {
  padding: 32px !important;
}

.shell-px-0 {
  padding-left: 0px !important;
  padding-right: 0px !important;
}

.shell-px-2 {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.shell-px-3 {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

.shell-px-4 {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.shell-px-6 {
  padding-left: 24px !important;
  padding-right: 24px !important;
}

.shell-py-0 {
  padding-top: 0px !important;
  padding-bottom: 0px !important;
}

.shell-py-1 {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

.shell-py-2 {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.shell-py-3 {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

.shell-py-4 {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

.shell-py-6 {
  padding-top: 24px !important;
  padding-bottom: 24px !important;
}

.shell-pt-2 {
  padding-top: 8px !important;
}

.shell-pt-4 {
  padding-top: 16px !important;
}

.shell-pb-2 {
  padding-bottom: 8px !important;
}

.shell-pb-4 {
  padding-bottom: 16px !important;
}

/* Spacing: Margin */

.shell-m-0 {
  margin: 0px !important;
}

.shell-m-1 {
  margin: 4px !important;
}

.shell-m-2 {
  margin: 8px !important;
}

.shell-m-3 {
  margin: 12px !important;
}

.shell-m-4 {
  margin: 16px !important;
}

.shell-m-6 {
  margin: 24px !important;
}

.shell-m-auto {
  margin: auto !important;
}

.shell-mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.shell-my-2 {
  margin-top: 8px !important;
  margin-bottom: 8px !important;
}

.shell-my-4 {
  margin-top: 16px !important;
  margin-bottom: 16px !important;
}

.shell-my-6 {
  margin-top: 24px !important;
  margin-bottom: 24px !important;
}

.shell-mt-1 {
  margin-top: 4px !important;
}

.shell-mt-2 {
  margin-top: 8px !important;
}

.shell-mt-3 {
  margin-top: 12px !important;
}

.shell-mt-4 {
  margin-top: 16px !important;
}

.shell-mt-6 {
  margin-top: 24px !important;
}

.shell-mt-8 {
  margin-top: 32px !important;
}

.shell-mb-1 {
  margin-bottom: 4px !important;
}

.shell-mb-2 {
  margin-bottom: 8px !important;
}

.shell-mb-3 {
  margin-bottom: 12px !important;
}

.shell-mb-4 {
  margin-bottom: 16px !important;
}

.shell-mb-6 {
  margin-bottom: 24px !important;
}

.shell-mb-8 {
  margin-bottom: 32px !important;
}

.shell-mr-2 {
  margin-right: 8px !important;
}

.shell-mr-4 {
  margin-right: 16px !important;
}

.shell-ml-2 {
  margin-left: 8px !important;
}

.shell-ml-4 {
  margin-left: 16px !important;
}

/* Typography Utilities */

.shell-text-xs {
  font-size: 0.75rem !important;
  line-height: 1rem !important;
}

.shell-text-sm {
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
}

.shell-text-base {
  font-size: 1rem !important;
  line-height: 1.5rem !important;
}

.shell-text-lg {
  font-size: 1.125rem !important;
  line-height: 1.75rem !important;
}

.shell-text-xl {
  font-size: 1.25rem !important;
  line-height: 1.75rem !important;
}

.shell-text-2xl {
  font-size: 1.5rem !important;
  line-height: 2rem !important;
}

.shell-text-3xl {
  font-size: 1.875rem !important;
  line-height: 2.25rem !important;
}

.shell-font-normal {
  font-weight: 400 !important;
}

.shell-font-medium {
  font-weight: 500 !important;
}

.shell-font-semibold {
  font-weight: 600 !important;
}

.shell-font-bold {
  font-weight: 700 !important;
}

.shell-text-left {
  text-align: left !important;
}

.shell-text-center {
  text-align: center !important;
}

.shell-text-right {
  text-align: right !important;
}

.shell-text-main {
  color: var(--shell-text) !important;
}

.shell-text-muted {
  color: var(--shell-text-muted) !important;
}

.shell-text-subtle {
  color: var(--shell-text-subtle) !important;
}

.shell-text-accent {
  color: var(--shell-accent) !important;
}

.shell-text-success {
  color: var(--shell-success) !important;
}

.shell-text-warning {
  color: var(--shell-warning) !important;
}

.shell-text-danger {
  color: var(--shell-danger) !important;
}

.shell-truncate {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.shell-uppercase {
  text-transform: uppercase !important;
}

/* Sizing Utilities */

.shell-w-full {
  width: 100% !important;
}

.shell-w-auto {
  width: auto !important;
}

.shell-w-fit {
  width: -moz-fit-content !important;
  width: fit-content !important;
}

.shell-w-1\/2 {
  width: 50% !important;
}

.shell-w-1\/3 {
  width: 33.333333% !important;
}

.shell-w-2\/3 {
  width: 66.666667% !important;
}

.shell-w-1\/4 {
  width: 25% !important;
}

.shell-w-3\/4 {
  width: 75% !important;
}

.shell-max-w-xs {
  max-width: 20rem !important;
}

.shell-max-w-sm {
  max-width: 24rem !important;
}

.shell-max-w-md {
  max-width: 28rem !important;
}

.shell-max-w-lg {
  max-width: 32rem !important;
}

.shell-max-w-xl {
  max-width: 36rem !important;
}

.shell-max-w-2xl {
  max-width: 42rem !important;
}

.shell-max-w-4xl {
  max-width: 56rem !important;
}

.shell-max-w-full {
  max-width: 100% !important;
}

.shell-h-full {
  height: 100% !important;
}

.shell-h-auto {
  height: auto !important;
}

.shell-min-h-screen {
  min-height: 100vh !important;
}

/* Borders & Radius */

.shell-border {
  border: 1px solid var(--shell-border) !important;
}

.shell-border-t {
  border-top: 1px solid var(--shell-border) !important;
}

.shell-border-b {
  border-bottom: 1px solid var(--shell-border) !important;
}

.shell-border-none {
  border: none !important;
}

.shell-rounded-none {
  border-radius: 0px !important;
}

.shell-rounded-sm {
  border-radius: 4px !important;
}

.shell-rounded {
  border-radius: 6px !important;
}

.shell-rounded-md {
  border-radius: 8px !important;
}

.shell-rounded-lg {
  border-radius: 10px !important;
}

.shell-rounded-xl {
  border-radius: 14px !important;
}

.shell-rounded-2xl {
  border-radius: 18px !important;
}

.shell-rounded-full {
  border-radius: 9999px !important;
}

/* Backgrounds & Surfaces */

.shell-bg-surface {
  background-color: var(--shell-surface) !important;
}

.shell-bg-body {
  background-color: var(--shell-bg) !important;
}

.shell-bg-hover {
  background-color: var(--shell-surface-hover) !important;
}

.shell-bg-accent-subtle {
  background-color: var(--shell-accent-subtle) !important;
}

/* Shadows */

.shell-shadow-none {
  box-shadow: none !important;
}

.shell-shadow-sm {
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.shell-shadow {
  box-shadow: var(--shell-card-shadow) !important;
}

.shell-shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04) !important;
}

.shell-shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05) !important;
}

/* Responsive Utilities (MD: >= 768px) */

@media (min-width: 768px) {
  .shell-md\:flex {
    display: flex !important;
  }

  .shell-md\:inline-flex {
    display: inline-flex !important;
  }

  .shell-md\:grid {
    display: grid !important;
  }

  .shell-md\:block {
    display: block !important;
  }

  .shell-md\:hidden {
    display: none !important;
  }

  .shell-md\:flex-row {
    flex-direction: row !important;
  }

  .shell-md\:flex-col {
    flex-direction: column !important;
  }

  .shell-md\:grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-7 {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-8 {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-9 {
    grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-10 {
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-11 {
    grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  }

  .shell-md\:grid-cols-auto {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }

  .shell-md\:col-span-1 {
    grid-column: span 1 / span 1 !important;
  }

  .shell-md\:col-span-2 {
    grid-column: span 2 / span 2 !important;
  }

  .shell-md\:col-span-3 {
    grid-column: span 3 / span 3 !important;
  }

  .shell-md\:col-span-4 {
    grid-column: span 4 / span 4 !important;
  }

  .shell-md\:col-span-5 {
    grid-column: span 5 / span 5 !important;
  }

  .shell-md\:col-span-6 {
    grid-column: span 6 / span 6 !important;
  }

  .shell-md\:col-span-7 {
    grid-column: span 7 / span 7 !important;
  }

  .shell-md\:col-span-8 {
    grid-column: span 8 / span 8 !important;
  }

  .shell-md\:col-span-9 {
    grid-column: span 9 / span 9 !important;
  }

  .shell-md\:col-span-10 {
    grid-column: span 10 / span 10 !important;
  }

  .shell-md\:col-span-11 {
    grid-column: span 11 / span 11 !important;
  }

  .shell-md\:col-span-12 {
    grid-column: span 12 / span 12 !important;
  }

  .shell-md\:col-span-full {
    grid-column: 1 / -1 !important;
  }

  .shell-md\:w-auto {
    width: auto !important;
  }

  .shell-md\:w-full {
    width: 100% !important;
  }
}

/* Responsive Utilities (LG: >= 1024px) */

@media (min-width: 1024px) {
  .shell-lg\:flex {
    display: flex !important;
  }

  .shell-lg\:grid {
    display: grid !important;
  }

  .shell-lg\:block {
    display: block !important;
  }

  .shell-lg\:hidden {
    display: none !important;
  }

  .shell-lg\:grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }

  .shell-lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .shell-lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .shell-lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .shell-lg\:grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  .shell-lg\:grid-cols-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  }

  .shell-lg\:col-span-1 {
    grid-column: span 1 / span 1 !important;
  }

  .shell-lg\:col-span-2 {
    grid-column: span 2 / span 2 !important;
  }

  .shell-lg\:col-span-3 {
    grid-column: span 3 / span 3 !important;
  }

  .shell-lg\:col-span-4 {
    grid-column: span 4 / span 4 !important;
  }

  .shell-lg\:col-span-6 {
    grid-column: span 6 / span 6 !important;
  }

  .shell-lg\:col-span-8 {
    grid-column: span 8 / span 8 !important;
  }

  .shell-lg\:col-span-12 {
    grid-column: span 12 / span 12 !important;
  }
}

/* ==========================================================================
   LAYOUT SHIFT PREVENTION (CLS Fix)
   Reserve sidebar + topbar space BEFORE Web Component JS loads.
   :not(:defined) matches custom elements before customElements.define() runs.
   Once the shadow DOM takes over, these styles automatically stop applying.
   ========================================================================== */

app-shell-header:not(:defined) {
  display: block;
  padding-left: 240px;
  /* --shell-sidebar-width */
  padding-top: 60px;
  /* --shell-topbar-height */
  min-height: 100vh;
  background: var(--shell-bg, #f8fafc);
}

/* If sidebar was collapsed in user's last session */

html[data-sidebar-collapsed="true"] app-shell-header:not(:defined) {
  padding-left: 65px;
  /* --shell-sidebar-collapsed */
}

/* On mobile, sidebar is an overlay — no left padding needed */

@media (max-width: 768px) {
  app-shell-header:not(:defined) {
    padding-left: 0;
  }

  html[data-sidebar-collapsed="true"] app-shell-header:not(:defined) {
    padding-left: 0;
  }
}
