:root {
  --ot-sidebar: #111827;
  --ot-bg: #f4f6f9;
  --ot-panel: #ffffff;
  --ot-border: #dce3ee;
  --ot-text: #172033;
  --ot-muted: #64748b;
  --ot-purple: #6f42c1;
  --ot-orange: #f08c00;
  --ot-brand: #1f6feb;
  --ot-teal: #2fb5a7;
}

body {
  background: var(--ot-bg);
  color: var(--ot-text);
  font-size: 0.95rem;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 248px;
  background: var(--ot-sidebar);
  color: #fff;
  padding: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo-wrap {
  display: inline-flex;
  width: 76px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 8px;
  padding: 6px;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  max-width: 100%;
  max-height: 24px;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}

.brand-title {
  font-size: 0.95rem;
  color: #ffffff;
}

.sidebar .nav-link {
  color: #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.sidebar .nav-link i {
  width: 18px;
  color: #8bbcf7;
  text-align: center;
}

.sidebar .nav-link:hover {
  background: rgba(96, 165, 250, 0.13);
  color: #fff;
}

.main-panel {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 60px;
  height: auto;
  background: var(--ot-panel);
  border-bottom: 1px solid var(--ot-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  flex-wrap: wrap;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar strong {
  overflow-wrap: anywhere;
}

.content-wrap {
  padding: 14px;
  flex: 1;
  min-width: 0;
}

.panel,
.metric-card,
.auth-card,
.triage-panel {
  background: var(--ot-panel);
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}

.metric-card {
  display: block;
  color: inherit;
  text-decoration: none;
  min-height: 106px;
}

.metric-label {
  color: var(--ot-muted);
  font-size: 0.85rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
}

.dashboard-console {
  display: grid;
  gap: 10px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-metric {
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ot-panel);
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.035);
}

.metric-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef4ff;
  flex: 0 0 auto;
}

.metric-body {
  min-width: 0;
  display: grid;
  line-height: 1.05;
}

.dashboard-metric .metric-label {
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-metric .metric-value {
  font-size: 1.42rem;
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-command {
  min-height: calc(100vh - 178px);
  display: grid;
  grid-template-rows: auto;
  align-content: start;
  gap: 12px;
}

.dashboard-hero {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--ot-panel);
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.035);
}

.dashboard-hero > div:first-child {
  min-width: 0;
  flex: 1 1 360px;
}

.dashboard-hero h1 {
  margin: 0;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 800;
}

.dashboard-hero p {
  margin: 3px 0 0;
  color: var(--ot-muted);
  font-size: 0.86rem;
}

.eyebrow {
  display: inline-block;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 260px;
}

.dashboard-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.kpi-compact {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
  background: var(--ot-panel);
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.03);
}

.kpi-compact:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-1px);
}

.kpi-compact i {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef2f7;
  color: #475569;
  flex: 0 0 auto;
}

.kpi-compact span {
  min-width: 0;
  display: grid;
  line-height: 1.05;
}

.kpi-compact strong {
  color: #0f172a;
  font-size: 1.2rem;
}

.kpi-compact small {
  color: var(--ot-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.95fr) minmax(520px, 1.45fr);
  grid-template-areas:
    "queue analytics"
    "controls analytics";
  align-items: stretch;
  gap: 12px;
}

.role-panel,
.analytics-panel,
.control-panel {
  min-width: 0;
  height: auto;
  display: flex;
  flex-direction: column;
}

.role-panel {
  grid-area: queue;
}

.analytics-panel {
  grid-area: analytics;
}

.control-panel {
  grid-area: controls;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 800;
}

.queue-list {
  overflow: visible;
  display: grid;
  gap: 8px;
}

.queue-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.queue-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.queue-row span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.queue-row strong {
  color: #0f172a;
  font-size: 0.9rem;
}

.queue-row small {
  color: var(--ot-muted);
  font-size: 0.78rem;
}

.queue-count {
  min-width: 42px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef2f7;
  color: #0f172a;
  font-weight: 800;
}

.analytics-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(210px, 0.85fr) minmax(280px, 1.15fr);
  grid-template-rows: auto auto;
  gap: 8px;
}

.mini-chart {
  min-width: 0;
  min-height: 156px;
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 8px;
}

.mini-chart-title {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.mini-chart-wide {
  grid-row: span 2;
}

.analytics-panel .dashboard-chart-frame {
  height: 136px;
  max-height: 136px;
}

.analytics-panel .risk-chart-frame {
  height: 324px;
  max-height: 324px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.action-chip {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  text-decoration: none;
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  padding: 8px;
  background: #fbfcfe;
  font-size: 0.82rem;
  font-weight: 700;
}

.action-chip i {
  color: #475569;
}

.action-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.watch-card {
  margin-top: 10px;
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  overflow: hidden;
}

.watch-title {
  padding: 8px 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
}

.watch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--ot-border);
  color: var(--ot-muted);
  text-decoration: none;
  font-size: 0.82rem;
}

.watch-row:hover {
  background: #f8fafc;
  color: var(--ot-text);
}

.watch-row strong {
  color: #0f172a;
}

.btn-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.theme-icon-sun {
  display: none;
}

[data-bs-theme="dark"] .theme-icon-sun {
  display: inline-block;
}

[data-bs-theme="dark"] .theme-icon-moon {
  display: none;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--ot-border);
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-panel {
  height: 340px;
  display: flex;
  flex-direction: column;
}

.dashboard-chart-panel {
  height: 218px;
}

.dashboard-chart-panel h2 {
  margin-bottom: 6px;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 700;
}

.chart-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 280px;
  max-height: 280px;
}

.dashboard-chart-frame {
  height: 166px;
  max-height: 166px;
}

.chart-frame canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.text-purple {
  color: var(--ot-purple) !important;
}

.text-orange {
  color: var(--ot-orange) !important;
}

.toolbar,
.profile-header,
.sticky-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(245, 247, 251, 0.92);
  border-top: 1px solid var(--ot-border);
  padding: 12px 0;
  justify-content: flex-end;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 12px;
}

.form-check {
  min-height: 26px;
}

.form-check-input,
input[type="checkbox"] {
  width: 1.05em;
  height: 1.05em;
  border: 2px solid #64748b;
  background-color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.form-check-input:hover,
input[type="checkbox"]:hover {
  border-color: #1f6feb;
}

.form-check-input:focus,
input[type="checkbox"]:focus {
  border-color: #1f6feb;
  box-shadow: 0 0 0 0.2rem rgba(31, 111, 235, 0.18);
}

.form-check-input:checked {
  border-color: #1f6feb;
  background-color: #1f6feb;
}

.form-check-label,
.form-check span {
  margin-left: 2px;
}

.triage-green,
.triage-panel.triage-green {
  background: #d1e7dd;
  color: #0f5132;
}

.triage-yellow,
.triage-panel.triage-yellow {
  background: #fff3cd;
  color: #664d03;
}

.triage-orange,
.triage-panel.triage-orange {
  background: #ffe5c2;
  color: #7a3f00;
}

.triage-red,
.triage-panel.triage-red {
  background: #f8d7da;
  color: #842029;
}

.triage-purple,
.triage-panel.triage-purple {
  background: #eadcff;
  color: #432874;
}

.triage-panel {
  min-height: 270px;
}

.compact-list {
  margin-bottom: 1rem;
}

.callout {
  border-left: 4px solid #2fb5a7;
  background: #eefcf9;
  padding: 12px;
  border-radius: 6px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #225ea8;
  border: 1px solid #c9ddff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.ai-action-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #c9ddff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 12px;
}

.ai-action-card h2 {
  color: #123c69;
}

.workflow-step-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.workflow-step-number {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e8f1ff;
  color: #225ea8;
  border: 1px solid #c9ddff;
  font-weight: 800;
  flex: 0 0 auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mdt-ai-panel {
  border-color: #c9ddff;
}

.mdt-ai-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.mdt-ai-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.9rem;
}

.mdt-ai-suggestion {
  border: 1px solid var(--ot-border);
  background: #fbfcfe;
  border-radius: 8px;
  padding: 12px;
}

.ai-copy-source[readonly] {
  background: #ffffff;
  cursor: default;
}

.mini-dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
}

.mini-dl dt {
  color: var(--ot-muted);
  font-weight: 600;
}

.mini-dl dd {
  margin-bottom: 0;
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: #2fb5a7;
}

.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 58vh;
}

.auth-card {
  width: min(420px, 100%);
}

.login-page {
  min-height: calc(100vh - 166px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0 32px;
}

.login-shell {
  width: min(1320px, 100%);
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(320px, 0.78fr) minmax(360px, 0.92fr);
  background: var(--ot-panel);
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.login-brand-pane {
  background: #10223a;
  color: #ffffff;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 520px;
}

.login-logo-surface {
  background: #ffffff;
  border-radius: 8px;
  padding: 14px 16px;
  width: min(280px, 100%);
}

.login-logo {
  display: block;
  width: 100%;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.login-kicker {
  color: #9fd6ce;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.login-brand-pane h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
  margin-bottom: 14px;
}

.login-brand-pane p {
  max-width: 560px;
  color: #dbeafe;
  font-size: 1.02rem;
  margin-bottom: 0;
}

.login-assurance {
  display: grid;
  gap: 10px;
  color: #dbeafe;
  font-size: 0.92rem;
}

.login-assurance i {
  color: #2fb5a7;
  margin-right: 8px;
}

.login-form-pane {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-demo-pane {
  padding: 30px;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border-left: 1px solid var(--ot-border);
}

.login-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.login-form .input-group-text {
  background: #f8fafc;
  color: var(--ot-muted);
}

.login-demo-note {
  margin-top: 18px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  color: var(--ot-muted);
  font-size: 0.9rem;
}

.credential-panel {
  margin-top: 18px;
  border: 1px solid var(--ot-border);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.credential-panel-standalone {
  width: 100%;
  margin-top: 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.credential-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--ot-border);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.credential-help {
  margin: 0;
  padding: 10px 12px;
  color: var(--ot-muted);
  font-size: 0.84rem;
  border-bottom: 1px solid var(--ot-border);
}

.credential-list {
  display: grid;
  max-height: 390px;
  overflow-y: auto;
}

.credential-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--ot-border);
  background: transparent;
  color: var(--ot-text);
  text-align: left;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.credential-row:last-child {
  border-bottom: 0;
}

.credential-row:hover,
.credential-row.selected {
  background: #eef4ff;
}

.credential-row-static {
  cursor: default;
}

.credential-row-static:hover {
  background: transparent;
}

.credential-role {
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-login {
  color: var(--ot-muted);
  font-family: Consolas, Monaco, monospace;
  font-size: 0.76rem;
  white-space: nowrap;
}

.footer-note {
  color: var(--ot-muted);
  font-size: 0.82rem;
  padding: 14px 20px;
  border-top: 1px solid var(--ot-border);
}

.clinical-disclaimer {
  font-size: 0.84rem;
  padding: 9px 12px;
}

.code-box {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.85rem;
}

.empty-state {
  background: var(--ot-panel);
  border: 1px dashed var(--ot-border);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: var(--ot-muted);
}

[data-bs-theme="dark"] {
  --ot-bg: #111827;
  --ot-panel: #172033;
  --ot-border: #263247;
  --ot-text: #e5e7eb;
  --ot-muted: #a6b0c3;
}

[data-bs-theme="dark"] .callout {
  background: #12312d;
}

[data-bs-theme="dark"] .login-form .input-group-text,
[data-bs-theme="dark"] .login-demo-note,
[data-bs-theme="dark"] .credential-title,
[data-bs-theme="dark"] .credential-help,
[data-bs-theme="dark"] .credential-panel,
[data-bs-theme="dark"] .login-demo-pane,
[data-bs-theme="dark"] .user-chip,
[data-bs-theme="dark"] .metric-icon {
  background: #111827;
}

[data-bs-theme="dark"] .credential-row:hover,
[data-bs-theme="dark"] .credential-row.selected {
  background: #1f2a44;
}

[data-bs-theme="dark"] .credential-row-static:hover {
  background: transparent;
}

[data-bs-theme="dark"] .dashboard-chart-panel h2 {
  color: #e5e7eb;
}

[data-bs-theme="dark"] .dashboard-hero h1,
[data-bs-theme="dark"] .panel-heading h2,
[data-bs-theme="dark"] .kpi-compact strong,
[data-bs-theme="dark"] .queue-row strong,
[data-bs-theme="dark"] .queue-count,
[data-bs-theme="dark"] .action-chip,
[data-bs-theme="dark"] .watch-row strong {
  color: #e5e7eb;
}

[data-bs-theme="dark"] .dashboard-hero,
[data-bs-theme="dark"] .kpi-compact,
[data-bs-theme="dark"] .queue-row,
[data-bs-theme="dark"] .mini-chart,
[data-bs-theme="dark"] .action-chip,
[data-bs-theme="dark"] .watch-title,
[data-bs-theme="dark"] .queue-count {
  background: #111827;
}

[data-bs-theme="dark"] .queue-row:hover,
[data-bs-theme="dark"] .action-chip:hover,
[data-bs-theme="dark"] .kpi-compact:hover,
[data-bs-theme="dark"] .watch-row:hover {
  background: #1f2a44;
}

[data-bs-theme="dark"] .mini-chart-title {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .ai-badge {
  background: #132b4f;
  border-color: #27538f;
  color: #9cc7ff;
}

[data-bs-theme="dark"] .ai-action-card {
  background: #101d30;
  border-color: #27538f;
}

[data-bs-theme="dark"] .ai-action-card h2 {
  color: #dbeafe;
}

[data-bs-theme="dark"] .workflow-step-panel {
  background: #111827;
}

[data-bs-theme="dark"] .workflow-step-number {
  background: #132b4f;
  border-color: #27538f;
  color: #9cc7ff;
}

[data-bs-theme="dark"] .mdt-ai-panel,
[data-bs-theme="dark"] .mdt-ai-suggestion {
  border-color: #334155;
}

[data-bs-theme="dark"] .mdt-ai-suggestion {
  background: #111827;
}

[data-bs-theme="dark"] .ai-copy-source[readonly] {
  background: #0f172a;
  border-color: #334155;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .form-check-input,
[data-bs-theme="dark"] input[type="checkbox"] {
  border-color: #94a3b8;
  background-color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.12);
}

[data-bs-theme="dark"] .form-check-input:hover,
[data-bs-theme="dark"] input[type="checkbox"]:hover,
[data-bs-theme="dark"] .form-check-input:focus,
[data-bs-theme="dark"] input[type="checkbox"]:focus {
  border-color: #9cc7ff;
}

[data-bs-theme="dark"] .form-check-input:checked {
  border-color: #60a5fa;
  background-color: #60a5fa;
}

@media (min-width: 1500px) {
  .dashboard-workspace {
    grid-template-columns: minmax(270px, 0.95fr) minmax(560px, 1.45fr) minmax(270px, 0.9fr);
    grid-template-areas: "queue analytics controls";
  }
}

@media (max-width: 1180px) {
  .dashboard-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "queue"
      "analytics"
      "controls";
  }

  .analytics-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .mini-chart-wide {
    grid-row: auto;
  }

  .analytics-panel .risk-chart-frame {
    height: 260px;
    max-height: 260px;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.95fr);
  }

  .login-brand-pane {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .login-demo-pane {
    border-left: 1px solid var(--ot-border);
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .content-wrap {
    padding: 12px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .chart-panel {
    height: 300px;
  }

  .chart-frame {
    height: 240px;
    max-height: 240px;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero {
    display: grid;
  }

  .dashboard-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-panel {
    height: 300px;
  }

  .dashboard-chart-frame {
    height: 240px;
    max-height: 240px;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .mini-chart-wide {
    grid-row: auto;
  }

  .analytics-panel .dashboard-chart-frame {
    height: 220px;
    max-height: 220px;
  }

  .analytics-panel .risk-chart-frame {
    height: 300px;
    max-height: 300px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-pane {
    min-height: auto;
    padding: 28px;
  }

  .login-form-pane {
    padding: 28px;
  }

  .login-demo-pane {
    padding: 28px;
    border-left: 0;
    border-top: 1px solid var(--ot-border);
  }

  .credential-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (min-width: 901px) {
  body.dashboard-page .content-wrap {
    padding: 10px 14px;
  }

  body.dashboard-page .footer-note {
    display: none;
  }
}

@media print {
  .sidebar,
  .topbar,
  .sticky-actions,
  .footer-note,
  .btn {
    display: none !important;
  }

  .main-panel {
    display: block;
  }

  .content-wrap {
    padding: 0;
  }
}
