/* ============================================================
   OmegaOS Design Tokens — public/css/theme.css
   Single source of truth for all color, spacing, and geometry.
   All authenticated pages link this file.
   Login page links this file but does NOT load shell.js.
   ============================================================ */

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

:root {
  /* ── Backgrounds ─────────────────────────────────────────── */
  --app-bg:               #242A30;   /* page background */
  --surface:              #303840;   /* card / panel surface */
  --surface-raised:       #39434C;   /* elevated cards, active panels */
  --surface-hover:        #424D57;   /* hover state on clickable surfaces */

  /* ── Sidebar ─────────────────────────────────────────────── */
  --sidebar-bg:           #1B2025;   /* primary sidebar — darkest layer */
  --sidebar-secondary-bg: #2B3239;   /* settings secondary sidebar */
  --sidebar-active-bg:    rgba(232, 160, 32, 0.16);
  --sidebar-active-border:#E8A020;
  --sidebar-width:        240px;
  --sidebar-collapsed:    60px;

  /* ── Cards ───────────────────────────────────────────────── */
  --card-bg:              #303840;
  --card-border:          rgba(255, 255, 255, 0.16);

  /* ── Inputs ──────────────────────────────────────────────── */
  --input-bg:             #20262C;
  --input-border:         rgba(255, 255, 255, 0.20);
  --input-focus:          #E8A020;

  /* ── Text ────────────────────────────────────────────────── */
  --text-primary:         #F5F7F8;    /* 13.4:1 on --app-bg */
  --text-secondary:       rgba(245, 247, 248, 0.78); /* 8.1:1 on --app-bg */
  --text-muted:           rgba(245, 247, 248, 0.58); /* 5.3:1 on --app-bg */

  /* ── Brand ───────────────────────────────────────────────── */
  --gold:                 #E8A020;   /* 6.2:1 on --app-bg */
  --gold-hover:           #F5B942;
  --gold-soft:            rgba(232, 160, 32, 0.16);
  --gold-text:            #1A1A1A;   /* text ON gold buttons: 8.2:1 */

  /* ── Borders ─────────────────────────────────────────────── */
  --border:               rgba(255, 255, 255, 0.16);
  --border-strong:        rgba(255, 255, 255, 0.26);

  /* ── Status ──────────────────────────────────────────────── */
  --status-success:       #43A047;
  --status-warning:       #F9A825;
  --status-danger:        #E53935;
  --status-inactive:      #8A949E;

  /* ── Geometry ────────────────────────────────────────────── */
  --radius:               10px;
  --tap-min:              56px;
  --bottomnav-height:     64px;

  /* ── Compatibility aliases ───────────────────────────────── */
  /* Existing pages use these names; they resolve to new dark values. */
  --bg:                   var(--app-bg);
  --surface-2:            var(--surface-raised);
  --shell:                var(--sidebar-bg);
  --on-shell:             var(--text-primary);
  --text:                 var(--text-primary);
  --text-dim:             var(--text-secondary);
  --gold-dim:             #C88A10;   /* dimmed gold, visible on dark surfaces */

  /* ── Light content layer tokens ─────────────────────────────── */
  --lc-canvas:            #FAFAF7;   /* page canvas background */
  --lc-surface:           #FFFFFF;   /* cards, drawers, panels */
  --lc-border:            #E0DFD8;   /* borders */
  --lc-border-light:      #F0EFEA;   /* table row dividers (lighter) */
  --lc-text:              #1A1A1A;   /* primary text on light */
  --lc-text-dim:          #6B6860;   /* secondary/muted text */
  --lc-text-muted:        #9B9890;   /* placeholder, very subtle */
  --lc-input-bg:          #F5F4F0;   /* input field background */
  --lc-gold:              #C8961E;   /* canonical gold on light backgrounds */
  --lc-gold-hover:        #B8860E;   /* gold hover */

  --error:                var(--status-danger);
  --green:                var(--status-success);
  --yellow:               var(--status-warning);
  --red:                  var(--status-danger);
  --gray:                 var(--status-inactive);
}

/* ── Base ────────────────────────────────────────────────────── */
html, body {
  min-height: 100%;
  background: var(--app-bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* ── Shell structure ─────────────────────────────────────────── */
#app-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: width 0.22s ease;
}

body.sidebar-collapsed #app-sidebar {
  width: var(--sidebar-collapsed);
}

#app-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.22s ease;
}

body.sidebar-collapsed #app-content {
  margin-left: var(--sidebar-collapsed);
}

#app-secondary-sidebar {
  position: fixed;
  left: var(--sidebar-width);
  top: 0;
  width: 220px;
  height: 100vh;
  background: var(--sidebar-secondary-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 99;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  transition: left 0.22s ease;
}

body.sidebar-collapsed #app-secondary-sidebar {
  left: var(--sidebar-collapsed);
}

#app-secondary-sidebar.open {
  display: flex;
}

body.secondary-sidebar-open #app-content {
  margin-left: calc(var(--sidebar-width) + 220px);
}

body.sidebar-collapsed.secondary-sidebar-open #app-content {
  margin-left: calc(var(--sidebar-collapsed) + 220px);
}

#app-bottomnav {
  display: none;
}

/* ── Sidebar skeleton (shown while auth/me loads) ─────────────── */
.sidebar-skeleton {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-line {
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line.short { height: 32px; width: 80%; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

/* ── Sidebar internals ───────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  min-height: 60px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
}

.sidebar-logo-icon {
  color: var(--gold);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sidebar-logo-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.15s;
}

body.sidebar-collapsed .sidebar-logo-text {
  opacity: 0;
  pointer-events: none;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.sidebar-collapse-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #4B5563 #111827;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: #111827;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #4B5563;
  border-radius: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #6B7280;
}

.sidebar-nav-main,
.sidebar-nav-bottom {
  display: flex;
  flex-direction: column;
}

.sidebar-nav-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 8px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  min-height: 44px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--gold);
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}

.nav-item-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
}

.nav-item-label {
  opacity: 1;
  transition: opacity 0.15s;
  white-space: nowrap;
  overflow: hidden;
}

body.sidebar-collapsed .nav-item-label {
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .sidebar-nav-bottom {
  padding-top: 8px;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  padding: 14px 16px 4px;
  user-select: none;
}

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

/* Legacy — kept for backward compat; new code uses nav-item-placeholder */
.nav-item-soon {
  opacity: 0.55;
}

.nav-soon-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(212, 160, 23, 0.18);
  color: var(--gold);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Collapsible section toggle ─────────────────────────────── */
.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 16px 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  user-select: none;
  text-align: left;
}
.nav-section-toggle:hover {
  color: rgba(255, 255, 255, 0.45);
}

.nav-sec-chev {
  opacity: 0.5;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.nav-sec-chev.collapsed {
  transform: rotate(-90deg);
}

body.sidebar-collapsed .nav-section-toggle {
  display: none;
}

/* Collapsible items container */
.nav-section-items {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}
.nav-section-items.collapsed {
  max-height: 0;
  opacity: 0;
}

/* ── V1 NEXT and SOON nav badges ────────────────────────────── */
.nav-badge-v1next {
  display: inline-block;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(212, 160, 23, 0.18);
  color: var(--gold);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

.nav-badge-soon {
  display: inline-block;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(245, 247, 248, 0.4);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Placeholder nav items — still clickable (route to /roadmap/:key) */
.nav-item-placeholder {
  opacity: 0.65;
}
.nav-item-placeholder:hover {
  opacity: 0.9;
}

body.sidebar-collapsed .nav-badge-v1next,
body.sidebar-collapsed .nav-badge-soon {
  display: none;
}

/* ── Sidebar user section ───────────────────────────────────── */
/* ── Area switcher (Dynamics-style, bottom-left, opens upward) ── */
.sidebar-area-switcher {
  position: relative;
  flex-shrink: 0;
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-area-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.sidebar-area-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.sidebar-area-btn-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-area-btn-chev {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

body.sidebar-collapsed .sidebar-area-btn-label { display: none; }
body.sidebar-collapsed .sidebar-area-btn { justify-content: center; padding: 9px 0; }

.sidebar-area-menu {
  position: absolute;
  bottom: calc(100% - 2px);
  left: 10px;
  right: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  padding: 5px;
  z-index: 60;
}

.sidebar-area-menu[hidden] { display: none; }

.sidebar-area-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.sidebar-area-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.sidebar-area-menu-item.active {
  color: var(--gold);
  font-weight: 600;
}

.sidebar-area-menu-check {
  display: flex;
  align-items: center;
  width: 15px;
  flex-shrink: 0;
  color: var(--gold);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  min-height: 64px;
  overflow: hidden;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(232, 160, 32, 0.3);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.15s;
}

body.sidebar-collapsed .sidebar-user-info {
  opacity: 0;
  pointer-events: none;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  opacity: 1;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.sidebar-logout-btn:hover {
  color: var(--status-danger);
  background: rgba(229, 57, 53, 0.1);
}

body.sidebar-collapsed .sidebar-logout-btn {
  opacity: 0;
  pointer-events: none;
}

/* ── Secondary sidebar internals ─────────────────────────────── */
.secondary-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  min-height: 60px;
}

.secondary-back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.secondary-back-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}

.secondary-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.secondary-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.secondary-nav-item {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.13s, color 0.13s;
  border-left: 3px solid transparent;
  min-height: 44px;
}

.secondary-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.secondary-nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--gold);
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}

/* ── Mobile navigation — hamburger drawer ────────────────────── */
@media (max-width: 767px) {
  /* Sidebar becomes a slide-out left drawer */
  #app-sidebar {
    position: fixed !important;
    top: 0; bottom: 0; left: 0;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 400;
    overflow-y: auto;
    display: flex !important;
  }

  body.mobile-nav-open #app-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.35);
  }

  #app-secondary-sidebar {
    display: none !important;
  }

  #app-content {
    margin-left: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 56px;
  }

  body.secondary-sidebar-open #app-content {
    margin-left: 0 !important;
  }

  /* Repurpose bottomnav element as mobile top bar with hamburger */
  #app-bottomnav {
    display: flex;
    position: fixed;
    top: 0; bottom: auto;
    left: 0; right: 0;
    height: 56px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    z-index: 300;
    align-items: center;
    padding: 0 8px;
    gap: 4px;
  }
}

/* Mobile drawer overlay */
.sidebar-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 390;
}

body.mobile-nav-open .sidebar-mobile-overlay {
  display: block;
}

/* Hamburger button */
.hamburger-btn {
  width: 44px; height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius);
  color: var(--text-primary);
  flex-shrink: 0;
}

.hamburger-btn:active { background: rgba(255,255,255,0.06); }

.hamburger-line {
  display: block;
  width: 20px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: opacity 0.15s;
}

.mobile-topbar-title {
  flex: 1;
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
  padding-left: 4px;
}

/* Legacy bottomnav item styles — hidden on mobile (kept for desktop compat) */
.bottomnav-item {
  display: none;
}

.bottomnav-icon, .bottomnav-label { display: none; }

/* ── Mobile "More" sheet ─────────────────────────────────────── */
.more-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}

.more-sheet.open {
  display: block;
}

.more-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.more-sheet-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-raised);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 12px 0 calc(var(--bottomnav-height) + 16px);
  max-height: 75vh;
  overflow-y: auto;
}

.more-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.more-sheet-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}

.more-sheet-item {
  display: block;
  padding: 14px 20px;
  color: var(--text-primary);
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  min-height: var(--tap-min);
}

.more-sheet-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.more-sheet-logout {
  color: var(--status-danger);
  margin-top: 8px;
}

/* ── Placeholder page layout ─────────────────────────────────── */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 24px;
  text-align: center;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.6;
}

.placeholder-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.placeholder-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.5;
}

.placeholder-badge {
  display: inline-block;
  margin-top: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 12px;
}

/* ── Shared: Alternating table rows (zebra stripes) ──────────── */
.zebra-table tbody tr:nth-child(even),
table.data-table tbody tr:nth-child(even),
.ws-table tbody tr:nth-child(even) {
  background: #F9F8F5;
}

.zebra-table tbody tr:hover,
table.data-table tbody tr:hover,
.ws-table tbody tr:hover {
  background: #F4F3EE !important;
  cursor: pointer;
}

/* ── Shared: Right-side drawer (light) ───────────────────────── */
.omega-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 250;
}

.omega-drawer-overlay.open {
  display: block;
}

.omega-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 95vw;
  background: var(--lc-surface);
  border-left: 1px solid var(--lc-border);
  z-index: 260;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.27s ease;
  overflow: hidden;
}

.omega-drawer.open {
  transform: translateX(0);
  box-shadow: -4px 0 24px rgba(0,0,0,0.10);
}

.omega-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--lc-border);
  flex-shrink: 0;
}

.omega-drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--lc-text);
}

.omega-drawer-close {
  background: none; border: none;
  color: var(--lc-text-dim);
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.omega-drawer-close:hover { color: var(--lc-text); background: #F0EFEB; }

.omega-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.omega-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--lc-border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .omega-drawer {
    width: 100%;
    max-width: 100vw;
  }
}

/* ── Toast (on-brand alert replacement; rendered by shell.js omToast) ────────── */
.omega-toast-host {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.omega-toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start;
  min-width: 240px; max-width: 440px;
  background: #FFFFFF; color: #1A1A1A;
  border: 1px solid #E0DFD8; border-left: 4px solid #C8961E; border-radius: 10px;
  padding: 12px 16px; box-shadow: 0 6px 24px rgba(0,0,0,0.16);
  font-size: 14px; line-height: 1.4; font-family: inherit; cursor: pointer;
  opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease;
}
.omega-toast.show { opacity: 1; transform: translateY(0); }
.omega-toast--error   { border-left-color: #DC3545; }
.omega-toast--success { border-left-color: #1A7040; }
.omega-toast-ico { flex: 0 0 auto; font-size: 15px; }
.omega-toast-msg { flex: 1; white-space: pre-line; }
@media (max-width: 600px) {
  .omega-toast-host { left: 16px; right: 16px; transform: none; bottom: 88px; }
  .omega-toast { width: 100%; max-width: 100%; }
}

/* ── PWA install hint banner (mobile) — dismissible bottom sheet ───────────── */
.omega-install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 9500; display: flex; align-items: center; gap: 12px;
  background: #1B2025; color: #EDEBE6; border: 1px solid #2C333A; border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 8px 26px rgba(0,0,0,0.32);
}
.omega-install-banner .oib-bolt { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  background: #D4A017; color: #1B2025; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; }
.omega-install-banner .oib-text { flex: 1; min-width: 0; }
.omega-install-banner .oib-title { font-size: 14px; font-weight: 700; color: #fff; }
.omega-install-banner .oib-sub { font-size: 12px; color: #B0ADA6; margin-top: 2px; line-height: 1.35; }
.omega-install-banner .oib-install { flex: 0 0 auto; border: 0; background: #D4A017; color: #1B2025;
  font-weight: 800; font-size: 13px; padding: 10px 16px; border-radius: 9px; cursor: pointer; min-height: 44px; }
.omega-install-banner .oib-install:active { opacity: .85; }
.omega-install-banner .oib-x { flex: 0 0 auto; border: 0; background: transparent; color: #8C8983;
  font-size: 17px; line-height: 1; padding: 8px; cursor: pointer; min-width: 40px; min-height: 40px; border-radius: 8px; }
.omega-install-banner .oib-x:active { background: rgba(255,255,255,0.08); }

/* ================================================================
   LIGHT CONTENT LAYER — Shared utility classes
   New pages use these instead of re-declaring per-page.
   Pattern: .cmd-bar (dark top strip) + .page-canvas (light body).
   ================================================================ */

/* ── Command bar ─────────────────────────────────────────────── */
.cmd-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px; height: 60px;
  background: var(--shell);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky; top: 0; z-index: 20;
  flex-shrink: 0;
}
.cmd-back {
  background: none; border: none;
  color: rgba(235,229,216,0.8);
  font-size: 14px; font-weight: 500;
  cursor: pointer; padding: 8px 10px;
  min-height: 44px; display: flex; align-items: center; gap: 5px;
  border-radius: 7px; white-space: nowrap; font-family: inherit;
}
.cmd-back:hover { color: rgba(235,229,216,1); background: rgba(255,255,255,0.06); }
.cmd-spacer { flex: 1; }
.cmd-title {
  font-size: 17px; font-weight: 700;
  color: rgba(235,229,216,0.95); letter-spacing: 0.01em;
}
.cmd-subtitle { font-size: 12px; color: rgba(235,229,216,0.5); }
.cmd-action {
  background: var(--lc-gold); border: none; color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 9px 18px; border-radius: 8px;
  min-height: 38px; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
  font-family: inherit; flex-shrink: 0;
}
.cmd-action:hover { background: var(--lc-gold-hover); }
.cmd-action:disabled { opacity: 0.5; cursor: not-allowed; }
.cmd-title-group { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.cmd-title-group .cmd-title { font-size: 17px; }
.cmd-actions { display: flex; align-items: center; gap: 10px; }
.cmd-lang-link {
  color: rgba(235,229,216,0.55);
  font-size: 12px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
  flex-shrink: 0; white-space: nowrap; cursor: pointer;
}
.cmd-lang-link:hover { color: rgba(235,229,216,0.9); }

/* ── Page canvas ─────────────────────────────────────────────── */
.page-canvas {
  background: var(--lc-canvas);
  min-height: calc(100vh - 60px);
  padding-bottom: 80px;
}
.page-heading { padding: 20px 24px 8px; }
.page-title { font-size: 22px; font-weight: 800; color: var(--lc-text); line-height: 1.2; }
.page-sub { font-size: 13px; color: var(--lc-text-dim); margin-top: 3px; }
.sec-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--lc-text-muted);
}

/* ── Filter card ─────────────────────────────────────────────── */
.filter-card {
  background: var(--lc-surface); border: 1px solid var(--lc-border);
  border-radius: 10px; padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row + .filter-row { margin-top: 8px; }
.filter-search {
  flex: 1; min-width: 180px;
  background: var(--lc-input-bg); border: 1px solid var(--lc-border);
  border-radius: 8px; color: var(--lc-text);
  font-size: 14px; padding: 9px 12px;
  outline: none; box-sizing: border-box; font-family: inherit;
}
.filter-search::placeholder { color: var(--lc-text-muted); }
.filter-search:focus { border-color: var(--lc-gold); background: #fff; }
.filter-select {
  background: var(--lc-input-bg); border: 1px solid var(--lc-border);
  border-radius: 8px; color: var(--lc-text);
  font-size: 13px; padding: 8px 10px;
  outline: none; cursor: pointer; font-family: inherit;
}
.filter-select:focus { border-color: var(--lc-gold); }
.filter-label { font-size: 12px; color: var(--lc-text-dim); white-space: nowrap; }
.btn-reset {
  background: none; border: 1px solid var(--lc-border);
  border-radius: 8px; color: var(--lc-text-dim);
  font-size: 12px; font-weight: 600;
  padding: 8px 14px; cursor: pointer; white-space: nowrap; font-family: inherit;
}
.btn-reset:hover { border-color: var(--lc-gold); color: var(--lc-gold); }

/* ── Light card ──────────────────────────────────────────────── */
.lc-card {
  background: var(--lc-surface); border: 1px solid var(--lc-border);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ── Light buttons ───────────────────────────────────────────── */
.lc-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  border-radius: 8px; padding: 9px 16px;
  border: none; font-family: inherit; white-space: nowrap;
  transition: opacity 0.12s;
}
.lc-btn-primary { background: var(--lc-gold); color: #fff; }
.lc-btn-primary:hover { background: var(--lc-gold-hover); }
.lc-btn-secondary {
  background: var(--lc-input-bg); border: 1px solid var(--lc-border);
  color: var(--lc-text-dim);
}
.lc-btn-secondary:hover { background: #EEECE5; }
.lc-btn-danger { background: #D94040; color: #fff; }
.lc-btn-danger:hover { background: #C03030; }
.lc-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Light form fields ───────────────────────────────────────── */
.lf-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.lf-label {
  font-size: 11px; font-weight: 600;
  color: var(--lc-text-dim); text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lf-input, .lf-select, .lf-textarea {
  width: 100%; box-sizing: border-box;
  background: var(--lc-input-bg); border: 1px solid var(--lc-border);
  border-radius: 6px; color: var(--lc-text);
  font-size: 13px; padding: 5px 10px;
  font-family: inherit; outline: none;
}
.lf-textarea { resize: vertical; min-height: 72px; }
.lf-input:focus, .lf-select:focus, .lf-textarea:focus {
  border-color: var(--lc-gold); background: #fff;
}
.lf-input::placeholder, .lf-textarea::placeholder { color: var(--lc-text-muted); }

/* ── Light data table ────────────────────────────────────────── */
.lc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lc-table th {
  text-align: left; padding: 9px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lc-text-dim); background: #FAFAF9;
  border-bottom: 1px solid var(--lc-border); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.lc-table th.asc::after  { content: ' ▲'; font-size: 9px; }
.lc-table th.desc::after { content: ' ▼'; font-size: 9px; }
.lc-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--lc-border-light);
  vertical-align: middle; color: var(--lc-text);
}
.lc-table tr:last-child td { border-bottom: none; }
.lc-table tbody tr:hover td { background: #F9F8F2; cursor: pointer; }

/* ── Light badge ─────────────────────────────────────────────── */
.lc-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
}

/* ── Empty state (light) ─────────────────────────────────────── */
.lc-empty { text-align: center; padding: 48px 24px; color: var(--lc-text-dim); }
.lc-empty .icon { font-size: 40px; margin-bottom: 12px; }
.lc-empty p { font-size: 14px; }
.lc-empty-sub { font-size: 12px; color: var(--lc-text-muted); margin-top: 4px; }

/* ── Sidebar language toggle ─────────────────────────────────── */
.sidebar-lang-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: rgba(245,247,248,0.65);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 7px; cursor: pointer;
  flex-shrink: 0; font-family: inherit;
  transition: background 0.13s, color 0.13s;
}
.sidebar-lang-btn:hover {
  background: rgba(255,255,255,0.14);
  color: var(--text-primary);
}

/* ── Sales Tasks rail (shared: opportunity-detail + quote-detail) ──────────
   Vitruvius 2026-06-16: clean card-based task rail. "Like screens behave
   alike" — keep these here so the two pages can't drift apart. */
.rail-header {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: #6B6860; padding: 4px 2px 6px;
}
.rail-card {
  background: #fff; border: 1px solid #E0DFD8;
  border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 10px;
}
/* Current-Task card carries a gold left accent so the eye lands on the
   active step. Won/lost/superseded cards stay plain (terminal, centered). */
.rail-card--current { border-left: 3px solid #C8961E; padding-left: 12px; }
.rail-task-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #6B6860; margin-bottom: 6px;
}
.rail-task-body {
  font-size: 13px; color: #4A4A44; line-height: 1.45;
}
/* Section title separates the gold CTA from secondary actions with a hairline
   so primary / secondary / destructive read as three distinct groups. */
.rail-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #6B6860; padding: 10px 2px 6px; margin-top: 4px;
  border-top: 1px solid #EDEBE4;
}
/* Primary rail CTA — single gold full-width action per stage.
   Sized for the salesman's tablet (≥48px touch target). */
.rail-cta {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 48px; margin-top: 4px; margin-bottom: 10px;
  background: #C8961E; color: #fff;
  font-size: 14px; font-weight: 700;
  padding: 12px 16px; border: none; border-radius: 8px;
  cursor: pointer; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); font-family: inherit;
}
.rail-cta:hover { background: #B5851A; }
.rail-cta:disabled { opacity: 0.45; cursor: not-allowed; }
