/* VeyoSign UI design themes — driven by html[data-ui="1"…"5"]
   FOSS / original CSS only. Design 1 ≈ refined baseline (:root). */

/* —— 1 Dark command center (baseline refine) —— */
html[data-ui="1"] {
  --accent: #1A6AFF;
  --accent-soft: rgba(26, 106, 255, 0.28);
  --bg: #0b1220;
  --bg-grad-from: #1a2a4a;
  --panel: #121a2b;
  --text: #e8eefc;
  --muted: #8b9bb8;
  --border: #243049;
  --input-bg: #0e1626;
  --topbar-bg: rgba(18, 26, 43, 0.9);
  --tab-active-bg: #13233f;
  --banner-bg: #13233f;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-card: 14px;
}

/* —— 2 Light SaaS dashboard —— */
html[data-ui="2"] {
  --accent: #1A6AFF;
  --accent-soft: rgba(26, 106, 255, 0.18);
  --bg: #f4f6fa;
  --bg-grad-from: #e8eef8;
  --panel: #ffffff;
  --text: #1a2332;
  --muted: #64748b;
  --border: #d8dee9;
  --input-bg: #f8fafc;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --tab-active-bg: #eef4ff;
  --banner-bg: #eef4ff;
  --code-bg: #f1f5f9;
  --code-fg: #334155;
  --md-body: #334155;
  --md-th-bg: #eef2f7;
  --chat-thread-bg: #f1f5f9;
  --chat-msg-bg: #ffffff;
  --chat-msg-mine-bg: #dbeafe;
  --chat-msg-mine-border: #93c5fd;
  --chat-msg-assistant-bg: #eef4ff;
  --chat-mine-author: #1e40af;
  --chat-body-fg: #1e293b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-card: 10px;
  --card-gap: 0.75rem;
  --card-min: 220px;
  --space: 1rem;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --ok: #16a34a;
  --danger: #dc2626;
}
html[data-ui="2"] body {
  background: linear-gradient(180deg, var(--bg-grad-from) 0%, var(--bg) 40%);
}
html[data-ui="2"] .topbar {
  box-shadow: 0 1px 0 var(--border);
  backdrop-filter: blur(10px);
}
html[data-ui="2"] .tabs button.active {
  color: var(--accent);
  font-weight: 700;
}
html[data-ui="2"] .badge.offline,
html[data-ui="2"] .badge.pending {
  color: #475569;
  background: #e2e8f0;
}
html[data-ui="2"] .card {
  box-shadow: var(--shadow);
}
html[data-ui="2"] .chat-unread-banner {
  color: #166534;
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
}
html[data-ui="2"] .chat-msg.unread-sep { color: #166534; }
html[data-ui="2"] .ui-design-switcher {
  background: #ffffff;
}

/* —— 3 Left sidebar nav (charcoal enterprise) —— */
html[data-ui="3"] {
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.28);
  --bg: #0f1419;
  --bg-grad-from: #1a222d;
  --panel: #1a222d;
  --text: #e7ecf3;
  --muted: #94a3b8;
  --border: #2a3544;
  --input-bg: #121820;
  --topbar-bg: #1a222d;
  --tab-active-bg: #243044;
  --banner-bg: #243044;
  --code-bg: #121820;
  --chat-thread-bg: #0c1016;
  --chat-msg-bg: #1e2836;
  --chat-msg-mine-bg: #1e3a5f;
  --chat-msg-mine-border: #3b6ea8;
  --chat-msg-assistant-bg: #1a2838;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-card: 8px;
  --space: 1rem;
}
html[data-ui="3"] body {
  background: var(--bg);
}
html[data-ui="3"] #main-view {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 100dvh;
}
html[data-ui="3"] #main-view > .ui-design-switcher {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 8;
}
html[data-ui="3"] #main-view > .tabs {
  grid-column: 1;
  grid-row: 2 / 4;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--border);
  background: #121820;
  min-height: 0;
  overflow-y: auto;
}
html[data-ui="3"] #main-view > .topbar {
  grid-column: 2;
  grid-row: 2;
  position: sticky;
  top: 2.1rem;
  z-index: 5;
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}
html[data-ui="3"] #main-view > .tab {
  grid-column: 2;
  grid-row: 3;
  min-width: 0;
  min-height: 0;
}
html[data-ui="3"] .tabs button {
  text-align: left;
  width: 100%;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
}
html[data-ui="3"] .tabs button.active {
  background: var(--tab-active-bg);
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
html[data-ui="3"] #main-view.team-fill {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
html[data-ui="3"] #main-view.team-fill #tab-team:not(.hidden) {
  overflow: hidden;
}
html[data-ui="3"] #main-view:not(:has(.ui-design-switcher:not(.hidden))) > .topbar {
  top: 0;
}
/* No switcher (customers): still use sidebar grid */
html[data-ui="3"] #main-view:not(:has(.ui-design-switcher:not(.hidden))) {
  grid-template-rows: auto minmax(0, 1fr);
}
html[data-ui="3"] #main-view:not(:has(.ui-design-switcher:not(.hidden))) > .tabs {
  grid-row: 1 / 3;
}
html[data-ui="3"] #main-view:not(:has(.ui-design-switcher:not(.hidden))) > .topbar {
  grid-row: 1;
}
html[data-ui="3"] #main-view:not(:has(.ui-design-switcher:not(.hidden))) > .tab {
  grid-row: 2;
}

/* —— 4 High-contrast ops / NOC —— */
html[data-ui="4"] {
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.25);
  --bg: #000000;
  --bg-grad-from: #050505;
  --panel: #0a0a0a;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --border: #262626;
  --input-bg: #050505;
  --topbar-bg: #0a0a0a;
  --tab-active-bg: #111111;
  --banner-bg: #111111;
  --code-bg: #050505;
  --code-fg: #bbf7d0;
  --md-body: #e5e5e5;
  --md-th-bg: #111111;
  --chat-thread-bg: #050505;
  --chat-msg-bg: #111111;
  --chat-msg-mine-bg: #052e16;
  --chat-msg-mine-border: #166534;
  --chat-msg-assistant-bg: #0a0a0a;
  --chat-mine-author: #86efac;
  --chat-body-fg: #f5f5f5;
  --radius: 2px;
  --radius-sm: 2px;
  --radius-card: 2px;
  --font: var(--font-mono);
  --space: 0.85rem;
  --card-gap: 0.65rem;
  --card-min: 240px;
  --shadow: none;
  --ok: #22c55e;
  --danger: #f87171;
}
html[data-ui="4"] body {
  background: var(--bg);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}
html[data-ui="4"] .topbar {
  backdrop-filter: none;
  border-bottom-width: 2px;
}
html[data-ui="4"] .tabs button {
  border-radius: 0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
html[data-ui="4"] .tabs button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #052e16;
}
html[data-ui="4"] .badge {
  border-radius: 0;
  font-family: var(--font-mono);
}
html[data-ui="4"] .badge.online {
  background: #052e16;
  color: #4ade80;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}
html[data-ui="4"] .meta,
html[data-ui="4"] .docs-stamp {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
html[data-ui="4"] .panel,
html[data-ui="4"] .card,
html[data-ui="4"] .chat-messages,
html[data-ui="4"] .chat-msg {
  border-width: 1px;
  border-radius: 0;
}
html[data-ui="4"] button {
  border-radius: 0;
}
html[data-ui="4"] .ui-design-switcher button {
  border-radius: 0;
}
html[data-ui="4"] .chat-msg.assistant {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* —— 5 Soft brand (warm charcoal + soft blue) —— */
html[data-ui="5"] {
  --accent: #3d7eff;
  --accent-soft: rgba(61, 126, 255, 0.22);
  --bg: #1c1a1f;
  --bg-grad-from: #2a2430;
  --panel: #26222a;
  --text: #f3eef8;
  --muted: #a89bb0;
  --border: #3a3342;
  --input-bg: #1a171e;
  --topbar-bg: rgba(38, 34, 42, 0.88);
  --tab-active-bg: #322c3a;
  --banner-bg: #322c3a;
  --code-bg: #1a171e;
  --code-fg: #d4c8e0;
  --md-body: #e4dceb;
  --md-th-bg: #322c3a;
  --chat-thread-bg: #17141b;
  --chat-msg-bg: #2c2733;
  --chat-msg-mine-bg: #2a3a5c;
  --chat-msg-mine-border: #4a6fb8;
  --chat-msg-assistant-bg: #2a2540;
  --chat-mine-author: #b4c8ff;
  --chat-body-fg: #f3eef8;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-card: 20px;
  --space: 1.5rem;
  --card-gap: 1.25rem;
  --card-min: 280px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
html[data-ui="5"] body {
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(61, 126, 255, 0.18) 0%, transparent 55%),
    radial-gradient(800px 400px at 5% 0%, #2a2430 0%, var(--bg) 60%);
}
html[data-ui="5"] .topbar {
  border-bottom: none;
  margin: 0.5rem var(--space) 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
html[data-ui="5"] .tabs {
  padding-top: 1.25rem;
  gap: 0.65rem;
}
html[data-ui="5"] .tabs button {
  border-radius: 999px;
  padding: 0.55rem 1rem;
}
html[data-ui="5"] .tabs button.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
html[data-ui="5"] .card,
html[data-ui="5"] .panel {
  box-shadow: var(--shadow);
}
html[data-ui="5"] .chat-msg {
  border-radius: 20px;
}
html[data-ui="5"] .chat-msg.theirs { border-bottom-left-radius: 8px; }
html[data-ui="5"] .chat-msg.mine { border-bottom-right-radius: 8px; }
html[data-ui="5"] .ui-design-switcher {
  border-bottom: none;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  background: transparent;
}
html[data-ui="5"] .ui-design-switcher button {
  border-radius: 999px;
}
html[data-ui="5"] #main-view:has(.ui-design-switcher:not(.hidden)) .topbar {
  top: 2.6rem;
}
