/**
 * RC global theme surfaces — Light / Dark / Reserve (Luxury)
 * Applies to ENTIRE app: sidebar + main + cards + tables + modals + widgets.
 * Load after Tailwind utilities. Version: 20260929.40
 */

/* ── Shared tokens ─────────────────────────────────────────── */
html[data-theme="light"] {
  --rc-ink: #0f172a;
  --rc-ink-soft: #1e293b;
  --rc-ink-muted: #334155;
  --rc-ink-faint: #64748b;
  --rc-paper: #f1f5f9;
  --rc-card: #ffffff;
  --rc-border: #e2e8f0;
  --rc-header: #ffffff;
  --rc-sidebar: #0f172a;
  --rc-sidebar-ink: #e2e8f0;
  --rc-accent: #2563eb;
  color-scheme: light;
}
html[data-theme="dark"],
html.dark:not([data-theme="reserve"]):not([data-theme="light"]) {
  --rc-ink: #f8fafc;
  --rc-ink-soft: #e2e8f0;
  --rc-ink-muted: #cbd5e1;
  --rc-ink-faint: #94a3b8;
  --rc-paper: #0b1220;
  --rc-card: #111827;
  --rc-border: #334155;
  --rc-header: #0f172a;
  --rc-sidebar: #020617;
  --rc-sidebar-ink: #e2e8f0;
  --rc-accent: #60a5fa;
  color-scheme: dark;
}
html[data-theme="reserve"] {
  --rc-ink: #f5efe6;
  --rc-ink-soft: #ebe0d0;
  --rc-ink-muted: #d4c4a8;
  --rc-ink-faint: #b8a68a;
  --rc-paper: #1a0a0c;
  --rc-card: #2a1216;
  --rc-border: #5c3038;
  --rc-header: #14080a;
  --rc-sidebar: #14080a;
  --rc-sidebar-ink: #ebe0d0;
  --rc-accent: #d4af6a;
  color-scheme: dark;
}

/* ── Shell: html/body/main/content ─────────────────────────── */
html[data-theme] body {
  background-color: var(--rc-paper) !important;
  color: var(--rc-ink) !important;
}
html[data-theme] #rc-main-content,
html[data-theme] main#rc-main-content,
html[data-theme] #rc-content,
html[data-theme] [data-rc-list] {
  background-color: var(--rc-paper) !important;
  color: var(--rc-ink) !important;
}
/* Kill fixed Tailwind light grays on main shell */
html[data-theme="dark"] #rc-main-content,
html[data-theme="dark"] #rc-content,
html[data-theme="reserve"] #rc-main-content,
html[data-theme="reserve"] #rc-content {
  background-color: var(--rc-paper) !important;
}

/* ── Sidebar ───────────────────────────────────────────────── */
html[data-theme] aside#rc-sidebar,
html[data-theme] #rc-sidebar {
  background: var(--rc-sidebar) !important;
  border-color: var(--rc-border) !important;
  color: var(--rc-sidebar-ink) !important;
}
html[data-theme] aside#rc-sidebar a,
html[data-theme] #rc-sidebar a,
html[data-theme] aside#rc-sidebar .sidebar-link {
  color: var(--rc-sidebar-ink) !important;
}
html[data-theme="light"] aside#rc-sidebar,
html[data-theme="light"] #rc-sidebar {
  /* light mode: keep dark navy rail for contrast brand bar */
  background: #0f172a !important;
  color: #e2e8f0 !important;
}
html[data-theme="light"] aside#rc-sidebar a,
html[data-theme="light"] #rc-sidebar a {
  color: #e2e8f0 !important;
}

/* ── Top header bar ────────────────────────────────────────── */
html[data-theme] header[role="banner"],
html[data-theme] #rc-main-content > header {
  background: var(--rc-header) !important;
  border-bottom-color: var(--rc-border) !important;
  color: var(--rc-ink) !important;
}
html[data-theme] header h1,
html[data-theme] header .font-bold,
html[data-theme] header .text-slate-800,
html[data-theme] header .text-slate-900 {
  color: var(--rc-ink) !important;
}

/* ── Cards / panels / white boxes ──────────────────────────── */
html[data-theme] .bg-white,
html[data-theme] .bg-slate-50,
html[data-theme] .bg-slate-100,
html[data-theme] .bg-gray-50,
html[data-theme] .bg-gray-100,
html[data-theme] .rc-vcard,
html[data-theme] .rc-card,
html[data-theme] article.bg-white,
html[data-theme] .rounded-xl.bg-white,
html[data-theme] .rounded-2xl.bg-white,
html[data-theme] #rc-live-strip > .rc-live-cell,
html[data-theme] #rc-bday-strip {
  background-color: var(--rc-card) !important;
  border-color: var(--rc-border) !important;
  color: var(--rc-ink) !important;
}

/* ── Typography utilities ──────────────────────────────────── */
/* Main content typography — NEVER apply to #rc-sidebar (left pane uses --rc-sidebar-ink) */
html[data-theme] #rc-main-content .text-slate-900,
html[data-theme] #rc-main-content .text-slate-800,
html[data-theme] #rc-main-content .text-gray-900,
html[data-theme] #rc-main-content .text-gray-800,
html[data-theme] #rc-main-content h1,
html[data-theme] #rc-main-content h2,
html[data-theme] #rc-main-content h3,
html[data-theme] #rc-main-content h4,
html[data-theme] #rc-main-content p,
html[data-theme] #rc-main-content li,
html[data-theme] #rc-main-content td,
html[data-theme] #rc-main-content th,
html[data-theme] #rc-main-content label {
  color: var(--rc-ink) !important;
}
html[data-theme] .text-slate-600,
html[data-theme] .text-slate-500,
html[data-theme] .text-slate-400,
html[data-theme] .text-gray-500,
html[data-theme] .text-gray-400 {
  color: var(--rc-ink-muted) !important;
}

/* ── Borders ───────────────────────────────────────────────── */
html[data-theme] .border-slate-100,
html[data-theme] .border-slate-200,
html[data-theme] .border-slate-300,
html[data-theme] .border-gray-200 {
  border-color: var(--rc-border) !important;
}

/* ── Inputs ────────────────────────────────────────────────── */
html[data-theme] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme] select,
html[data-theme] textarea,
html[data-theme] .rc-ed-input {
  background-color: var(--rc-card) !important;
  color: var(--rc-ink) !important;
  border-color: var(--rc-border) !important;
}
html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* ── Tables ────────────────────────────────────────────────── */
html[data-theme] table,
html[data-theme] thead,
html[data-theme] tbody,
html[data-theme] tr,
html[data-theme] th,
html[data-theme] td {
  color: var(--rc-ink) !important;
  border-color: var(--rc-border) !important;
}
html[data-theme] thead,
html[data-theme] th {
  background-color: var(--rc-card) !important;
}

/* ── Modals ────────────────────────────────────────────────── */
html[data-theme] [role="dialog"] .bg-white,
html[data-theme] [data-rc-dialog] .bg-white,
html[data-theme] #enterprise-editor-root .bg-white {
  background-color: var(--rc-card) !important;
  color: var(--rc-ink) !important;
}

/* ── Team sticky bar ───────────────────────────────────────── */
html[data-theme] .rc-team-sticky-bar {
  background: color-mix(in srgb, var(--rc-paper) 92%, transparent) !important;
  border-bottom-color: var(--rc-border) !important;
}
html[data-theme="reserve"] .rc-team-sticky-bar {
  background: rgba(26, 10, 12, 0.94) !important;
}
html[data-theme="dark"] .rc-team-sticky-bar {
  background: rgba(11, 18, 32, 0.94) !important;
}

/* ── Reserve luxury accents ────────────────────────────────── */
html[data-theme="reserve"] body {
  background:
    radial-gradient(ellipse 70% 50% at 80% 20%, rgba(120, 40, 45, 0.28) 0%, transparent 55%),
    var(--rc-paper) !important;
}
html[data-theme="reserve"] .rc-count-badge {
  background: #d4af6a !important;
  color: #2a1810 !important;
}
html[data-theme="reserve"] .bg-blue-600,
html[data-theme="reserve"] button.bg-blue-600 {
  background: linear-gradient(180deg, #f0e2c4 0%, #d4af6a 100%) !important;
  color: #2a1810 !important;
  border-color: #a67c3d !important;
}
html[data-theme="reserve"] .rc-vcard-name {
  color: #e8d5a3 !important;
}

/* ── Dark mode accents ─────────────────────────────────────── */
html[data-theme="dark"] .rc-count-badge {
  background: #334155 !important;
  color: #f8fafc !important;
}

/* ── Light mode count badge ────────────────────────────────── */
html[data-theme="light"] .rc-count-badge {
  background: #1e293b !important;
  color: #f8fafc !important;
}


/* ══════════════════════════════════════════════════════════════
   20260929.41 — Sidebar FOLLOWS theme (overrides old contrast-lock locks)
   + Reserve right-pane readability
   ══════════════════════════════════════════════════════════════ */

/* Light: dark navy rail (readable light text) */
html[data-theme="light"] aside#rc-sidebar,
html[data-theme="light"] aside.sidebar,
html[data-theme="light"] #rc-sidebar {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-right: 1px solid #1e293b !important;
}
html[data-theme="light"] aside#rc-sidebar a,
html[data-theme="light"] aside#rc-sidebar .sidebar-link,
html[data-theme="light"] aside#rc-sidebar span,
html[data-theme="light"] aside#rc-sidebar .section-label,
html[data-theme="light"] aside#rc-sidebar .link-text,
html[data-theme="light"] #rc-sidebar a,
html[data-theme="light"] #rc-sidebar span {
  color: #e2e8f0 !important;
}
html[data-theme="light"] aside#rc-sidebar a:hover,
html[data-theme="light"] aside#rc-sidebar a.active,
html[data-theme="light"] aside#rc-sidebar .sidebar-link:hover,
html[data-theme="light"] aside#rc-sidebar .sidebar-link.active {
  color: #ffffff !important;
  background: rgba(59, 130, 246, 0.15) !important;
}
html[data-theme="light"] aside#rc-sidebar .section-label {
  color: #94a3b8 !important;
}
html[data-theme="light"] aside#rc-sidebar .count-badge {
  background: #1e293b !important;
  color: #f8fafc !important;
}

/* Dark: near-black rail */
html[data-theme="dark"] aside#rc-sidebar,
html[data-theme="dark"] aside.sidebar,
html[data-theme="dark"] #rc-sidebar {
  background: #020617 !important;
  color: #e2e8f0 !important;
  border-right: 1px solid #334155 !important;
}
html[data-theme="dark"] aside#rc-sidebar a,
html[data-theme="dark"] aside#rc-sidebar .sidebar-link,
html[data-theme="dark"] aside#rc-sidebar span,
html[data-theme="dark"] aside#rc-sidebar .link-text,
html[data-theme="dark"] #rc-sidebar a,
html[data-theme="dark"] #rc-sidebar span {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] aside#rc-sidebar a:hover,
html[data-theme="dark"] aside#rc-sidebar a.active,
html[data-theme="dark"] aside#rc-sidebar .sidebar-link.active {
  color: #ffffff !important;
  background: rgba(96, 165, 250, 0.12) !important;
}
html[data-theme="dark"] aside#rc-sidebar .section-label {
  color: #94a3b8 !important;
}

/* Reserve / Luxury: wine rail + champagne type */
html[data-theme="reserve"] aside#rc-sidebar,
html[data-theme="reserve"] aside.sidebar,
html[data-theme="reserve"] #rc-sidebar {
  background: #14080a !important;
  color: #f5efe6 !important;
  border-right: 1px solid #5c3038 !important;
}
html[data-theme="reserve"] aside#rc-sidebar *,
html[data-theme="reserve"] aside.sidebar *,
html[data-theme="reserve"] #rc-sidebar * {
  border-color: #5c3038 !important;
}
html[data-theme="reserve"] aside#rc-sidebar a,
html[data-theme="reserve"] aside#rc-sidebar .sidebar-link,
html[data-theme="reserve"] aside#rc-sidebar span,
html[data-theme="reserve"] aside#rc-sidebar .link-text,
html[data-theme="reserve"] aside#rc-sidebar .section-label,
html[data-theme="reserve"] #rc-sidebar a,
html[data-theme="reserve"] #rc-sidebar span,
html[data-theme="reserve"] #rc-sidebar .section-label {
  color: #ebe0d0 !important;
}
html[data-theme="reserve"] aside#rc-sidebar .section-label {
  color: #d4af6a !important;
  letter-spacing: 0.1em;
}
html[data-theme="reserve"] aside#rc-sidebar a:hover,
html[data-theme="reserve"] aside#rc-sidebar a.active,
html[data-theme="reserve"] aside#rc-sidebar .sidebar-link:hover,
html[data-theme="reserve"] aside#rc-sidebar .sidebar-link.active {
  color: #f5efe6 !important;
  background: rgba(212, 175, 106, 0.14) !important;
}
html[data-theme="reserve"] aside#rc-sidebar .count-badge {
  background: rgba(212, 175, 106, 0.2) !important;
  color: #f5efe6 !important;
  border-color: #a67c3d !important;
}
html[data-theme="reserve"] aside#rc-sidebar .text-sky-300,
html[data-theme="reserve"] aside#rc-sidebar .text-slate-400,
html[data-theme="reserve"] aside#rc-sidebar .text-slate-500,
html[data-theme="reserve"] aside#rc-sidebar .text-slate-600 {
  color: #d4c4a8 !important;
}
html[data-theme="reserve"] aside#rc-sidebar button,
html[data-theme="reserve"] aside#rc-sidebar .ctrl-btn {
  color: #ebe0d0 !important;
}
html[data-theme="reserve"] aside#rc-sidebar .bg-slate-800,
html[data-theme="reserve"] aside#rc-sidebar .bg-slate-800\/80 {
  background: #2a1216 !important;
  border-color: #5c3038 !important;
}

/* ── Reserve RIGHT pane: force readable ink on all common surfaces ── */
html[data-theme="reserve"] #rc-main-content,
html[data-theme="reserve"] #rc-content,
html[data-theme="reserve"] #rc-main-content * {
  /* don't blanket * color — breaks icons; target text utilities below */
}
html[data-theme="reserve"] #rc-main-content,
html[data-theme="reserve"] #rc-content {
  background-color: #1a0a0c !important;
  color: #f5efe6 !important;
}
html[data-theme="reserve"] #rc-main-content .text-slate-900,
html[data-theme="reserve"] #rc-main-content .text-slate-800,
html[data-theme="reserve"] #rc-main-content .text-slate-700,
html[data-theme="reserve"] #rc-main-content .text-gray-900,
html[data-theme="reserve"] #rc-main-content .text-black,
html[data-theme="reserve"] #rc-main-content h1,
html[data-theme="reserve"] #rc-main-content h2,
html[data-theme="reserve"] #rc-main-content h3,
html[data-theme="reserve"] #rc-main-content h4,
html[data-theme="reserve"] #rc-main-content p,
html[data-theme="reserve"] #rc-main-content label,
html[data-theme="reserve"] #rc-main-content td,
html[data-theme="reserve"] #rc-main-content th,
html[data-theme="reserve"] #rc-main-content li,
html[data-theme="reserve"] #rc-main-content .font-bold,
html[data-theme="reserve"] #rc-main-content .font-semibold,
html[data-theme="reserve"] #rc-main-content .font-black {
  color: #f5efe6 !important;
}
html[data-theme="reserve"] #rc-main-content .text-slate-600,
html[data-theme="reserve"] #rc-main-content .text-slate-500,
html[data-theme="reserve"] #rc-main-content .text-slate-400,
html[data-theme="reserve"] #rc-main-content .text-gray-500,
html[data-theme="reserve"] #rc-main-content .text-gray-400,
html[data-theme="reserve"] #rc-main-content .text-amber-800,
html[data-theme="reserve"] #rc-main-content .text-amber-900,
html[data-theme="reserve"] #rc-main-content .text-rose-700,
html[data-theme="reserve"] #rc-main-content .text-rose-800 {
  color: #d4c4a8 !important;
}
html[data-theme="reserve"] #rc-main-content .bg-white,
html[data-theme="reserve"] #rc-main-content .bg-slate-50,
html[data-theme="reserve"] #rc-main-content .bg-slate-100,
html[data-theme="reserve"] #rc-main-content .rc-vcard,
html[data-theme="reserve"] #rc-main-content .rc-card {
  background-color: #2a1216 !important;
  border-color: #5c3038 !important;
  color: #f5efe6 !important;
}
html[data-theme="reserve"] #rc-main-content .bg-amber-50,
html[data-theme="reserve"] #rc-main-content .bg-rose-50,
html[data-theme="reserve"] #rc-main-content .bg-emerald-50,
html[data-theme="reserve"] #rc-main-content .bg-blue-50 {
  background-color: rgba(42, 18, 22, 0.9) !important;
  border-color: #5c3038 !important;
  color: #f5efe6 !important;
}
html[data-theme="reserve"] #rc-main-content input,
html[data-theme="reserve"] #rc-main-content select,
html[data-theme="reserve"] #rc-main-content textarea {
  background-color: #1f0e11 !important;
  color: #f5efe6 !important;
  border-color: #5c3038 !important;
}
html[data-theme="reserve"] #rc-main-content header[role="banner"] {
  background: #14080a !important;
  border-bottom-color: #5c3038 !important;
  color: #f5efe6 !important;
}
html[data-theme="reserve"] .rc-team-sticky-bar {
  background: rgba(26, 10, 12, 0.96) !important;
  border-bottom-color: #5c3038 !important;
  color: #f5efe6 !important;
}
html[data-theme="reserve"] .rc-team-sticky-bar button {
  color: #ebe0d0 !important;
}
html[data-theme="reserve"] .rc-team-sticky-bar .bg-white {
  background: #2a1216 !important;
  border-color: #5c3038 !important;
  color: #f5efe6 !important;
}


/* ═══════════════════════════════════════════════════════════════
   LEFT PANE THEME LOCK (20261001.03)
   Sidebar must follow --rc-sidebar / --rc-sidebar-ink on every theme.
   Global text rules must not paint dark ink onto the navy/burgundy rail.
   ═══════════════════════════════════════════════════════════════ */
html[data-theme] aside#rc-sidebar,
html[data-theme] #rc-sidebar,
html[data-theme] aside.sidebar {
  background: var(--rc-sidebar) !important;
  color: var(--rc-sidebar-ink) !important;
  border-color: var(--rc-border) !important;
}
html[data-theme] aside#rc-sidebar *,
html[data-theme] #rc-sidebar * {
  /* inherit unless explicitly overridden below */
}
html[data-theme] aside#rc-sidebar a,
html[data-theme] #rc-sidebar a,
html[data-theme] aside#rc-sidebar button,
html[data-theme] #rc-sidebar button,
html[data-theme] aside#rc-sidebar .sidebar-link,
html[data-theme] #rc-sidebar .sidebar-link,
html[data-theme] aside#rc-sidebar span,
html[data-theme] #rc-sidebar span,
html[data-theme] aside#rc-sidebar p,
html[data-theme] #rc-sidebar p,
html[data-theme] aside#rc-sidebar li,
html[data-theme] #rc-sidebar li,
html[data-theme] aside#rc-sidebar label,
html[data-theme] #rc-sidebar label,
html[data-theme] aside#rc-sidebar .text-slate-300,
html[data-theme] #rc-sidebar .text-slate-400,
html[data-theme] #rc-sidebar .text-slate-500,
html[data-theme] #rc-sidebar .text-slate-600,
html[data-theme] #rc-sidebar .text-slate-700,
html[data-theme] #rc-sidebar .text-slate-800,
html[data-theme] #rc-sidebar .text-slate-900,
html[data-theme] #rc-sidebar .text-gray-400,
html[data-theme] #rc-sidebar .text-gray-500,
html[data-theme] #rc-sidebar .text-white,
html[data-theme] #rc-sidebar i,
html[data-theme] aside#rc-sidebar i {
  color: var(--rc-sidebar-ink) !important;
}
html[data-theme] aside#rc-sidebar a:hover,
html[data-theme] #rc-sidebar a:hover,
html[data-theme] aside#rc-sidebar .sidebar-link:hover,
html[data-theme] #rc-sidebar .sidebar-link:hover,
html[data-theme] aside#rc-sidebar a.bg-white\/10,
html[data-theme] #rc-sidebar a[aria-current="page"],
html[data-theme] #rc-sidebar .sidebar-link.active {
  color: #ffffff !important;
  background-color: color-mix(in srgb, var(--rc-accent) 28%, transparent) !important;
}
/* Active nav item */
html[data-theme] #rc-sidebar a.router-active,
html[data-theme] #rc-sidebar .sidebar-link.bg-white\/10,
html[data-theme] #rc-sidebar a[class*="bg-white"] {
  color: #fff !important;
}
/* Group headings in left pane */
html[data-theme] #rc-sidebar .text-xs,
html[data-theme] #rc-sidebar .uppercase {
  color: color-mix(in srgb, var(--rc-sidebar-ink) 75%, transparent) !important;
  opacity: 1 !important;
}
/* Light: keep dark rail; ink stays light */
html[data-theme="light"] aside#rc-sidebar,
html[data-theme="light"] #rc-sidebar {
  background: #0f172a !important;
  --rc-sidebar-ink: #e2e8f0;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] aside#rc-sidebar,
html[data-theme="dark"] #rc-sidebar {
  background: #020617 !important;
  color: #e2e8f0 !important;
}
html[data-theme="reserve"] aside#rc-sidebar,
html[data-theme="reserve"] #rc-sidebar {
  background: #14080a !important;
  color: #ebe0d0 !important;
}
