/* ==========================================================================
   Bus-Proof V2 — white-label professional theme
   Steel blue primary, slate grays, Inter, card-based layout.
   ========================================================================== */

:root {
  --primary: #4A6FA5;
  --primary-dark: #3A5A8A;
  --primary-light: #EDF2F9;
  --primary-lighter: #F6F9FC;
  --ink: #1E293B;
  --ink-soft: #475569;
  --muted: #64748B;
  --faint: #94A3B8;
  --line: #E2E8F0;
  --line-soft: #EDF1F5;
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --sidebar-bg: #1B2735;
  --sidebar-ink: #C7D2DE;
  --sidebar-active: #263850;
  --green: #2E8B57;
  --green-bg: #E7F5EE;
  --amber: #B45309;
  --amber-bg: #FEF3E2;
  --red: #C0392B;
  --red-bg: #FBEAE8;
  --gray-badge-bg: #EEF1F5;
  --shadow: 0 1px 3px rgba(16, 30, 54, 0.06), 0 4px 14px rgba(16, 30, 54, 0.05);
  --shadow-lg: 0 8px 30px rgba(16, 30, 54, 0.14);
  --radius: 10px;
  --radius-sm: 7px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--ink); }
h1 { font-size: 22px; letter-spacing: -0.02em; }
h2 { font-size: 17px; letter-spacing: -0.01em; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   App shell layout
   ========================================================================== */

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

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 12px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-ink);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item.active .nav-icon { color: #7FA3D6; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; color: var(--faint); flex-shrink: 0; }

.sidebar-footer { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 0 6px 10px; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--faint); text-transform: capitalize; }

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px 48px;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.view-header .subtitle { color: var(--muted); font-size: 13px; margin-top: 4px; }
.view-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Buttons, forms, badges
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--faint); background: var(--primary-lighter); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #A93226; }
.btn-ghost { background: transparent; color: var(--sidebar-ink); border-color: rgba(255,255,255,0.15); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.07); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.15);
}
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 4px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-badge-bg); color: var(--muted); }
.badge-blue { background: var(--primary-light); color: var(--primary-dark); }

/* ==========================================================================
   Cards, tables, stats
   ========================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card + .card { margin-top: 18px; }
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.stat-value.accent { color: var(--primary); }
.stat-value.warn { color: var(--amber); }
.stat-value.danger { color: var(--red); }
.stat-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }

table.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.clickable { cursor: pointer; transition: background 0.1s; }
.data-table tr.clickable:hover { background: var(--primary-lighter); }
.td-main { font-weight: 600; }
.td-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 30px; margin-bottom: 10px; opacity: 0.6; }
.empty-state .empty-title { font-weight: 700; color: var(--ink-soft); font-size: 15px; margin-bottom: 5px; }
.empty-state .empty-copy { font-size: 13px; max-width: 420px; margin: 0 auto; line-height: 1.5; }

/* ==========================================================================
   Auth layer (login / setup)
   ========================================================================== */

.auth-layer {
  position: fixed;
  inset: 0;
  background: linear-gradient(140deg, #1B2735 0%, #2C4160 55%, #4A6FA5 130%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  overflow-y: auto;
}
.auth-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 36px 38px 32px;
  width: 100%;
  max-width: 420px;
}
.auth-card.wide { max-width: 500px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand .brand-mark { width: 42px; height: 42px; font-size: 16px; border-radius: 11px; }
.auth-brand-title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.auth-brand-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.auth-error {
  background: var(--red-bg);
  color: var(--red);
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 14px;
}

/* ==========================================================================
   Modals, progress overlay, toasts
   ========================================================================== */

.modal-layer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}
.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 26px;
  animation: modal-in 0.16s ease-out;
}
@keyframes modal-in {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal h2 { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal .confirm-body { color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; }

.progress-layer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.progress-box {
  background: #fff;
  border-radius: 12px;
  padding: 30px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 380px;
}
.progress-box .progress-title { font-weight: 700; font-size: 15px; margin: 14px 0 6px; }
.progress-box .progress-copy { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.view-loading { display: flex; align-items: center; justify-content: center; padding: 80px 0; }

.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 400;
}
.toast {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--primary); }

/* ==========================================================================
   Employee detail view
   ========================================================================== */

.employee-header { display: flex; align-items: center; gap: 18px; }
.employee-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.employee-header-meta { flex: 1; min-width: 0; }
.employee-header-meta .role-line { color: var(--muted); font-size: 13px; margin-top: 3px; }
.employee-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.session-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-card .session-num { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.session-card .session-title { font-weight: 700; font-size: 14px; }
.session-card .session-meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; }
.session-card .session-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.followup-item { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.followup-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: #fff;
  transition: background 0.1s;
}
.followup-head:hover { background: var(--primary-lighter); }
.followup-title { flex: 1; font-weight: 600; font-size: 13.5px; min-width: 0; }
.followup-caret { color: var(--faint); font-size: 11px; transition: transform 0.15s; }
.followup-item.open .followup-caret { transform: rotate(90deg); }
.followup-body { display: none; padding: 4px 16px 16px; background: var(--primary-lighter); border-top: 1px solid var(--line-soft); }
.followup-item.open .followup-body { display: block; }
.followup-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 12px 0 5px; }
.followup-body ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.followup-body p { color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.followup-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ==========================================================================
   Interview view (chat)
   ========================================================================== */

.interview-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 76px);
  max-width: 860px;
  margin: 0 auto;
}
.interview-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px 14px;
  flex-wrap: wrap;
}
.interview-topbar .grow { flex: 1; }
.section-chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.timer-chip {
  font-variant-numeric: tabular-nums;
  background: var(--gray-badge-bg);
  color: var(--ink-soft);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.msg-row { display: flex; margin-bottom: 14px; }
.msg-row.user { justify-content: flex-end; }
.msg-bubble {
  max-width: 76%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg-row.assistant .msg-bubble {
  background: var(--primary-lighter);
  border: 1px solid var(--line-soft);
  border-bottom-left-radius: 4px;
  color: var(--ink);
}
.msg-row.user .msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.typing-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  animation: typing-bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: none; opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.completion-banner {
  background: var(--green-bg);
  border: 1px solid #BFE3CF;
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  font-weight: 600;
  font-size: 13.5px;
}

.chat-input-row { display: flex; gap: 10px; margin-top: 14px; }
.chat-input-row textarea {
  flex: 1;
  resize: none;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  outline: none;
  min-height: 46px;
  max-height: 140px;
  background: #fff;
}
.chat-input-row textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,111,165,0.15); }

/* ==========================================================================
   Graph explorer & org chart
   ========================================================================== */

.graph-layout { display: flex; gap: 18px; align-items: stretch; }
.graph-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.graph-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.graph-toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
}
.cy-canvas {
  flex: 1;
  min-height: 480px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.graph-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

.detail-drawer {
  width: 380px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 130px);
}
.drawer-close { float: right; background: none; border: none; font-size: 17px; color: var(--faint); cursor: pointer; padding: 2px 6px; }
.drawer-close:hover { color: var(--ink); }
.drawer-type-line { color: var(--muted); font-size: 12px; margin: 4px 0 16px; text-transform: capitalize; }

.claim-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.claim-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 7px; }
.claim-quote {
  border-left: 3px solid var(--line);
  padding: 3px 0 3px 11px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.5;
  margin: 8px 0 6px;
}
.claim-attribution { font-size: 11.5px; color: var(--faint); }
.lock-icon { font-size: 11px; }

.gap-item {
  background: var(--red-bg);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--red);
  font-weight: 500;
}

/* Org intelligence panel */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.intel-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.intel-card h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.intel-list { list-style: none; margin: 0; padding: 0; }
.intel-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.intel-list li:last-child { border-bottom: none; }
.intel-empty { color: var(--faint); font-size: 12.5px; padding: 6px 0; }

/* ==========================================================================
   Review queue
   ========================================================================== */

.review-item { margin-bottom: 18px; }
.review-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
}
.review-entity {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--primary-lighter);
}
.review-entity .entity-name { font-weight: 700; font-size: 14px; }
.review-entity .entity-type { font-size: 11.5px; color: var(--muted); text-transform: capitalize; margin: 2px 0 8px; }
.review-entity ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.review-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.similarity-pct { font-size: 19px; font-weight: 800; color: var(--primary); }
.similarity-label { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.review-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

/* ==========================================================================
   Settings
   ========================================================================== */

.settings-category { margin-bottom: 8px; }
.settings-category h3 { text-transform: capitalize; margin-bottom: 4px; }
.setting-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(240px, 1.4fr);
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.setting-row:last-child { border-bottom: none; }
.setting-key { font-weight: 600; font-size: 13px; }
.setting-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.setting-row input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.setting-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,111,165,0.15); }

/* ==========================================================================
   Responsive tweaks (laptop-focused; degrade gracefully below)
   ========================================================================== */

@media (max-width: 1100px) {
  .graph-layout { flex-direction: column; }
  .detail-drawer { width: 100%; max-height: 420px; }
}

@media (max-width: 860px) {
  .sidebar { width: 60px; padding: 16px 8px; }
  .brand-text, .user-meta, .nav-item .nav-label, #logout-btn { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .sidebar-brand { justify-content: center; padding-bottom: 14px; }
  .user-chip { justify-content: center; padding-bottom: 0; }
  .main-content { padding: 20px 18px 40px; }
  .review-pair { grid-template-columns: 1fr; }
  .review-vs { flex-direction: row; }
  .setting-row { grid-template-columns: 1fr; gap: 6px; }
}

/* Company switcher (global admin) */
.company-switcher { padding: 10px 16px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 8px; }
.company-switcher label { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 5px; }
.company-switcher select { width: 100%; background: #FFFFFF; color: #1E293B; border: 1px solid rgba(255,255,255,0.35); border-radius: 6px; padding: 6px 8px; font-size: 13px; font-family: inherit; font-weight: 600; }
.company-switcher select:focus { outline: none; border-color: #6E93C4; }
/* Native option popups render on a white background — force dark text so the list is readable everywhere */
.company-switcher select option { background: #FFFFFF; color: #1E293B; }
.intel-exclude, .intel-reinstate { margin-top: 4px; }
.badge-amber { background: #FEF3C7; color: #92400E; }
