/* @AI_CRITICAL_GUARD v3.0: UNTOUCHABLE ZONE — MACE APPROVAL REQUIRED.
   Protects: Enterprise UI/UX · Realtime Sync Logic · Core State Management ·
   Database/API Adapters · Tab Isolation · Virtual Column State ·
   QuickBase Settings Persistence · Auth Flow.
   DO NOT modify any existing logic, layout, or structure in this file without
   first submitting a RISK IMPACT REPORT to MACE and receiving explicit "CLEARED" approval.
   Violations will cause regressions. When in doubt — STOP and REPORT. */

/**
 * @file services-premium.css
 * @description Premium UI/UX overlay for the Services Workspace.
 *              Mockup-inspired aesthetic: glass panels, Inter typography,
 *              cyan/purple accents, gradient stats cards, premium modals.
 *
 * @module MUMS/Services
 * @version 1.0 (2026-05-16)
 *
 * IMPLEMENTATION NOTE
 * -------------------
 * This file LAYERS on top of `services.css`. It only overrides visual
 * treatment (colors, spacing, radius, glass, typography) — it does NOT
 * change DOM contracts, class names, or anything the JS toggles. All
 * critical JS↔HTML hooks (IDs, .active, .svc-tv-active, .cf-row-*, etc.)
 * remain intact.
 *
 * Load order in services.html:
 *   1. /css/services.css           (base — existing rules)
 *   2. /css/services-premium.css   (this file — premium overlay)
 */

/* ───────────────────────────────────────────────────────────────────────────
   1. ROOT VARIABLES — mockup palette overrides
   ─────────────────────────────────────────────────────────────────────────── */
:root {
  /* Premium palette */
  --bgp-primary:   #0b1120;
  --bgp-secondary: #111827;
  --bgp-tertiary:  #1a2332;
  --bgp-hover:     #1e293b;
  --bgp-border:    #2d3748;
  --bgp-accent:    #06b6d4;
  --bgp-accent-2:  #8b5cf6;
  --bgp-text:      #f1f5f9;
  --bgp-text-2:    #94a3b8;
  --bgp-text-3:    #64748b;
  --bgp-green:     #10b981;
  --bgp-amber:     #f59e0b;
  --bgp-red:       #ef4444;
  --bgp-blue:      #3b82f6;

  /* Re-map existing service vars so legacy rules adopt the new palette */
  --svc-bg:         var(--bgp-primary);
  --svc-bg-2:       var(--bgp-secondary);
  --svc-panel:      var(--bgp-secondary);
  --svc-panel-2:    var(--bgp-hover);
  --svc-border:     var(--bgp-border);
  --svc-text:       var(--bgp-text);
  --svc-text-dim:   var(--bgp-text-2);
  --svc-accent:     var(--bgp-accent);
  --svc-accent-glow: rgba(6, 182, 212, 0.35);
  --svc-danger:     var(--bgp-red);
  --svc-success:    var(--bgp-green);
}

/* ───────────────────────────────────────────────────────────────────────────
   2. BODY & GLOBAL TYPOGRAPHY
   ─────────────────────────────────────────────────────────────────────────── */
body.services-body {
  background:
    radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.06), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(6, 182, 212, 0.05), transparent 50%),
    var(--bgp-primary) !important;
  color: var(--bgp-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar — sleeker thin variant */
* { scrollbar-width: thin; scrollbar-color: #334155 #0f172a; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #2d3748;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: #475569; background-clip: padding-box; border: 2px solid transparent; }

/* ───────────────────────────────────────────────────────────────────────────
   3. UTILITY — Glass panel & gradient bg helpers
   ─────────────────────────────────────────────────────────────────────────── */
.svc-glass {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bgp-border);
}

/* ───────────────────────────────────────────────────────────────────────────
   4. TOP BAR (svc-topbar)
   ─────────────────────────────────────────────────────────────────────────── */
.svc-topbar {
  background: rgba(17, 24, 39, 0.85) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bgp-border) !important;
  padding: 10px 22px !important;
}
.svc-back {
  color: var(--bgp-text-2) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s;
}
.svc-back:hover { background: var(--bgp-hover); color: var(--bgp-text) !important; }
.svc-title h1 {
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: var(--bgp-text);
}
.svc-title-icon { font-size: 16px; }

.update-timer {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid var(--bgp-border) !important;
  color: var(--bgp-text-2) !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-family: 'JetBrains Mono', monospace !important;
}
.sync-badge {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.32) !important;
  color: #34d399 !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
.sync-badge .sync-dot {
  background: var(--bgp-green) !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
.svc-user-chip {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid var(--bgp-border) !important;
  color: var(--bgp-text-2) !important;
  padding: 5px 12px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
}
.svc-icon-btn {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid var(--bgp-border) !important;
  color: var(--bgp-text-2) !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  transition: all 0.15s;
}
.svc-icon-btn:hover {
  border-color: var(--bgp-accent) !important;
  color: var(--bgp-accent) !important;
}

/* ───────────────────────────────────────────────────────────────────────────
   5. LEFT SIDEBAR (svc-left) — widened so long sheet titles stay readable
   ─────────────────────────────────────────────────────────────────────────── */
.svc-main {
  gap: 0 !important;
  /* Force a wider left column (was 280px default). 296px gives ~24 chars of
     title space before truncation while keeping the chips visible. */
  grid-template-columns: 296px 1fr 320px !important;
}
.svc-main.right-collapsed {
  grid-template-columns: 296px 1fr 0 !important;
}
.svc-main.left-collapsed {
  grid-template-columns: 0 1fr 320px !important;
}
.svc-left {
  background: rgba(17, 24, 39, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--bgp-border) !important;
}

.svc-left-header {
  padding: 18px 16px 14px !important;
  border-bottom: 1px solid rgba(45, 55, 72, 0.5) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.svc-left-label {
  font-size: 10px !important;
  letter-spacing: 0.15em !important;
  color: var(--bgp-text-2) !important;
  font-weight: 700 !important;
  text-transform: uppercase;
}

/* New Sheet button — gradient pill */
.svc-new-btn {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  color: white !important;
  border: none !important;
  padding: 7px 14px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(6, 182, 212, 0.3);
  transition: all 0.15s;
}
.svc-new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4) !important;
}

.svc-sheet-search {
  background: rgba(11, 17, 32, 0.7) !important;
  border: 1px solid var(--bgp-border) !important;
  border-radius: 7px !important;
  color: var(--bgp-text) !important;
  font-size: 12px !important;
  padding: 8px 12px 8px 32px !important;
  margin: 12px 14px !important;
  width: calc(100% - 28px) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.svc-sheet-search:focus {
  border-color: var(--bgp-accent) !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
  outline: none !important;
}

.svc-sheet-list { padding: 4px 10px 8px !important; }

/* Sheet item — premium row (mockup-faithful, vivid colors) */
.svc-sheet-item {
  display: flex;
  align-items: center;
  gap: 10px !important;
  padding: 9px 12px !important;
  border-radius: 8px !important;
  cursor: pointer;
  color: #cbd5e1 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: 1px solid transparent !important;
  margin-bottom: 2px !important;
  transition: all 0.12s ease;
  position: relative;
  background: transparent !important;
}
.svc-sheet-item:hover {
  background: rgba(30, 41, 59, 0.8) !important;
  color: #f1f5f9 !important;
}
.svc-sheet-item.active {
  background: rgba(6, 182, 212, 0.14) !important;
  color: #67e8f9 !important;
  border-color: rgba(6, 182, 212, 0.25) !important;
}
.svc-sheet-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #06b6d4, #0891b2);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}
.svc-sheet-item .icon {
  font-size: 14px !important;
  color: #64748b;
  flex-shrink: 0;
  transition: color 0.12s;
}
.svc-sheet-item.active .icon { color: #22d3ee; }
.svc-sheet-item:hover .icon { color: #94a3b8; }
.svc-sheet-item .title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.svc-sheet-item .menu {
  opacity: 0;
  color: #94a3b8;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.15s;
}
.svc-sheet-item:hover .menu, .svc-sheet-item.active .menu { opacity: 0.7; }
.svc-sheet-item .menu:hover {
  opacity: 1 !important;
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
}

/* Visibility chips on sheet items — VIVID (mockup-matched saturation).
   Slim padding so the chip doesn't crowd long sheet titles. */
.svc-sheet-vischip {
  display: inline-flex !important;
  align-items: center;
  font-size: 9.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.025em !important;
  padding: 1px 7px !important;
  border-radius: 9999px !important;
  border-width: 1px;
  border-style: solid;
  line-height: 1.5;
  font-family: 'Inter', sans-serif !important;
  text-transform: capitalize;
  flex-shrink: 0;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.svc-sheet-vischip.svc-vis-global {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #22d3ee !important;
  border-color: rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.12);
}
.svc-sheet-vischip.svc-vis-team {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #a78bfa !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.12);
}
.svc-sheet-vischip.svc-vis-public {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.14);
}
.svc-sheet-vischip.svc-vis-shared {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.32) !important;
}
.svc-sheet-vischip.svc-vis-member {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.14);
}

/* PRIVATE chip (default for personal sheets — no other chip variant matches).
   Used by buildSheetWrapper when sheet has no global/team/public/shared flag. */
.svc-sheet-item:not(.svc-sheet-readonly):not(.svc-sheet-public) .svc-sheet-vischip:empty + .svc-sheet-vischip,
.svc-sheet-vischip.svc-vis-private {
  background: rgba(6, 182, 212, 0.12);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.32);
}

/* ── TREEVIEW FOLDERS — only visible on ACTIVE sheet (mockup parity) ────
   In the mockup, sheet items are clean flat rows; the treeview folder
   subtree only expands under the selected sheet. We achieve this by
   collapsing .svc-tv-container to zero height unless its parent wrapper
   contains an .active sheet-item. */
.svc-sheet-wrapper .svc-tv-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.svc-sheet-wrapper:has(.svc-sheet-item.active) .svc-tv-container {
  max-height: 9999px;
  padding: 2px 0 6px;
}
/* Fallback for browsers without :has() support — keep treeview visible
   under any sheet whose wrapper has the active class explicitly. */
.svc-sheet-wrapper.active .svc-tv-container {
  max-height: 9999px;
  padding: 2px 0 6px;
}

/* Section headers — mockup-faithful uppercase tracking */
.svc-sheet-section { margin-bottom: 6px !important; }
.svc-sheet-section-header {
  padding: 10px 12px 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: #94a3b8 !important;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.12s;
  gap: 9px !important;
  display: flex !important;
  align-items: center;
}
.svc-sheet-section-header:hover {
  background: transparent !important;
  color: #cbd5e1 !important;
}
.svc-sheet-section-caret {
  font-size: 9px !important;
  color: #64748b !important;
  width: 10px;
  text-align: center;
}
.svc-sheet-section-count {
  background: transparent !important;
  border: none !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  padding: 0 !important;
  margin-left: auto;
}
/* Shared parent group — subtle divider + slightly brighter heading */
.svc-sheet-section-parent {
  border-top: 1px solid rgba(45, 55, 72, 0.4) !important;
  padding-top: 4px !important;
  margin-top: 8px !important;
}
.svc-sheet-section-parent-header {
  color: #94a3b8 !important;
  font-size: 11px !important;
}
.svc-sheet-section-parent-body {
  padding-left: 0 !important;
}
.svc-sheet-section-parent-body .svc-sheet-section {
  margin-bottom: 4px !important;
}
.svc-sheet-section-parent-body .svc-sheet-section-header {
  padding: 6px 12px !important;
  font-size: 11px !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  color: #64748b !important;
  font-weight: 500 !important;
}
.svc-sheet-section-parent-body .svc-sheet-section-header:hover {
  color: #cbd5e1 !important;
}
.svc-sheet-section-parent-body .svc-sheet-section-count {
  font-size: 10px !important;
}
/* Nested sheets under Shared subfolders — slightly indented + bordered */
.svc-sheet-section-parent-body .svc-sheet-section-body {
  margin-left: 14px;
  padding-left: 10px !important;
  border-left: 1px solid rgba(45, 55, 72, 0.5);
}
.svc-sheet-section-parent-body .svc-sheet-section.svc-sheet-section-collapsed > .svc-sheet-section-body {
  border-left: none;
}
.svc-sheet-section-parent-body .svc-sheet-item {
  padding: 6px 10px !important;
  font-size: 12px !important;
}
.svc-sheet-section-parent-body .svc-sheet-section-empty {
  padding: 6px 10px !important;
  font-size: 10.5px !important;
  margin-left: 14px;
}

.svc-left-footer {
  padding: 10px 16px !important;
  border-top: 1px solid rgba(45, 55, 72, 0.5) !important;
  color: var(--bgp-text-3) !important;
  font-size: 10px !important;
}

/* ───────────────────────────────────────────────────────────────────────────
   6. CENTER — Active sheet header + toolbar
   ─────────────────────────────────────────────────────────────────────────── */
.svc-center {
  background: transparent !important;
}

/* Active-sheet header — single-row dense layout that absorbs the old toolbar.
   Left: title + badge + meta. Right: search + action buttons. */
.svc-active-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bgp-border);
  gap: 14px;
  flex-shrink: 0;
}
.svc-active-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}
.svc-active-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.svc-active-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--bgp-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32ch;
  margin: 0;
}
.svc-active-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.svc-tb-sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: rgba(45, 55, 72, 0.6);
  margin: 0 4px;
}
.svc-btn.svc-icon {
  padding: 7px 9px !important;
  min-width: 32px;
  justify-content: center;
}
.svc-btn.svc-icon i { font-size: 12px; }
.svc-search-all-input {
  min-width: 200px !important;
  max-width: 220px !important;
}
.svc-active-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
}
.svc-active-badge.private { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border-color: rgba(6, 182, 212, 0.32); }
.svc-active-badge.public  { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.32); }
.svc-active-badge.global  { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border-color: rgba(6, 182, 212, 0.32); }
.svc-active-badge.team    { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border-color: rgba(139, 92, 246, 0.32); }
.svc-active-meta {
  font-size: 11px;
  color: var(--bgp-text-3);
  white-space: nowrap;
}

/* Toolbar collapsed into active-sheet header — kept rules as fallback for
   any code path that still touches .svc-sheet-toolbar. The new compact
   layout uses .svc-active-actions inside .svc-active-header-right. */
.svc-sheet-toolbar { display: none !important; }
.svc-sheet-tabs:empty { display: none; }
.svc-toolbar-actions { gap: 6px !important; }

/* Backup modal — emphasize restore list when opened via the Restore button */
.svc-backup-restore-mode .svc-modal-header::after {
  content: '· Restore Mode';
  margin-left: 10px;
  font-size: 11px;
  font-weight: 500;
  color: #fbbf24;
  letter-spacing: 0.02em;
}
.svc-backup-restore-mode #svcBackupList {
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 6px;
  background: rgba(245, 158, 11, 0.04);
  margin-top: 8px;
}
.svc-search-all-input {
  background: rgba(11, 17, 32, 0.7) !important;
  border: 1px solid var(--bgp-border) !important;
  border-radius: 7px !important;
  color: var(--bgp-text) !important;
  font-size: 12px !important;
  padding: 7px 12px !important;
  min-width: 280px !important;
}
.svc-search-all-input:focus {
  border-color: var(--bgp-accent) !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12) !important;
  outline: none !important;
}

/* Premium pill buttons */
.svc-btn {
  background: rgba(30, 41, 59, 0.6) !important;
  border: 1px solid var(--bgp-border) !important;
  color: var(--bgp-text-2) !important;
  padding: 7px 13px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: -0.005em;
  transition: all 0.15s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.svc-btn:hover {
  background: rgba(51, 65, 85, 0.7) !important;
  border-color: rgba(71, 85, 105, 0.7) !important;
  color: var(--bgp-text) !important;
}
.svc-btn.accent {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 1px 3px rgba(6, 182, 212, 0.3);
}
.svc-btn.accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4) !important;
}
.svc-btn.ghost {
  background: transparent !important;
  border-color: rgba(45, 55, 72, 0.6) !important;
}
.svc-btn.svc-refresh-btn {
  background: rgba(6, 182, 212, 0.08) !important;
  border-color: rgba(6, 182, 212, 0.25) !important;
  color: #67e8f9 !important;
}
.svc-btn.svc-save-btn {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.28) !important;
  color: #6ee7b7 !important;
}
.svc-btn.svc-import-btn {
  background: rgba(139, 92, 246, 0.08) !important;
  border-color: rgba(139, 92, 246, 0.25) !important;
  color: #c4b5fd !important;
}
.svc-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Grid wrapper — glass panel.
   CRITICAL: overflow:auto (not hidden) so the table scrolls vertically.
   Premium glass aesthetic preserved via background+border+radius; the
   inner table inherits the rounded edges via its own corner masking. */
.svc-grid-wrap {
  margin: 14px 18px !important;
  background: rgba(17, 24, 39, 0.7) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bgp-border) !important;
  border-radius: 12px !important;
  overflow: auto !important; /* enables vertical + horizontal scroll */
  flex: 1;
  min-height: 0;
  padding: 0 !important;
}

/* Empty state — premium centered card */
.svc-empty-state {
  padding: 60px 32px !important;
  text-align: center;
}
.svc-empty-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 14px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 28px !important;
  margin: 0 auto 20px;
}
.svc-empty-state h2 {
  font-size: 18px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: var(--bgp-text) !important;
  margin-bottom: 6px !important;
}
.svc-empty-state p {
  font-size: 13px !important;
  color: var(--bgp-text-2) !important;
  margin-bottom: 18px !important;
}

/* Status bar at bottom */
.svc-statusbar {
  background: rgba(17, 24, 39, 0.5) !important;
  border-top: 1px solid rgba(45, 55, 72, 0.4) !important;
  padding: 8px 22px !important;
  font-size: 11px !important;
  color: var(--bgp-text-2) !important;
  flex-shrink: 0;
}

/* ───────────────────────────────────────────────────────────────────────────
   7. RIGHT SIDEBAR — Dashboard
   ─────────────────────────────────────────────────────────────────────────── */
.svc-right {
  background: rgba(17, 24, 39, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid var(--bgp-border) !important;
}
.svc-right-header {
  padding: 16px 18px !important;
  border-bottom: 1px solid rgba(45, 55, 72, 0.5) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.15em !important;
  color: var(--bgp-text-2) !important;
  text-transform: uppercase;
}
.svc-widget {
  padding: 16px 18px !important;
  border-bottom: 1px solid rgba(45, 55, 72, 0.3);
}
.svc-widget-title {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
  color: var(--bgp-text-2) !important;
  margin-bottom: 10px !important;
}
.svc-stat-grid { gap: 10px !important; }
.svc-stat {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.06), rgba(139, 92, 246, 0.03)) !important;
  border: 1px solid rgba(6, 182, 212, 0.15) !important;
  border-radius: 9px !important;
  padding: 12px !important;
}
.svc-stat span {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--bgp-accent) !important;
  letter-spacing: -0.02em;
}
.svc-stat label {
  font-size: 9.5px !important;
  letter-spacing: 0.08em !important;
  color: var(--bgp-text-2) !important;
  text-transform: uppercase;
  margin-top: 4px;
}
.svc-collab-chip {
  background: rgba(6, 182, 212, 0.1) !important;
  border: 1px solid rgba(6, 182, 212, 0.25) !important;
  color: #67e8f9 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
}
.svc-activity-list .muted {
  color: var(--bgp-text-3) !important;
  font-size: 12px !important;
  font-style: italic;
}

.svc-sidebar-toggle {
  background: rgba(17, 24, 39, 0.9) !important;
  border: 1px solid var(--bgp-border) !important;
  color: var(--bgp-text-2) !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  width: 22px !important;
  height: 40px !important;
}
.svc-sidebar-toggle:hover {
  background: rgba(6, 182, 212, 0.15) !important;
  border-color: rgba(6, 182, 212, 0.4) !important;
  color: var(--bgp-accent) !important;
}

/* ───────────────────────────────────────────────────────────────────────────
   8. MODALS — premium glass panel
   ─────────────────────────────────────────────────────────────────────────── */
.svc-modal-overlay,
.svc-tv-modal-overlay {
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.svc-modal,
.svc-tv-modal {
  background: rgba(17, 24, 39, 0.96) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bgp-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(6, 182, 212, 0.08) !important;
}
.svc-modal-header,
.svc-tv-modal-header {
  padding: 18px 22px !important;
  border-bottom: 1px solid var(--bgp-border) !important;
}
.svc-modal-title,
.svc-tv-modal-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: var(--bgp-text) !important;
}
.svc-modal-close,
.svc-tv-modal-close {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--bgp-text-2) !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  padding: 4px 8px !important;
  transition: all 0.15s;
}
.svc-modal-close:hover, .svc-tv-modal-close:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
}
.svc-tv-modal-body { padding: 18px 22px !important; }
.svc-tv-modal-footer {
  padding: 12px 22px 16px !important;
  border-top: 1px solid var(--bgp-border) !important;
  gap: 8px !important;
}
.svc-tv-modal-input {
  background: rgba(11, 17, 32, 0.7) !important;
  border: 1px solid var(--bgp-border) !important;
  color: var(--bgp-text) !important;
  border-radius: 7px !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
  width: 100% !important;
  margin-bottom: 12px !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.svc-tv-modal-input:focus {
  border-color: var(--bgp-accent) !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12) !important;
  outline: none !important;
}
.svc-tv-modal-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  color: var(--bgp-text-2) !important;
  margin-bottom: 6px !important;
  text-transform: uppercase;
}

/* Context menu — premium dark popover */
.svc-col-ctx-menu, .svc-tv-ctx-menu {
  background: rgba(30, 41, 59, 0.97) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--bgp-border) !important;
  border-radius: 10px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(6, 182, 212, 0.06) !important;
  padding: 6px !important;
  padding-top: 6px !important;
  min-width: 220px !important;
}
.svc-col-ctx-menu .ctx-close-btn,
.svc-tv-ctx-menu .ctx-close-btn { display: none; }
.ctx-section-header {
  padding: 6px 10px 4px !important;
  font-size: 9px !important;
  letter-spacing: 0.13em !important;
  color: var(--bgp-text-2) !important;
  text-transform: uppercase;
}
.ctx-item {
  padding: 9px 12px !important;
  border-radius: 6px !important;
  font-size: 12.5px !important;
  color: var(--bgp-text) !important;
  gap: 10px !important;
}
.ctx-item:hover {
  background: rgba(6, 182, 212, 0.12) !important;
  color: var(--bgp-accent) !important;
}
.ctx-item.ctx-item-danger:hover { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; }
.ctx-item.disabled {
  opacity: 0.35 !important;
  pointer-events: none !important;
}
.ctx-separator {
  background: rgba(45, 55, 72, 0.7) !important;
  margin: 4px 4px !important;
}
.ctx-icon {
  width: 16px !important;
  font-size: 13px !important;
}
.svc-tv-ctx-scope-chip {
  background: rgba(6, 182, 212, 0.08) !important;
  border: 1px solid rgba(6, 182, 212, 0.22) !important;
  color: #67e8f9 !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  margin: 4px 6px 8px !important;
  padding: 7px 10px !important;
  border-radius: 6px !important;
}

/* ───────────────────────────────────────────────────────────────────────────
   9. TREEVIEW NODES — match premium sheet items
   ─────────────────────────────────────────────────────────────────────────── */
.svc-tv-node {
  padding: 5px 12px 5px 26px !important;
  font-size: 11.5px !important;
  border-radius: 6px !important;
  color: var(--bgp-text-2) !important;
}
.svc-tv-node:hover {
  background: rgba(30, 41, 59, 0.6) !important;
  color: var(--bgp-text) !important;
}
.svc-tv-node.svc-tv-active {
  background: rgba(6, 182, 212, 0.12) !important;
  color: var(--bgp-accent) !important;
  border-left: 2px solid var(--bgp-accent) !important;
}
.svc-tv-count {
  background: rgba(45, 55, 72, 0.6) !important;
  border: 1px solid rgba(71, 85, 105, 0.4) !important;
  color: var(--bgp-text-2) !important;
  font-size: 9.5px !important;
  padding: 1px 6px !important;
  border-radius: 999px !important;
  font-family: 'JetBrains Mono', monospace !important;
}
.svc-tv-node.svc-tv-active .svc-tv-count {
  background: rgba(6, 182, 212, 0.15) !important;
  border-color: rgba(6, 182, 212, 0.3) !important;
  color: var(--bgp-accent) !important;
}

/* ───────────────────────────────────────────────────────────────────────────
   10. NOTIFY toasts — premium pill
   ─────────────────────────────────────────────────────────────────────────── */
.notify-toast {
  background: rgba(17, 24, 39, 0.96) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--bgp-border) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
  font-family: 'Inter', sans-serif !important;
}
.notify-toast.notify-success { border-color: rgba(16, 185, 129, 0.4) !important; }
.notify-toast.notify-error   { border-color: rgba(239, 68, 68, 0.4) !important; }
.notify-toast.notify-warning { border-color: rgba(245, 158, 11, 0.4) !important; }
.notify-toast.notify-loading { border-color: rgba(6, 182, 212, 0.4) !important; }
.notify-icon { font-size: 14px !important; }
.notify-title { font-weight: 600 !important; font-size: 12.5px !important; }
.notify-message { font-size: 11.5px !important; color: var(--bgp-text-2) !important; }

/* ───────────────────────────────────────────────────────────────────────────
   11. LOADER (svc-loader) — premium splash
   ─────────────────────────────────────────────────────────────────────────── */
.svc-loader {
  background:
    radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.08), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(6, 182, 212, 0.06), transparent 50%),
    var(--bgp-primary) !important;
}
.loader-content h2 {
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--bgp-text) !important;
}
.loader-status { color: var(--bgp-text-2) !important; font-size: 13px; }
.progress-bar { background: rgba(45, 55, 72, 0.5) !important; }
.progress-fill {
  background: linear-gradient(90deg, var(--bgp-accent), var(--bgp-accent-2)) !important;
}
.loader-logo svg { color: var(--bgp-accent); }

/* ───────────────────────────────────────────────────────────────────────────
   12. GRID TABLE — premium polish
   ─────────────────────────────────────────────────────────────────────────── */
.svc-grid {
  background: transparent !important;
  border-collapse: separate !important;
  border-spacing: 0;
  margin: 0 !important;
}
/* Sticky header so column labels stay visible while scrolling rows */
.svc-grid thead th {
  background: rgba(11, 17, 32, 0.96) !important;
  color: var(--bgp-text-2) !important;
  font-weight: 600 !important;
  font-size: 10px !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase;
  border-bottom: 1px solid var(--bgp-border) !important;
  padding: 8px 10px !important;
  position: sticky;
  top: 0;
  z-index: 5;
}
.svc-grid tbody td {
  background: transparent !important;
  border-bottom: 1px solid rgba(45, 55, 72, 0.35) !important;
  padding: 4px 10px !important;       /* TIGHTER — 4px vs 10px before */
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: var(--bgp-text) !important;
  height: 28px !important;            /* explicit row height for density */
  vertical-align: middle;
}
.svc-grid tbody tr:hover td:not(.row-num) {
  background: rgba(30, 41, 59, 0.55) !important;
}
.svc-grid tbody td.row-num {
  background: rgba(11, 17, 32, 0.7) !important;
  color: var(--bgp-text-3) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 10px !important;
  font-weight: 600;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 3;
}
.svc-grid tbody td input.cell {
  background: transparent !important;
  color: var(--bgp-text) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  padding: 2px 5px !important;        /* TIGHTER — 2px vs 4px */
  height: 22px !important;
  line-height: 1.3 !important;
  transition: border-color 0.12s, background 0.12s;
}
.svc-grid tbody td input.cell:focus {
  background: rgba(6, 182, 212, 0.1) !important;
  border-color: var(--bgp-accent) !important;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2) !important;
  outline: none !important;
}

/* Filter row (Excel-style under headers) — tighter spacing */
.svc-grid thead tr.filter-row th {
  padding: 4px 8px !important;
  background: rgba(15, 23, 42, 0.8) !important;
  border-bottom: 1px solid var(--bgp-border) !important;
  position: sticky;
  top: 30px; /* below the main header row */
  z-index: 4;
}
.svc-grid thead tr.filter-row input {
  font-size: 11px !important;
  padding: 3px 7px !important;
  height: 22px !important;
}

/* Column ctx menu — capped height with internal scroll so all options are
   reachable when the header is near the top of the viewport (prevents the
   "missing features" experience the user reported). */
.svc-col-ctx-menu {
  background: rgba(30, 41, 59, 0.97) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--bgp-border) !important;
  border-radius: 10px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(6, 182, 212, 0.1) !important;
  min-width: 280px !important;
  max-width: 320px !important;
  padding: 6px !important;
  padding-top: 32px !important; /* room for close button */
  /* max-height + overflow-y set inline by services-grid.js positioning logic */
}
.svc-col-ctx-menu .ctx-close-btn {
  display: flex !important;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 5px;
  color: #f87171;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s;
  z-index: 10;
}
.svc-col-ctx-menu .ctx-close-btn:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.4);
}
.svc-col-ctx-menu .ctx-rename-input {
  flex: 1;
  background: rgba(11, 17, 32, 0.7);
  border: 1px solid var(--bgp-border);
  color: var(--bgp-text);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
}
.svc-col-ctx-menu .ctx-rename-input:focus {
  border-color: var(--bgp-accent);
  box-shadow: 0 0 0 2px rgba(6,182,212,0.15);
}
.svc-col-ctx-menu .ctx-rename-ok {
  background: var(--bgp-accent);
  color: #0b1120;
  border: none;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
}

/* ───────────────────────────────────────────────────────────────────────────
   13. TRANSFER OWNERSHIP / MANAGE ACCESS / ACTIVITY LOG modal lists
   ─────────────────────────────────────────────────────────────────────────── */
.svc-tv-transfer-list,
.svc-tv-access-grants,
.svc-tv-access-users,
.svc-tv-audit-list {
  background: rgba(11, 17, 32, 0.6) !important;
  border-color: var(--bgp-border) !important;
  border-radius: 9px !important;
}

/* ───────────────────────────────────────────────────────────────────────────
   14. Counter-recovery banner (my_quickbase.js) — match premium aesthetic
   ─────────────────────────────────────────────────────────────────────────── */
#qbCounterRecoveryBanner,
#svcSmokeBanner {
  background: rgba(17, 24, 39, 0.96) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-family: 'Inter', sans-serif !important;
}
