:root {
  --aemos-blue: #627de7;
  --aemos-blue-light: #05ceb6;
  --aemos-grey-bg: #f9f9f9;
  --aemos-grey-light: #e8ecf8;
  --aemos-sidebar-bg: #17193f;
  --aemos-sidebar-border: #343957;
  --acertara-blue: #627de7;
  --acertara-black: #17193f;
  --acertara-grey: #9698a7;
  --acertara-white: #ffffff;
  --acertara-blue-hover: #5169d4;
  --acertara-blue-active: #34499b;
  --acertara-grey-light: #e8ecf8;
  --acertara-grey-bg: #f9f9f9;
  --acertara-font-heading: "sofia-pro", "Sofia Pro", "Segoe UI", Calibri, sans-serif;
  --acertara-font-body: "sofia-pro", "Sofia Pro", "Segoe UI", Calibri, sans-serif;
}

body.aemos-staff,
body.staff-shell {
  font-family: var(--acertara-font-body);
  color: var(--acertara-black);
  background: var(--acertara-grey-bg);
  margin: 0;
  line-height: 1.45;
}

body.aemos-staff h1,
body.aemos-staff h2,
body.aemos-staff h3,
body.aemos-staff h4,
body.staff-shell h1,
body.staff-shell h2,
body.staff-shell h3,
body.staff-shell h4,
.aemos-staff-topbar-title {
  font-family: var(--acertara-font-heading);
  color: var(--acertara-black);
}

body.aemos-staff-login {
  background: var(--acertara-grey-bg);
}

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

.aemos-sidebar {
  width: 15rem;
  flex-shrink: 0;
  background: var(--aemos-sidebar-bg);
  color: #e8eaed;
  padding: 1rem 0;
  overflow-y: auto;
}

.aemos-sidebar-brand {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--aemos-sidebar-border);
  margin-bottom: 0.75rem;
}

.aemos-sidebar-brand .brand-title {
  color: var(--aemos-blue-light);
  font-size: 0.95rem;
  font-weight: 700;
}

.aemos-sidebar-brand .brand-sub {
  color: #9aa3b0;
  font-size: 0.8rem;
}

.aemos-sidebar-heading {
  margin: 0 1rem 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9aa3b0;
}

.aemos-sidebar-flow {
  margin: 0 1rem 0.75rem;
  font-size: 0.85rem;
  color: #b8c0cc;
}

.aemos-sidebar-flow a {
  color: var(--aemos-blue-light);
  text-decoration: none;
}

/* Clinician portal sidebar (flat link list) */
.aemos-sidebar-flow > a {
  display: block;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--aemos-sidebar-border);
  color: #e8ecf8;
}
.aemos-sidebar-flow > a:hover,
.aemos-sidebar-flow > a.active {
  color: #fff;
  background: rgba(5, 206, 182, 0.12);
}

.aemos-nav-section {
  margin: 0;
  border-bottom: 1px solid var(--aemos-sidebar-border);
}

.aemos-nav-section summary {
  cursor: pointer;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.aemos-nav-summary-label {
  flex: 1;
  min-width: 0;
}
.aemos-nav-help {
  margin-left: 0;
  flex-shrink: 0;
}
.aemos-nav-help .section-help-tip {
  width: 1rem;
  height: 1rem;
  font-size: 0.65rem;
  border-color: #6b7c93;
  background: #1b2838;
  color: #d7e3f4;
}
.aemos-nav-help .section-help-tip:hover,
.aemos-nav-help .section-help-tip:focus {
  background: #243044;
}

.aemos-nav-section summary::-webkit-details-marker {
  display: none;
}

.aemos-nav-section ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem;
}

.aemos-nav-subgroup {
  margin: 0.35rem 0 0.15rem;
  padding: 0.25rem 1rem 0.1rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a939f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.aemos-nav-section li a {
  display: block;
  padding: 0.35rem 1rem 0.35rem 1.5rem;
  color: #c8d0da;
  text-decoration: none;
  font-size: 0.88rem;
}

.aemos-nav-section li a:hover {
  background: #243044;
  color: #fff;
}

.aemos-nav-section li a.active {
  background: var(--aemos-blue);
  color: #fff;
}

.kpi-tabs .kpi-tab.active {
  background: var(--aemos-blue);
  color: #fff;
}

.aemos-nav-section li span.nav-planned {
  display: block;
  padding: 0.35rem 1rem 0.35rem 1.5rem;
  color: #6f7885;
  font-size: 0.85rem;
  font-style: italic;
}

.aemos-sidebar-planned {
  margin: 1rem;
  font-size: 0.78rem;
  color: #8a939f;
  line-height: 1.35;
}

.aemos-staff-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.aemos-staff-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--aemos-grey-light);
}

.aemos-staff-topbar-leading {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.aemos-staff-topbar-title {
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
}

.aemos-global-search {
  position: relative;
  flex: 1;
  max-width: 32rem;
  min-width: 12rem;
}

.aemos-global-search-input {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--acertara-grey-light);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--acertara-white);
  font-family: var(--acertara-font-body);
  color: var(--acertara-black);
}

.aemos-global-search-input:focus {
  outline: 2px solid rgba(0, 119, 200, 0.25);
  border-color: var(--acertara-blue);
  background: var(--acertara-white);
}

.aemos-global-search-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 24rem;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--aemos-grey-light);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.aemos-global-search-group {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eef1f4;
}

.aemos-global-search-group:last-child {
  border-bottom: none;
}

.aemos-global-search-group-label {
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.aemos-global-search-hit {
  display: block;
  padding: 0.5rem 0.75rem;
  color: inherit;
  text-decoration: none;
}

.aemos-global-search-hit:hover,
.aemos-global-search-hit.is-active {
  background: #f0f7ff;
}

.aemos-global-search-hit-label {
  font-weight: 600;
  font-size: 0.92rem;
}

.aemos-global-search-hit-sub {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 0.1rem;
}

.aemos-global-search-empty {
  padding: 0.75rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.aemos-staff-topbar .meta {
  color: var(--acertara-grey);
  font-size: 0.9rem;
}

.aemos-staff-topbar .meta a {
  color: var(--acertara-blue);
}

.aemos-staff-main {
  padding: 1.25rem;
  max-width: 1100px;
}

.aemos-staff-main.login-main {
  max-width: none;
  display: flex;
  justify-content: center;
  padding-top: 3rem;
}

.card {
  background: var(--acertara-white);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
  border: 1px solid var(--acertara-grey-light);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--acertara-grey-light);
}

.muted {
  color: var(--acertara-grey);
  font-size: 0.9rem;
}

.error {
  color: #b00020;
}

button:not(.section-help-tip),
.btn {
  background: var(--acertara-blue);
  color: var(--acertara-white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
}

button.secondary:not(.section-help-tip),
.btn.secondary {
  background: var(--acertara-grey);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
textarea,
select {
  width: 100%;
  padding: 0.5rem;
  margin: 0.25rem 0 0.75rem;
  box-sizing: border-box;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  max-width: 1.05rem;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  flex: 0 0 auto;
  box-sizing: border-box;
}

/* Checkbox + label on one tight row (never stretch across the card) */
.checkbox-row,
.intake-options label {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, max-content);
  align-items: center;
  justify-content: start;
  column-gap: 0.55rem;
  width: max-content;
  max-width: 100%;
  margin: 0.4rem 0;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"],
.intake-options input[type="checkbox"],
.intake-options input[type="radio"] {
  margin: 0;
  padding: 0;
  justify-self: center;
}

.checkbox-row span,
.intake-options label > span {
  line-height: 1.3;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-completed {
  background: #d4edda;
  color: #155724;
}

.badge-running {
  background: #fff3cd;
  color: #856404;
}

.badge-failed {
  background: #f8d7da;
  color: #721c24;
}

.insp-section {
  border: 1px solid var(--aemos-grey-light);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}
.insp-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #555;
}
.insp-damage select { min-width: 10rem; }
.staff-ac-wrap { position: relative; margin-bottom: 0.75rem; }
.staff-ac-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 14rem;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.staff-ac-empty {
  padding: 0.5rem 0.75rem;
  color: #1a1a1a;
}
.staff-ac-dropdown .staff-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  line-height: 1.4;
}
.staff-ac-dropdown .staff-ac-item:hover,
.staff-ac-dropdown .staff-ac-item:focus {
  background: var(--aemos-grey-bg);
  color: #1a1a1a;
  outline: none;
}
.intake-pe-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: #e8f0fe;
  color: #1a4480;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}
.symptom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: var(--aemos-grey-bg);
  border-radius: 4px;
}
.symptom-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  min-width: 10rem;
  flex: 1 1 12rem;
}
.symptom-row .symptom-remove {
  align-self: flex-end;
  margin-bottom: 0.1rem;
}
.intake-options {
  margin: 1rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--aemos-grey-light);
}

/* Section help: lowercase (i) — hover tip + click for full docs */
h1:has(> .section-help),
h2:has(> .section-help),
h3:has(> .section-help),
summary:has(> .section-help) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.45rem;
}
.section-help {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0;
  vertical-align: middle;
  line-height: 1;
}
.section-help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  min-height: 1.15rem;
  padding: 0;
  padding-top: 0.02rem;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--acertara-grey);
  background: var(--acertara-grey-bg);
  color: var(--acertara-blue);
  font-size: 0.75rem;
  font-weight: 700;
  font-style: normal;
  font-family: var(--acertara-font-heading);
  text-transform: lowercase;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
}
.section-help-tip:hover,
.section-help-tip:focus {
  background: #e6f3fb;
  outline: 2px solid var(--acertara-blue);
  outline-offset: 1px;
}
.staff-help-float-tip {
  position: fixed;
  z-index: 1100;
  min-width: 12rem;
  max-width: min(22rem, calc(100vw - 1rem));
  padding: 0.5rem 0.65rem;
  border-radius: 4px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  font-family: var(--acertara-font-body);
  line-height: 1.35;
  white-space: normal;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
/* Legacy Docs link (hidden if present while pages migrate) */
.section-help-docs {
  display: none;
}
.staff-doc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(28rem, 100vw);
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.staff-doc-drawer.open {
  transform: translateX(0);
}
.staff-doc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--aemos-grey-light);
}
.staff-doc-drawer-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.staff-doc-drawer-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.staff-doc-drawer-body h3 {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
}
.staff-doc-drawer-body p,
.staff-doc-drawer-body li {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #333;
}
.staff-doc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 45, 82, 0.35);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.staff-doc-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}
.hub-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.hub-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #fff;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.hub-card:hover {
  box-shadow: 0 4px 16px rgba(15, 45, 82, 0.12);
  border-color: var(--aemos-blue);
}
.hub-card:active {
  transform: translateY(1px);
}
.hub-card.is-selected {
  border-color: var(--aemos-blue);
  box-shadow: 0 0 0 2px rgba(0, 119, 200, 0.2);
  background: #f5faff;
}
.hub-card strong {
  display: block;
  color: var(--aemos-blue);
  font-size: 1rem;
  margin-bottom: 0.15rem;
}
.hub-card .muted {
  font-size: 0.85rem;
}
.hub-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--aemos-blue);
}
.hub-card-link {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--aemos-blue);
}
.hub-dl {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.35rem 1rem;
}
.hub-dl dt { font-weight: 600; color: var(--acertara-grey); }

/* Report widgets (KPI page) */
.report-bar-row, .report-stack-row { display: grid; grid-template-columns: 8rem 1fr 3rem; gap: 0.5rem; align-items: center; margin: 0.35rem 0; }
.report-bar-track, .report-stack-track { background: #eef2f6; border-radius: 4px; height: 1rem; overflow: hidden; display: flex; }
.report-bar-fill { background: var(--acertara-blue); height: 100%; border-radius: 4px; }
.report-stack-seg { height: 100%; min-width: 2px; }
.report-bar-label { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-val { text-align: right; font-size: 0.85rem; }
.report-pie-wrap { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.report-pie { width: 8rem; height: 8rem; border-radius: 50%; }
.report-pie-legend { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.report-pie-legend .swatch { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 2px; margin-right: 0.35rem; }

.fin-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.fin-kpi-card { background: var(--acertara-grey-bg); border: 1px solid var(--acertara-grey-light); border-radius: 8px; padding: 0.75rem 1rem; }
.fin-kpi-label { font-size: 0.8rem; color: var(--acertara-grey); margin-bottom: 0.25rem; }
.fin-kpi-value { font-size: 1.35rem; font-weight: 600; color: var(--acertara-black); }
.fin-report-table .fin-row-expandable { cursor: pointer; }
.fin-report-table .fin-row-expandable:hover { background: var(--acertara-grey-bg); }
.fin-report-table .fin-row-open { background: #e6f3fb; }
.fin-expand-cell { width: 2rem; text-align: center; color: var(--acertara-grey); }
.fin-detail-row td { background: var(--acertara-grey-bg); padding: 0.75rem 1rem !important; border-bottom: 1px solid var(--acertara-grey-light); }
.fin-detail-inner { font-size: 0.9rem; line-height: 1.5; }
.fin-detail-links { margin-top: 0.5rem; }
.fin-detail-links a { color: var(--acertara-blue); font-weight: 600; }
.fin-ops-context { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--acertara-grey-light); }
.fin-ops-heading { font-weight: 600; margin-bottom: 0.35rem; color: var(--acertara-black); }
.fin-ops-block { margin: 0.25rem 0; }
.fin-ops-block a { color: var(--acertara-blue); font-weight: 600; }
.fin-drill-link { background: none; border: none; padding: 0; color: var(--acertara-blue); font-weight: 600; cursor: pointer; text-decoration: underline; font-size: inherit; }
.fin-drill-link:hover { color: var(--acertara-blue-hover); }
.fin-status-pass { color: #15803d; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; }
.fin-status-warn { color: #b45309; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; }
.fin-status-fail { color: #b91c1c; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; }
.fin-customer-link, .fin-invoice-link { color: var(--acertara-blue); font-weight: 600; text-decoration: none; }
.fin-customer-link:hover, .fin-invoice-link:hover { text-decoration: underline; }
.report-widget-card .report-table { width: 100%; margin-top: 0.75rem; font-size: 0.9rem; border-collapse: collapse; }
.report-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.report-table-wrap .report-table { margin-top: 0; }
.report-table th,
.report-table td {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #e8ecf0;
}
.report-table--wide {
  font-size: 0.8rem;
}
.report-table--wide th {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  max-width: 4.75rem;
  min-width: 3.25rem;
  vertical-align: bottom;
  line-height: 1.15;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  padding: 0.4rem 0.3rem;
}
.report-table--wide td {
  max-width: 3.25rem;
  min-width: 2.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.report-table--wide th:first-child,
.report-table--wide td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  min-width: 4.5rem;
  max-width: 5rem;
  text-align: left;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}
.report-extra-sources { display: flex; flex-direction: column; gap: 0.5rem; min-width: 14rem; }
.report-extra-source-row { display: flex; gap: 0.35rem; align-items: center; }
.report-extra-source-row select { flex: 1; min-width: 10rem; }
.report-builder-form label { min-width: 10rem; }
.report-summary-value { font-size: 2rem; font-weight: 600; margin: 0.5rem 0; color: var(--aemos-blue); }
.report-summary-value .muted { font-size: 1rem; font-weight: 400; }
.report-chart-host { margin-top: 0.75rem; }
.hub-dl dd { margin: 0; }
.hub-add-panel {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px dashed #ccc;
  border-radius: 6px;
  background: #fafafa;
}
.hub-add-panel h4 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.hub-add-panel label { display: inline-block; margin: 0 0.5rem 0.5rem 0; font-size: 0.85rem; }
.hub-add-panel input, .hub-add-panel select, .hub-add-panel textarea {
  display: block;
  margin-top: 0.2rem;
  padding: 0.35rem 0.5rem;
  min-width: 10rem;
}
.hub-add-panel .hub-form-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.hub-filter-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-bottom: 1rem; }
.hub-filter-form label { font-size: 0.85rem; }
.hub-msg { color: #0a6; font-size: 0.85rem; margin: 0.5rem 0; }
.hub-msg.error { color: #b00; }
.quote-lines-table { width: 100%; margin: 0.5rem 0; }
.quote-lines-table input { width: 100%; }

/* Collapsible staff sections (CO workstation + customer hub financial, etc.) */
.hub-section,
.co-section {
  border: 1px solid var(--acertara-grey-light);
  border-radius: 4px;
  background: var(--acertara-white);
  margin: 0 0 0.75rem;
  padding: 0;
}
.hub-section > summary,
.co-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  font-family: var(--acertara-font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--acertara-black);
  user-select: none;
}
.hub-section > summary::-webkit-details-marker,
.co-section > summary::-webkit-details-marker { display: none; }
.hub-section > summary::before,
.co-section > summary::before {
  content: '▸';
  display: inline-block;
  width: 0.9rem;
  color: var(--acertara-grey);
  font-weight: 400;
  transition: transform 0.12s ease;
}
.hub-section[open] > summary::before,
.co-section[open] > summary::before {
  transform: rotate(90deg);
}
.hub-section > summary .hub-section-title,
.hub-section > summary .co-section-title,
.co-section > summary .co-section-title,
.co-section > summary .hub-section-title { flex: 1; }
.hub-section > summary .section-help,
.co-section > summary .section-help { margin-left: 0.15rem; }
.hub-section-body,
.co-section-body {
  padding: 0 0.7rem 0.75rem;
  border-top: 1px solid var(--acertara-grey-light);
}
.hub-section-body > :first-child,
.co-section-body > :first-child { margin-top: 0.65rem; }
.hub-section-body h3,
.co-section-body h3 { margin-top: 0; }

/* Guided tour (AWS-style coach marks) */
body.aemos-tour-active {
  overflow: hidden;
}
#aemos-tour-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}
#aemos-tour-root:not([hidden]) {
  pointer-events: auto;
}
.aemos-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.aemos-tour-spotlight {
  position: fixed;
  z-index: 1201;
  border-radius: 8px;
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, 0.55),
    0 0 0 3px var(--acertara-blue, #1a4480);
  background: transparent;
  pointer-events: none;
  transition: top 0.15s ease, left 0.15s ease, width 0.15s ease, height 0.15s ease, opacity 0.15s ease;
}
.aemos-tour-target {
  position: relative;
  z-index: 1202;
  border-radius: 6px;
}
.aemos-tour-coach {
  position: fixed;
  z-index: 1203;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--acertara-grey-light, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  padding: 0.85rem 1rem 0.9rem;
  font-family: var(--acertara-font-body, system-ui, sans-serif);
  color: var(--acertara-black, #111);
}
.aemos-tour-coach-docked {
  border-color: var(--acertara-blue, #1a4480);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}
.aemos-tour-progress {
  font-size: 0.75rem;
  color: var(--acertara-grey, #6b7280);
  margin-bottom: 0.35rem;
}
.aemos-tour-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-family: var(--acertara-font-heading, Georgia, serif);
}
.aemos-tour-body {
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
}
.aemos-tour-body p { margin: 0 0 0.5rem; }
.aemos-tour-body ul { margin: 0.25rem 0 0.5rem 1.1rem; padding: 0; }
.aemos-tour-body li { margin: 0.2rem 0; }
.aemos-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.aemos-tour-actions-right {
  display: flex;
  gap: 0.4rem;
}
.tour-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.tour-card {
  border: 1px solid var(--acertara-grey-light, #e5e7eb);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: #fff;
}
.tour-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.tour-card .tour-meta {
  font-size: 0.8rem;
  color: var(--acertara-grey, #6b7280);
  margin-bottom: 0.5rem;
}
.tour-card .tour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

