/* ==========================================================================
   Glass UI System (global)
   Goal: harmonize buttons, inputs, tables, badges across the whole app
   without rewriting every Blade view.
   ========================================================================== */

:root {
  /* ===== Pro Design System Variables ===== */
  
  /* Spacing (cohérent partout) */
  --sn-space-xs: 4px;
  --sn-space-sm: 8px;
  --sn-space-md: 12px;
  --sn-space-lg: 16px;
  --sn-space-xl: 24px;
  --sn-space-2xl: 32px;
  
  /* Radius (cohérent partout) */
  --ui-radius: 12px;
  --ui-radius-sm: 8px;
  --ui-radius-xs: 6px;
  
  /* Typography (finesse) */
  --sn-font-xs: 10.5px;
  --sn-font-sm: 11.5px;
  --sn-font-base: 13px;
  --sn-font-md: 14px;
  --sn-font-lg: 16px;
  --sn-font-xl: 18px;
  --sn-font-2xl: 24px;
  
  --sn-font-weight-light: 300;
  --sn-font-weight-normal: 400;
  --sn-font-weight-medium: 500;
  --sn-font-weight-semibold: 600;
  --sn-font-weight-bold: 700;
  
  --sn-line-height-tight: 1.25;
  --sn-line-height-normal: 1.45;
  --sn-line-height-relaxed: 1.6;
  
  /* Colors (glassmorphisme) */
  --ui-border: rgba(229, 229, 229, 0.65);
  --ui-border-strong: rgba(209, 213, 219, 0.9);
  --ui-surface: rgba(255, 255, 255, 0.90);
  --ui-surface-2: rgba(255, 255, 255, 0.78);
  --ui-surface-dark: rgba(0, 0, 0, 0.35);
  
  /* Shadows (profondeur) */
  --ui-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
  --ui-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.06);
  --ui-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --ui-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --ui-focus: 0 0 0 3px rgba(99, 102, 241, 0.18);
  
  /* Buttons (hauteur cohérente) */
  --sn-btn-height-xs: 24px;
  --sn-btn-height-sm: 28px;
  --sn-btn-height-md: 32px;
  --sn-btn-height-lg: 36px;
  
  /* Transitions */
  --sn-transition-fast: 0.12s ease;
  --sn-transition-base: 0.18s ease;
  --sn-transition-slow: 0.25s ease;
}

/* ===== Pro Typography System (Finesse) ===== */
body {
  font-weight: var(--sn-font-weight-light);
  font-size: var(--sn-font-base);
  line-height: var(--sn-line-height-normal);
  letter-spacing: -0.01em;
  color: #1f2937;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings : hiérarchie claire avec poids fins */
h1, h2, h3, h4, h5, h6 { 
  letter-spacing: -0.02em;
  font-weight: var(--sn-font-weight-semibold);
  line-height: var(--sn-line-height-tight);
}

h1 { font-size: var(--sn-font-2xl); }
h2 { font-size: var(--sn-font-xl); }
h3 { font-size: var(--sn-font-lg); }
h4 { font-size: var(--sn-font-md); }
h5, h6 { font-size: var(--sn-font-base); }

/* Labels : ultra-fins */
label, .sn-label {
  font-size: var(--sn-font-xs);
  font-weight: var(--sn-font-weight-medium);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b7280;
}

/* Text utilities */
.text-light { font-weight: var(--sn-font-weight-light); }
.text-normal { font-weight: var(--sn-font-weight-normal); }
.text-medium { font-weight: var(--sn-font-weight-medium); }
.text-semibold { font-weight: var(--sn-font-weight-semibold); }

/* Desktop-like compact density (Super Admin) */
.sn-density-compact {
  --ui-font-size: var(--ui-font-size-compact);
}
.sn-platform .sn-shell__header { height: 48px; }
.sn-platform .sn-shell__content { padding: 14px; }
.sn-platform .sn-shell__sidebar { width: 248px; flex: 0 0 248px; }
.sn-platform .main-nav-item { padding: 8px 10px; font-size: 12px; border-radius: 12px; }
.sn-platform .page-title { font-size: 13px; font-weight: 700; }

/* Compact buttons ("desktop") for platform + tenant */
.sn-platform .sn-btn,
.sn-platform .sn-btn-secondary,
.sn-platform .sn-btn-danger,
.sn-platform .sn-btn-ghost,
.sn-platform .sn-btn-primary,
.sn-tenant .sn-btn,
.sn-tenant .sn-btn-secondary,
.sn-tenant .sn-btn-danger,
.sn-tenant .sn-btn-ghost,
.sn-tenant .sn-btn-primary {
  font-size: 10.5px !important;
  padding: 5px 8px !important;
  min-height: 24px !important;
  border-radius: 9px !important;
  gap: 6px !important;
}

/* Compact inputs/selects (Pipeline dropdown, etc.) */
.sn-platform .sn-input,
.sn-platform .sn-select,
.sn-platform .sn-textarea,
.sn-tenant .sn-input,
.sn-tenant .sn-select,
.sn-tenant .sn-textarea {
  font-size: 11px !important;
  padding: 6px 10px !important;
  min-height: 28px !important;
  border-radius: 9px !important;
}

/* When views add extra Tailwind px/py, keep compact height */
.sn-platform .sn-btn-ghost.px-3.py-2,
.sn-platform .sn-btn.px-3.py-2 {
  padding: 5px 8px !important;
}

.sn-tenant .sn-btn-ghost.px-3.py-2,
.sn-tenant .sn-btn.px-3.py-2 {
  padding: 5px 8px !important;
}

/* Tenant: compact legacy Tailwind buttons (px-4 py-2 / py-3 px-4 etc.) */
.sn-tenant a[class*="px-4"][class*="py-2"],
.sn-tenant button[class*="px-4"][class*="py-2"],
.sn-tenant input[type="submit"][class*="px-4"][class*="py-2"],
.sn-tenant a[class*="px-4"][class*="py-3"],
.sn-tenant button[class*="px-4"][class*="py-3"],
.sn-tenant input[type="submit"][class*="px-4"][class*="py-3"],
.sn-tenant a[class*="py-2"][class*="px-4"],
.sn-tenant button[class*="py-2"][class*="px-4"],
.sn-tenant input[type="submit"][class*="py-2"][class*="px-4"],
.sn-tenant a[class*="py-3"][class*="px-4"],
.sn-tenant button[class*="py-3"][class*="px-4"],
.sn-tenant input[type="submit"][class*="py-3"][class*="px-4"] {
  font-size: 10.5px !important;
  padding: 5px 8px !important;
  min-height: 24px !important;
  border-radius: 9px !important;
  line-height: 1 !important;
}

.sn-tenant a[class*="text-sm"][class*="font-medium"],
.sn-tenant button[class*="text-sm"][class*="font-medium"] {
  font-size: 10.5px !important;
}

/* ------------------------------ Alerts / Toasts (Glassmorphisme) ---------- */
.sn-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--ui-radius);
  border: 1px solid rgba(229, 231, 235, 0.50);
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.sn-alert__body { flex: 1; min-width: 0; }
.sn-alert__title {
  font-weight: 700;
  font-size: 13px;
  color: #111827;
  margin-bottom: 2px;
}
.sn-alert__content {
  font-size: 13px;
  color: #374151;
}
.sn-alert__content a { text-decoration: underline; }
.sn-alert__content ul { margin-top: 8px; }
.sn-alert__close {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 6px;
  line-height: 0;
  color: rgba(55, 65, 81, 0.75);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sn-alert__close:hover {
  background: rgba(17, 24, 39, 0.06);
  color: rgba(17, 24, 39, 0.85);
}
.sn-alert__close:focus { outline: none; box-shadow: var(--ui-focus); }
.sn-alert__close-icon { width: 18px; height: 18px; }

.sn-alert--success {
  border-color: rgba(16, 185, 129, 0.30);
  background: rgba(16, 185, 129, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.sn-alert--success .sn-alert__title,
.sn-alert--success .sn-alert__content { color: #065f46; }

.sn-alert--error {
  border-color: rgba(239, 68, 68, 0.30);
  background: rgba(239, 68, 68, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.sn-alert--error .sn-alert__title,
.sn-alert--error .sn-alert__content { color: #7f1d1d; }

.sn-alert--warning {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.sn-alert--warning .sn-alert__title,
.sn-alert--warning .sn-alert__content { color: #7c2d12; }

.sn-alert--info {
  border-color: rgba(59, 130, 246, 0.30);
  background: rgba(59, 130, 246, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.sn-alert--info .sn-alert__title,
.sn-alert--info .sn-alert__content { color: #1e3a8a; }

.sn-toast-stack {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}
.sn-toast { pointer-events: auto; }

/* ------------------------------ App shell / Side panel ------------------- */
.sn-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}
.sn-shell__overlay {
  display: none;
}
.sn-shell__sidebar {
  width: 260px;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
}
.sn-shell__brand {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}
.sn-shell__nav {
  flex: 1;
  overflow: auto;
  padding: 10px 10px 14px;
}
.sn-shell__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* Allow overlays (profile dropdown, menus) to appear above content */
  overflow: visible;
}
/* ===== Topbar Pro (Style Moderne) ===== */
.sn-shell__header {
  /* Align with sidebar brand height (52px) */
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.50);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  position: relative;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

.sn-shell__header .page-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

/* User menu button pro */
.sn-shell__header [data-sn-user-menu-toggle] {
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.60);
  border: 1px solid rgba(229, 231, 235, 0.50);
  transition: all 0.15s ease;
}

.sn-shell__header [data-sn-user-menu-toggle]:hover {
  background: rgba(248, 250, 252, 0.90);
  border-color: rgba(229, 231, 235, 0.70);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sn-shell__header [data-sn-user-menu-toggle] img,
.sn-shell__header [data-sn-user-menu-toggle] > div {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.sn-shell__header [data-sn-user-menu-toggle] p {
  font-size: 10.5px;
  font-weight: 500;
  color: #111827;
}

.sn-shell__header [data-sn-user-menu-toggle] p:last-child {
  font-size: 9.5px;
  font-weight: 400;
  color: #6b7280;
}

/* Sidebar toggle button */
.sn-shell__header [data-sn-sidebar-toggle] {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.60);
  border: 1px solid rgba(229, 231, 235, 0.50);
  border-radius: 10px;
  color: #374151;
  transition: all 0.15s ease;
}

.sn-shell__header [data-sn-sidebar-toggle]:hover {
  background: rgba(248, 250, 252, 0.90);
  border-color: rgba(229, 231, 235, 0.70);
  color: #111827;
}

/* User menu dropdown */
.user-menu-dropdown {
  min-width: 220px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(229, 231, 235, 0.60);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.95) inset;
  overflow: hidden;
}

.user-menu-item {
  display: block;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: all 0.12s ease;
  border: none;
  background: transparent;
}

.user-menu-item:hover {
  background: rgba(99, 102, 241, 0.06);
  color: #111827;
}

.user-menu-divider {
  height: 1px;
  background: rgba(229, 231, 235, 0.50);
  margin: 4px 0;
}
.sn-shell__content {
  flex: 1;
  overflow: auto;
  padding: 16px;
  position: relative;
  z-index: 1;
}

/* ------------------------------ Bitrix-like top nav ---------------------- */
.sn-nav-bitrix .sn-shell__header {
  border-bottom: 1px solid rgba(229, 231, 235, 0.75);
}

/* Menu sidebar (modules): slightly bigger + light */
.sn-nav-bitrix .main-nav-item {
  font-size: 13.5px;
  font-weight: 400;
}
.sn-nav-bitrix .main-nav-item.active {
  font-weight: 600;
}
/* ===== Subnav Pro (Tabs Modernes) ===== */
.sn-subnav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid rgba(229, 231, 235, 0.50);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.sn-subnav__inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  overflow-x: auto;
}

.sn-subnav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.15s ease;
  background: transparent;
}

.sn-subnav-item:hover {
  background: rgba(248, 250, 252, 0.80);
  border-color: rgba(229, 231, 235, 0.60);
  color: #111827;
}

.sn-subnav-item.active {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(99, 102, 241, 0.25);
  color: #4f46e5;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.08), 0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

/* Dark theme: subnav transparent with white text */
body.theme-background .sn-subnav {
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.theme-background .sn-subnav-item {
  color: rgba(255, 255, 255, 0.85);
  border-color: transparent;
}

body.theme-background .sn-subnav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.20);
  color: rgba(255, 255, 255, 1);
}

body.theme-background .sn-subnav-item.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.30);
  color: rgba(255, 255, 255, 1);
}

/* Optional: in Bitrix mode, sidebar becomes secondary */
.sn-nav-bitrix .sn-shell__sidebar {
  width: 220px;
  flex: 0 0 220px;
}

/* In Bitrix mode the sidebar is the primary menu (modules). */

/* ------------------------------ Command Palette (Ctrl+K) ----------------- */
.sn-cmdk {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
}
.sn-cmdk.is-open { display: block; }
.sn-cmdk__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sn-cmdk__panel {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  margin: 10vh auto 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.50);
  box-shadow: 0 20px 60px rgba(0,0,0,0.20), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
}
.sn-cmdk__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.75);
}
.sn-cmdk__hint {
  font-size: 11px;
  color: rgba(107, 114, 128, 0.95);
  white-space: nowrap;
}
.sn-cmdk__input {
  flex: 1;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 12px;
  outline: none;
}
.sn-cmdk__input:focus {
  box-shadow: var(--ui-focus);
  border-color: rgba(99, 102, 241, 0.55);
}
.sn-cmdk__list {
  max-height: 52vh;
  overflow: auto;
  padding: 8px;
}
.sn-cmdk__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: #111827;
  border: 1px solid transparent;
}
.sn-cmdk__item:hover,
.sn-cmdk__item.is-active {
  background: rgba(99, 102, 241, 0.10);
  border-color: rgba(99, 102, 241, 0.18);
}
.sn-cmdk__item-title {
  font-size: 12px;
  font-weight: 600;
}
.sn-cmdk__item-meta {
  font-size: 11px;
  color: rgba(107, 114, 128, 0.95);
  white-space: nowrap;
}
.sn-cmdk__empty {
  padding: 18px 10px;
  font-size: 12px;
  color: rgba(107, 114, 128, 0.95);
}
@media (min-width: 1024px) {
  .sn-shell__content { padding: 20px 22px; }
}
@media (max-width: 1023px) {
  .sn-shell__sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sn-shell__sidebar:not(.hidden) { transform: translateX(0); }
  .sn-shell__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 50;
  }
  .sn-shell__overlay.active { display: block; }
}

body.sn-modal-open { overflow: hidden; }

.sn-panel {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
}
.sn-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.sn-panel__drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(860px, 100vw);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-left: 1px solid rgba(229, 231, 235, 0.50);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  box-shadow: -10px 0 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}
.sn-panel__header {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sn-panel__heading { min-width: 0; }
.sn-panel__title { font-weight: 800; font-size: 13px; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-panel__subtitle { font-size: 11px; color: #6b7280; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-panel__actions { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sn-panel__body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: rgba(249, 250, 251, 0.35);
}
.sn-panel--open { pointer-events: auto; }
.sn-panel--open .sn-panel__overlay { opacity: 1; }
.sn-panel--open .sn-panel__drawer { transform: translateX(0); }

/* Réduire la taille des boutons dans les panneaux latéraux */
.sn-panel__actions .sn-btn,
.sn-panel__actions .sn-btn-ghost,
.sn-panel__actions .sn-btn-primary,
.sn-panel__actions .sn-btn-secondary {
  font-size: 10.5px !important;
  padding: 4px 8px !important;
  min-height: 24px !important;
  border-radius: 7px !important;
  gap: 4px !important;
}

.sn-panel-fragment { padding: 12px; }
.sn-panel-fragment-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sn-panel-fragment-title h1 { font-size: 14px; font-weight: 800; margin: 0; color: #111827; }
.sn-panel-fragment-title p { font-size: 11px; margin: 2px 0 0; color: #6b7280; }
.sn-panel-fragment-actions { display: inline-flex; gap: 6px; }
.sn-panel-fragment-actions .sn-btn,
.sn-panel-fragment-actions .sn-btn-ghost,
.sn-panel-fragment-actions .sn-btn-primary {
  font-size: 10.5px !important;
  padding: 4px 8px !important;
  min-height: 24px !important;
  border-radius: 7px !important;
}
.sn-panel-fragment-body { padding-top: 6px; }

.sn-skel {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(229,231,235,0.7) 25%, rgba(243,244,246,0.9) 37%, rgba(229,231,235,0.7) 63%);
  background-size: 400% 100%;
  animation: sn-skel 1.2s ease infinite;
}
.sn-skel--line { height: 14px; margin: 10px 0; }
@keyframes sn-skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ------------------------------ Buttons (Glassmorphisme) ----------------- */
.sn-btn,
.sn-btn-secondary,
.sn-btn-danger,
.sn-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--ui-radius-sm);
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  padding: 8px 12px;
  min-height: 32px;
  transition: transform 0.08s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sn-btn:active,
.sn-btn-secondary:active,
.sn-btn-danger:active,
.sn-btn-ghost:active {
  transform: translateY(1px);
}

.sn-btn:focus,
.sn-btn-secondary:focus,
.sn-btn-danger:focus,
.sn-btn-ghost:focus {
  outline: none;
  box-shadow: var(--ui-focus);
}

/* Primary keeps existing .sn-btn-primary, but normalize radius/height */
.sn-btn-primary {
  border-radius: var(--ui-radius-sm) !important;
  min-height: 32px;
  padding: 8px 12px !important;
  font-weight: 600 !important;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: var(--ui-shadow-soft);
}

.sn-btn-secondary,
.sn-btn {
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(229, 231, 235, 0.60);
  color: #374151;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}
.sn-btn-secondary:hover,
.sn-btn:hover {
  background: rgba(255, 255, 255, 0.80);
  border-color: rgba(209, 213, 219, 0.75);
  color: #111827;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.sn-btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: #374151;
}
.sn-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(229, 231, 235, 0.75);
}

/* Command bar actions: make legacy buttons look consistent (light border) */
.sn-command-actions > a:not(.sn-btn):not(.sn-btn-primary):not(.sn-btn-secondary):not(.sn-btn-ghost):not(.sn-btn-danger),
.sn-command-actions > button:not(.sn-btn):not(.sn-btn-primary):not(.sn-btn-secondary):not(.sn-btn-ghost):not(.sn-btn-danger),
.sn-command-actions > form > button:not(.sn-btn):not(.sn-btn-primary):not(.sn-btn-secondary):not(.sn-btn-ghost):not(.sn-btn-danger),
.sn-command-actions > form > input[type="submit"]:not(.sn-btn):not(.sn-btn-primary):not(.sn-btn-secondary):not(.sn-btn-ghost):not(.sn-btn-danger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--ui-border-strong);
  color: #374151;
  border-radius: var(--ui-radius-sm);
  box-shadow: var(--ui-shadow-soft);
  font-weight: 500;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.sn-command-actions > a:not(.sn-btn):not(.sn-btn-primary):not(.sn-btn-secondary):not(.sn-btn-ghost):not(.sn-btn-danger):hover,
.sn-command-actions > button:not(.sn-btn):not(.sn-btn-primary):not(.sn-btn-secondary):not(.sn-btn-ghost):not(.sn-btn-danger):hover,
.sn-command-actions > form > button:not(.sn-btn):not(.sn-btn-primary):not(.sn-btn-secondary):not(.sn-btn-ghost):not(.sn-btn-danger):hover,
.sn-command-actions > form > input[type="submit"]:not(.sn-btn):not(.sn-btn-primary):not(.sn-btn-secondary):not(.sn-btn-ghost):not(.sn-btn-danger):hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(209, 213, 219, 1);
  color: #111827;
}

.main-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  color: rgba(55, 65, 81, 0.92);
  transition: background 0.16s ease, color 0.16s ease, transform 0.08s ease;
}
.main-nav-item:hover {
  background: rgba(99, 102, 241, 0.08);
  color: #111827;
}
.main-nav-item.active {
  background: rgba(99, 102, 241, 0.14);
  color: #111827;
}

/* ------------------------------ Sidebar sub-menus (Bitrix-like) ---------- */
.sn-nav-group {
  margin: 6px 0;
}
.sn-nav-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  color: rgba(55, 65, 81, 0.92);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.sn-nav-group__toggle:hover {
  background: rgba(99, 102, 241, 0.08);
  color: #111827;
}
.sn-nav-group.is-active .sn-nav-group__toggle {
  background: rgba(99, 102, 241, 0.14);
  color: #111827;
}
.sn-nav-group__chev {
  opacity: 0.7;
  font-size: 12px;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}
.sn-nav-group.is-open .sn-nav-group__chev {
  transform: rotate(180deg);
}
.sn-nav-group__items {
  margin-top: 6px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(229, 231, 235, 0.9);
  display: none;
}
.sn-nav-group.is-open .sn-nav-group__items {
  display: block;
}
.sn-nav-subitem {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(55, 65, 81, 0.92);
  text-decoration: none;
}
.sn-nav-subitem:hover {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(229, 231, 235, 0.75);
}
.sn-nav-subitem.active {
  background: rgba(99, 102, 241, 0.12);
  color: #111827;
}

.sn-tenant .sn-nav-group__toggle,
.sn-platform .sn-nav-group__toggle {
  padding: 7px 10px;
  font-size: 11.5px;
}
.sn-tenant .sn-nav-subitem,
.sn-platform .sn-nav-subitem {
  padding: 6px 9px;
  font-size: 11px;
}

/* Legacy button classes -> PRO system (compat only while cleaning views) */
.btn,
.btn.btn-secondary,
.btn.btn-outline,
.btn.btn-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--ui-radius-sm);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  padding: 8px 12px;
  min-height: 32px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--ui-border-strong);
  color: #374151;
  box-shadow: var(--ui-shadow-soft);
  transition: transform 0.08s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  text-decoration: none;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(209, 213, 219, 1);
  color: #111827;
}
.btn-primary,
.btn.btn-primary {
  background: var(--sn-primary) !important;
  border-color: var(--sn-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25) !important;
}
.btn-primary:hover,
.btn.btn-primary:hover {
  background: var(--sn-primary-hover) !important;
  border-color: var(--sn-primary-hover) !important;
}

.bc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--ui-radius-sm);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  padding: 8px 12px;
  min-height: 32px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--ui-border-strong);
  color: #374151;
  box-shadow: var(--ui-shadow-soft);
}
.bc-btn:hover { background: rgba(255, 255, 255, 0.92); border-color: rgba(209, 213, 219, 1); color: #111827; }
.bc-btn-primary { background: var(--sn-primary) !important; border-color: var(--sn-primary) !important; color: #fff !important; }
.bc-btn-primary:hover { background: var(--sn-primary-hover) !important; border-color: var(--sn-primary-hover) !important; }

.sn-btn-danger {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #b91c1c;
}
.sn-btn-danger:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.36);
  color: #991b1b;
}

/* ------------------------------ Links ------------------------------------ */
.sn-link,
a.sn-link {
  color: var(--sn-accent);
  text-decoration: none;
  font-weight: 500;
}
.sn-link:hover,
a.sn-link:hover {
  color: var(--sn-accent-hover);
  text-decoration: underline;
}

/* ------------------------------ Inputs (Glassmorphisme) ------------------ */
.sn-input,
.sn-select,
.sn-textarea {
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(209, 213, 219, 0.50);
  border-radius: var(--ui-radius-sm);
  color: #111827;
  font-size: 13px;
  padding: 10px 12px;
  transition: box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.sn-textarea { padding: 10px 12px; }

.sn-input:focus,
.sn-select:focus,
.sn-textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.60);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.85);
}

body.theme-background .sn-input,
body.theme-background .sn-select,
body.theme-background .sn-textarea {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.theme-background .sn-input::placeholder,
body.theme-background .sn-select::placeholder,
body.theme-background .sn-textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

body.theme-background .sn-input:focus,
body.theme-background .sn-select:focus,
body.theme-background .sn-textarea:focus {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
}

/* Selects in command bar (pipelines, etc.) on dark wallpaper */
body.theme-background .sn-command-actions .sn-select,
body.theme-background .sn-command-actions select {
  background: rgba(255, 255, 255, 0.20) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.theme-background .sn-command-actions .sn-select:focus,
body.theme-background .sn-command-actions select:focus {
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
}

/* ------------------------------ Dark Theme: Text on wallpaper vs containers */
/* 
   Strategy:
   1. Direct children of body/shell (command bar, etc.) = WHITE text
   2. Inside glass containers (.sn-card, .sn-table) = KEEP BLACK text but INCREASE opacity
*/

/* Command bar titles on wallpaper → white */
body.theme-background .sn-shell__content > .mb-4 h1,
body.theme-background .sn-shell__content > .mb-4 p {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Command bar action buttons → more visible on dark */
body.theme-background .sn-command-actions .sn-btn,
body.theme-background .sn-command-actions .sn-btn-secondary,
body.theme-background .sn-command-actions button,
body.theme-background .sn-command-actions a {
  background: rgba(255, 255, 255, 0.20) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

body.theme-background .sn-command-actions .sn-btn:hover,
body.theme-background .sn-command-actions .sn-btn-secondary:hover,
body.theme-background .sn-command-actions button:hover,
body.theme-background .sn-command-actions a:hover {
  background: rgba(255, 255, 255, 0.32) !important;
  border-color: rgba(255, 255, 255, 0.50) !important;
  color: rgba(255, 255, 255, 1) !important;
}

body.theme-background .sn-command-actions .sn-btn-primary {
  background: var(--sn-primary) !important;
  border-color: var(--sn-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.40), 0 1px 0 rgba(255, 255, 255, 0.3) inset !important;
}

body.theme-background .sn-command-actions .sn-btn-primary:hover {
  background: var(--sn-primary-hover) !important;
  border-color: var(--sn-primary-hover) !important;
}

/* Topbar elements on wallpaper → white */
body.theme-background .sn-shell__header {
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-bottom-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.10) inset;
}

body.theme-background .sn-shell__header .page-title {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.theme-background .sn-shell__header [data-sn-sidebar-toggle] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.20);
  color: rgba(255, 255, 255, 0.90);
}

body.theme-background .sn-shell__header [data-sn-sidebar-toggle]:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.30);
  color: rgba(255, 255, 255, 1);
}

body.theme-background .sn-shell__header [data-sn-user-menu-toggle] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.20);
}

body.theme-background .sn-shell__header [data-sn-user-menu-toggle]:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.30);
}

body.theme-background .sn-shell__header [data-sn-user-menu-toggle] p {
  color: rgba(255, 255, 255, 0.95) !important;
}

body.theme-background .sn-shell__header [data-sn-user-menu-toggle] p:last-child {
  color: rgba(255, 255, 255, 0.70) !important;
}

/* Sidebar on wallpaper → semi-transparent with white text */
body.theme-background .sn-shell__sidebar {
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

body.theme-background .sn-shell__brand,
body.theme-background .main-nav-item,
body.theme-background .sn-nav-group__toggle,
body.theme-background .sn-nav-subitem {
  color: rgba(255, 255, 255, 0.90) !important;
}

body.theme-background .main-nav-item:hover,
body.theme-background .sn-nav-group__toggle:hover,
body.theme-background .sn-nav-subitem:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 1) !important;
}

body.theme-background .main-nav-item.active,
body.theme-background .sn-nav-group.is-active .sn-nav-group__toggle,
body.theme-background .sn-nav-subitem.active {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 1) !important;
}

/* Cards: MORE OPAQUE + keep black text for readability */
body.theme-background .sn-card {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.70) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

/* Text inside cards stays BLACK (good contrast on white-ish glass) */
body.theme-background .sn-card,
body.theme-background .sn-card * {
  /* Don't force white; inherit natural dark text */
}

/* Tables: MORE OPAQUE too */
body.theme-background .sn-table {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.65);
}

body.theme-background .sn-table thead {
  background: rgba(248, 250, 252, 0.75);
}

/* Buttons on dark wallpaper → more visible */
body.theme-background .sn-btn,
body.theme-background .sn-btn-secondary {
  background: rgba(255, 255, 255, 0.80);
  border-color: rgba(255, 255, 255, 0.65);
  color: #111827;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.20), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

body.theme-background .sn-btn:hover,
body.theme-background .sn-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.80);
  color: #000;
}

body.theme-background .sn-btn-primary {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35), 0 1px 0 rgba(255, 255, 255, 0.3) inset !important;
}

/* Alerts: more opaque for readability */
body.theme-background .sn-alert {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

/* Panels & Modals on dark theme */
body.theme-background .sn-panel__drawer {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-left-color: rgba(255, 255, 255, 0.70);
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.35);
}

body.theme-background .sn-cmdk__panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.70);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

/* Global list tools (Filters/Columns buttons) on dark wallpaper */
body.theme-background [data-sn-list-tools] button {
  background: rgba(255, 255, 255, 0.20) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

body.theme-background [data-sn-list-tools] button:hover {
  background: rgba(255, 255, 255, 0.32) !important;
  border-color: rgba(255, 255, 255, 0.50) !important;
  color: rgba(255, 255, 255, 1) !important;
}

/* ===== Pro Cards (Meilleur contraste) ===== */
.sn-card {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.60) !important;
  border-radius: var(--ui-radius) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 
              0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
body.theme-background .sn-card {
  background: rgba(255, 255, 255, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.70) !important;
}

/* ------------------------------ Badges ----------------------------------- */
.sn-badge {
  border-radius: 999px !important;
  padding: 3px 8px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

/* ===== Pro Table System (Meilleur contraste) ===== */
.sn-table-pro {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(229, 231, 235, 0.60);
  border-radius: var(--ui-radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.sn-table-pro thead {
  background: rgba(248, 250, 252, 0.70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sn-table-pro th {
  padding: var(--sn-space-md) var(--sn-space-lg) !important;
  font-size: var(--sn-font-xs);
  font-weight: var(--sn-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(229, 231, 235, 0.60) !important;
}

.sn-table-pro th.text-right {
  text-align: right;
}

.sn-table-pro tbody {
  background: transparent;
}

.sn-table-pro td {
  padding: var(--sn-space-lg) var(--sn-space-lg) !important;
  font-size: var(--sn-font-sm);
  font-weight: var(--sn-font-weight-normal);
  color: #111827;
  border-bottom: 1px solid rgba(229, 231, 235, 0.40) !important;
  vertical-align: middle;
}

.sn-table-pro td.text-right {
  text-align: right;
}

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

.sn-table-pro tbody tr:hover {
  background: rgba(99, 102, 241, 0.05) !important;
}

.sn-table-pro tbody tr:last-child td {
  border-bottom: none !important;
}

/* Table cell styles cohérents */
.sn-table-pro .cell-title {
  font-size: var(--sn-font-sm);
  font-weight: var(--sn-font-weight-medium);
  color: #111827;
  margin-bottom: 2px;
}

.sn-table-pro .cell-subtitle {
  font-size: var(--sn-font-xs);
  font-weight: var(--sn-font-weight-normal);
  color: #6b7280;
}

/* Table actions cohérentes */
.sn-table-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--sn-space-sm);
}

.sn-table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--ui-radius-xs);
  color: #6b7280;
  transition: all var(--sn-transition-fast);
  border: 1px solid transparent;
}

.sn-table-action-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.sn-table-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* Empty state cohérent */
.sn-table-empty {
  padding: var(--sn-space-2xl) var(--sn-space-lg);
  text-align: center;
}

.sn-table-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--sn-space-md);
  opacity: 0.3;
}

.sn-table-empty-title {
  font-size: var(--sn-font-sm);
  font-weight: var(--sn-font-weight-medium);
  color: #6b7280;
  margin-bottom: var(--sn-space-xs);
}

.sn-table-empty-text {
  font-size: var(--sn-font-xs);
  font-weight: var(--sn-font-weight-normal);
  color: #9ca3af;
  margin-bottom: var(--sn-space-lg);
}

/* Dark theme */
body.theme-background .sn-table-pro {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.70);
}

body.theme-background .sn-table-pro thead {
  background: rgba(248, 250, 252, 0.80);
}

/* ------------------------------ Cues (tiles) ----------------------------- */
.bc-cue {
  position: relative;
}
.bc-cue::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(99, 102, 241, 0.55);
}
.bc-cue__label { color: rgba(75, 85, 99, 0.95); }
.bc-cue__value { color: #111827; }
.bc-cue--info::before { background: rgba(59, 130, 246, 0.75); }
.bc-cue--success::before { background: rgba(16, 185, 129, 0.75); }
.bc-cue--warning::before { background: rgba(245, 158, 11, 0.85); }
.bc-cue--danger::before { background: rgba(239, 68, 68, 0.75); }
.bc-cue--neutral::before { background: rgba(156, 163, 175, 0.75); }

/* -------------------------------------------------------------------------
   AUTO-HARMONIZATION for legacy Tailwind patterns (no view edits needed)
   ------------------------------------------------------------------------- */

/* Border buttons used everywhere */
button[class*="px-4"][class*="py-2"][class*="border"][class*="rounded-lg"],
a[class*="px-4"][class*="py-2"][class*="border"][class*="rounded-lg"],
button[class*="px-3"][class*="py-1.5"][class*="border"][class*="rounded-lg"],
a[class*="px-3"][class*="py-1.5"][class*="border"][class*="rounded-lg"] {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: rgba(209, 213, 219, 0.95) !important;
  border-radius: var(--ui-radius-sm) !important;
  color: #374151 !important;
  box-shadow: var(--ui-shadow-soft) !important;
}
button[class*="px-4"][class*="py-2"][class*="border"][class*="rounded-lg"]:hover,
a[class*="px-4"][class*="py-2"][class*="border"][class*="rounded-lg"]:hover,
button[class*="px-3"][class*="py-1.5"][class*="border"][class*="rounded-lg"]:hover,
a[class*="px-3"][class*="py-1.5"][class*="border"][class*="rounded-lg"]:hover {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(209, 213, 219, 1) !important;
  color: #111827 !important;
}

/* Inputs / selects used everywhere */
input[class*="border-gray-300"][class*="rounded-lg"],
select[class*="border-gray-300"][class*="rounded-lg"],
textarea[class*="border-gray-300"][class*="rounded-lg"] {
  background: rgba(255, 255, 255, 0.90) !important;
  border-color: rgba(209, 213, 219, 0.9) !important;
  border-radius: var(--ui-radius-sm) !important;
}
input[class*="border-gray-300"][class*="rounded-lg"]:focus,
select[class*="border-gray-300"][class*="rounded-lg"]:focus,
textarea[class*="border-gray-300"][class*="rounded-lg"]:focus {
  outline: none !important;
  border-color: rgba(99, 102, 241, 0.55) !important;
  box-shadow: var(--ui-focus) !important;
}

/* -------------------------------------------------------------------------
   Compatibility: pages that use BC-like utility classes should still look glass
   ------------------------------------------------------------------------- */
/* Commandbar should NOT look like a white container:
   keep it transparent and let each action (button/select) be its own surface */
.bc-commandbar {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.bc-btn {
  background: rgba(255, 255, 255, 0.82) !important;
  border: 1px solid rgba(209, 213, 219, 0.95) !important;
  border-radius: var(--ui-radius-sm) !important;
  color: #374151 !important;
  box-shadow: var(--ui-shadow-soft) !important;
  font-weight: 600;
  font-size: 12px;
  padding: 8px 12px !important;
  min-height: 32px;
}
.bc-btn:hover {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(209, 213, 219, 1) !important;
  color: #111827 !important;
}
.bc-btn-primary {
  background: var(--sn-primary) !important;
  border-color: var(--sn-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25) !important;
}
.bc-btn-primary:hover {
  background: var(--sn-primary-hover) !important;
  border-color: var(--sn-primary-hover) !important;
}

.bc-select {
  background: rgba(255, 255, 255, 0.90) !important;
  border: 1px solid rgba(209, 213, 219, 0.9) !important;
  border-radius: var(--ui-radius-sm) !important;
  color: #111827 !important;
  font-size: 12px;
  padding: 7px 34px 7px 10px !important;
  box-shadow: var(--ui-shadow-soft);
}
.bc-select:focus {
  outline: none !important;
  border-color: rgba(99, 102, 241, 0.55) !important;
  box-shadow: var(--ui-focus) !important;
}

.bc-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(55, 65, 81, 0.85);
}

