:root {
  --bg0: #1a1510;
  --bg1: #2a2118;
  --bg2: #3a2e22;
  --ink: #f4ebe0;
  --muted: #c4b3a0;
  --accent: #d9772e;
  --accent2: #7aa2a8;
  --ok: #6f9f6a;
  --warn: #c9a227;
  --err: #c45c4a;
  --line: rgba(244, 235, 224, 0.12);
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", Candara, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(217, 119, 46, 0.22), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(122, 162, 168, 0.18), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 45%, #17130f);
}

.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.top { display: flex; justify-content: space-between; gap: 1.5rem; align-items: end; margin-bottom: 1.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; color: var(--accent); margin: 0 0 0.35rem; }
.brand h1 { font-family: var(--font-display); font-size: 2.2rem; margin: 0; font-weight: 600; }
.tagline { color: var(--muted); margin: 0.35rem 0 0; }
nav { display: flex; flex-wrap: wrap; gap: 0.75rem; }
nav a, .button {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}
nav a:hover, .button:hover { border-color: var(--accent); color: #fff; }

.flashes { list-style: none; padding: 0; }
.flash { padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 0.75rem; }
.flash-success { background: rgba(111,159,106,0.2); border: 1px solid var(--ok); }
.flash-warning { background: rgba(201,162,39,0.18); border: 1px solid var(--warn); }
.flash-error { background: rgba(196,92,74,0.2); border: 1px solid var(--err); }

.hero-panel, .panel {
  background: linear-gradient(180deg, rgba(58,46,34,0.85), rgba(42,33,24,0.9));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.hero-panel { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.hero-panel h2, .panel h3 { font-family: var(--font-display); margin-top: 0; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.kpi-grid article {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
.label { margin: 0; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.value { margin: 0.35rem 0 0; font-size: 1.6rem; font-family: var(--font-display); }
.value.small { font-size: 1.05rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
a { color: var(--accent2); }

.refresh-form, .ask-form { display: grid; gap: 0.6rem; min-width: 220px; }
label { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.85rem; }
input, select, textarea, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.28);
  color: var(--ink);
  padding: 0.55rem 0.7rem;
}
button {
  background: linear-gradient(135deg, var(--accent), #b45309);
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.check { display: flex; align-items: center; gap: 0.5rem; }
.code { white-space: pre-wrap; background: rgba(0,0,0,0.35); padding: 0.9rem; border-radius: 12px; overflow: auto; }
.summary { font-size: 1.05rem; line-height: 1.45; }
.briefing { border-top: 1px solid var(--line); padding-top: 0.6rem; margin-top: 0.6rem; }
.kv { list-style: none; padding: 0; }
.kv li { display: grid; grid-template-columns: 120px 1fr; gap: 0.75rem; margin-bottom: 0.5rem; }
.hint { color: var(--muted); }
footer { color: var(--muted); margin-top: 2rem; font-size: 0.85rem; }

@media (max-width: 860px) {
  .top, .hero-panel, .two-col { display: grid; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kv li { grid-template-columns: 1fr; }
}


/* monthly-sales-report */
.report-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 0.75rem;
  align-items: end;
}
.table-scroll { overflow-x: auto; }
.num { text-align: right; white-space: nowrap; }
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.status-pass { color: var(--ok); }
.status-fail { color: var(--err); }
.status-warn { color: var(--warn); }
.row-flagged { background: rgba(201, 162, 39, 0.12); }
@media (max-width: 860px) {
  .report-filters { grid-template-columns: 1fr 1fr; }
}


/* compact-light-sales-report-v1 */
body.sales-report-page {
  --bg0: #f5f9fc;
  --bg1: #ffffff;
  --bg2: #eef7f4;
  --ink: #16324a;
  --muted: #60788b;
  --accent: #2476b9;
  --accent2: #16836b;
  --ok: #16836b;
  --warn: #a66a08;
  --err: #b63f48;
  --line: #d8e5ed;
  min-height: 100vh;
  color: var(--ink);
  /* replaced by page-atmosphere gradient */
  font-size: 13px;
}
.sales-report-page .page {
  max-width: none;
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
  padding: 7px 12px 10px;
}
.sales-report-page .top {
  min-height: 0;
  margin: 0 0 3px;
  gap: 8px;
  align-items: center;
}
.sales-report-page .eyebrow { display: none; }
.sales-report-page .brand h1 {
  margin: 0;
  color: #194d76;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 700;
}
.sales-report-page .tagline {
  margin: 1px 0 0;
  color: #6d8394;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}
.sales-report-page nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
}
.sales-report-page nav a,
.sales-report-page nav .button,
.sales-report-page nav .nav-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 22px;
  min-height: 22px;
  min-width: 0;
  margin: 0;
  padding: 0 7px;
  color: #2e5e7f;
  border: 1px solid #d6e4ed;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  vertical-align: middle;
}
.sales-report-page nav a:hover,
.sales-report-page nav .button:hover,
.sales-report-page nav .nav-logout-btn:hover {
  border-color: #63a6d3;
  color: #155f91;
  background: #edf7fd;
}
.sales-report-page nav .nav-account-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #2e5e7f;
  border-color: #cfe1ec;
  background: linear-gradient(180deg, #ffffff, #eef6fb);
  font-weight: 600;
  opacity: 1;
}
.sales-report-page nav .nav-account-link::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #56aadd, #2476b9);
  box-shadow: 0 0 0 2px rgba(36, 118, 185, 0.16);
}
.sales-report-page nav .nav-account-link:hover {
  color: #124b6c;
  border-color: #8fc0de;
  background: linear-gradient(180deg, #ffffff, #dcedf8);
  box-shadow: 0 1px 3px rgba(23, 77, 112, 0.16);
}
.sales-report-page .hero-panel,
.sales-report-page .panel {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(35, 84, 113, 0.04);
}
.sales-report-page .report-hero {
  display: block;
  margin: 0 0 4px;
  padding: 7px 11px 8px;
  border-left: 3px solid var(--rp-hero-accent, #4f82a6);
  background: linear-gradient(180deg, #ffffff, var(--rp-hero-face-end, #f7fbfd));
}
.sales-report-page .report-hero h2 {
  margin: 0;
  color: #195f91;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.sales-report-page .report-hero p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.25;
}
.sales-report-page .report-query {
  margin: 0 0 5px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #ffffff, var(--rp-query-face-end, #f9fbfd));
}
.sales-report-page .report-filters {
  display: grid;
  grid-template-columns: 1fr 1fr .8fr .65fr .8fr 1.25fr auto;
  gap: 5px;
  align-items: end;
}
.sales-report-page .report-filters label {
  gap: 1px;
  color: #597184;
  font-size: 9.5px;
  line-height: 1.05;
}
.sales-report-page input,
.sales-report-page select,
.sales-report-page textarea,
.sales-report-page button {
  min-height: 27px;
  border: 1px solid #cadce7;
  border-radius: 4px;
  padding: 3px 6px;
  color: #18384f;
  background: #fff;
  font-size: 11px;
  line-height: 1.15;
}
.sales-report-page input:focus {
  outline: 2px solid rgba(36, 118, 185, 0.16);
  border-color: #4d96c8;
}
.sales-report-page button {
  min-width: 78px;
  color: #fff;
  border-color: #2476b9;
  background: #2476b9;
  font-weight: 650;
}
.sales-report-page button:hover { background: #16836b; border-color: #16836b; }
.sales-report-page a.report-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 27px;
  min-width: 78px;
  padding: 3px 6px;
  border: 1px solid #2476b9;
  border-radius: 4px;
  color: #fff;
  background: #2476b9;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}
.sales-report-page a.report-action:visited { color: #fff; }
.sales-report-page a.report-action:hover {
  color: #fff;
  background: #16836b;
  border-color: #16836b;
  text-decoration: none;
}
.sales-report-page .sale-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  flex-shrink: 0;
}
.sales-report-page .sale-detail-actions .report-action {
  min-width: 120px;
}
.sale-detail-page .sale-detail-shell {
  max-width: 1180px;
  margin: 0 auto 28px;
  padding: 18px 18px 20px;
  border: 3px solid #1f4a3a;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(244, 248, 246, 0.96) 100%);
  box-shadow:
    0 0 0 1px rgba(180, 210, 195, 0.55) inset,
    0 0 0 1px rgba(12, 40, 30, 0.35),
    0 10px 28px rgba(18, 48, 38, 0.14);
  background-clip: padding-box;
  /* metallic dark-green edge */
  border-image: none;
  border-color: #16382c;
  outline: 1px solid rgba(120, 168, 145, 0.45);
  outline-offset: -5px;
}
@supports (background: linear-gradient(green, green)) {
  .sale-detail-page .sale-detail-shell {
    border: 3px solid transparent;
    background:
      linear-gradient(180deg, #ffffff 0%, #f4f8f6 100%) padding-box,
      linear-gradient(
        145deg,
        #8fb89f 0%,
        #2f5f4b 18%,
        #0f2e24 42%,
        #4a7a64 58%,
        #13281f 78%,
        #9bc4ad 100%
      ) border-box;
    outline: none;
    box-shadow:
      0 0 0 1px rgba(14, 40, 30, 0.45),
      0 12px 30px rgba(18, 48, 38, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.65);
  }
}
@media (max-width: 720px) {
  .sale-detail-page .sale-detail-shell {
    padding: 12px 10px 14px;
    border-radius: 10px;
  }
}
.sale-detail-page .sale-detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 14px;
  padding: 20px 22px;
  border-color: #c5d9e8;
  background:
    linear-gradient(135deg, rgba(36, 118, 185, 0.07), rgba(22, 131, 107, 0.05)),
    linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
}
.sale-detail-page .sale-detail-hero-main {
  min-width: 0;
  flex: 1 1 auto;
}
.sale-detail-page .sale-detail-hero .page-title-eyebrow {
  margin: 0 0 4px;
  color: #3f7ea8;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sale-detail-page .sale-detail-invoice-num {
  margin: 0;
  color: #173f5c;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.sale-detail-page .sale-detail-date {
  margin: 4px 0 0;
  color: #5a7386;
  font-size: 13px;
  font-weight: 500;
}
.sale-detail-page .sale-detail-account {
  margin: 14px 0 0;
  color: #0f3a57;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.sale-detail-page .sale-detail-account a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(36, 118, 185, 0.28);
}
.sale-detail-page .sale-detail-account a:hover {
  color: #1b5f96;
  border-bottom-color: rgba(27, 95, 150, 0.55);
}
.sale-detail-page .sale-detail-account-code {
  margin: 5px 0 0;
  color: #6a8498;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sale-detail-page .sale-detail-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.sale-detail-page .sale-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.sale-detail-page .sale-detail-btn-primary {
  color: #fff;
  background: #2476b9;
  border-color: #2476b9;
}
.sale-detail-page .sale-detail-btn-primary:hover {
  color: #fff;
  background: #1b5f96;
  border-color: #1b5f96;
}
.sale-detail-page .sale-detail-btn-ghost {
  color: #2f678c;
  background: rgba(255, 255, 255, 0.72);
  border-color: #c5d9e8;
}
.sale-detail-page .sale-detail-btn-ghost:hover {
  color: #15507a;
  background: #eef6fb;
  border-color: #9ebfd6;
}
@media (max-width: 720px) {
  .sale-detail-page .sale-detail-hero {
    flex-direction: column;
  }
  .sale-detail-page .sale-detail-actions {
    justify-content: flex-start;
  }
  .sale-detail-page .sale-detail-account {
    font-size: 1.4rem;
  }
}
.sale-detail-page .sale-detail-kpis {
  margin-bottom: 14px;
}
.sale-detail-page .sale-header-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-color: #d2e3ef;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfe 100%);
}
.sale-detail-page .sale-header-field dt {
  color: #3f7ea8;
}
.sale-detail-page .invoice-items-panel {
  margin-bottom: 18px;
  padding: 0;
  overflow: hidden;
  border-color: #cfe0ec;
  box-shadow: 0 4px 16px rgba(35, 84, 113, 0.06);
}
.sale-detail-page .invoice-items-panel .panel-heading-row {
  padding: 14px 16px;
  border-bottom: 1px solid #d9e7f0;
  background: linear-gradient(180deg, #f7fbfe 0%, #eef6fb 100%);
}
.sale-detail-page .invoice-items-panel h3 {
  margin: 0;
  color: #174d70;
}
.sale-detail-page .invoice-items-panel table {
  margin: 0;
}
.sale-detail-page .invoice-items-panel tbody tr.row-flagged {
  background: rgba(185, 72, 88, 0.06);
}
.sale-detail-page .sale-detail-columns {
  margin: 0;
  padding: 0;
  border-color: #d5e4ef;
  background: linear-gradient(180deg, #fbfcfe 0%, #f3f8fc 100%);
  box-shadow: none;
  opacity: 0.92;
}
.sale-detail-page .sale-detail-columns > summary {
  padding: 10px 14px;
  color: #4d6b80;
}
.sale-detail-page .sale-detail-columns .control-disclosure-title {
  color: #3d6480;
  font-size: 12px;
  font-weight: 650;
}
.sale-detail-page .sale-detail-columns .control-disclosure-hint {
  color: #7a93a6;
  font-size: 11px;
}
.sale-detail-page .sale-detail-columns .control-disclosure-content {
  padding: 4px 14px 14px;
}
.sale-detail-page .sale-detail-columns .column-config-item {
  border-color: #d7e7f2;
  background: #ffffff;
  color: #3f627a;
}
.sale-detail-page .sale-detail-columns .column-config-item.on {
  border-color: #9ec4df;
  background: #eaf5fc;
  color: #1f5f86;
}
.sale-detail-page .sale-detail-columns .column-config-actions button {
  background: #2476b9;
  border-color: #2476b9;
  color: #fff;
}
.sale-detail-page .sale-detail-columns .column-config-actions .button {
  color: #2f678c;
  border-color: #c5d9e8;
  background: #fff;
}
.sales-report-page.lisa-report-page .column-config-panel:not(.control-disclosure) {
  margin-left: 0;
  margin-right: 0;
  padding: 6px 8px;
}
.sales-report-page.lisa-report-page .column-config-panel:not(.control-disclosure) h3 {
  margin: 0 0 5px;
  font-size: 13px;
}
.sales-report-page.lisa-report-page .control-disclosure {
  margin-left: 0;
  margin-right: 0;
  padding: 0;
}
.sales-report-page.lisa-report-page .column-config-grid {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 3px 6px;
  margin: 0 0 6px;
  align-items: stretch;
}
.sales-report-page.lisa-report-page .column-config-item {
  gap: 6px;
  min-height: 22px;
  padding: 2px 6px;
  font-size: 10.5px;
  line-height: 1.2;
}
.sales-report-page.lisa-report-page .column-config-item input {
  width: 13px;
  height: 13px;
}
.sales-report-page.lisa-report-page .lisa-special-checks,
.sales-report-page .salesperson-config-panel .lisa-special-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 3px 6px;
  margin: 0 0 6px;
}
.sales-report-page.lisa-report-page .lisa-special-checks .column-config-item,
.sales-report-page .salesperson-config-panel .lisa-special-checks .column-config-item {
  white-space: normal;
}
.sales-report-page.lisa-report-page .salesperson-config-panel .column-config-grid,
.sales-report-page .salesperson-config-panel .column-config-grid {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 3px 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 2px;
}
.sales-report-page .salesperson-config-panel .column-config-item {
  gap: 6px;
  min-height: 22px;
  padding: 2px 6px;
  font-size: 10.5px;
  line-height: 1.2;
}
.sales-report-page.lisa-report-page .column-config-actions {
  gap: 5px;
  margin-top: 2px;
}
.sales-report-page .kpi-grid {
  gap: 5px;
  margin: 0 0 5px;
}
.sales-report-page .kpi-grid article {
  min-height: 45px;
  padding: 5px 8px;
  border: 1px solid #dbe8ef;
  border-radius: 6px;
  background: #fff;
}
.sales-report-page .label {
  color: #658094;
  font-size: 8.5px;
  letter-spacing: .06em;
}
.sales-report-page .value {
  margin: 1px 0 0;
  color: #176f60;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}
.sales-report-page .value.small { font-size: 11px; }
.sales-report-page .panel {
  margin-bottom: 5px;
  padding: 7px 9px;
}
.sales-report-page .panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.sales-report-page .panel-heading-row h3 {
  margin: 0;
}
.sales-report-page .panel h3 {
  margin: 0 0 4px;
  color: #245c80;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.15;
}
.sales-report-page .two-col { gap: 5px; }
.sales-report-page table { font-size: 10.5px; }
.sales-report-page th,
.sales-report-page td {
  padding: 3px 4px;
  border-bottom: 1px solid #e4edf2;
  line-height: 1.15;
}
.sales-report-page th {
  color: #587287;
  background: #f7fafc;
}
.sales-report-page tbody tr:hover { background: var(--rp-row-hover, #f1f8fb); }
.sales-report-page a { color: #176fa8; }
.sales-report-page #exact-sales {
  scroll-margin-top: 12px;
}
.sales-report-page .kv { margin: 0; }
.sales-report-page .kv li {
  grid-template-columns: 52px 1fr;
  gap: 5px;
  margin-bottom: 3px;
}
.sales-report-page .sale-header-panel h3 { margin-bottom: 8px; }
.sales-report-page .sale-header-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
  width: 100%;
}
.sales-report-page .sale-header-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sales-report-page .sale-header-field-wide {
  grid-column: span 2;
}
.sales-report-page .sale-header-field dt {
  margin: 0;
  color: #658094;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sales-report-page .sale-header-field dd {
  margin: 0;
  color: var(--rp-text, #18384f);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.sales-report-page .account-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(240px, .85fr);
  gap: 5px;
}
.sales-report-page .account-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.sales-report-page .account-section-heading h3 {
  margin: 1px 0 0;
}
.sales-report-page .account-section-heading .eyebrow {
  margin: 0;
  color: #6f8797;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sales-report-page .account-date-range {
  flex: 0 0 auto;
  color: #6f8797;
  font-size: 9.5px;
  white-space: nowrap;
}
.sales-report-page .account-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px 16px;
  margin: 0;
}
.sales-report-page .account-facts div {
  min-width: 0;
}
.sales-report-page .account-facts dt,
.sales-report-page .account-metric-list span {
  color: #6c8393;
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.sales-report-page .account-facts dd {
  margin: 2px 0 0;
  color: var(--rp-text, #18384f);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
}
.sales-report-page .account-metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.sales-report-page .account-metric-list div {
  padding: 6px 7px;
  border: 1px solid #e3edf2;
  border-radius: 5px;
  background: #f9fbfc;
}
.sales-report-page .account-metric-list span,
.sales-report-page .account-metric-list strong {
  display: block;
}
.sales-report-page .account-metric-list strong {
  margin-top: 2px;
  color: #176f60;
  font-size: 13px;
}
.sales-report-page .account-item-history {
  border-color: #d4e7df;
}
@media (max-width: 900px) {
  .sales-report-page .sale-header-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sales-report-page .sale-header-field-wide {
    grid-column: span 2;
  }
  .sales-report-page .account-insights-grid {
    grid-template-columns: 1fr;
  }
  .sales-report-page .account-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .sales-report-page .sale-header-grid {
    grid-template-columns: 1fr;
  }
  .sales-report-page .sale-header-field-wide {
    grid-column: auto;
  }
  .sales-report-page .account-facts,
  .sales-report-page .account-metric-list {
    grid-template-columns: 1fr;
  }
}
.sales-report-page footer {
  margin-top: 7px;
  color: #718797;
  font-size: 9px;
}
.sales-report-page footer p { margin: 0; }
.sales-report-page .status-pass { color: #16836b; }
.sales-report-page .status-fail { color: #b63f48; }
.sales-report-page .status-warn { color: #a66a08; }
.sales-report-page .row-flagged { background: #fdf3df; }

@media (max-width: 1050px) {
  .sales-report-page .top { align-items: start; }
  .sales-report-page .report-filters {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }
}
@media (max-width: 680px) {
  .sales-report-page .top { display: grid; }
  .sales-report-page nav { justify-content: flex-start; }
  .sales-report-page .tagline { white-space: normal; }
  .sales-report-page .report-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .sales-report-page .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .sales-report-page .tagline,
  .sales-report-page .report-hero p { display: none; }
  .sales-report-page .report-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* short-receivables-report */
.sales-report-page .receivable-filters {
  grid-template-columns: .85fr 1fr 1fr .7fr .8fr 1fr auto auto auto;
}
.sales-report-page .inline-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  white-space: nowrap;
}
.sales-report-page .inline-check input[type="checkbox"] {
  min-height: 0;
  width: 13px;
  height: 13px;
  margin: 0;
}
.sales-report-page .column-config { margin-top: 5px; }
.sales-report-page .column-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.sales-report-page .column-toggles .inline-check {
  min-height: 18px;
  font-size: 10px;
}
.sales-report-page [hidden] { display: none !important; }

@media (max-width: 1150px) {
  .sales-report-page .receivable-filters {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }
}
@media (max-width: 680px) {
  .sales-report-page .receivable-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* sales-sort-controls */
.sort-controls {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}
.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 18px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #8aa0b2;
  font-size: 10px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.85;
}
button.sort-button {
  font: inherit;
  font-size: 10px;
  appearance: none;
}
.sort-button:hover {
  opacity: 1;
  color: #2f719c;
  background: rgba(47, 113, 156, 0.1);
  border-color: rgba(47, 113, 156, 0.22);
}
.sort-button.active {
  opacity: 1;
  color: #1f5f86;
  background: rgba(47, 113, 156, 0.12);
  border-color: rgba(47, 113, 156, 0.28);
  font-weight: 700;
}

.sales-report-page th {
  white-space: nowrap;
}
.sales-report-page th .sort-controls {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  vertical-align: middle;
}
.sales-report-page .sort-button {
  min-width: 18px;
  width: 18px;
  height: 18px;
  font-size: 10px;
  color: #8aa0b2;
}
.sales-report-page .sort-button:hover {
  color: #2f719c;
  background: rgba(47, 113, 156, 0.1);
  border-color: rgba(47, 113, 156, 0.22);
}
.sales-report-page .sort-button.active {
  color: #1f5f86;
  background: rgba(47, 113, 156, 0.12);
  border-color: rgba(47, 113, 156, 0.28);
  font-weight: 700;
}
.sales-report-page .sort-button.active:hover {
  color: #2f719c;
  background: rgba(47, 113, 156, 0.14);
  border-color: rgba(47, 113, 156, 0.28);
}
/* Prevent visited-link purple/blue from making Date desc look different */
.sales-report-page th .sort-button,
.sales-report-page th .sort-button:visited,
.sales-report-page th .sort-button:link {
  color: #8aa0b2;
}
.sales-report-page th .sort-button.active,
.sales-report-page th .sort-button.active:visited {
  color: #1f5f86;
}

/* Shared data-table polish (report + admin surfaces) */
.sales-report-page .results-table-panel,
.sales-report-page .comparison-panel,
.admin-settings-page .admin-users-panel,
.admin-settings-page .admin-roster-panel,
.system-health-page .panel.table-scroll {
  overflow: hidden;
}
.sales-report-page table,
.admin-settings-page .admin-users-table,
.system-health-page table,
.ask-page table {
  border-collapse: separate;
  border-spacing: 0;
}
.sales-report-page thead th,
.admin-settings-page .admin-users-table thead th,
.system-health-page thead th,
.ask-page thead th {
  position: relative;
  padding: 11px 14px;
  border-bottom: 2px solid #c5d7e4;
  background: linear-gradient(180deg, #f7fbfe 0%, #eef5fa 100%);
  color: #3d5f78;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}
.sales-report-page tbody td,
.admin-settings-page .admin-users-table tbody td,
.system-health-page tbody td,
.ask-page tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #e2ebf1;
  vertical-align: middle;
}
.sales-report-page tbody tr:nth-child(even),
.admin-settings-page .admin-users-table tbody tr:nth-child(even),
.system-health-page tbody tr:nth-child(even),
.ask-page tbody tr:nth-child(even) {
  background: rgba(238, 246, 251, 0.55);
}
.sales-report-page tbody tr:hover,
.admin-settings-page .admin-users-table tbody tr:hover,
.system-health-page tbody tr:hover,
.ask-page tbody tr:hover {
  background: #eef6fb;
}
.sales-report-page thead th.is-sorted,
.admin-settings-page thead th.is-sorted,
.ask-page thead th.is-sorted {
  color: #1f4b63;
  background: #e7f1f7;
}
.sales-report-page th.num .sort-controls {
  margin-left: 8px;
  margin-right: 0;
}

/* auth-stealth */
body.auth-stealth {
  margin: 0;
  min-height: 100vh;
  color: #e8ecef;
  font-family: "Avenir Next", "Segoe UI", Candara, sans-serif;
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(90, 120, 140, 0.18), transparent 58%),
    radial-gradient(800px 480px at 88% 78%, rgba(40, 55, 65, 0.55), transparent 55%),
    linear-gradient(165deg, #0b0e11 0%, #12171c 48%, #0a0d10 100%);
}
.stealth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}
.stealth-hero {
  text-align: center;
  max-width: 46rem;
  width: min(92vw, 46rem);
  padding-inline: 1.5rem;
  animation: stealth-rise 0.9s ease both;
}
.splash-page .stealth-hero {
  max-width: 64rem;
  width: min(98vw, 64rem);
}
.stealth-mark {
  margin: 0;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #8a9aa8;
}
.stealth-brand {
  margin: 0.55rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 5.2vw, 3.4rem);
  letter-spacing: 0.02em;
  color: #f2f5f7;
  white-space: nowrap;
}
.splash-page .stealth-brand {
  font-size: clamp(2.1rem, 4.8vw, 3.35rem);
  letter-spacing: 0.04em;
}
.stealth-line {
  margin: 0.65rem 0 0;
  color: #6f7f8c;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.stealth-line-muted {
  margin-top: 1.1rem;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: #566370;
}
.stealth-actions {
  margin-top: 2.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.stealth-cta {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border: 1px solid rgba(232, 236, 239, 0.22);
  border-radius: 2px;
  color: #f2f5f7;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.stealth-cta-secondary {
  border-color: rgba(232, 236, 239, 0.12);
  color: #c5d0d8;
}
.stealth-cta:hover {
  border-color: rgba(232, 236, 239, 0.55);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}
.stealth-switch {
  margin: 1.1rem 0 0;
  color: #7a8a97;
  font-size: 0.84rem;
  text-align: center;
  line-height: 1.45;
}
.stealth-switch a {
  color: #d7e2ea;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.stealth-switch-muted {
  margin-top: 0.45rem;
  font-size: 0.78rem;
}
.stealth-switch-muted a {
  color: #8a9aa8;
  text-decoration: none;
}
.user-title {
  color: inherit;
  opacity: 0.78;
  font-weight: 500;
}
.stealth-panel {
  width: min(100%, 22.5rem);
  padding: 1.75rem 1.5rem 1.35rem;
  border: 1px solid rgba(232, 236, 239, 0.1);
  border-radius: 4px;
  background: rgba(10, 13, 16, 0.72);
  backdrop-filter: blur(10px);
  animation: stealth-rise 0.7s ease both;
}
.stealth-panel-head h1 {
  margin: 0.35rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.7rem;
  font-weight: 500;
}
.stealth-sub {
  margin: 0.35rem 0 0;
  color: #7a8a97;
  font-size: 0.88rem;
}
.stealth-sub-muted {
  font-size: 0.76rem;
  color: #566370;
}
.stealth-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.35rem;
}
.stealth-form label {
  display: grid;
  gap: 0.3rem;
  color: #93a2ae;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stealth-form input {
  font: inherit;
  color: #eef2f5;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(232, 236, 239, 0.14);
  border-radius: 3px;
  padding: 0.65rem 0.75rem;
}
.stealth-form input:focus {
  outline: none;
  border-color: rgba(180, 200, 215, 0.55);
  box-shadow: 0 0 0 3px rgba(120, 150, 170, 0.15);
}
.stealth-form button {
  margin-top: 0.35rem;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0b0e11;
  background: #d7dee4;
  border: none;
  border-radius: 3px;
  padding: 0.72rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.stealth-form button:hover { background: #f0f4f7; }
.stealth-error {
  margin: 1rem 0 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(196, 92, 74, 0.45);
  background: rgba(196, 92, 74, 0.12);
  color: #f0c4bc;
  font-size: 0.88rem;
}
.stealth-success {
  margin: 1rem 0 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(88, 166, 122, 0.45);
  background: rgba(88, 166, 122, 0.12);
  color: #bfe6cf;
  font-size: 0.88rem;
}
.stealth-foot {
  margin: 1.1rem 0 0;
  text-align: center;
}
.stealth-foot a {
  color: #8a9aa8;
  text-decoration: none;
  font-size: 0.85rem;
}
.stealth-foot a:hover { color: #d7dee4; }
@keyframes stealth-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-logout {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.account-settings-page .account-settings-header {
  margin-bottom: 16px;
}
.account-settings-page .account-card {
  max-width: 520px;
  margin-bottom: 14px;
}
.account-settings-page .account-dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
.account-settings-page .account-dl div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: baseline;
}
.account-settings-page .account-dl dt {
  margin: 0;
  color: #5a7386;
  font-size: 12px;
  font-weight: 650;
}
.account-settings-page .account-dl dd {
  margin: 0;
  color: #1f3f55;
}
.account-settings-page .account-form {
  display: grid;
  gap: 12px;
  max-width: 360px;
}
.account-settings-page .account-form label {
  display: grid;
  gap: 5px;
  color: #4a6578;
  font-size: 12px;
  font-weight: 600;
}
.account-settings-page .account-form input {
  padding: 9px 11px;
}
.account-settings-page .account-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.account-settings-page .totp-setup-qr {
  margin: 12px 0;
}
.account-settings-page .totp-setup-qr img {
  display: block;
  border: 1px solid #d5e3ec;
  border-radius: 8px;
  background: #fff;
}
.account-settings-page .totp-secret-line {
  font-size: 12px;
  color: #3d5f78;
  word-break: break-all;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: 0;
}
.danger-btn {
  background: #b63f48 !important;
  border-color: #b63f48 !important;
  color: #fff !important;
}

/* admin-settings */
.admin-settings-page main {
  max-width: 1320px;
  margin-inline: auto;
}
.admin-page-shell {
  margin: 0 0 28px;
  padding: 3px;
  border: 1px solid #4a0f16;
  border-radius: 16px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 22%),
    linear-gradient(155deg, #6e131b 0%, #93202a 28%, #4a0e14 52%, #7a1a22 74%, #33080d 100%);
  box-shadow:
    0 10px 28px rgba(50, 8, 12, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.admin-page-shell-inner {
  padding: 22px 24px 26px;
  border: 1px solid #ddc9cb;
  border-radius: 13px;
  background:
    linear-gradient(180deg, #fbf8f8 0%, #f5eff0 140px, #efe8e9 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.admin-settings-page .admin-settings-header {
  margin-bottom: 22px;
  padding: 18px 22px;
  border-color: #e3d0d2;
  background: linear-gradient(135deg, #fff 0%, #faf1f2 100%);
}
.admin-settings-page .admin-settings-header h2 {
  margin: 0;
  color: #174d70;
  font-size: 22px;
  letter-spacing: -.015em;
}
.admin-settings-lead {
  margin: 6px 0 0;
  color: #5a7386;
  font-size: 13px;
  line-height: 1.4;
}
.admin-settings-section {
  margin-bottom: 22px;
}
.admin-section-label {
  margin: 0 0 10px;
}
.admin-section-label h3 {
  margin: 0;
  color: #3d5f78;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.admin-settings-page .admin-card,
.admin-settings-page .admin-users-panel,
.admin-settings-page .admin-permissions-panel,
.admin-settings-page .admin-roster-panel {
  margin: 0;
  padding: 18px 20px;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(35, 84, 113, .07);
}
.admin-settings-page .admin-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}
.admin-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}
.admin-settings-page .admin-card-heading h3 {
  margin: 0;
  color: #174d70;
  font-size: 15px;
  font-weight: 700;
}
.admin-status-badge,
.admin-count-badge,
.admin-you-badge,
.admin-protected-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.admin-status-badge {
  padding: 6px 9px;
}
.admin-status-badge.is-restricted {
  color: #126752;
  background: #e5f6ef;
  border: 1px solid #b9e2d5;
}
.admin-status-badge.is-expanded {
  color: #8a5708;
  background: #fff3d9;
  border: 1px solid #ead29d;
}
.admin-status-badge.is-neutral {
  color: #37556b;
  background: #eef3f7;
  border: 1px solid #cddbe5;
}
.admin-settings-page .admin-card-note {
  margin: 0;
  color: #5a7386;
  font-size: 0.8rem;
  line-height: 1.5;
}
.admin-settings-page .admin-card-note-lead {
  margin: 0 0 4px;
}
.admin-settings-page .admin-card-note-warn {
  color: #92400e;
  background: rgba(146, 64, 14, 0.08);
  border: 1px solid rgba(146, 64, 14, 0.18);
  border-radius: 6px;
  padding: 8px 12px;
}
.admin-settings-page .admin-roster-panel {
  margin-bottom: 22px;
}
.admin-theme-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #294d65;
  font-size: 13px;
  font-weight: 600;
}
.admin-settings-page .admin-theme-select select {
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid #b8ccd9;
  border-radius: 6px;
  background: #fff;
  color: #294d65;
  font-size: 13px;
  font-weight: 600;
}
.admin-scope-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  margin-top: auto;
}
.admin-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #294d65;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.admin-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.admin-switch-track {
  position: relative;
  width: 38px;
  height: 21px;
  flex: 0 0 auto;
  border: 1px solid #b8ccd9;
  border-radius: 999px;
  background: #dbe6ec;
  transition: background .18s ease, border-color .18s ease;
}
.admin-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(21, 60, 84, .25);
  transition: transform .18s ease;
}
.admin-switch input:checked + .admin-switch-track {
  border-color: #d2a84e;
  background: #d9a83f;
}
.admin-switch input:checked + .admin-switch-track::after {
  transform: translateX(17px);
}
.admin-switch input:focus-visible + .admin-switch-track {
  outline: 2px solid #438fbe;
  outline-offset: 2px;
}
.admin-settings-page .admin-scope-form button,
.admin-settings-page .admin-create-form button {
  border-color: #2375a8;
  color: #fff;
  background: #2375a8;
  font-weight: 700;
  white-space: nowrap;
}
.admin-settings-page .admin-scope-form button:hover,
.admin-settings-page .admin-create-form button:hover {
  border-color: #175b85;
  background: #175b85;
}
.admin-create-form {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.1fr 1fr auto;
  gap: 14px 16px;
  align-items: end;
}
.admin-create-form .admin-create-jwt {
  grid-column: 1 / -1;
}
.admin-create-form textarea,
.admin-jwt-form textarea,
.account-settings-page .account-form textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #b8ccd9;
  border-radius: 6px;
  background: #fff;
  color: #294d65;
  font: inherit;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}
.admin-jwt-form {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.admin-jwt-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  padding: 4px 7px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.3;
  resize: vertical;
  white-space: nowrap;
}
.admin-jwt-form textarea:focus {
  height: 60px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.admin-jwt-form button {
  flex: 0 0 auto;
  padding: 5px 8px;
  font-size: 10.5px;
}
.admin-create-form label {
  display: grid;
  gap: 6px;
  color: #4a6578;
  font-size: 12px;
  font-weight: 600;
}
.admin-create-actions {
  display: flex;
  align-items: end;
}
.admin-settings-page .admin-create-form input,
.admin-settings-page .admin-create-form select {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
}
.admin-settings-page .admin-users-panel {
  margin-bottom: 22px;
  padding: 0;
  overflow: hidden;
}
.admin-users-panel .admin-card-heading {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid #d9e5ec;
  background: #f8fbfd;
}
.admin-count-badge {
  min-width: 24px;
  padding: 5px 7px;
  color: #276281;
  background: #e6f1f7;
}
.admin-settings-page .admin-users-table {
  width: 100%;
  margin: 0;
}
.admin-settings-page .admin-users-panel .admin-users-table {
  table-layout: fixed;
}
.admin-users-panel .col-user { width: 15%; }
.admin-users-panel .col-title { width: 8%; }
.admin-users-panel .col-email { width: 15%; }
.admin-users-panel .col-invite { width: 6%; }
.admin-users-panel .col-role { width: 10%; }
.admin-users-panel .col-jwt { width: 23%; }
.admin-users-panel .col-lastlogin { width: 9%; }
.admin-users-panel .col-created { width: 9%; }
.admin-users-panel .col-action { width: 5%; }
.admin-settings-page .admin-users-table th {
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  color: #587286;
  background: #f4f8fa;
  font-size: 9.5px;
  letter-spacing: .03em;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}
.admin-settings-page .admin-users-table td {
  height: 40px;
  padding: 5px 8px;
  overflow: hidden;
  vertical-align: middle;
  font-size: 11.5px;
}
.admin-settings-page .admin-users-table tbody tr:hover {
  background: #f5fafc;
}
.admin-cell-ellipsis {
  display: block;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-identity {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}
.admin-user-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, #3b83ad, #256384);
  font-size: 10px;
  font-weight: 800;
}
.admin-user-name {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-you-badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  color: #246885;
  background: #e6f3f8;
}
.admin-protected-label {
  padding: 5px 8px;
  color: #60788b;
  background: #edf2f5;
  font-size: 9.5px;
  white-space: nowrap;
}
.admin-settings-page .admin-users-table select {
  width: 100%;
  min-width: 0;
  padding: 5px 6px;
  font-size: 11px;
}
.admin-settings-page .col-lastlogin span,
.admin-settings-page .col-created span {
  color: #587286;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.admin-settings-page .col-action .danger-btn {
  padding: 5px 9px;
  font-size: 10.5px;
  white-space: nowrap;
}
.admin-settings-page .admin-permissions-panel {
  padding: 0;
  overflow: hidden;
}
.admin-settings-page .admin-permissions-panel.control-disclosure {
  border-left-width: 3px;
}
.admin-permissions-panel .table-scroll,
.admin-roster-panel .table-scroll {
  border-top: 1px solid #d9e5ec;
}
.admin-permissions-panel table {
  margin: 0;
}
@media (max-width: 1100px) {
  .admin-settings-grid {
    grid-template-columns: 1fr;
  }
  .admin-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-create-actions {
    grid-column: 1 / -1;
  }
}
@media (max-width: 680px) {
  .admin-page-shell {
    border-radius: 12px;
  }
  .admin-page-shell-inner {
    padding: 14px 12px 18px;
    border-radius: 10px;
  }
  .admin-settings-page .admin-card,
  .admin-settings-page .admin-users-panel,
  .admin-settings-page .admin-permissions-panel,
  .admin-settings-page .admin-roster-panel {
    border-radius: 8px;
  }
  .admin-create-form {
    grid-template-columns: 1fr;
  }
  .admin-scope-form {
    align-items: stretch;
    flex-direction: column;
  }
}

/* page-atmosphere — fixed silvery page wash */
body.page-atmosphere {
  background-color: #e4e7ec;
  background-image: linear-gradient(
    180deg,
    #f3f4f6 0px,
    #e8eaee 200px,
    #d9dde4 55%,
    #c5cad3 100%
  );
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

body.sales-report-page.page-atmosphere {
  background-color: #e4e7ec;
  background-image: linear-gradient(
    180deg,
    #f3f4f6 0px,
    #e8eaee 200px,
    #d9dde4 55%,
    #c5cad3 100%
  );
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* Admin Settings — a touch darker/warmer than the rest of the app, on
   every theme, as a quiet visual cue that you're in a privileged area. */
body.sales-report-page.admin-settings-page.page-atmosphere {
  background-color: #cdc4c5;
  background-image: linear-gradient(
    180deg,
    #e2dcdc 0px,
    #d2c9ca 200px,
    #beb2b3 55%,
    #a59496 100%
  );
}

.status-footer p,
.sales-report-page .status-footer p {
  margin: 0;
  line-height: 1.35;
  max-width: 100%;
}
.sales-report-page .status-footer {
  margin-top: 10px;
  color: #5f7384;
  font-size: 9.5px;
}

/* weekly/numeric header alignment */
.sales-report-page th.num {
  text-align: right;
  white-space: nowrap;
}

/* date-range menu (sales report) */
.sales-report-page .range-menu {
  position: relative;
  display: inline-block;
  align-self: end;
}
.sales-report-page .range-menu-btn {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 27px;
  min-width: 78px;
  margin: 0;
  padding: 3px 10px;
  border: 1px solid #9eb6c9;
  border-radius: 4px;
  background: linear-gradient(180deg, #eef5fb 0%, #d9e7f3 100%);
  color: #3a5f7a;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sales-report-page .range-menu-btn::-webkit-details-marker { display: none; }
.sales-report-page .range-menu-btn::marker { content: ""; }
.sales-report-page .range-menu-btn:hover {
  border-color: #7aa0bc;
  background: linear-gradient(180deg, #f5f9fc 0%, #e4eef7 100%);
  color: #2d516a;
}
.sales-report-page .range-menu[open] .range-menu-btn {
  border-color: #6b92b0;
  background: #e3eef7;
}
.sales-report-page .range-menu-caret {
  font-size: 10px;
  opacity: 0.75;
}
.sales-report-page .range-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 220px;
  padding: 6px;
  border: 1px solid #c5d7e4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(22, 50, 74, 0.14);
}
.sales-report-page .range-menu-heading,
.sales-report-page .range-menu-foot {
  margin: 0;
  padding: 4px 8px;
  color: #6d8394;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sales-report-page .range-menu-foot {
  margin-top: 4px;
  text-transform: none;
  letter-spacing: 0;
  border-top: 1px solid #e4edf2;
  padding-top: 6px;
}
.sales-report-page .range-menu-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #18384f;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.sales-report-page .range-menu-item:hover {
  background: var(--rp-hover-bg, #edf5fb);
  color: var(--rp-hover-text, #155f91);
}
.sales-report-page .range-menu-item.active {
  background: var(--rp-active-bg, #e7f2fa);
  box-shadow: inset 2px 0 0 var(--rp-active-border, #5b8fb5);
}
.sales-report-page .range-menu-item-label {
  font-size: 12px;
  font-weight: 650;
}
.sales-report-page .range-menu-item-hint {
  color: #6d8394;
  font-size: 10px;
}

/* deleted-sales under construction */
.deleted-sales-page .under-construction-panel {
  max-width: 36rem;
  margin-top: 0.25rem;
}
.deleted-sales-page .under-construction-table {
  width: 100%;
  border-collapse: collapse;
}
.deleted-sales-page .under-construction-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.22);
  background: rgba(148, 163, 184, 0.08);
}
.deleted-sales-page .under-construction-table td {
  padding: 1.75rem 1.15rem 1.9rem;
  text-align: center;
  vertical-align: middle;
  color: #475569;
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.55),
    rgba(241, 245, 249, 0.35)
  );
}
.deleted-sales-page .under-construction-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: #334155;
  letter-spacing: 0.01em;
}
.deleted-sales-page .under-construction-note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

/* compact in-table filter buttons */
.sales-report-page td .button,
.sales-report-page td a.table-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 18px;
  min-height: 18px;
  min-width: 0;
  margin: 0;
  padding: 0 6px;
  border: 1px solid #c5d9e8;
  border-radius: 3px;
  background: #f7fbfe;
  color: #2a6286;
  font-size: 10px;
  font-weight: 550;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}
.sales-report-page td .button:hover,
.sales-report-page td a.table-filter:hover {
  border-color: var(--rp-hover-border, #63a6d3);
  color: var(--rp-hover-text, #155f91);
  background: var(--rp-hover-bg, #edf7fd);
}

/* ask-page sales-report styling */
.ask-page .ask-form {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 6px 8px;
  align-items: end;
}
.ask-page .ask-form .ask-question {
  grid-column: 1 / -1;
}
.ask-page .ask-form .ask-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #597184;
  font-size: 10.5px;
  line-height: 1.2;
  padding-bottom: 4px;
}
.ask-page .ask-form .ask-check input {
  min-height: 0;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
}
.ask-page .ask-form textarea {
  min-height: 66px;
  resize: vertical;
  width: 100%;
}
.ask-page .ask-form button {
  justify-self: start;
  align-self: end;
}
.ask-page .ask-result-panel h4 {
  margin: 8px 0 3px;
  color: #245c80;
  font-family: var(--font-body);
  font-size: 12px;
}
.ask-page .ask-list {
  margin: 0 0 6px;
  padding-left: 1.1rem;
  color: #18384f;
  font-size: 11px;
  line-height: 1.35;
}
.ask-page .summary {
  margin: 4px 0 8px;
  color: #18384f;
  font-size: 12px;
  line-height: 1.4;
}
.ask-page .briefing {
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 1px solid #e4edf2;
  border-radius: 5px;
  background: #f8fbfd;
  font-size: 11px;
}
.ask-page .briefing p { margin: 3px 0 0; color: #334155; }
.ask-page .ask-code {
  margin: 4px 0 0;
  padding: 8px;
  border: 1px solid #dbe8ef;
  border-radius: 5px;
  background: #f4f8fb;
  color: #18384f;
  font-size: 10.5px;
  line-height: 1.35;
  overflow: auto;
  max-height: 320px;
}
.ask-page .ask-raw {
  margin-top: 8px;
  color: #597184;
  font-size: 11px;
}
.ask-page .ask-raw summary {
  cursor: pointer;
  color: #2a6286;
}
@media (max-width: 820px) {
  .ask-page .ask-form {
    grid-template-columns: 1fr;
  }
}

/* ask-pipeline extras */
.ask-page .ask-form {
  grid-template-columns: 1fr auto auto;
}
.ask-page .ask-form .ask-question { grid-column: 1 / -1; }
@media (max-width: 820px) {
  .ask-page .ask-form { grid-template-columns: 1fr; }
}

.ask-page .ask-alpha-note {
  display: none;
}

.ask-page .ask-open-btn {
  justify-self: start;
  padding: 8px 16px;
  border: 1px solid #1f2937;
  border-radius: 0;
  background: #111827;
  color: #f9fafb;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.ask-page .ask-open-btn:hover,
.ask-page .ask-open-btn:focus-visible {
  background: #000;
}

.ask-page .ask-history-panel {
  padding-top: 18px;
  padding-bottom: 10px;
}
.ask-page .ask-history-heading {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
}
.ask-page .ask-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ask-page .ask-history-row {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.ask-page .ask-history-row:last-child {
  border-bottom: none;
}
.ask-page .ask-history-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  padding: 13px 2px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
.ask-page .ask-history-link:hover,
.ask-page .ask-history-link:focus-visible {
  background: rgba(15, 23, 42, 0.02);
}
.ask-page .ask-history-question {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-style: italic;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: #1f2937;
}
.ask-page .ask-history-link:hover .ask-history-question {
  color: #0f172a;
}
.ask-page .ask-history-stamp {
  font-family: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  white-space: nowrap;
  padding-top: 3px;
}
.ask-page .ask-history-link:hover .ask-history-stamp {
  color: #6b7280;
}

/* exact-sales column config */
.sales-report-page .invoice-column-config {
  margin-left: 0;
  margin-right: 0;
}
.sales-report-page .invoice-column-config h3 {
  margin-bottom: 6px;
}
.sales-report-page .invoice-items-panel {
  margin-left: 0;
  margin-right: 0;
}
.sales-report-page .column-config-hint {
  margin: 0 0 7px;
  font-size: 10px;
  line-height: 1.3;
}
.sales-report-page .column-config-hint code {
  font-size: 9.5px;
  color: #3d6680;
}
.sales-report-page .column-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 2px 4px;
  margin: 0 0 8px;
}
.sales-report-page .column-config-item {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 3px 5px;
  border: 1px solid #e2ebf1;
  border-radius: 3px;
  background: #fbfcfd;
  color: #4a6578;
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.sales-report-page .column-config-item.on {
  border-color: #c5d9e8;
  background: #f3f8fc;
  color: #2a5472;
}
.sales-report-page .column-config-item input {
  min-height: 0;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}
.sales-report-page .column-config-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.sales-report-page .column-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.sales-report-page .column-config-actions .button,
.sales-report-page a.column-config-reset {
  display: inline-flex;
  align-items: center;
  height: 27px;
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid #cadce7;
  border-radius: 4px;
  background: #fff;
  color: #18384f;
  font-size: 11px;
  text-decoration: none;
}
.sales-report-page a.column-config-reset:hover {
  border-color: var(--rp-hover-border, #63a6d3);
  color: var(--rp-hover-text, #155f91);
  background: var(--rp-hover-bg, #edf7fd);
}

/* ask chat history + answer focus */
.ask-page .ask-answer-text {
  margin: 6px 0 10px;
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.45;
  color: #18384f;
}
.ask-page .ask-pipeline-details {
  margin-top: 4px;
}
/* Collapsed OpenWebUI chat history (Ask hub) */
.ask-page .ask-owui-history {
  padding: 10px 14px;
}
.ask-page .ask-owui-history-details {
  margin: 0;
}
.ask-page .ask-owui-history-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 2px 0;
  color: #3a1d63;
  font-weight: 650;
  font-size: 13px;
}
.ask-page .ask-owui-history-details > summary::-webkit-details-marker {
  display: none;
}
.ask-page .ask-owui-history-details > summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: #9b6fd9;
  transition: transform 0.12s ease;
}
.ask-page .ask-owui-history-details[open] > summary::before {
  transform: rotate(90deg);
}
.ask-page .ask-owui-history-summary-title {
  flex: 1;
}
.ask-page .ask-owui-history-summary-meta {
  font-weight: 550;
  font-size: 11px;
  color: #8a7a9e;
  background: #f3ebfc;
  border: 1px solid #e2d2f5;
  border-radius: 999px;
  padding: 1px 8px;
}
.ask-page .ask-owui-history-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 8px 0 2px;
  font-size: 12px;
}
.ask-page .ask-owui-history-table th,
.ask-page .ask-owui-history-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #eee6f6;
  text-align: left;
  vertical-align: middle;
}
.ask-page .ask-owui-history-table thead th {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #7a6a90;
  background: #faf7fd;
  border-bottom-color: #e5d8f4;
}
.ask-page .ask-owui-history-table tbody tr:hover {
  background: #f8f3fc;
}
.ask-page .ask-owui-col-title {
  max-width: 0;
  width: 78%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2f2640;
  font-weight: 550;
}
.ask-page .ask-owui-col-link {
  width: 22%;
  white-space: nowrap;
  text-align: right;
}
.ask-page .ask-owui-col-link a {
  display: inline-block;
  color: #6a3fa0;
  text-decoration: none;
  font-weight: 650;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #d8c4f0;
  background: #f6effc;
}
.ask-page .ask-owui-col-link a:hover,
.ask-page .ask-owui-col-link a:focus-visible {
  background: #caa6f7;
  border-color: #b98aef;
  color: #3a1d63;
}
.ask-page .ask-owui-history-empty {
  margin: 8px 0 2px;
  font-size: 12px;
}

.ask-page .ask-chat-history > h3 {
  margin: 0 0 14px;
}
.ask-page .ask-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ask-page .ask-chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid #e2ebf1;
}
.ask-page .ask-chat-list li:last-child {
  border-bottom: none;
}
.ask-page .ask-chat-item {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 14px 4px 14px 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}
.ask-page .ask-chat-row:hover {
  background: #f4f8fb;
}
.ask-page .ask-chat-item-title {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #155f91;
  line-height: 1.35;
  margin-bottom: 5px;
}
.ask-page .ask-chat-row:hover .ask-chat-item-title {
  color: #0f4a73;
}
.ask-page .ask-chat-item-answer {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
  color: #5a7386;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ask-page .ask-chat-empty {
  margin: 0;
  padding: 8px 0 4px;
  font-size: 13px;
  color: #5a7386;
}
.ask-page .ask-chat-delete-form {
  margin: 0;
  padding: 14px 0 0;
  flex-shrink: 0;
}
.ask-page .ask-chat-delete {
  appearance: none;
  border: none;
  background: transparent;
  color: #8a9bab;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 2px 4px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.ask-page .ask-chat-row:hover .ask-chat-delete,
.ask-page .ask-chat-side-row:hover .ask-chat-delete,
.ask-page .ask-chat-delete:focus-visible {
  opacity: 1;
  color: #8a3b3b;
}
.ask-page .ask-chat-delete:hover {
  color: #9b2c2c;
  text-decoration: underline;
}

/* working overlay */
.ask-working {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 250, 252, 0.62);
  backdrop-filter: blur(1.5px);
}
.ask-working[hidden] {
  display: none !important;
}
.ask-working-card {
  min-width: min(340px, 90vw);
  max-width: 420px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #d5e3ec;
  box-shadow: 0 10px 30px rgba(24, 56, 79, 0.08);
  text-align: left;
}
.ask-working-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 650;
  color: #18384f;
}
.ask-working-question {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #155f91;
  font-weight: 600;
}
.ask-working-hint {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #5a7386;
}
.ask-working-data {
  margin: 0 0 8px;
  font-size: 11.5px;
  line-height: 1.4;
  color: #3d5a6e;
}
.ask-working-queries {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ask-working-queries li {
  font-size: 11px;
  line-height: 1.35;
  color: #5a7386;
  padding: 4px 0;
  border-top: 1px solid #eef3f7;
}
.ask-working-queries li:first-child {
  border-top: none;
}
.ask-working-elapsed {
  margin: 8px 0 0;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #8a9bab;
  font-variant-numeric: tabular-nums;
}
.ask-working-retry {
  margin-top: 12px;
}
.ask-page .ask-stalled-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #e2c48a;
  background: #fff8e8;
  color: #5c4a22;
  font-size: 12.5px;
  line-height: 1.4;
}
.ask-page .ask-form.is-busy button[type="submit"] {
  opacity: 0.75;
}

/* multi-turn chat page */
.ask-chat-page .ask-chat-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.ask-chat-page .ask-chat-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ask-chat-page .ask-chat-delete-form-hero {
  padding: 0;
}
.ask-chat-page .ask-chat-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  color: #5a7386;
}
.ask-chat-page .ask-chat-kicker a {
  color: #155f91;
  text-decoration: none;
}
.ask-chat-page .ask-chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  gap: 12px;
  align-items: start;
}
.ask-chat-page .ask-thread-panel {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.ask-chat-page .ask-thread {
  flex: 1;
  max-height: min(62vh, 640px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
}
.ask-chat-page .ask-msg {
  border: 1px solid #d5e3ec;
  background: #f7fafc;
  padding: 10px 12px;
  border-radius: 2px;
}
.ask-chat-page .ask-msg-user {
  background: #eef6fb;
  border-color: #c5dceb;
}
.ask-chat-page .ask-msg-assistant {
  background: #fff;
}
.ask-chat-page .ask-msg-pending {
  opacity: 0.92;
}
.ask-chat-page .ask-msg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 11px;
  color: #5a7386;
}
.ask-chat-page .ask-msg-role {
  font-weight: 700;
  color: #18384f;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ask-chat-page .ask-msg-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.ask-chat-page .ask-msg-mode {
  border: 1px solid #c5dceb;
  background: #edf7fd;
  color: #155f91;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
}
.ask-chat-page .ask-msg-body {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.45;
  color: #18384f;
}
.ask-chat-page .ask-msg-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5a7386;
  font-style: italic;
}
.ask-chat-page .ask-thinking-dots {
  display: inline-flex;
  gap: 3px;
}
.ask-chat-page .ask-thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7ea8c4;
  display: block;
  animation: ask-dot 1.2s ease-in-out infinite;
}
.ask-chat-page .ask-thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.ask-chat-page .ask-thinking-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ask-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
.ask-chat-page .ask-followup-form {
  margin-top: 10px;
  border-top: 1px solid #d5e3ec;
  padding-top: 10px;
}
.ask-chat-page .ask-followup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ask-chat-page .ask-followup-hint {
  font-size: 11px;
  color: #8a9bab;
}
.ask-chat-page .ask-chat-sidebar h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.ask-chat-page .ask-chat-side-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 55vh;
  overflow-y: auto;
}
.ask-chat-page .ask-chat-side-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid transparent;
}
.ask-chat-page .ask-chat-side-row.active {
  border-color: #c5dceb;
  background: #edf7fd;
}
.ask-chat-page .ask-chat-side-link {
  flex: 1;
  min-width: 0;
  color: #155f91;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  word-break: break-word;
}
.ask-chat-page .ask-chat-side-link:hover {
  text-decoration: underline;
}
.ask-chat-page .ask-chat-side-row .ask-chat-delete-form {
  padding: 0;
}
@media (max-width: 900px) {
  .ask-chat-page .ask-chat-layout {
    grid-template-columns: 1fr;
  }
  .ask-chat-page .ask-chat-sidebar {
    order: -1;
  }
}

/* Ask Claude -> OpenWebUI handoff */
.ask-handoff-btn {
  background: #caa6f7;
  border: 1px solid #b98aef;
  color: #3a1d63;
}
.ask-handoff-btn:hover,
.ask-handoff-btn:focus-visible {
  background: #9b6fd9;
  border-color: #9b6fd9;
  color: #fff;
}
.sales-report-page .ask-handoff-btn {
  background: #caa6f7;
  border-color: #b98aef;
  color: #3a1d63;
}
.sales-report-page .ask-handoff-btn:hover,
.sales-report-page .ask-handoff-btn:focus-visible {
  background: #9b6fd9;
  border-color: #9b6fd9;
  color: #fff;
}
.ask-handoff-page .ask-handoff-panel {
  display: grid;
  gap: 12px;
}
.ask-handoff-steps {
  margin: 0;
  padding-left: 1.2em;
  color: #46617a;
  font-size: 12.5px;
  line-height: 1.5;
}
.ask-handoff-steps li + li {
  margin-top: 4px;
}
.ask-handoff-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ask-handoff-actions .ask-handoff-btn {
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font-weight: 650;
  cursor: pointer;
}
.ask-handoff-btn-primary {
  background: #caa6f7;
  border: 1px solid #b98aef;
  color: #3a1d63;
}
.ask-handoff-btn-primary:hover,
.ask-handoff-btn-primary:focus-visible {
  background: #9b6fd9;
  border-color: #9b6fd9;
  color: #fff;
}
.ask-handoff-btn-secondary {
  background: transparent;
  border: 1px solid #b98aef;
  color: #6a3fa0;
}
.ask-handoff-btn-secondary:hover,
.ask-handoff-btn-secondary:focus-visible {
  background: #f2e9fd;
}
.ask-handoff-copied {
  color: #16836b;
  font-size: 12px;
  font-weight: 650;
}

/* report-layout-theme-v2 */
body.sales-report-page {
  --rp-bg: #ffffff;
  --rp-bg-soft: #f8fbfd;
  --rp-text: #18384f;
  --rp-muted: #60788b;
  --rp-border: #d8e5ed;
  --rp-heading: #245c80;
  --rp-link: #176fa8;
  --rp-btn-bg: #2476b9;
  --rp-btn-hover: #175b85;
  --rp-btn-text: #ffffff;
  --rp-kpi-value: #176f60;
  --rp-row-hover: #f4f6f7;
  --rp-hover-bg: #eef1f3;
  --rp-hover-border: #c7d0d6;
  --rp-hover-text: #245c80;
  --rp-active-bg: #e7edf1;
  --rp-active-border: var(--rp-link);
  /* page chrome: hero accent rail, filter bar, KPI band face */
  --rp-hero-accent: #4f82a6;
  --rp-hero-face-end: #f7fbfd;
  --rp-query-face-end: #f9fbfd;
  --rp-kpi-face-top: #fbfcfe;
  /* unified page shell + page title card */
  --rp-shell-border: #bcd1df;
  --rp-shell-face-top: #fafcfe;
  --rp-shell-face-end: #edf3f7;
  --rp-panel-face-end: rgba(248, 251, 253, 0.99);
  --rp-title-border: #3f79a3;
  --rp-title-rail-top: #2f668e;
  --rp-title-rail-end: #5f91b3;
  /* closed drawer face — slightly darker, recessed */
  --rp-drawer-face-top: #e4ecf2;
  --rp-drawer-face-mid: #d7e2eb;
  --rp-drawer-face-end: #cedae4;
  --rp-drawer-face-hover-top: #eaf1f6;
  --rp-drawer-face-hover-end: #d8e4ed;
  --rp-drawer-open-face: #eef5fa;
  --rp-drawer-lip: rgba(255, 255, 255, 0.7);
  --rp-drawer-recess: rgba(22, 50, 74, 0.11);
  --rp-drawer-edge: rgba(22, 50, 74, 0.08);
  --rp-drawer-pull: rgba(36, 70, 96, 0.22);
  --rp-drawer-accent: #5a7f99;
  --rp-drawer-accent-data: #4f82a6;
  --rp-drawer-accent-people: #3f79a3;
}

body.sales-report-page.theme-openwebui {
  --rp-bg: #ffffff;
  --rp-bg-soft: #f9fafb;
  --rp-text: #111827;
  --rp-muted: #6b7280;
  --rp-border: #e5e7eb;
  --rp-heading: #1f2937;
  --rp-link: #0369a1;
  --rp-btn-bg: #111827;
  --rp-btn-hover: #374151;
  --rp-btn-text: #f9fafb;
  --rp-kpi-value: #111827;
  --rp-row-hover: #f3f4f6;
  --rp-hover-bg: #eceef0;
  --rp-hover-border: #cbd0d5;
  --rp-hover-text: #1f2937;
  --rp-active-bg: #e5e7eb;
  --rp-active-border: var(--rp-link);
  --rp-hero-accent: #6b7280;
  --rp-hero-face-end: #f9fafb;
  --rp-query-face-end: #f9fafb;
  --rp-kpi-face-top: #ffffff;
  --rp-shell-border: #e5e7eb;
  --rp-shell-face-top: #ffffff;
  --rp-shell-face-end: #f3f4f6;
  --rp-panel-face-end: rgba(249, 250, 251, 0.99);
  --rp-title-border: #374151;
  --rp-title-rail-top: #374151;
  --rp-title-rail-end: #9ca3af;
  --rp-drawer-face-top: #e8eaee;
  --rp-drawer-face-mid: #dcdee3;
  --rp-drawer-face-end: #d3d6dc;
  --rp-drawer-face-hover-top: #eff0f3;
  --rp-drawer-face-hover-end: #dfe1e6;
  --rp-drawer-open-face: #f3f4f6;
  --rp-drawer-lip: rgba(255, 255, 255, 0.75);
  --rp-drawer-recess: rgba(17, 24, 39, 0.1);
  --rp-drawer-edge: rgba(17, 24, 39, 0.08);
  --rp-drawer-pull: rgba(55, 65, 81, 0.28);
  --rp-drawer-accent: #6b7280;
  --rp-drawer-accent-data: #4b5563;
  --rp-drawer-accent-people: #374151;
}

.sales-report-page:not(.admin-settings-page) main {
  margin-inline: 5%;
}
.sales-report-page:not(.admin-settings-page) .report-hero,
.sales-report-page:not(.admin-settings-page) .report-query,
.sales-report-page:not(.admin-settings-page) .results-table-panel,
.sales-report-page:not(.admin-settings-page) .two-col,
.sales-report-page:not(.admin-settings-page) .account-insights-grid,
.sales-report-page:not(.admin-settings-page) .kpi-grid {
  margin: 0;
}
.sales-report-page:not(.admin-settings-page) .results-table-panel,
.sales-report-page:not(.admin-settings-page) .column-config-panel,
.sales-report-page:not(.admin-settings-page) .invoice-items-panel,
.sales-report-page:not(.admin-settings-page) .invoice-column-config {
  margin-left: 0;
  margin-right: 0;
}
.sales-report-page:not(.admin-settings-page) .panel,
.sales-report-page:not(.admin-settings-page) .hero-panel {
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  border-color: var(--rp-border);
  background: var(--rp-bg);
  color: var(--rp-text);
}
.sales-report-page:not(.admin-settings-page) .report-hero {
  border-bottom: none;
  border-left: 3px solid var(--rp-hero-accent, #4f82a6);
  background: linear-gradient(180deg, #ffffff, var(--rp-hero-face-end, #f7fbfd));
}
.sales-report-page:not(.admin-settings-page) .report-query {
  background: linear-gradient(180deg, #ffffff, var(--rp-query-face-end, #f9fbfd));
}
.sales-report-page:not(.admin-settings-page) .kpi-grid {
  gap: 0;
  border: 1px solid var(--rp-border);
  border-top: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--rp-border);
}
.sales-report-page:not(.admin-settings-page) .kpi-grid article {
  border: 0;
  border-right: 1px solid var(--rp-border);
  border-radius: 0;
  min-height: 48px;
  padding: 8px 10px;
  background: linear-gradient(
    180deg,
    var(--rp-kpi-face-top, #fbfcfe),
    var(--rp-bg-soft)
  );
}
.sales-report-page:not(.admin-settings-page) .kpi-grid article:last-child {
  border-right: 0;
}
.sales-report-page:not(.admin-settings-page) .label {
  color: var(--rp-muted);
}
.sales-report-page:not(.admin-settings-page) .value {
  color: var(--rp-kpi-value);
}
.sales-report-page:not(.admin-settings-page) .panel h3,
.sales-report-page:not(.admin-settings-page) .report-hero h2 {
  color: var(--rp-heading);
}
.sales-report-page:not(.admin-settings-page) .report-hero p,
.sales-report-page:not(.admin-settings-page) .hint,
.sales-report-page:not(.admin-settings-page) label {
  color: var(--rp-muted);
}
.sales-report-page:not(.admin-settings-page) table {
  color: var(--rp-text);
}
.sales-report-page:not(.admin-settings-page) th,
.sales-report-page:not(.admin-settings-page) td {
  border-bottom-color: var(--rp-border);
}
.sales-report-page:not(.admin-settings-page) th {
  color: var(--rp-muted);
  background: var(--rp-bg-soft);
}
.sales-report-page:not(.admin-settings-page) a {
  color: var(--rp-link);
}
.sales-report-page:not(.admin-settings-page) input,
.sales-report-page:not(.admin-settings-page) select,
.sales-report-page:not(.admin-settings-page) textarea {
  border-color: var(--rp-border);
  color: var(--rp-text);
  background: #fff;
}
.sales-report-page:not(.admin-settings-page) button,
.sales-report-page:not(.admin-settings-page) a.report-action {
  border-color: var(--rp-btn-bg);
  background: var(--rp-btn-bg);
  color: var(--rp-btn-text);
}
.sales-report-page:not(.admin-settings-page) button:hover,
.sales-report-page:not(.admin-settings-page) a.report-action:hover {
  border-color: var(--rp-btn-hover);
  background: var(--rp-btn-hover);
}
.sales-report-page:not(.admin-settings-page) .two-col > .panel,
.sales-report-page:not(.admin-settings-page) .account-insights-grid > .panel {
  border-top: none;
}
.sales-report-page:not(.admin-settings-page) .column-config-panel {
  border-top: none;
}

/* single-salesperson insights */
.sales-report-page .kpi-grid.kpi-grid-cohesive {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.sales-report-page .kpi-note {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--rp-muted, #60788b);
}
.sales-report-page .value.delta-pos,
.sales-report-page td.delta-pos { color: #167a4b; }
.sales-report-page .value.delta-neg,
.sales-report-page td.delta-neg { color: #b0362f; }
.sales-report-page .panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sales-report-page .panel-heading-row h3 { margin-bottom: 4px; }
.sales-report-page .comparison-export-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.sales-report-page a.report-action.report-action-sm {
  min-height: 20px;
  min-width: 0;
  padding: 2px 8px;
  font-size: 9.5px;
  border-radius: 3px;
}
.sales-report-page .comparison-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 8px;
}
.sales-report-page .sp-status {
  display: inline-block;
  min-width: 0;
  min-height: 0;
  padding: 1px 8px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--rp-border, #d8e5ed);
  background: var(--rp-bg-soft, #f8fbfd);
  color: var(--rp-muted, #60788b);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.sales-report-page .sp-status.new {
  border-color: #9cd6b6; background: #ebf8f1; color: #167a4b;
}
.sales-report-page .sp-status.growing {
  border-color: #b5d9a8; background: #f2faee; color: #3d7a24;
}
.sales-report-page .sp-status.returning {
  border-color: #a9c8ea; background: #eef5fc; color: #23639e;
}
.sales-report-page .sp-status.steady {
  border-color: #d3ddb9; background: #f8faef; color: #6c7a35;
}
.sales-report-page .sp-status.declining {
  border-color: #eec1a0; background: #fdf3ea; color: #a05a1c;
}
.sales-report-page .sp-status.lost {
  border-color: #e6b6b3; background: #fbeeed; color: #a53832;
}
/* Delivery reconciliation statuses */
.sales-report-page .sp-status.balanced {
  border-color: #9cd6b6; background: #ebf8f1; color: #167a4b;
}
.sales-report-page .sp-status.uncredited {
  border-color: #e6b6b3; background: #fbeeed; color: #a53832;
}
.sales-report-page .sp-status.overcredited {
  border-color: #eec1a0; background: #fdf3ea; color: #a05a1c;
}
.sales-report-page .sp-status.credit_only {
  border-color: #a9c6e8; background: #eef5fc; color: #23639e;
}
button.sales-report-page .sp-status,
.sales-report-page button.sp-status {
  cursor: pointer;
  transition: opacity 0.12s ease, filter 0.12s ease;
}
.sales-report-page button.sp-status:hover {
  border-color: var(--rp-hover-border, #c7d0d6) !important;
  background: var(--rp-hover-bg, #eef1f3) !important;
  color: var(--rp-hover-text, #245c80) !important;
}
.sales-report-page button.sp-status:focus-visible {
  outline: 2px solid var(--rp-link, #176fa8);
  outline-offset: 1px;
}
.sales-report-page button.sp-status.off {
  border-color: var(--rp-border, #d8e5ed) !important;
  background: var(--rp-bg-soft, #f8fbfd) !important;
  color: #9aa7b0 !important;
  opacity: 0.75;
}
.sales-report-page button.sp-status.off:hover {
  border-color: var(--rp-hover-border, #c7d0d6) !important;
  background: var(--rp-hover-bg, #eef1f3) !important;
  color: var(--rp-hover-text, #245c80) !important;
  opacity: 1;
}
.sales-report-page table.comparison-table tbody tr[hidden] {
  display: none;
}
@media (max-width: 980px) {
  .sales-report-page .kpi-grid.kpi-grid-cohesive { grid-template-columns: 1fr 1fr; }
}

/* Lisa quick salesperson links */
.sales-report-page .lisa-quick-links {
  padding: 8px 12px;
  background: var(--rp-bg-soft, #f8fbfd);
}
.sales-report-page .lisa-quick-links-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sales-report-page .lisa-quick-links-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.sales-report-page .lisa-quick-links-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--rp-heading, #245c80);
  line-height: 1.25;
}
.sales-report-page .lisa-quick-links-dates {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--rp-muted, #60788b);
  line-height: 1.3;
}
.sales-report-page .lisa-quick-links-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 0;
}
.sales-report-page .lisa-quick-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.sales-report-page .lisa-quick-links-row-total {
  align-self: flex-end;
  width: fit-content;
}
.sales-report-page a.lisa-quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 11px;
  border: 1px solid #4f9a74;
  border-radius: 4px;
  background: #4f9a74;
  color: #ffffff !important;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.sales-report-page a.lisa-quick-link:hover {
  border-color: #3d7e5d;
  background: #3d7e5d;
  color: #ffffff !important;
}
.sales-report-page a.lisa-quick-link.lisa-quick-link-total {
  font-weight: 500;
  border-color: #a8d4ba;
  background: #d8efe2;
  color: #2f6b4f !important;
}
.sales-report-page a.lisa-quick-link.lisa-quick-link-total:hover {
  border-color: #86c4a1;
  background: #c5e6d4;
  color: #24553e !important;
}

/* role-aware owner overview */
.overview-page main {
  display: block;
}
.overview-page .overview-shell {
  display: grid;
  gap: 5px;
  padding: 5px;
  border: 1px solid #bcd1df;
  border-radius: 11px;
  background: linear-gradient(180deg, #fafcfe, #edf3f7);
  box-shadow:
    0 1px 3px rgba(35, 84, 113, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.overview-page .overview-title,
.overview-page .overview-section.panel {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rp-border, #cfdfe9);
  border-radius: 7px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 251, 253, 0.99)),
    var(--rp-bg, #fff);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.overview-page .overview-title {
  padding: 10px 12px 9px;
  border-top: 4px solid #3f79a3;
}
.overview-page .overview-title::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #2f668e, #5f91b3);
  content: "";
}
.overview-page .overview-title p {
  margin: 0 0 4px;
  color: var(--rp-muted, #5d768a);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}
.overview-page .overview-title h1 {
  margin: 0;
  color: var(--rp-heading, #1f5578);
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -0.028em;
  line-height: 1.1;
}
.overview-page .overview-invoice-lookup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 8px;
  margin: 14px 0 0 auto;
  max-width: 280px;
  width: 100%;
}
.overview-page .overview-invoice-lookup-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.overview-page .overview-invoice-lookup-input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--rp-border, #d0dde8);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--rp-text, #18384f);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.overview-page .overview-invoice-lookup-input::placeholder {
  color: var(--rp-muted, #7a90a2);
}
.overview-page .overview-invoice-lookup-input:focus {
  outline: none;
  border-color: #6a97b8;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(106, 151, 184, 0.18);
}
.overview-page .overview-invoice-lookup-btn {
  flex: 0 0 auto;
  padding: 6px 11px;
  border: 1px solid var(--rp-border, #c5d6e3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  color: #2f5d74;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.overview-page .overview-invoice-lookup-btn:hover {
  border-color: #6a97b8;
  background: #fff;
  color: #1f4054;
}
.overview-page .overview-section {
  padding: 10px 12px 11px;
  border-left: 3px solid #5f91b3;
}
.overview-page .overview-team-panel {
  overflow: visible;
  border-left-color: #4f82a6;
}
.overview-page .overview-sales-panel {
  border-left-color: #3f79a3;
  padding-bottom: 10px;
}
.overview-page .overview-system-panel {
  border-left-color: #6a8799;
}
.overview-page .overview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rp-border, #d5e3ed);
}
.overview-page .overview-heading h2 {
  margin: 0;
  color: var(--rp-heading, #1f5578);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.overview-page .overview-eyebrow {
  margin: 0 0 3px;
  color: var(--rp-muted, #5d768a);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}
.overview-page .overview-range {
  color: var(--rp-muted, #5d768a);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.overview-page .overview-team-panel {
  /* Let Team Links dropdowns (Lisa reports, etc.) paint outside the card. */
  overflow: visible;
}
.overview-page .team-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 140px;
}
.overview-page .team-link-menu {
  position: relative;
  z-index: 60;
}
.overview-page .team-link-menu summary,
.overview-page .team-link-direct {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 8px;
  border: 1px solid var(--rp-border, #c7d9e6);
  border-radius: 6px;
  background: linear-gradient(180deg, #fbfcfe, #f3f8fb);
  color: var(--rp-heading, #1f5578);
  font-size: 12px;
  font-weight: 640;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.overview-page .team-link-menu summary::-webkit-details-marker { display: none; }
.overview-page .team-link-menu summary::marker { content: ""; }
.overview-page .team-link-menu summary:hover,
.overview-page .team-link-direct:hover {
  border-color: var(--rp-hover-border, #63a6d3);
  background: var(--rp-hover-bg, #edf7fd);
  color: var(--rp-hover-text, #155f91);
}
.overview-page .team-link-menu-items {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 200px;
  padding: 4px;
  border: 1px solid var(--rp-border, #c7d9e6);
  border-radius: 6px;
  background: var(--rp-bg, #fff);
  box-shadow: 0 10px 22px rgba(24, 56, 79, 0.14);
}
.overview-page .team-link-menu-items a {
  display: block;
  padding: 5px 7px;
  border-radius: 4px;
  color: var(--rp-text, #18384f);
  font-size: 11.5px;
  text-decoration: none;
}
.overview-page .team-link-menu-items a:hover {
  background: var(--rp-hover-bg, #edf7fd);
  color: var(--rp-hover-text, #155f91);
}
.overview-page .overview-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.overview-page .overview-kpi {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 88px;
  flex-direction: column;
  justify-content: space-between;
  padding: 9px 11px 8px;
  border: 1px solid var(--rp-border, #cfdfea);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 250, 253, 0.98));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.overview-page .overview-kpi::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: #7a96a8;
  content: "";
}
.overview-page .overview-kpi-primary::before {
  background: linear-gradient(180deg, #3f79a3, #5f91b3);
}
.overview-page .overview-kpi-profit::before {
  background: linear-gradient(180deg, #3f7d5d, #5b9b76);
}
.overview-page .overview-kpi .label {
  margin: 0;
  padding-left: 6px;
  color: var(--rp-muted, #5d768a);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.overview-page .overview-kpi .value {
  margin: 8px 0 6px;
  padding-left: 6px;
  color: var(--rp-heading, #1f5578);
  font-family: var(--font-body);
  font-size: 23px;
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.overview-page .overview-kpi-note {
  margin: 0;
  padding-left: 6px;
  color: var(--rp-muted, #5d768a);
  font-size: 10px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.overview-page a.overview-kpi-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.overview-page a.overview-kpi-link:hover {
  border-color: var(--rp-hover-border, #63a6d3);
  background: linear-gradient(180deg, #ffffff, #eef6fb);
  box-shadow: 0 2px 8px rgba(35, 84, 113, 0.1);
}
.overview-page a.overview-kpi-link:hover .value {
  color: var(--rp-hover-text, #155f91);
}
.overview-page a.overview-kpi-link:focus-visible {
  outline: 2px solid rgba(63, 121, 163, 0.35);
  outline-offset: 2px;
}
.overview-page .overview-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rp-border, #d5e3ed);
}
.overview-page .overview-signals div,
.overview-page .overview-signals a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 3px;
  border: 1px solid var(--rp-border, #d8e5ed);
  border-radius: 999px;
  background: var(--rp-bg, #fff);
  color: var(--rp-text, #18384f);
  font-size: 10px;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.overview-page .overview-signals a:hover {
  border-color: var(--rp-hover-border, #63a6d3);
  background: var(--rp-hover-bg, #edf7fd);
  color: var(--rp-hover-text, #155f91);
}
.overview-page .overview-signals .sp-status {
  pointer-events: none;
}
.overview-page .overview-signals strong {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.overview-page .overview-health {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.02em;
}
.overview-page .overview-health.is-healthy {
  background: #e2f1e8;
  color: #2f6b4f;
}
.overview-page .overview-health.is-warn {
  background: #f8edcf;
  color: #855c12;
}
.overview-page .overview-health.is-fail {
  background: #f8dfe1;
  color: #8f3540;
}
.overview-page .overview-system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rp-border, #cfdfea);
  border-radius: 7px;
  background: var(--rp-border, #cfdfea);
}
.overview-page .overview-system-grid div {
  min-width: 0;
  padding: 9px 11px;
  background: linear-gradient(180deg, #fbfcfe, #f4f8fb);
}
.overview-page .overview-system-grid dt {
  margin-bottom: 3px;
  color: var(--rp-muted, #5d768a);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.overview-page .overview-system-grid dd {
  margin: 0;
  overflow: hidden;
  color: var(--rp-text, #18384f);
  font-size: 12px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.overview-page .overview-system-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  color: var(--rp-muted, #5d768a);
  font-size: 10px;
}
.overview-page .overview-source {
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overview-page .overview-openwebui-launch {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}
.overview-page .overview-openwebui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  padding: 12px 28px;
  border: 1px solid #1d6fad;
  border-radius: 8px;
  background: linear-gradient(180deg, #3b93d1, #2476b9);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 6px 16px rgba(36, 118, 185, 0.28);
  color: #e8f6fc;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.overview-page a.overview-openwebui-btn:hover {
  filter: brightness(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34) inset,
    0 8px 20px rgba(36, 118, 185, 0.36);
  transform: translateY(-1px);
}
.overview-page .overview-openwebui-btn.is-disabled {
  border-color: #9bb8cc;
  background: linear-gradient(180deg, #9eb8cb, #7f9cb2);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.82);
  cursor: not-allowed;
}

/* focused single-salesperson readability */
.single-salesperson-view .single-report-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.single-salesperson-view .single-report-eyebrow {
  margin: 0 0 1px;
  color: var(--rp-muted, #60788b);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.single-salesperson-view .single-report-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--rp-muted, #60788b);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}
.single-salesperson-view .single-report-actions a {
  padding: 3px 7px;
  border: 1px solid var(--rp-border, #cbdde8);
  border-radius: 4px;
  background: var(--rp-bg-soft, #f7fbfd);
  color: var(--rp-heading, #245c80);
  text-decoration: none;
}
.single-salesperson-view .kpi-grid-cohesive {
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--rp-border, #d8e5ed);
  border-radius: 6px;
  background: var(--rp-border, #d8e5ed);
}
.single-salesperson-view .kpi-grid-cohesive article {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.single-salesperson-view .comparison-panel {
  overflow: visible;
  max-height: none;
}
.single-salesperson-view .comparison-panel thead {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--rp-bg-soft, #f5f9fc);
}
.single-salesperson-view .comparison-table tbody tr:nth-child(even) {
  background: rgba(116, 151, 176, 0.035);
}
.sales-report-page .comparison-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 1px solid var(--rp-border, #d5e3ed);
  border-radius: 6px;
  background: linear-gradient(180deg, #f8fbfd, #eef4f8);
}
.sales-report-page .comparison-size {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.sales-report-page .comparison-size-label {
  margin-right: 2px;
  color: var(--rp-muted, #60788b);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sales-report-page .comparison-size-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--rp-border, #cbdde8);
  border-radius: 4px;
  background: #fff;
  color: var(--rp-heading, #245c80);
  font-size: 10.5px;
  font-weight: 650;
  text-decoration: none;
}
.sales-report-page .comparison-size-btn:hover {
  border-color: var(--rp-hover-border, #63a6d3);
  background: var(--rp-hover-bg, #edf7fd);
  color: var(--rp-hover-text, #155f91);
}
.sales-report-page .comparison-size-btn.active {
  border-color: #3f79a3;
  background: #e7f2fa;
  color: #1f5578;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.sales-report-page .comparison-range-label {
  margin: 0;
  color: var(--rp-muted, #60788b);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Column configuration strip: a slim, recessed disclosure attached flush to
   the top edge of the comparison table frame. */
.sales-report-page .comparison-config {
  margin: 0;
  border: 1px solid var(--rp-border, #d5e3ed);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(
    180deg,
    var(--rp-drawer-face-top, #e4ecf2),
    var(--rp-drawer-face-end, #cedae4)
  );
  overflow: hidden;
}
.sales-report-page .comparison-config > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 3px 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  box-shadow:
    inset 0 1px 0 var(--rp-drawer-lip, rgba(255, 255, 255, 0.7)),
    inset 0 -2px 3px -2px var(--rp-drawer-recess, rgba(22, 50, 74, 0.11));
  transition: background 150ms ease;
}
.sales-report-page .comparison-config > summary::-webkit-details-marker {
  display: none;
}
.sales-report-page .comparison-config > summary:hover {
  background: rgba(255, 255, 255, 0.35);
}
.sales-report-page .comparison-config-title {
  color: var(--rp-heading, #245c80);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sales-report-page .comparison-config-hint {
  color: var(--rp-muted, #60788b);
  font-size: 9.5px;
}
.sales-report-page .comparison-config-caret {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--rp-muted, #60788b);
  border-bottom: 1.5px solid var(--rp-muted, #60788b);
  transform: rotate(45deg);
  transition: transform 150ms ease;
}
.sales-report-page .comparison-config[open] > summary {
  background: var(--rp-bg-soft, #f5f9fc);
  box-shadow: inset 0 -1px 0 var(--rp-border, #d5e3ed);
}
.sales-report-page .comparison-config[open] .comparison-config-caret {
  transform: rotate(-135deg);
}
.sales-report-page .comparison-config-body {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  background: var(--rp-bg, #fff);
}
.sales-report-page .comparison-config-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sales-report-page .comparison-config-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--rp-border, #cbdde8);
  border-radius: 999px;
  background: #fff;
  color: var(--rp-text, #33475a);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sales-report-page .comparison-config-item input {
  width: 11px;
  height: 11px;
  margin: 0;
  accent-color: var(--rp-heading, #245c80);
}
.sales-report-page .comparison-config-item.on {
  border-color: var(--rp-hover-border, #63a6d3);
  background: var(--rp-hover-bg, #edf7fd);
  color: var(--rp-hover-text, #155f91);
}
.sales-report-page .comparison-config-item:hover {
  border-color: var(--rp-hover-border, #63a6d3);
}
.sales-report-page .comparison-config-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sales-report-page .comparison-config-actions button {
  min-height: 24px;
  padding: 2px 12px;
  border: 1px solid var(--rp-heading, #245c80);
  border-radius: 4px;
  background: var(--rp-heading, #245c80);
  color: #fff;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}
.sales-report-page .comparison-config-actions button:hover {
  filter: brightness(1.1);
}
.sales-report-page .comparison-config-reset {
  color: var(--rp-muted, #60788b);
  font-size: 10px;
  text-decoration: none;
}
.sales-report-page .comparison-config-reset:hover {
  color: var(--rp-hover-text, #155f91);
  text-decoration: underline;
}
.sales-report-page .comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rp-border, #d5e3ed);
  border-radius: 6px;
}
.sales-report-page .comparison-config + .comparison-table-wrap {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.sales-report-page .comparison-table-wrap .comparison-table {
  margin: 0;
}
/* Consistent, fixed widths for the identity columns so the table reads the
   same regardless of which optional columns are visible. */
.sales-report-page .comparison-table th.col-account,
.sales-report-page .comparison-table td.col-account {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}
.sales-report-page .comparison-table th.col-business,
.sales-report-page .comparison-table td.col-business {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sales-report-page .comparison-table th.col-status,
.sales-report-page .comparison-table td.col-status {
  width: 108px;
  min-width: 108px;
  max-width: 108px;
}
/* Start date: deliberately thin and quiet — small font, tight spacing. */
.sales-report-page .comparison-table th.col-start-date,
.sales-report-page .comparison-table td.col-start-date {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding-left: 4px;
  padding-right: 4px;
  white-space: nowrap;
}
.sales-report-page .comparison-table th.col-start-date {
  font-size: 8.5px;
  letter-spacing: 0.03em;
}
.sales-report-page .comparison-table td.col-start-date,
.sales-report-page .comparison-table td.col-compact-date {
  color: var(--rp-muted, #60788b);
  font-size: 9px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.sales-report-page .comparison-table td.col-compact-date {
  white-space: nowrap;
}
.sales-report-page .comparison-table thead th {
  vertical-align: bottom;
  white-space: nowrap;
}
.sales-report-page .comparison-table thead th .comparison-th-label {
  display: inline-block;
  margin-right: 2px;
}
.sales-report-page .comparison-table thead th.is-sorted {
  color: #1f4b63;
  background: #eef5f9;
}
.sales-report-page .comparison-table thead th .sort-controls {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
}
.sales-report-page .comparison-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sales-report-page .comparison-totals {
  margin: 0;
  flex: 1 1 240px;
}
.sales-report-page .comparison-pager {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.sales-report-page .comparison-pager .button {
  min-width: 72px;
  text-decoration: none;
}
.sales-report-page .comparison-pager-status {
  color: var(--rp-heading, #245c80);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sales-report-page .comparison-pager-disabled {
  opacity: 0.38;
  pointer-events: none;
  cursor: default;
}

@media (max-width: 900px) {
  .overview-page .overview-kpis,
  .overview-page .overview-system-grid {
    grid-template-columns: 1fr 1fr;
  }
  .overview-page .overview-heading,
  .single-salesperson-view .single-report-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .overview-page .overview-source {
    width: 100%;
    margin-left: 0;
  }
}
@media (max-width: 560px) {
  .overview-page .overview-kpis,
  .overview-page .overview-system-grid {
    grid-template-columns: 1fr;
  }
  .overview-page .team-links-grid,
  .overview-page .team-link-menu,
  .overview-page .team-link-menu summary,
  .overview-page .team-link-direct {
    width: 100%;
  }
}

/* admin health checks and bounded log viewer */
.overview-page .overview-health-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.overview-page .overview-health-link {
  padding: 3px 7px;
  border: 1px solid var(--rp-border, #cbdde8);
  border-radius: 4px;
  background: var(--rp-bg-soft, #f7fbfd);
  color: var(--rp-heading, #245c80);
  font-size: 9.5px;
  font-weight: 650;
  text-decoration: none;
}
.overview-page .overview-health-link:hover {
  border-color: var(--rp-hover-border, #63a6d3);
  background: var(--rp-hover-bg, #edf7fd);
  color: var(--rp-hover-text, #155f91);
}
.system-health-page main {
  display: grid;
  gap: 5px;
}
.system-health-page .panel,
.system-health-page .report-hero {
  margin: 0;
}
.system-health-page .health-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.system-health-page .health-eyebrow {
  margin: 0 0 2px;
  color: var(--rp-muted, #60788b);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.system-health-page .health-actions {
  display: flex;
  gap: 5px;
}
.system-health-page .health-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.system-health-page .health-kpi {
  position: relative;
  min-height: 78px;
  padding: 10px 12px;
  border: 1px solid var(--rp-border, #d8e5ed);
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff, #f5f9fc);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}
.system-health-page .health-kpi::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: #7a96a8;
  content: "";
}
.system-health-page .health-kpi.is-pass::before { background: linear-gradient(180deg, #3f7d5d, #5b9b76); }
.system-health-page .health-kpi.is-warn::before { background: linear-gradient(180deg, #a67b1d, #c79a3b); }
.system-health-page .health-kpi.is-fail::before { background: linear-gradient(180deg, #a04550, #c05a64); }
.system-health-page .health-kpi.is-pass,
.system-health-page .health-kpi.is-warn,
.system-health-page .health-kpi.is-fail { border-left-color: var(--rp-border, #d8e5ed); }
.system-health-page .health-kpi .value {
  margin: 2px 0 0;
  color: var(--rp-heading, #245c80);
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
}
.system-health-page .health-kpi .value.small {
  font-size: 13px;
}
.system-health-page .health-check-total {
  color: var(--rp-muted, #60788b);
  font-size: 9.5px;
}
.system-health-page .health-status {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 750;
  text-transform: uppercase;
}
.system-health-page .health-status-pass {
  background: #e2f1e8;
  color: #2f6b4f;
}
.system-health-page .health-status-warn {
  background: #f8edcf;
  color: #855c12;
}
.system-health-page .health-status-fail {
  background: #f8dfe1;
  color: #8f3540;
}
.system-health-page .health-status-info {
  background: #e5edf4;
  color: #48657a;
}
.system-health-page .health-row-warn {
  background: rgba(199, 154, 59, 0.08);
}
.system-health-page .health-row-fail {
  background: rgba(192, 90, 100, 0.08);
}
.system-health-page .health-row-info {
  background: rgba(95, 125, 147, 0.055);
}
.system-health-page .health-control-note {
  margin: 0 0 7px;
  color: var(--rp-muted, #60788b);
  font-size: 9.5px;
  line-height: 1.35;
}
.system-health-page .health-events {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.system-health-page .health-events div {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--rp-border, #d8e5ed);
  border-radius: 5px;
  background: var(--rp-bg-soft, #f8fbfd);
}
.system-health-page .health-events span {
  color: var(--rp-muted, #60788b);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.system-health-page .health-events strong {
  color: var(--rp-text, #18384f);
  font-size: 10.5px;
  font-weight: 600;
}
.system-health-page .health-log-panel code {
  color: var(--rp-muted, #60788b);
  font-size: 9px;
}
.system-health-page .health-log {
  max-height: 360px;
  margin: 0;
  padding: 9px 10px;
  overflow: auto;
  border: 1px solid var(--rp-border, #d8e5ed);
  border-radius: 5px;
  background: #17232d;
  color: #dce7ee;
  font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.system-health-page .health-config-panel .kv {
  margin-bottom: 0;
}
@media (max-width: 720px) {
  .system-health-page .health-kpis,
  .system-health-page .health-events {
    grid-template-columns: 1fr 1fr;
  }
  .system-health-page .health-hero,
  .overview-page .overview-health-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* collapsible raw account-level sales tables + control panels
   Closed panels read like a shut desk drawer: a slightly darker,
   recessed face with a highlight lip; hover eases it forward and
   opening reveals a flat, lit interior. */
.sales-report-page .raw-sales-disclosure,
.sales-report-page .control-disclosure {
  position: relative;
  padding: 0;
  overflow: visible;
  border-color: var(--rp-border, #cbdde8);
  border-left: 3px solid var(--rp-drawer-accent-data, #4f82a6);
  background: var(--rp-bg, #fff);
  box-shadow: 0 1px 2px var(--rp-drawer-edge, rgba(22, 50, 74, 0.08));
}
.sales-report-page .control-disclosure {
  border-left-color: var(--rp-drawer-accent, #5a7f99);
}
.sales-report-page .salesperson-config-panel.control-disclosure {
  border-left-color: var(--rp-drawer-accent-people, #3f79a3);
}
.sales-report-page .raw-sales-disclosure > summary,
.sales-report-page .control-disclosure > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 10px;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 11px 0 12px;
  list-style: none;
  color: var(--rp-heading, #245c80);
  background: linear-gradient(
    180deg,
    var(--rp-drawer-face-top, #e4ecf2),
    var(--rp-drawer-face-mid, #d7e2eb) 58%,
    var(--rp-drawer-face-end, #cedae4)
  );
  box-shadow:
    inset 0 1px 0 var(--rp-drawer-lip, rgba(255, 255, 255, 0.7)),
    inset 0 -3px 4px -2px var(--rp-drawer-recess, rgba(22, 50, 74, 0.11));
  transition: background 150ms ease, box-shadow 150ms ease, color 150ms ease;
  cursor: pointer;
  user-select: none;
}
.sales-report-page .raw-sales-disclosure > summary::-webkit-details-marker,
.sales-report-page .control-disclosure > summary::-webkit-details-marker {
  display: none;
}
.sales-report-page .raw-sales-disclosure > summary::marker,
.sales-report-page .control-disclosure > summary::marker {
  content: "";
}
.sales-report-page .raw-sales-disclosure > summary:hover,
.sales-report-page .control-disclosure > summary:hover {
  background: linear-gradient(
    180deg,
    var(--rp-drawer-face-hover-top, #eaf1f6),
    var(--rp-drawer-face-hover-end, #d8e4ed)
  );
  box-shadow:
    inset 0 1px 0 var(--rp-drawer-lip, rgba(255, 255, 255, 0.7)),
    inset 0 -2px 3px -2px var(--rp-drawer-recess, rgba(22, 50, 74, 0.11));
  color: var(--rp-hover-text, #155f91);
}
.sales-report-page .raw-sales-title,
.sales-report-page .control-disclosure-title {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 720;
  letter-spacing: 0.015em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sales-report-page .control-disclosure-title {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sales-report-page .raw-sales-count,
.sales-report-page .control-disclosure-hint {
  color: var(--rp-muted, #60788b);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.sales-report-page .raw-sales-caret,
.sales-report-page .control-disclosure-caret {
  width: 8px;
  height: 8px;
  justify-self: center;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 150ms ease;
}
.sales-report-page .raw-sales-disclosure[open],
.sales-report-page .control-disclosure[open] {
  border-left-color: var(--rp-title-rail-top, #2f668e);
  box-shadow: 0 2px 5px var(--rp-drawer-edge, rgba(22, 50, 74, 0.08));
}
.sales-report-page .raw-sales-disclosure[open] > summary,
.sales-report-page .control-disclosure[open] > summary {
  border-bottom: 1px solid var(--rp-border, #d8e5ed);
  background: var(--rp-drawer-open-face, #eef5fa);
  box-shadow: inset 0 1px 0 var(--rp-drawer-lip, rgba(255, 255, 255, 0.7));
}
.sales-report-page .raw-sales-disclosure[open] .raw-sales-caret,
.sales-report-page .control-disclosure[open] .control-disclosure-caret {
  transform: rotate(225deg) translate(-1px, -1px);
}
.sales-report-page .raw-sales-content,
.sales-report-page .control-disclosure-content {
  padding: 10px 12px 12px;
  background: var(--rp-bg, #fff);
}
.sales-report-page .control-disclosure-content .column-config-form,
.sales-report-page .control-disclosure-content .column-toggles {
  margin: 0;
}
.sales-report-page .control-disclosure-content h3 {
  display: none;
}
.sales-report-page .raw-sales-actions {
  display: flex;
  justify-content: flex-end;
  min-height: 22px;
  margin-bottom: 5px;
}
.sales-report-page .raw-sales-content .pager {
  margin-top: 7px;
}
@media (max-width: 560px) {
  .sales-report-page .raw-sales-disclosure > summary,
  .sales-report-page .control-disclosure > summary {
    grid-template-columns: minmax(0, 1fr) 16px;
  }
  .sales-report-page .raw-sales-count,
  .sales-report-page .control-disclosure-hint {
    display: none;
  }
}

/* unified page shell + title card — replicates the Overview page's
   cohesive single-element layout across the main report pages */
.sales-report-page .page-shell {
  display: grid;
  gap: 8px;
  padding: 8px;
  box-sizing: border-box;
  /* Grow with wide tables instead of leaving a bare strip past the card. */
  width: max-content;
  min-width: 100%;
  border: 1px solid var(--rp-shell-border, #bcd1df);
  border-radius: 11px;
  background: linear-gradient(
    180deg,
    var(--rp-shell-face-top, #fafcfe),
    var(--rp-shell-face-end, #edf3f7)
  );
  box-shadow:
    0 1px 3px rgba(35, 84, 113, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.sales-report-page .page-shell > * {
  margin: 0;
}
.sales-report-page .page-shell > .panel:not(details),
.sales-report-page .page-shell > .hero-panel {
  border: 1px solid var(--rp-border, #cfdfe9);
  border-radius: 7px !important;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.97),
      var(--rp-panel-face-end, rgba(248, 251, 253, 0.99))
    ),
    var(--rp-bg, #fff);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.sales-report-page .page-shell > details.panel {
  border-radius: 7px !important;
}
.sales-report-page .page-shell > details.panel > summary {
  border-radius: 5px;
}
.sales-report-page .page-shell > details.panel[open] > summary {
  border-radius: 5px 5px 0 0;
}
.sales-report-page .page-shell > .kpi-grid {
  border: 1px solid var(--rp-border, #cfdfe9);
  border-radius: 7px;
  overflow: hidden;
}
.sales-report-page .page-shell .column-config-panel {
  border-top: 1px solid var(--rp-border, #cfdfe9);
}
.sales-report-page .page-shell .two-col > .panel,
.sales-report-page .page-shell .account-insights-grid > .panel {
  border-top: 1px solid var(--rp-border, #cfdfe9);
  border-radius: 6px;
}
.sales-report-page .page-shell > .page-title-card {
  position: relative;
  overflow: hidden;
  padding: 15px 18px 14px;
  border-top: 4px solid var(--rp-title-border, #3f79a3);
}
.sales-report-page .page-shell > .page-title-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--rp-title-rail-top, #2f668e),
    var(--rp-title-rail-end, #5f91b3)
  );
  content: "";
}
.sales-report-page .page-title-card .page-title-eyebrow {
  display: block;
  margin: 0 0 4px;
  color: var(--rp-muted, #5d768a);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}
.sales-report-page .page-title-card h2 {
  margin: 0;
  color: var(--rp-heading, #1f5578);
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -0.028em;
  line-height: 1.1;
}
.sales-report-page .page-title-card p:not(.page-title-eyebrow) {
  margin: 5px 0 0;
  color: var(--rp-muted, #5d768a);
  font-size: 11px;
  line-height: 1.4;
  max-width: 920px;
}

/* Period-comparison invoice count links + account invoice list */
.sales-report-page .invoice-count-link {
  color: var(--rp-link, #0369a1);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.sales-report-page .invoice-count-link:hover,
.sales-report-page .invoice-count-link:focus-visible {
  border-bottom-color: currentColor;
}
.account-invoices-page .account-invoices-code {
  color: var(--rp-muted, #6b7280);
  font-size: 0.72em;
  font-weight: 550;
}
.account-invoices-page .item-mix-panel {
  padding: 14px 16px 16px;
}
.account-invoices-page .item-mix-panel > h3 {
  margin: 0 0 12px;
}
.account-invoices-page .account-invoices-list-panel {
  padding: 14px 16px 16px;
}
.account-invoices-page .account-invoices-list-panel > h3 {
  margin: 0 0 12px;
}
.account-invoices-page .account-invoices-table {
  width: 100%;
  border-collapse: collapse;
}
.account-invoices-page .account-invoices-table th,
.account-invoices-page .account-invoices-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rp-border, #e5e7eb);
  text-align: left;
  font-size: 12.5px;
  vertical-align: middle;
}
.account-invoices-page .account-invoices-table thead th {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rp-muted, #6b7280);
  background: var(--rp-band, #f9fafb);
  padding-top: 9px;
  padding-bottom: 9px;
}
.account-invoices-page .account-invoices-table tr.is-overdue {
  background: rgba(185, 55, 62, 0.06);
}
.account-invoices-page .account-invoices-table tr.is-unpaid {
  background: rgba(180, 120, 20, 0.05);
}
.account-invoices-page .account-invoice-status {
  min-width: 7.5rem;
}
.account-invoices-page .inv-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 3px;
}
.account-invoices-page .inv-unpaid {
  color: #92400e;
  background: rgba(146, 64, 14, 0.08);
  border-color: rgba(146, 64, 14, 0.2);
}
.account-invoices-page .inv-overdue {
  color: #9f1239;
  background: rgba(159, 18, 57, 0.08);
  border-color: rgba(159, 18, 57, 0.22);
}
.account-invoices-page .account-item-analyst-panel {
  margin-top: 16px;
}
.account-invoices-page .account-item-analyst-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.account-invoices-page .account-item-analyst-header h3 {
  margin-bottom: 2px;
}
.account-invoices-page .account-item-analyst-btn {
  flex-shrink: 0;
}
.account-invoices-page .account-item-analyst-status {
  margin: 8px 0 0;
  min-height: 1.2em;
}
.account-invoices-page .account-item-analyst-status.is-error {
  color: #9f1239;
}
.account-invoices-page .account-item-analyst-result {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rp-border, #e5e7eb);
  font-size: 13px;
  line-height: 1.5;
}
.account-invoices-page .account-item-analyst-result h2,
.account-invoices-page .account-item-analyst-result h3,
.account-invoices-page .account-item-analyst-result h4 {
  margin: 14px 0 4px;
  font-size: 13.5px;
}
.account-invoices-page .account-item-analyst-result h2:first-child,
.account-invoices-page .account-item-analyst-result h3:first-child,
.account-invoices-page .account-item-analyst-result h4:first-child {
  margin-top: 0;
}
.account-invoices-page .account-item-analyst-result p {
  margin: 0 0 8px;
}
.account-invoices-page .account-item-analyst-result ul,
.account-invoices-page .account-item-analyst-result ol {
  margin: 0 0 8px;
  padding-left: 20px;
}
.account-invoices-page .account-item-analyst-result li {
  margin-bottom: 3px;
}
.account-invoices-page .account-item-analyst-result code {
  background: var(--rp-band, #f9fafb);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.92em;
}
.account-invoices-page .item-mix-panel h3 .hint {
  font-weight: 450;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 8px;
  font-size: 0.75em;
}
.account-invoices-page .item-mix-movers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 28px;
  margin-top: 4px;
}
.account-invoices-page .item-mix-movers-col {
  min-width: 0;
}
.account-invoices-page .item-mix-movers-title {
  margin: 0 0 10px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.account-invoices-page .item-mix-movers-title.trend-up { color: #166534; }
.account-invoices-page .item-mix-movers-title.trend-down { color: #9f1239; }
.account-invoices-page .item-mix-movers-list,
.account-invoices-page .item-mix-reorder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-invoices-page .item-mix-movers-list li,
.account-invoices-page .item-mix-reorder-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  flex-wrap: wrap;
  line-height: 1.35;
  padding: 2px 0;
}
.account-invoices-page .item-mix-code {
  font-weight: 650;
  font-size: 12px;
}
.account-invoices-page .item-mix-expand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.account-invoices-page .item-mix-expand-btn {
  margin: 0;
  padding: 4px 10px;
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--rp-border, #c5d6e3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  color: #2f5d74;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.account-invoices-page .item-mix-expand-btn:hover {
  border-color: #6a97b8;
  background: #fff;
  color: #1f4054;
}
.account-invoices-page .item-mix-reorder-watch {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rp-border, #e5e7eb);
}
.account-invoices-page .item-mix-reorder-watch h4,
.account-invoices-page .item-mix-movers h4 {
  margin: 0 0 8px;
}
.account-invoices-page .item-mix-reorder-watch h4 .hint {
  font-weight: 450;
  margin-left: 6px;
}
.account-invoices-page .item-mix-reorder-detail {
  color: var(--rp-muted, #6b7280);
  font-size: 11.5px;
}
.account-invoices-page .item-trend-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 3px;
}
.account-invoices-page .trend-rising {
  color: #166534;
  background: rgba(22, 101, 52, 0.08);
  border-color: rgba(22, 101, 52, 0.18);
}
.account-invoices-page .trend-new {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.08);
  border-color: rgba(29, 78, 216, 0.18);
}
.account-invoices-page .trend-steady {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.08);
  border-color: rgba(107, 114, 128, 0.18);
}
.account-invoices-page .trend-fading {
  color: #92400e;
  background: rgba(146, 64, 14, 0.08);
  border-color: rgba(146, 64, 14, 0.2);
}
.account-invoices-page .trend-dormant,
.account-invoices-page .trend-one-off {
  color: #9f1239;
  background: rgba(159, 18, 57, 0.08);
  border-color: rgba(159, 18, 57, 0.22);
}
.account-invoices-page .item-mix-details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rp-border, #e5e7eb);
}
.account-invoices-page .item-mix-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--rp-muted, #6b7280);
  padding: 4px 0;
}
.account-invoices-page .item-mix-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.account-invoices-page .item-mix-table th,
.account-invoices-page .item-mix-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--rp-border, #e5e7eb);
  text-align: left;
  font-size: 12px;
}
.account-invoices-page .item-mix-table thead th {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rp-muted, #6b7280);
  background: var(--rp-band, #f9fafb);
}
@media (max-width: 720px) {
  .account-invoices-page .item-mix-movers {
    grid-template-columns: 1fr;
  }
}

/* Routes Reconciliation (Carlos commission tallies) */
.routes-recon-page .reason-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.routes-recon-page .reason-chip-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rp-muted, #6b7280);
  margin-right: 4px;
}
.routes-recon-page .reason-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--rp-border, #d8e5ed);
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.routes-recon-page .reason-chip.on {
  border-color: #3d6b86;
  background: rgba(61, 107, 134, 0.08);
  color: #1f4054;
}
.routes-recon-page .reason-chip-input {
  margin: 0;
}
.routes-recon-page .routes-tally {
  position: sticky;
  top: 8px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin: 0 0 14px;
  padding: 14px 18px;
  border: 1px solid #c5d6e0;
  border-radius: 6px;
  background: linear-gradient(180deg, #f7fbfd 0%, #eef5f9 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.routes-recon-page .routes-tally-eyebrow {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rp-muted, #6b7280);
}
.routes-recon-page .routes-tally-amount {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #183848;
  line-height: 1.1;
}
.routes-recon-page .routes-tally-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--rp-muted, #6b7280);
}
.routes-recon-page .routes-tally-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.routes-recon-page .routes-tally-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--rp-muted, #6b7280);
}
.routes-recon-page .routes-tally-note input {
  min-width: 220px;
  padding: 7px 10px;
  border: 1px solid var(--rp-border, #d8e5ed);
  border-radius: 4px;
  font-size: 14px;
}
.routes-recon-page .routes-tally-save {
  padding: 8px 14px;
  border: 0;
  border-radius: 4px;
  background: #2f5d74;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.routes-recon-page .routes-tally-save:hover {
  background: #244a5c;
}
.routes-recon-page .routes-recon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.routes-recon-page .routes-recon-table th,
.routes-recon-page .routes-recon-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rp-border, #e5e7eb);
  text-align: left;
  vertical-align: top;
}
.routes-recon-page .routes-recon-table thead th {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rp-muted, #6b7280);
  background: var(--rp-band, #f9fafb);
  position: sticky;
  top: 0;
  z-index: 2;
}
.routes-recon-page .routes-recon-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.routes-recon-page .routes-recon-table .col-check {
  width: 28px;
  text-align: center;
}
.routes-recon-page .routes-recon-table tr.has-returns {
  background: rgba(180, 70, 50, 0.035);
}
.routes-recon-page .return-hot,
.routes-recon-page .return-hot a {
  color: #9a3412;
  font-weight: 600;
}
.routes-recon-page a.invoice-count-link {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border-radius: 3px;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.routes-recon-page a.invoice-count-link.inv-has-return {
  background: rgba(185, 55, 62, 0.12);
  color: #9a3412;
  font-weight: 650;
}
.routes-recon-page a.invoice-count-link.inv-major-return {
  background: rgba(185, 55, 62, 0.22);
  color: #7f1d1d;
  font-weight: 700;
  outline: 1px solid #7f1d1d;
  outline-offset: 0;
}
.routes-recon-page a.invoice-count-link.inv-driver-return {
  box-shadow: inset 3px 0 0 #c2410c;
  padding-left: 8px;
}
.routes-recon-page .route-code-link {
  font-weight: 600;
  color: #1f4054;
  text-decoration: none;
}
.routes-recon-page .route-code-link:hover {
  text-decoration: underline;
}
.routes-recon-page .reasons-cell {
  max-width: 320px;
}
.routes-recon-page .reason-pill {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11.5px;
  background: #eef2f5;
  color: #334155;
}
.routes-recon-page .reason-pill.group-driver {
  background: #fde8e4;
  color: #9a3412;
}
.routes-recon-page .reason-pill.group-ops {
  background: #e8eef8;
  color: #1e3a5f;
}
.routes-recon-page .reason-pill.group-bakery {
  background: #eaf5ea;
  color: #1f4d2a;
}
.routes-recon-page .reason-pill.group-customer {
  background: #f5f0e8;
  color: #5c4320;
}
.routes-recon-page .routes-deductions-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.routes-recon-page .routes-deductions-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--rp-border, #e5e7eb);
  font-size: 13px;
}
@media (max-width: 720px) {
  .routes-recon-page .routes-tally {
    position: static;
  }
  .routes-recon-page .routes-tally-note input {
    min-width: 0;
    width: 100%;
  }
}

/* Route invoice refund severity */
.route-invoices-page .route-inv-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 10px;
  font-size: 12.5px;
}
.route-invoices-page .route-inv-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  border-radius: 2px;
  border: 1px solid transparent;
}
.route-invoices-page .route-inv-swatch.inv-has-return {
  background: rgba(185, 55, 62, 0.12);
  border-color: rgba(185, 55, 62, 0.25);
}
.route-invoices-page .route-inv-swatch.inv-major-return {
  background: rgba(185, 55, 62, 0.22);
  border-color: #7f1d1d;
}
.route-invoices-page .route-inv-swatch.inv-driver-return {
  background: rgba(185, 55, 62, 0.1);
  box-shadow: inset 3px 0 0 #c2410c;
  border-color: rgba(194, 65, 12, 0.35);
}
.route-invoices-page .account-invoices-table tr.inv-has-return {
  background: rgba(185, 55, 62, 0.08);
}
.route-invoices-page .account-invoices-table tr.inv-major-return {
  background: rgba(185, 55, 62, 0.16);
  outline: 1px solid #7f1d1d;
  outline-offset: -1px;
}
.route-invoices-page .account-invoices-table tr.inv-driver-return {
  box-shadow: inset 4px 0 0 #c2410c;
}
.route-invoices-page a.invoice-num-link {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  text-decoration: none;
  color: #1f4054;
  font-weight: 600;
}
.route-invoices-page a.invoice-num-link.inv-has-return {
  background: rgba(185, 55, 62, 0.14);
  color: #9a3412;
}
.route-invoices-page a.invoice-num-link.inv-major-return {
  background: rgba(185, 55, 62, 0.24);
  color: #7f1d1d;
  outline: 1px solid #7f1d1d;
  outline-offset: 0;
}
.route-invoices-page a.invoice-num-link.inv-driver-return {
  box-shadow: inset 3px 0 0 #c2410c;
  padding-left: 8px;
}
.route-invoices-page .inv-driver-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a3412;
  background: rgba(194, 65, 12, 0.12);
  border: 1px solid rgba(194, 65, 12, 0.35);
}
.route-invoices-page .return-hot {
  color: #9a3412;
  font-weight: 600;
}

/* Routes Reconciliation — Display Columns for individual reasons */
.routes-recon-page .routes-reason-columns {
  margin-top: 12px;
}
.routes-recon-page .routes-reason-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.routes-recon-page .routes-reason-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.routes-recon-page .routes-reason-section-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: #1f4054;
}
.routes-recon-page .routes-reason-section-toggle {
  padding: 2px 8px;
  border: 1px solid var(--rp-border, #d8e5ed);
  border-radius: 3px;
  background: #fff;
  font-size: 11.5px;
  color: #3d6b86;
  cursor: pointer;
}
.routes-recon-page .routes-reason-section-toggle:hover {
  border-color: #3d6b86;
  background: rgba(61, 107, 134, 0.06);
}
.routes-recon-page .routes-reason-item-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}
.routes-recon-page .routes-reason-name {
  font-size: 13px;
}
.routes-recon-page .routes-reason-dollars {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #9a3412;
  font-weight: 600;
}
.routes-recon-page .routes-reason-columns .column-config-item {
  align-items: flex-start;
}



