/* ─────────────────────────────────────────────────────────────────────────────
   rcm-look.css — makes the RPA Control Panel look like rcm-ui (the Dental-X app).

   Loaded last, so it only overrides. Values are copied from rcm-ui's
   src/styles.css theme tokens (staging, 2026-11-30):
     brand teal #34b6b3 / dark #0da0b8 / hover #2a9290
     app background #f5f7f9, lines #d6ddeb, table head #f3f6f9,
     table stripes #ebf3fe, row hover #d6e6fb, info blue #2563eb
   Shell: rcm-ui has no side panel. A top bar holds the name on the left,
   a rounded "pill" menu in the middle (active item = solid teal pill) and
   round buttons on the right. Page title row sits under it with the
   customer / clinic pickers on the right.
   ───────────────────────────────────────────────────────────────────────────── */

:root,
body[data-theme="light"] {
  --color-brand-primary: #34b6b3;
  --color-brand-primary-dark: #0da0b8;
  --color-brand-primary-hover: #2a9290;
  --color-brand-secondary: #2563eb;
  --color-text-primary: #1a2f3c;
  --color-text-secondary: #596d7b;
  --color-border: #d6ddeb;

  --bg: #f5f7f9;
  --bg-2: #f5f7f9;
  --panel: #ffffff;
  --panel-border: #dee4e9;
  --text: #1a2f3c;
  --muted: #596d7b;
  --accent: #34b6b3;
  --accent-2: #0da0b8;
  --field-bg: #ffffff;
  --field-border: #d6ddeb;
  --surface-soft: #f3f6f9;
  --surface-tint: rgba(52, 182, 179, 0.1);
  --hover-surface: #f3f4f6;
  --active-surface: #34b6b3;
  --focus-ring: rgba(52, 182, 179, 0.22);

  --rcm-header-h: 64px;
  --rcm-line: #d6ddeb;
  --rcm-table-head: #f3f6f9;
  --rcm-table-head-text: #4a5568;
  --rcm-table-cell: #2d3748;
  --rcm-row-stripe: #ebf3fe;
  --rcm-row-hover: #d6e6fb;
  --rcm-pill-bg: #ffffff;

  --font-ui: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* rcm-ui retired Space Mono for figures: Outfit with even-width digits. */
  --font-numbers: "Outfit", system-ui, sans-serif;
}

body[data-theme="dark"] {
  --bg: #0f172a;
  --bg-2: #0f172a;
  --panel: #111827;
  --panel-border: #273449;
  --surface-soft: #172033;
  --hover-surface: #1e293b;
  --rcm-line: #334155;
  --rcm-table-head: #172033;
  --rcm-table-head-text: #cbd5e1;
  --rcm-table-cell: #e2e8f0;
  --rcm-row-stripe: #15203a;
  --rcm-row-hover: #1e2d4d;
  --rcm-pill-bg: #111827;
}

/* ── Page ─────────────────────────────────────────────────────────────────── */
body {
  display: block;
  background: var(--bg);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  padding: 0 1.25rem;
}

/* ── Top bar (replaces the side panel) ────────────────────────────────────── */
.sidebar.rcm-header,
body.sidebar-collapsed .sidebar.rcm-header {
  position: sticky;
  top: 0;
  inset: auto;
  z-index: 60;
  width: auto;
  height: var(--rcm-header-h);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  margin: 0 -1.25rem;
  padding: 0 1.25rem;
  overflow: visible;
  background: var(--bg);
  border: 0;
  box-shadow: none;
}

.rcm-brand,
body.sidebar-collapsed .rcm-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0;
  border: 0;
  flex-shrink: 0;
}

.rcm-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  font-size: 0.72rem;
}

body.sidebar-collapsed .rcm-brand .sidebar-brand-copy,
.rcm-brand .sidebar-brand-copy {
  display: block;
}

.rcm-brand .eyebrow {
  display: none;
}

.rcm-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: #1f2937;
}

body[data-theme="dark"] .rcm-brand h1 {
  color: var(--text);
}

/* Pill menu */
.sidebar-nav-main.rcm-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
}

.rcm-nav {
  gap: 0;
}

.rcm-nav::before {
  content: none;
}

.rcm-nav {
  /* the white rounded track */
  --track-h: 44px;
}

.rcm-nav > .sidebar-nav-item:first-of-type {
  margin-left: 0;
}

.sidebar-nav-main.rcm-nav {
  flex: 0 1 auto;
  margin: 0 auto;
  height: var(--track-h);
  padding: 2px;
  gap: 2px;
  background: var(--rcm-pill-bg);
  border: 1px solid color-mix(in srgb, var(--rcm-line) 60%, transparent);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  overflow-x: auto;
  scrollbar-width: none;
}

.sidebar-nav-main.rcm-nav::-webkit-scrollbar {
  display: none;
}

.rcm-nav .sidebar-nav-item,
body.sidebar-collapsed .rcm-nav .sidebar-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: auto;
  height: 100%;
  min-height: 0;
  padding: 0 0.85rem 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 80%, transparent);
  box-shadow: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.rcm-nav .sidebar-nav-item[hidden] {
  display: none;
}

.rcm-nav .sidebar-nav-item:hover {
  background: #f3f4f6;
  color: var(--text);
}

body[data-theme="dark"] .rcm-nav .sidebar-nav-item:hover {
  background: var(--hover-surface);
}

.rcm-nav .sidebar-nav-item.active,
.rcm-nav .sidebar-nav-item.active:hover {
  background: var(--accent);
  color: #ffffff;
  border: 0;
  box-shadow: none;
}

.rcm-nav .nav-icon,
.rcm-nav .sidebar-nav-item.active .nav-icon {
  width: 38px;
  height: 100%;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 1rem;
}

.rcm-nav .nav-icon svg {
  display: block;
}

body.sidebar-collapsed .rcm-nav .nav-label,
.rcm-nav .nav-label {
  display: inline;
  margin-left: -4px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Right-hand round buttons */
.rcm-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.rcm-header-actions .sidebar-user {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.rcm-round-btn,
.rcm-header-actions .btn-ghost {
  min-height: 36px;
  height: 36px;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--rcm-line) 60%, transparent);
  background: var(--rcm-pill-bg);
  color: #334155;
  font-weight: 500;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

body[data-theme="dark"] .rcm-round-btn {
  color: var(--text);
  box-shadow: none;
}

.rcm-round-btn:hover {
  background: #f8fafc;
}

body[data-theme="dark"] .rcm-round-btn:hover {
  background: var(--hover-surface);
}

.sidebar-collapse-btn {
  display: none !important;
}

/* ── Main area ────────────────────────────────────────────────────────────── */
.main-content,
body.sidebar-collapsed .main-content {
  margin: 0;
  max-width: none;
  min-height: calc(100vh - var(--rcm-header-h));
  padding: 0 0 1.25rem;
  background: transparent;
  gap: 0.85rem;
}

/* Page title row (rcm-ui's sub-navigation bar): title left, pickers right */
.app-topbar {
  position: static;
  margin: 0;
  min-height: 52px;
  padding: 0.25rem 0.25rem;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  flex-wrap: wrap;
}

.app-topbar-title .eyebrow {
  display: none;
}

.app-topbar-title h2 {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
}

/* The pickers already show the customer and clinic. */
.app-topbar-context {
  display: none;
}

/* ── Customer / clinic pickers ────────────────────────────────────────────── */
.rcm-context {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}

/* Before app.js moves it into the title row, keep it out of sight. */
body > .rcm-context {
  display: none;
}

.rcm-context .sidebar-section {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  border: 0;
}

.rcm-context .sidebar-section-header {
  display: contents;
}

.rcm-context .sidebar-section-title {
  order: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.rcm-context #add-customer-btn {
  order: 3;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--rcm-line);
  background: var(--rcm-pill-bg);
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1;
}

.rcm-context #add-customer-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.rcm-context #locations-loader {
  order: 3;
}

.rcm-context .sidebar-search,
.rcm-context .sidebar-select,
.rcm-context #customer-select,
.rcm-context #clinic-select {
  order: 2;
  width: auto;
  min-height: 36px;
  height: 36px;
  margin: 0;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--rcm-line);
  background: var(--rcm-pill-bg);
  font-size: 0.85rem;
}

.rcm-context .sidebar-search {
  order: 1;
  width: 150px;
}

.rcm-context #customer-select {
  max-width: 220px;
}

.rcm-context #clinic-select {
  max-width: 240px;
}

/* Only show the clinic note when something went wrong. */
.rcm-context .location-list {
  display: none;
}

.rcm-context .location-list:has(.context-helper--error) {
  display: block;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  white-space: nowrap;
}

/* "+ New customer" form opens as a small card under the pickers */
.rcm-context #new-customer-panel:not([hidden]) {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 300px;
  padding: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

/* ── Cards / panels ───────────────────────────────────────────────────────── */
.content-panel {
  border-radius: 12px;
  border-color: var(--panel-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.content-panel-header {
  border-bottom-color: var(--panel-border);
}

.content-panel-header h2 {
  font-weight: 600;
}

.dashboard-metric-card {
  border-radius: 12px;
  border-top-width: 1px;
  border-top-color: var(--panel-border) !important;
  box-shadow: none;
}

.dashboard-metric-card:hover {
  border-color: var(--accent) !important;
  background: var(--panel);
}

.dashboard-metric-card strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  border-radius: 8px;
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--color-brand-primary-hover);
  border-color: var(--color-brand-primary-hover);
  filter: none;
}

.btn-secondary {
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--accent-2);
  border-radius: 8px;
}

.btn-secondary:hover {
  background: rgba(52, 182, 179, 0.08);
}

.btn-ghost,
.btn-icon {
  border-radius: 8px;
}

/* Tabs → rcm-ui's rounded sub-tabs */
.request-tabs {
  border-radius: 999px;
  background: var(--rcm-pill-bg);
  border: 1px solid var(--rcm-line);
  padding: 2px;
}

.request-tab {
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 80%, transparent);
  font-weight: 500;
}

.request-tab:hover {
  background: #f3f4f6;
}

body[data-theme="dark"] .request-tab:hover {
  background: var(--hover-surface);
}

.request-tab.active,
.request-tab.active:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

/* Inputs */
.sidebar-select,
.sidebar-search,
.form-label input,
.form-label select,
.request-filter-label input,
.request-filter-label select,
.request-page-size-label select,
.request-date-label input,
.logs-search-input,
.logs-date-input,
.app-modal-field input,
.app-modal-field textarea {
  border-color: var(--rcm-line);
  border-radius: 8px;
}

/* ── Tables: rcm-ui table system ──────────────────────────────────────────── */
.rpa-table th,
.tc-table th,
.data-table th {
  background: var(--rcm-table-head);
  color: var(--rcm-table-head-text);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  border-bottom: 1px solid #cbd5df;
}

body[data-theme="dark"] .rpa-table th,
body[data-theme="dark"] .tc-table th,
body[data-theme="dark"] .data-table th {
  border-bottom-color: var(--rcm-line);
}

.rpa-table td,
.tc-table td,
.data-table td {
  color: var(--rcm-table-cell);
  border-bottom-color: var(--panel-border);
}

.rpa-table tbody tr:nth-child(even) td,
.tc-table tbody tr:nth-child(even) td,
.data-table tbody tr:nth-child(even) td {
  background: var(--rcm-row-stripe);
}

.rpa-table tbody tr:hover td,
.tc-table tbody tr:hover td,
.data-table tbody tr:hover td {
  background: var(--rcm-row-hover);
}

.rpa-table th:last-child {
  background: var(--rcm-table-head);
}

.tc-table-wrap,
.request-table-wrap {
  border-radius: 12px;
  border-color: var(--panel-border);
}

/* ── Medium screens: ten menu items don't fit with words, so only the open
   page keeps its word; the rest are icons with the name on hover. ────────── */
@media (max-width: 1720px) {
  .rcm-nav .sidebar-nav-item:not(.active) .nav-label {
    display: none;
  }

  .rcm-nav .sidebar-nav-item:not(.active) {
    padding: 0;
  }

  .rcm-header-actions .sidebar-user {
    display: none;
  }
}

/* ── Narrow screens: labels drop, icons stay (as in rcm-ui below "lg") ───── */
@media (max-width: 1100px) {
  .rcm-nav .nav-label,
  body.sidebar-collapsed .rcm-nav .nav-label {
    display: none;
  }

  .rcm-nav .sidebar-nav-item,
  body.sidebar-collapsed .rcm-nav .sidebar-nav-item {
    padding: 0;
  }
}

@media (max-width: 760px) {
  body {
    padding: 0 0.75rem;
  }

  .sidebar.rcm-header {
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
    gap: 0.4rem;
  }

  .rcm-brand .sidebar-brand-copy,
  body.sidebar-collapsed .rcm-brand .sidebar-brand-copy {
    display: none;
  }

  .rcm-header-actions .sidebar-user {
    display: none;
  }

  .rcm-context .sidebar-search {
    display: none;
  }
}

/* Login page: centred card, no top-bar padding. */
body.login-page {
  display: flex;
  padding: 0;
}

/* ═════════════════════════════════════════════════════════════════════════
   Layout v2 (shell.js): 5 menu items, tabs inside, side panels.
   ═════════════════════════════════════════════════════════════════════════ */

/* ── Top menu: 5 items in rcm-ui's white pill track ── */
#rcm-modules {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  margin: 0 auto;
  padding: 2px;
  background: var(--rcm-pill-bg);
  border: 1px solid color-mix(in srgb, var(--rcm-line) 60%, transparent);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  overflow-x: auto;
  scrollbar-width: none;
}

#rcm-modules::-webkit-scrollbar {
  display: none;
}

.rcm-module {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 0.95rem 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 80%, transparent);
  font: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.rcm-module:hover {
  background: #f3f4f6;
  color: var(--text);
}

body[data-theme="dark"] .rcm-module:hover {
  background: var(--hover-surface);
}

.rcm-module.active,
.rcm-module.active:hover {
  background: var(--accent);
  color: #fff;
}

.rcm-module .nav-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 100%;
  background: transparent;
  color: inherit;
}

.rcm-module .nav-label {
  margin-left: -4px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Only five items now: words stay on until the screen is small. */
@media (max-width: 1720px) {
  .rcm-module .nav-label {
    display: inline;
  }
}

@media (max-width: 1000px) {
  .rcm-module:not(.active) .nav-label {
    display: none;
  }

  .rcm-module:not(.active) {
    padding: 0;
  }
}

/* ── Account menu (round button, right) ── */
.rcm-account {
  position: relative;
}

.rcm-account > summary {
  list-style: none;
}

.rcm-account > summary::-webkit-details-marker {
  display: none;
}

.rcm-account-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.rcm-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 210px;
  padding: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.rcm-account-name {
  margin: 0;
  padding: 0.5rem 0.6rem 0.55rem;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.rcm-account-menu .sidebar-user {
  display: none !important;
}

.rcm-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.rcm-menu-item:hover {
  background: var(--surface-soft);
}

#theme-toggle-btn::before {
  content: "Theme: switch to ";
  color: var(--muted);
}

.rcm-danger,
.rcm-menu-item.rcm-danger {
  color: var(--error);
}

/* ── Title row: title, tabs, then pickers on the right ── */
.app-topbar {
  justify-content: flex-start;
  gap: 1rem;
}

.rcm-subnav {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 2px;
  background: var(--rcm-pill-bg);
  border: 1px solid var(--rcm-line);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}

.rcm-subnav[hidden] {
  display: none;
}

.rcm-subtab {
  height: 100%;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 80%, transparent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.rcm-subtab:hover {
  background: #f3f4f6;
}

body[data-theme="dark"] .rcm-subtab:hover {
  background: var(--hover-surface);
}

.rcm-subtab.active,
.rcm-subtab.active:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Things the menu and tabs now do ── */
#close-rpa-list-btn,
#close-request-runs-btn,
#close-logs-btn,
#close-jobs-btn,
#open-rpa-list-btn,
#open-request-runs-btn,
#open-logs-btn,
#open-jobs-btn,
#tc-tabs,
#empty-state {
  display: none !important;
}

/* Page title is in the title row; drop the repeat inside each card. */
#dashboard-panel > .content-panel-header h2,
#rpa-list-title,
#request-run-title,
#logs-panel > .content-panel-header h2,
#jobs-panel > .content-panel-header h2,
#testing-panel > .content-panel-header h2,
#eob-panel > .content-panel-header h2,
#onboarding-panel > .content-panel-header h2,
#settings-panel > .content-panel-header h2 {
  display: none;
}

.content-panel-header .muted {
  margin: 0;
}

.rcm-section-title {
  margin: 1.1rem 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Overview: number boxes read as links ── */
.dashboard-metric-card {
  position: relative;
}

.dashboard-metric-card::after {
  content: "→";
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.dashboard-metric-card:hover::after {
  color: var(--accent);
  transform: translateX(3px);
}

/* ── Simple click-through tables (customer list, clinics) ── */
.rcm-simple-table {
  min-width: 0 !important;
  width: 100%;
}

.rcm-simple-table th:last-child,
.rcm-simple-table td:last-child {
  position: static;
  width: 1%;
  min-width: 0;
  box-shadow: none;
  white-space: nowrap;
  text-align: right;
}

.rcm-click-row {
  cursor: pointer;
}

.rcm-click-row td {
  vertical-align: middle !important;
}

.rcm-row-selected td {
  box-shadow: inset 3px 0 0 var(--accent);
}

.rcm-simple-table .setup-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.rcm-table-foot {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
}

.content-panel-actions .logs-search-input {
  height: 32px;
  min-width: 200px;
  padding: 0 0.85rem;
  border-radius: 999px;
}

/* ── Agents: one button + "⋯" menu per row ── */
.rpa-table td:last-child,
.rpa-table th:last-child {
  min-width: 150px;
  width: 150px;
}

.rcm-row-actions,
.rpa-table td:last-child .rcm-row-actions {
  display: flex !important;
  align-items: center;
  gap: 0.35rem;
}

.rpa-table td:last-child .rcm-row-actions .btn-sm {
  width: auto;
}

.rcm-row-menu {
  position: relative;
}

.rcm-row-menu > summary {
  list-style: none;
  min-width: 34px;
  min-height: 31px;
  padding: 0 0.5rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rcm-line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-weight: 700;
}

.rcm-row-menu > summary::-webkit-details-marker {
  display: none;
}

.rcm-row-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 160px;
  padding: 0.3rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.rcm-row-menu-list button {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.rcm-row-menu-list button:hover {
  background: var(--surface-soft);
}

.rcm-row-menu-list .rcm-danger {
  color: var(--error);
}

#add-agent-btn.is-disabled {
  opacity: 0.55;
}

/* ── Side panels (Add agent, Edit agent runtime) ── */
.rcm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(520px, 100vw);
  margin: 0 !important;
  padding: 0 1.25rem 1.25rem !important;
  overflow-y: auto;
  background: var(--panel) !important;
  border: 0 !important;
  border-left: 1px solid var(--panel-border) !important;
  border-radius: 0 !important;
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.16);
}

.rcm-drawer[hidden] {
  display: none !important;
}

.rcm-drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -1.25rem 0.75rem;
  padding: 1rem 1.25rem 0.85rem;
  background: var(--panel);
  border-bottom: 1px solid var(--panel-border);
}

.rcm-drawer-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.rcm-drawer-head .btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1.2rem;
}

.rcm-drawer-group {
  margin: 1rem 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.rcm-drawer .rcm-drawer-group:first-child {
  margin-top: 0.2rem;
}

.rcm-drawer #new-rpa-form,
.rcm-drawer #edit-rpa-runtime-form {
  display: grid !important;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.rcm-drawer #new-rpa-form[hidden] {
  display: grid !important;
}

.rcm-drawer .form-grid-3 {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.rcm-drawer .form-actions-row {
  position: sticky;
  bottom: -1.25rem;
  margin: 0.5rem -1.25rem -1.25rem;
  padding: 0.85rem 1.25rem;
  background: var(--panel);
  border-top: 1px solid var(--panel-border);
}

/* ── Customer page ── */
#customer-detail .content-panel-actions {
  gap: 0.5rem;
}

/* ── Payment posting: API call panel only where payloads are built ── */
#testing-panel .tc-tabbar {
  justify-content: flex-end;
}

body:not(.pp-api) #testing-panel .tc-aside {
  display: none;
}

body:not(.pp-api) #testing-panel .tc-layout,
body.pp-dev #testing-panel .tc-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.pp-dev #testing-panel .tc-main {
  display: none;
}

body.pp-dev #testing-panel .tc-aside {
  position: static;
  max-height: none;
}

/* ═════════════════════════════════════════════════════════════════════════
   Look C — the Dental-X app's current look (rcm-ui styles.css, default for
   everyone since 2026-11-22): Inter for text, Plus Jakarta Sans for headings,
   JetBrains Mono for codes and ids, petrol teal brand, slate greys, borderless
   cards with a soft shadow, roomier table rows, distinct status colours.
   Like rcm-ui, the colours apply to the light theme; dark keeps its palette.
   ═════════════════════════════════════════════════════════════════════════ */
:root,
body {
  --font-ui: "Inter", "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-numbers: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --look-card-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

body[data-theme="light"] {
  --color-brand-primary: #0f5c5c;
  --color-brand-primary-dark: #0a4242;
  --color-brand-primary-hover: #0a4242;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;
  --accent: #0f5c5c;
  --accent-2: #0a4242;
  --active-surface: #0f5c5c;
  --focus-ring: rgba(15, 92, 92, 0.18);
  --surface-tint: #edf7f6;
  --text: #0f172a;
  --muted: #475569;
  --bg: #f8fafc;
  --bg-2: #f8fafc;
  --panel-border: #e2e8f0;
  --field-border: #e2e8f0;
  --surface-soft: #f8fafc;
  --hover-surface: #f1f5f9;
  --rcm-line: #e2e8f0;
  --rcm-table-head: #f8fafc;
  --rcm-table-head-text: #475569;
  --rcm-table-cell: #0f172a;
  --rcm-row-stripe: #f8fafc;
  --rcm-row-hover: #edf7f6;
}

body {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
.app-topbar-title h2,
.rcm-brand h1,
.content-panel-header h2,
.rcm-drawer-head h3,
.dashboard-metric-card strong {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.app-topbar-title h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.rcm-brand h1 {
  font-weight: 700;
}

code,
pre,
.tc-code,
.rpa-table td code,
.request-table td code,
.raw-block,
.log-output-pre {
  font-family: var(--font-mono);
}

/* Cards: no border, soft shadow (light theme) */
body[data-theme="light"] .content-panel,
body[data-theme="light"] .dashboard-metric-card,
body[data-theme="light"] .tc-main,
body[data-theme="light"] .tc-aside {
  border-color: transparent;
  box-shadow: var(--look-card-shadow);
}

body[data-theme="light"] .dashboard-metric-card:hover {
  border-color: var(--accent) !important;
}

.dashboard-metric-card strong {
  font-size: 1.6rem;
  font-weight: 700;
}

/* Inner boxes on the overview: flat tinted strips */
body[data-theme="light"] .dashboard-work-panel {
  background: #f8fafc;
  border-color: transparent;
}

body[data-theme="light"] .setup-row,
body[data-theme="light"] .recent-error-row {
  border-color: #e2e8f0;
  box-shadow: none;
}

/* Tables: small slate headers, roomier rows */
.rpa-table th,
.tc-table th,
.data-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 0.875rem 0.5rem;
}

body[data-theme="light"] .rpa-table th,
body[data-theme="light"] .tc-table th,
body[data-theme="light"] .data-table th {
  border-bottom-color: #e2e8f0;
}

.rpa-table td,
.tc-table td,
.data-table td {
  padding: 0.75rem 0.875rem;
  line-height: 1.45;
}

/* Status chips: green = done, amber = action needed, red = failed */
body[data-theme="light"] .setup-step.complete {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

body[data-theme="light"] .setup-step.pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

body[data-theme="light"] .badge-ok,
body[data-theme="light"] .status-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

body[data-theme="light"] .status-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

body[data-theme="light"] .status-pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* Hovers that used a light grey now use the slate one */
body[data-theme="light"] .rcm-module:hover,
body[data-theme="light"] .rcm-subtab:hover,
body[data-theme="light"] .request-tab:hover {
  background: #f1f5f9;
}

body[data-theme="light"] .rcm-brand h1 {
  color: #0f172a;
}

.rcm-row-menu-list { z-index: 95; }
