/* CAMEL brand layer. Keep after module and contrast styles. */
:root {
  --theme-canvas: #f5f6fb;
  --theme-surface: #ffffff;
  --theme-soft: #eef0fa;
  --theme-hover: #e8eaf7;
  --theme-text: #242842;
  --theme-muted: #606a82;
  --theme-line: #c2c8dc;
  --theme-link: #252568;
  --theme-focus: #6767c2;
  --theme-code: #eef0fa;
  --theme-user: #eef0fa;
  --brand-blue: #252568;
  --brand-red: #ff3028;
  --shell-sidebar: 260px;
  --bg: #f5f6fb;
  --panel: #ffffff;
  --text: #242842;
  --muted: #606a82;
  --border: #e0e3ee;
  --line: var(--border);
  --surface-soft: #eef0fa;
  --accent: var(--brand-blue);
  --accent-2: #1d1d54;
  --sidebar: var(--brand-blue);
  --sidebar-muted: #bdc2e3;
  --action-bg: var(--brand-blue);
  --action-hover: #1d1d54;
  --control-border: #7c839c;
  --focus: #6767c2;
  --link: var(--brand-blue);
  --statement-muted: var(--muted);
  --shadow: 0 8px 28px #2525680a;
  --chat-glass: rgba(245, 246, 251, .94);
  --chat-card: rgba(255, 255, 255, .9);
  --chat-ink: #242842;
  --chat-subtle: #606a82;
  --chat-edge: #d4d8e8;
  --chat-tint: #eef0fa;
}

:root[data-theme=dark] {
  --theme-canvas: #111321;
  --theme-surface: #1a1d30;
  --theme-soft: #252a43;
  --theme-hover: #323853;
  --theme-text: #edf0fa;
  --theme-muted: #b9bed5;
  --theme-line: #535b7d;
  --theme-link: #ceceff;
  --theme-focus: #b6b6ff;
  --theme-code: #252a43;
  --theme-user: #32325d;
  --bg: #111321;
  --panel: #1a1d30;
  --text: #edf0fa;
  --muted: #b9bed5;
  --border: #383e5c;
  --line: var(--border);
  --surface-soft: #252a43;
  --accent: #b6b6ff;
  --accent-2: #ceceff;
  --action-bg: #434391;
  --action-hover: #5050a3;
  --control-border: #7e87a8;
  --focus: #b6b6ff;
  --link: #ceceff;
  --statement-muted: var(--muted);
  --shadow: 0 10px 32px #0004;
  --chat-glass: rgba(26, 29, 48, .95);
  --chat-card: rgba(37, 42, 67, .94);
  --chat-ink: #edf0fa;
  --chat-subtle: #b9bed5;
  --chat-edge: #535b7d;
  --chat-tint: #32325d;
}

body { font-family: Inter, "Segoe UI", Arial, sans-serif; }
::selection { background: var(--brand-blue); color: #fff; }
input[type=checkbox], input[type=radio], progress { accent-color: var(--accent); }

/* The same blue navigation in both themes, as in WECAMEL-FRONT. */
:root[data-theme] body #camelSidebar {
  padding: 28px 19px 16px;
  gap: 24px;
  background: var(--brand-blue);
  color: #f4f5ff;
  border-right: 0;
  overflow: hidden;
}
:root[data-theme] body #camelSidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 3px 0 0;
  text-align: center;
  border-radius: 4px;
}
:root[data-theme] body #camelSidebar .camel-brand-logo {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
}
:root[data-theme] body #camelSidebar .brand-product strong {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}
:root[data-theme] body #camelSidebar .brand-product span {
  color: #c4c7e5;
  margin-top: 6px;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
:root[data-theme] body #camelSidebar .primary-nav {
  display: block !important;
  width: calc(100% + 14px);
  margin: 0 -7px;
  padding: 0 7px;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #ffffff40 transparent;
}
:root[data-theme] body #camelSidebar .nav-group { display: grid; gap: 4px; margin-bottom: 20px; }
:root[data-theme] body #camelSidebar .nav-group:last-child { margin-bottom: 0; }
:root[data-theme] body #camelSidebar .nav-section-label {
  display: block;
  padding: 0;
  margin: 6px 12px 8px;
  color: #bdc2e3;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
:root[data-theme] body #camelSidebar .nav-item {
  width: 100%;
  min-height: 40px;
  padding: 11px 12px;
  gap: 13px;
  background: transparent;
  color: #d4d7ef;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: none;
}
:root[data-theme] body #camelSidebar .nav-item:hover { background: #ffffff10; color: #fff; }
:root[data-theme] body #camelSidebar .nav-item.active {
  background: #ffffff1a;
  color: #fff;
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--brand-red);
}
:root[data-theme] body #camelSidebar .nav-item.active:hover { background: #ffffff22; }
:root[data-theme] body #camelSidebar .nav-icon {
  display: block;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: inherit;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:root[data-theme] body #camelSidebar .rc-sidebar-children {
  min-width: 0;
  margin: 3px 0 0 21px;
  padding-left: 14px;
  border: 0;
  border-left: 1px solid #ffffff40;
  border-radius: 0;
  background: transparent;
}
:root[data-theme] body #camelSidebar .rc-sidebar-children > summary {
  min-height: 36px;
  padding: 8px 6px;
  background: transparent;
  color: #d4d7ef;
  border: 0;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
:root[data-theme] body #camelSidebar .rc-sidebar-children > summary:hover { color: #fff; }
:root[data-theme] body #camelSidebar .rc-child { min-height: 36px; margin-top: 4px; padding: 8px 10px; font-size: 11px; }
:root[data-theme] body #camelSidebar .header-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid #ffffff24;
}
:root[data-theme] body #camelSidebar :is(.server-status, .user-context) { grid-column: 1 / -1; }
:root[data-theme] body #camelSidebar .server-status { color: #c4c7e5; font-size: 11px; padding: 0 4px 4px; white-space: normal; }
:root[data-theme] body #camelSidebar .user-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding: 8px 4px;
  border: 0;
  background: transparent;
}
:root[data-theme] body #camelSidebar .user-context span { color: #bdc2e3; font-size: 10px; }
:root[data-theme] body #camelSidebar .user-context strong { color: #fff; font-size: 11px; margin: 0; overflow-wrap: anywhere; }
:root[data-theme] body #camelSidebar .ghost {
  min-height: 36px;
  background: #ffffff0d;
  color: #eef0ff;
  border: 1px solid #ffffff30;
  border-radius: 6px;
  font-size: 11px;
}
:root[data-theme] body #camelSidebar .ghost:hover { background: #ffffff1a; }
:root[data-theme] body #camelSidebar #sidebarPin { background: transparent; border-color: transparent; color: #c4c7e5; }
:root[data-theme] body #camelSidebar :focus-visible { outline-color: #fff; }

/* Shared workspace controls and brand highlights. Status colors remain semantic. */
body .workspace-tools { min-height: 64px; padding: 10px 30px; background: var(--panel); }
body .workspace-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
body .workspace-actions > .ghost { font-size: 12px; padding: 8px 10px; }
body .workspace-head { padding: 24px 32px; background: var(--panel); box-shadow: none; }
body .workspace-head h1 { font-size: 28px; font-weight: 650; letter-spacing: -.9px; }
body :is(.panel, .command-kpi) { box-shadow: none; border-color: var(--border); border-radius: 9px; }
body :is(.secondary, .drop-icon, .assistant-context) { background: var(--surface-soft); color: var(--accent-2); border-color: var(--border); }
body .secondary:hover { border-color: var(--accent); }
body :is(.dropzone.drag, .kanban-column.is-drag-over, .batch-mode-card.is-selected, .batch-step.is-current) { background: var(--surface-soft); border-color: var(--accent); }
body .financial-strip { background: var(--brand-blue); color: #fff; border-radius: 9px; box-shadow: none; }
body .financial-strip span { color: #d4d7ef; }
body :is(.migration-progress-bar, .assistant-message.user) { background: var(--action-bg); color: #fff; border-color: var(--action-bg); }
body :is(.assistant-suggestion:hover, .assistant-context strong) { color: var(--accent-2); }
body :is(.rc-page, .rc-chart-card, .rc-import-dialog) { background: var(--panel); color: var(--text); border-color: var(--border); }
body :is(.rc-action, .rc-mart-description, .rc-chart-selection) { background: var(--surface-soft); color: var(--text); border-color: var(--accent); }
body :is(.rc-tabs [aria-selected=true], .rc-import-dialog [aria-pressed=true]) { background: var(--surface-soft); color: var(--accent-2); border-color: var(--accent); }
body .rc-tabs button:focus-visible { outline-color: var(--focus); }
body :is(.rc-mart-bar i, .camel-chat-bar-track i) { background: var(--action-bg); }
body :is(.rc-history-progress progress, .audit-size-label input) { accent-color: var(--accent); }
body .audit-viewer-resize:hover { background: #6767c250; }
body .audit-viewer-guide summary span { color: var(--muted); }
:root .camel-chat-launcher { background: var(--action-bg); color: #fff; border-color: #ffffff30; box-shadow: 0 8px 24px #25256826; }
:root .camel-chat-launcher:hover { background: var(--action-hover); }
:root[data-theme=dark] #app .main :is(.batch-mode-card.is-selected, .batch-step.is-current) { background: #32325d; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
:root[data-theme=dark] .audit-viewer .audit-search-hit:is(:hover, [aria-pressed=true]) { background: #32325d; color: #edf0fa; border-color: var(--accent); }

@media (max-width: 1100px) {
  :root[data-theme] body.shell-mobile #camelSidebar { padding: 24px 19px 16px; gap: 24px; }
  body.shell-mobile #camelSidebar .brand { margin-top: 0; }
  body.shell-mobile #camelSidebar .header-actions { display: grid; margin-top: 0; }
  body.shell-mobile .workspace-tools { padding: 10px 16px; }
  body.shell-mobile.sidebar-open .camel-chat-launcher { visibility: hidden; }
}
@media (max-height: 700px) {
  :root[data-theme] body #camelSidebar { padding-top: 20px; gap: 16px; }
  :root[data-theme] body #camelSidebar .brand { gap: 12px; }
  :root[data-theme] body #camelSidebar .camel-brand-logo { max-width: 184px; }
  :root[data-theme] body #camelSidebar .header-actions { padding-top: 10px; gap: 5px; }
}
@media (max-width: 520px) {
  body .workspace-head h1 { font-size: 24px; }
  :root[data-theme] body #camelSidebar .primary-nav { min-height: 100px; }
}

/* Production theme and analytic chat use these existing semantic tokens. */
:root[data-theme] .primary { background: var(--action-bg); color: #fff; }
:root[data-theme] .primary:hover { background: var(--action-hover); color: #fff; }
:root[data-theme] :is(.ca-panel, .ca-launch) { --ca-blue: var(--action-bg); }
:root[data-theme] .ca-panel :is(.ca-primary, .ca-answer-views [aria-pressed=true]),
:root[data-theme] .ca-launch { background: var(--action-bg); color: #fff; border-color: var(--action-bg); }
:root[data-theme] .ca-launch:hover { background: var(--action-hover); }
:root[data-theme] .ca-brand img { width: 90px; height: auto; padding: 7px; background: var(--brand-blue); }
body.shell-mobile.sidebar-open .ca-launch { visibility: hidden; }
