/* =========================================================================
   OnePayy console — comfort layer.

   Loads last. The console had been trimmed, pass by pass, to fit a mockup's
   first screen: 11-13px text, 5px row padding, glows and an aurora behind
   every page. This layer puts reading first. It owns three things:

   1. The palette, both themes: OnePayy blue for actions only, neutral greys
      everywhere else, no glows or gradients.
   2. A spacing and type scale driven by a handful of --pf-* tokens, so the
      opt-in compact density is a token swap, not a second stylesheet.
   3. Component sizing on top of the earlier layers, which keep their
      structure and hooks.

   Hand-written, no build step, same as every other file in this directory.
   ========================================================================= */

/* ------------------------------------------------------------------ scale */

:root {
  --pf-text: 15px;          /* body copy and descriptions */
  --pf-text-ui: 14.5px;     /* nav, tables, controls */
  --pf-text-sm: 13.5px;     /* secondary lines */
  --pf-text-xs: 12.5px;     /* the floor: pills, column heads, captions */
  --pf-title: 28px;
  --pf-card-title: 17px;

  --pf-page-x: 40px;
  --pf-page-top: 36px;
  --pf-gap: 28px;           /* between page sections */
  --pf-gap-sm: 18px;        /* between cards inside a section */
  --pf-pad: 24px;           /* card padding */
  --pf-cell-y: 15px;
  --pf-cell-x: 20px;
  --pf-control: 40px;       /* buttons, inputs, selects */
  --pf-control-sm: 34px;
  --pf-nav-item: 40px;
  --pf-content-max: 1480px;

  --radius-xl: 12px;
  --radius: 10px;
  --radius-md: 8px;
  --radius-sm: 7px;
}

/* Compact density, chosen from the account menu. Same layout, tighter
   tokens, for anyone who wants more rows on a screen. */
html[data-density="compact"] {
  --pf-text: 14px;
  --pf-text-ui: 13.5px;
  --pf-text-sm: 12.5px;
  --pf-text-xs: 12px;
  --pf-title: 25px;
  --pf-card-title: 15.5px;

  --pf-page-x: 28px;
  --pf-page-top: 26px;
  --pf-gap: 20px;
  --pf-gap-sm: 14px;
  --pf-pad: 18px;
  --pf-cell-y: 10px;
  --pf-cell-x: 16px;
  --pf-control: 36px;
  --pf-control-sm: 30px;
  --pf-nav-item: 36px;
}

/* ---------------------------------------------------------------- palette */

/* Light. Plain white for the things you read (cards, tables, fields), set
   on a cool blue-grey page that matches the navy rail, with tinted card and
   table heads and hovers, so the screen has a clear order instead of one
   sheet of white. Blue is for actions and the current place only. Declared
   on body, level with the earlier layers' theme blocks. */
html:not([data-theme="dark"]) { background: #e9eef6; }
html:not([data-theme="dark"]) body {
  --paper: #e9eef6;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunk: #f0f4f9;
  --surface-head: #f4f7fb;
  --sidebar: #0e1d3e;
  /* The rail is deep OnePayy navy in both themes: the one coloured block on
     the screen, so the app reads as OnePayy and the page as the workspace. */
  --rail: #0e1d3e;
  --rail-ink: #ffffff;
  --rail-ink-soft: rgba(255, 255, 255, .76);
  --rail-ink-faint: rgba(255, 255, 255, .52);
  --rail-hover: rgba(255, 255, 255, .08);
  --rail-active: rgba(255, 255, 255, .14);
  --rail-line: rgba(255, 255, 255, .13);
  --rail-mark: #7ea6ff;
  --surface-veil: rgba(233, 238, 246, .92);
  --surface-grad: none;
  --field: #ffffff;
  --field-line: #c3cbd8;
  --nav-hover: #d6dae0;
  --nav-active: #ffffff;
  --row-hover: #f2f6fb;
  --table-head: #eff3f9;
  --btn: #f4f7fb;
  --btn-hover: #e3e9f2;
  --btn-line: #c8d0dc;

  --line: #d6dde8;
  --line-soft: #e3e8f0;
  --line-strong: #c3cbd8;

  --ink: #101828;
  --ink-soft: #475467;
  --ink-faint: #5d6a7e;

  --accent: #2458d6;
  --accent-hot: #2c63e6;
  --accent-ink: #1d4cbf;
  --accent-strong: #1c48b3;
  --accent-soft: #e7eefd;
  --accent-line: #b9cbf5;
  --accent-tile: #e7eefd;
  --accent-tile-ink: #2458d6;
  --accent-ring: rgba(36, 88, 214, .22);
  --accent-glow: none;

  --chart: #2c63e6;
  --chart-compare: #aeb5c0;
  --chart-area-top: rgba(44, 99, 230, .14);
  --chart-area-bottom: rgba(44, 99, 230, 0);
  --chart-grid: #e3e8f0;

  --good: #0d7448;  --good-soft: #e3f4ea;  --good-line: #b4dfc6;  --good-tile: #e3f4ea;
  --warn: #8a5300;  --warn-soft: #fcf1d9;  --warn-line: #eccf8f;  --warn-tile: #fcf1d9;
  --bad: #b3202f;   --bad-soft: #fceaec;   --bad-line: #f0bfc6;   --bad-tile: #fceaec;
  --info: #1d55b8;  --info-soft: #e5edfb;  --info-tile: #e5edfb;

  --hl: 0 0 0 transparent;
  --shadow: 0 1px 2px rgba(15, 17, 21, .05);
  --shadow-soft: 0 1px 1px rgba(15, 17, 21, .04);
  --shadow-lift: 0 1px 2px rgba(15, 17, 21, .06), 0 6px 16px -6px rgba(15, 17, 21, .12);
  --shadow-pop: 0 0 0 1px rgba(15, 17, 21, .06), 0 12px 32px -8px rgba(15, 17, 21, .22);

  --radius-xl: 12px;
  --radius: 10px;
  --radius-md: 8px;
  --radius-sm: 7px;
}

/* Dark. Plain black and neutral greys (no blue or violet cast): a black
   page, a slightly lighter rail, dark grey cards with lighter grey heads. */
html[data-theme="dark"] { background: #0a0a0b; }
html[data-theme="dark"] body {
  --paper: #0a0a0b;
  --surface: #151517;
  --surface-raised: #1c1c1f;
  --surface-sunk: #101012;
  --surface-head: #1a1a1d;
  --sidebar: #0b1430;
  --rail: #0b1430;
  --rail-ink: #ffffff;
  --rail-ink-soft: rgba(255, 255, 255, .74);
  --rail-ink-faint: rgba(255, 255, 255, .5);
  --rail-hover: rgba(255, 255, 255, .07);
  --rail-active: rgba(255, 255, 255, .12);
  --rail-line: rgba(255, 255, 255, .11);
  --rail-mark: #7ea6ff;
  --surface-veil: rgba(10, 10, 11, .92);
  --surface-grad: none;
  --field: #0f0f11;
  --field-line: #3a3a40;
  --nav-hover: #1f1f23;
  --nav-active: #232327;
  --row-hover: #1c1c1f;
  --table-head: #1a1a1d;
  --btn: #1f1f23;
  --btn-hover: #2a2a2f;
  --btn-line: #38383e;

  --line: #2a2a2f;
  --line-soft: #222226;
  --line-strong: #3a3a40;

  --ink: #ededf0;
  --ink-soft: #b5b5bd;
  --ink-faint: #8e8e98;

  --accent: #3b6cf0;
  --accent-hot: #4a78f2;
  --accent-ink: #93b3ff;
  --accent-strong: #2f5ad6;
  --accent-soft: rgba(59, 108, 240, .16);
  --accent-line: rgba(120, 155, 255, .36);
  --accent-tile: rgba(59, 108, 240, .16);
  --accent-tile-ink: #9fbbff;
  --accent-ring: rgba(80, 125, 245, .34);
  --accent-glow: none;

  --chart: #5b8af5;
  --chart-compare: #5f5f68;
  --chart-area-top: rgba(91, 138, 245, .2);
  --chart-area-bottom: rgba(91, 138, 245, 0);
  --chart-grid: #232327;

  --good: #4fcf8e;  --good-soft: rgba(79, 207, 142, .12);  --good-line: rgba(79, 207, 142, .32);  --good-tile: rgba(79, 207, 142, .12);
  --warn: #f0c15a;  --warn-soft: rgba(240, 193, 90, .12);  --warn-line: rgba(240, 193, 90, .32);  --warn-tile: rgba(240, 193, 90, .12);
  --bad: #ff8593;   --bad-soft: rgba(255, 133, 147, .12);  --bad-line: rgba(255, 133, 147, .32);  --bad-tile: rgba(255, 133, 147, .12);
  --info: #86c5f7;  --info-soft: rgba(134, 197, 247, .12); --info-tile: rgba(134, 197, 247, .12);

  --hl: 0 0 0 transparent;
  --shadow: none;
  --shadow-soft: none;
  --shadow-lift: 0 8px 24px -10px rgba(0, 0, 0, .7);
  --shadow-pop: 0 0 0 1px rgba(255, 255, 255, .07), 0 18px 44px -12px rgba(0, 0, 0, .8);

  --radius-xl: 12px;
  --radius: 10px;
  --radius-md: 8px;
  --radius-sm: 7px;
}

/* ------------------------------------------------------------------- base */

body.payflow-dashboard {
  font-size: var(--pf-text);
  line-height: 1.55;
  font-feature-settings: "cv11";
}
body.payflow-dashboard :is(button, input, select, textarea) { font-feature-settings: "cv11"; }
body.payflow-dashboard .muted { color: var(--ink-faint); }

/* No artwork, aurora or grid behind the page: the content is the picture. */
body.payflow-dashboard .main::before { content: none; }

/* Wide screens: the working area stops growing at a readable measure and
   centres, instead of stretching tables to 2000px. */
body.payflow-dashboard .st-pagehead,
body.payflow-dashboard .content {
  width: 100%;
  max-width: calc(var(--pf-content-max) + 2 * var(--pf-page-x));
  margin-inline: auto;
}

body.payflow-dashboard :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- sidebar */

body.payflow-dashboard .shell { grid-template-columns: 248px minmax(0, 1fr); }
body.payflow-dashboard .sidebar { padding: 16px 14px 18px; gap: 12px; }

body.payflow-dashboard .st-account > summary {
  min-height: 54px;
  padding: 8px 10px;
  background: var(--surface);
  box-shadow: none;
}
body.payflow-dashboard .st-account__avatar,
body.payflow-dashboard .st-identity__avatar {
  background: var(--accent);
  box-shadow: none;
}
body.payflow-dashboard .st-account__copy strong { font-size: 14px; }
body.payflow-dashboard .st-account__copy span { font-size: 12.5px; }

body.payflow-dashboard .nav { gap: 2px; }
body.payflow-dashboard .nav__section {
  padding: 20px 12px 6px;
  color: var(--ink-faint);
  font-size: var(--pf-text-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
}
body.payflow-dashboard .nav__link,
body.payflow-dashboard .st-nav__fold > summary {
  min-height: var(--pf-nav-item);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--pf-text-ui);
  font-weight: 500;
}
body.payflow-dashboard .nav__label { gap: 12px; }
body.payflow-dashboard .nav__link svg,
body.payflow-dashboard .st-nav__fold > summary .nav__label svg { width: 18px; height: 18px; }
body.payflow-dashboard .nav__link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: none;
}
body.payflow-dashboard .nav__link[aria-current="page"]::before {
  left: 0;
  height: 18px;
  background: var(--accent);
  box-shadow: none;
}
body.payflow-dashboard .nav__link--sub {
  min-height: calc(var(--pf-nav-item) - 4px);
  padding: 7px 12px 7px 42px;
  font-size: var(--pf-text-ui);
  background-position: 21px 0;
}
body.payflow-dashboard .nav__link--sub[aria-current="page"] {
  background:
    linear-gradient(var(--accent), var(--accent)) 21px 50% / 2px 60% no-repeat,
    var(--accent-soft);
  color: var(--accent-ink);
}

/* Counts read as quiet badges; red is reserved for things that are wrong. */
body.payflow-dashboard .nav__count {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border: 0;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 650;
}
/* A folded group still says when something inside it needs a look. */
body.payflow-dashboard .st-nav__fold > summary .nav__count { margin-left: auto; margin-right: 8px; }
body.payflow-dashboard .st-nav__fold[open] > summary .nav__count { display: none; }

body.payflow-dashboard .nav--foot { padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ----------------------------------------------------------------- topbar */

body.payflow-dashboard .st-topbar {
  min-height: 64px;
  padding: 10px var(--pf-page-x);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
body.payflow-dashboard .header-search {
  height: var(--pf-control);
  max-width: 560px;
  background: var(--field);
  box-shadow: none;
}
body.payflow-dashboard .header-search:focus-within { box-shadow: 0 0 0 3px var(--accent-ring); }
body.payflow-dashboard .header-search input { font-size: var(--pf-text-ui); }
body.payflow-dashboard .search-shortcut { font-family: var(--font); font-size: 12px; padding: 1px 7px; }
body.payflow-dashboard .utility-button { width: 40px; height: 40px; position: relative; }
body.payflow-dashboard .utility-button svg { width: 19px; height: 19px; }
body.payflow-dashboard .utility-indicator {
  box-shadow: 0 0 0 2px var(--surface-veil);
  animation: none;
}
body.payflow-dashboard .st-identity__copy strong { font-size: 14px; }
body.payflow-dashboard .st-identity__copy span { font-size: 12.5px; }

/* Popovers: opaque, readable rows, a title, and room to breathe. Matched
   with the theme attribute so it outranks refine.css's frosted dark menu,
   which let the page show through the text. */
html[data-theme] body.payflow-dashboard :is(.utility-popover, .st-account__menu, .range-popover) {
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body.payflow-dashboard .utility-popover > strong {
  padding: 6px 10px 6px;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
body.payflow-dashboard :is(.utility-popover, .st-account__menu) > a,
body.payflow-dashboard .st-identity__theme {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 14px;
}
body.payflow-dashboard .header-menu .utility-popover { min-width: 300px; }
body.payflow-dashboard .st-identity .utility-popover { min-width: 260px; }

/* Notification and help rows: label left, count or key right. */
body.payflow-dashboard .pf-pop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
body.payflow-dashboard .pf-pop-row > span:first-child { display: grid; gap: 1px; min-width: 0; }
body.payflow-dashboard .pf-pop-row small { color: var(--ink-faint); font-size: 12.5px; }
body.payflow-dashboard .pf-pop-count {
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
body.payflow-dashboard .pf-pop-empty {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 10px 10px 12px;
  color: var(--ink-soft);
  font-size: 14px;
}
body.payflow-dashboard .pf-pop-empty strong { color: var(--ink); font-weight: 600; }
body.payflow-dashboard .pf-pop-sep { height: 1px; margin: 6px 4px; background: var(--line-soft); }
body.payflow-dashboard .pf-keys { display: grid; gap: 2px; margin: 0; padding: 4px 10px 6px; }
body.payflow-dashboard .pf-keys div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 14px; color: var(--ink); }
body.payflow-dashboard .pf-keys dt { font-weight: 400; }
body.payflow-dashboard .pf-keys dd { margin: 0; display: inline-flex; gap: 4px; }
body.payflow-dashboard kbd.pf-kbd {
  min-width: 24px;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-sunk);
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 12px;
  text-align: center;
}

/* -------------------------------------------------------------- page head */

body.payflow-dashboard .st-pagehead {
  padding: var(--pf-page-top) var(--pf-page-x) 0;
  gap: 20px;
}
body.payflow-dashboard .st-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-size: var(--pf-text-sm);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
body.payflow-dashboard .st-eyebrow::before { content: none; }
body.payflow-dashboard :is(.st-pagehead h1, .st-hero__copy h1) {
  font-size: var(--pf-title);
  font-weight: 680;
  letter-spacing: -.022em;
  line-height: 1.2;
}
body.payflow-dashboard :is(.st-pagehead__sub, .st-hero__copy p) {
  max-width: 72ch;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: var(--pf-text);
  line-height: 1.5;
}
body.payflow-dashboard .st-pagehead__actions { gap: 10px; align-items: center; flex-wrap: wrap; }

body.payflow-dashboard .content {
  padding: 28px var(--pf-page-x) 72px;
  gap: var(--pf-gap);
}

/* --------------------------------------------------------------- surfaces */

body.payflow-dashboard :is(.card, .st-side-card, .st-metric-card, .st-settings__card, .operational-section, .st-today__main, .st-panel, .st-kpi, .metric-card--plain, .health-item, .tile) {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
body.payflow-dashboard .health-item { background: var(--surface-sunk); box-shadow: none; }

/* Calm hover: a border change, no lift or slide. */
body.payflow-dashboard :is(.st-metric-card, .st-kpi, .st-settings__card):hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
body.payflow-dashboard :is(.quick-link, .attention-row):hover { transform: none; }

body.payflow-dashboard :is(.card__head, .card__header) {
  min-height: 64px;
  padding: 16px var(--pf-pad);
  gap: 16px;
}
body.payflow-dashboard :is(.card__head, .card__header) h2,
body.payflow-dashboard .st-table-card__head h2,
body.payflow-dashboard .pl-table-card__head h2,
body.payflow-dashboard .st-side-card h2,
body.payflow-dashboard .st-panel .section-heading h2 {
  font-size: var(--pf-card-title);
  font-weight: 650;
  letter-spacing: -.01em;
}
body.payflow-dashboard .card__body { padding: var(--pf-pad); }
body.payflow-dashboard .card__body--flush { padding: 0; }
body.payflow-dashboard .card__foot { padding: 14px var(--pf-pad); font-size: var(--pf-text-sm); background: transparent; }
body.payflow-dashboard .card__head .section-description,
body.payflow-dashboard .st-panel .section-heading p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: var(--pf-text-sm);
}

body.payflow-dashboard :is(.st-card-icon, .st-kpi__icon, .st-metric-card__icon, .quick-link__icon, .st-settings__icon) { box-shadow: none; }
body.payflow-dashboard .st-card-icon { width: 32px; height: 32px; margin-right: 12px; border-radius: 9px; }
body.payflow-dashboard .st-card-icon svg { width: 18px; height: 18px; }
body.payflow-dashboard .st-panel .section-heading p,
body.payflow-dashboard .card__head:has(.st-card-icon) .section-description { margin-left: 44px; }

/* ---------------------------------------------------------------- figures */

body.payflow-dashboard :is(.st-kpi__value, .st-metric-card__value strong, .st-metric-card header strong, .st-today__metric strong, .st-today__foot strong, .metric-card--plain strong, .st-insight dd, .link-card__amount, .tile__value) {
  font-weight: 680;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
body.payflow-dashboard .st-delta {
  padding: 2px 8px;
  border: 0;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------- tabs */

body.payflow-dashboard .st-tabs { gap: 4px; }
body.payflow-dashboard .st-tabs a {
  padding: 10px 14px 13px;
  font-size: var(--pf-text-ui);
}
body.payflow-dashboard .st-tabs a[aria-current="page"] { color: var(--ink); }
body.payflow-dashboard .st-tabs a[aria-current="page"]::after {
  left: 12px;
  right: 12px;
  background: var(--accent);
  box-shadow: none;
}

/* ------------------------------------------------------ chips and pills */

body.payflow-dashboard .st-toolbar { gap: 16px; }
body.payflow-dashboard .st-chips { gap: 8px; }
body.payflow-dashboard .st-chip {
  height: 36px;
  padding: 0 15px;
  font-size: var(--pf-text-sm);
}
body.payflow-dashboard .st-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

body.payflow-dashboard .st-pills { padding: 4px; gap: 2px; border-radius: 12px; }
body.payflow-dashboard .st-pills a { padding: 7px 14px; font-size: var(--pf-text-sm); }
body.payflow-dashboard .st-pills a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

body.payflow-dashboard :is(.pill, .pl-status) {
  height: 24px;
  padding: 0 10px 0 9px;
  font-size: var(--pf-text-xs);
  font-weight: 600;
}
body.payflow-dashboard .pill::before,
body.payflow-dashboard .pl-status i { box-shadow: none; animation: none; }
body.payflow-dashboard :is(.pill--warn, .payment-status--warn)::before,
body.payflow-dashboard .pl-status--warn i { animation: none; }
body.payflow-dashboard .tag { font-size: 12px; }

/* ---------------------------------------------------------------- buttons */

body.payflow-dashboard .btn,
.authcard .btn {
  min-height: var(--pf-control);
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}
body.payflow-dashboard .btn:hover,
.authcard .btn:hover { background: var(--surface-sunk); border-color: var(--line-strong); }
body.payflow-dashboard .btn:active:not(:disabled),
.authcard .btn:active:not(:disabled) { transform: scale(.97); }
body.payflow-dashboard .btn--primary,
.authcard .btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
body.payflow-dashboard .btn--primary:hover,
.authcard .btn--primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  filter: none;
  box-shadow: var(--shadow-soft);
  transform: none;
}
body.payflow-dashboard .btn--ghost { background: transparent; border-color: transparent; box-shadow: none; }
body.payflow-dashboard .btn svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.payflow-dashboard .btn--sm svg { width: 15px; height: 15px; }
body.payflow-dashboard .btn--sm {
  min-height: var(--pf-control-sm);
  height: auto;
  padding: 0 12px;
  font-size: 13.5px;
}
body.payflow-dashboard .btn--danger { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
body.payflow-dashboard .btn--danger:hover { border-color: var(--bad); background: var(--bad-soft); }
body.payflow-dashboard :is(.st-controlbar, .st-hero__actions, .st-pagehead__actions) .btn { min-height: var(--pf-control); height: var(--pf-control); }
body.payflow-dashboard .st-pagehead__actions .btn--sm { min-height: var(--pf-control); height: var(--pf-control); font-size: 14px; }

/* ----------------------------------------------------------------- forms */

body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="range"]):not([type="file"]), select) {
  min-height: var(--pf-control);
}
body.payflow-dashboard :where(input, select, textarea) { font-size: var(--pf-text-ui); box-shadow: none; }
body.payflow-dashboard :is(input, select, textarea):focus { box-shadow: 0 0 0 3px var(--accent-ring); }
body.payflow-dashboard .header-search input,
body.payflow-dashboard .pl-search input { min-height: 0; }

body.payflow-dashboard .field { gap: 7px; }
body.payflow-dashboard :is(.field > label, .field__label, label.field, legend.field__label) {
  color: var(--ink);
  font-size: var(--pf-text-sm);
  font-weight: 600;
}
body.payflow-dashboard .field__hint { color: var(--ink-faint); font-size: 13px; line-height: 1.45; }
body.payflow-dashboard .field__error { font-size: 13px; }
/* Wider columns: six 150px fields in a row clipped every placeholder. Top
   aligned so a hint under one field does not drop its neighbours. */
body.payflow-dashboard .formgrid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  align-items: start;
}
body.payflow-dashboard .filters { gap: 18px; }
body.payflow-dashboard .stack { gap: 18px; }
body.payflow-dashboard .stack--tight { gap: 10px; }
body.payflow-dashboard .btnrow { gap: 10px; }
/* Two-column page bodies: bounded tracks, so a long reference or UUID wraps
   inside its card instead of pushing the page sideways on a phone. */
body.payflow-dashboard .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--pf-gap-sm); }
body.payflow-dashboard .split > * { min-width: 0; }

/* Plain forms inside a card: the blocks were stacked with no space between a
   field row, a fieldset and the submit button. */
body.payflow-dashboard .card__body > form:not([class]) > :not([type="hidden"]) ~ :not([type="hidden"]),
body.payflow-dashboard .card__body > form.formgrid + * { margin-top: 20px; }
body.payflow-dashboard .card__body > form:not([class]) > :is(button, .btn, .btnrow):last-child,
body.payflow-dashboard .card__body > form:not([class]) > div:last-child:has(> .btn:only-child) { margin-top: 22px; }
body.payflow-dashboard fieldset { min-width: 0; }
/* Grouped options (Discord and Waylar settings): one option per line, in a
   bordered group, instead of checkboxes running on as a paragraph. */
body.payflow-dashboard .card__body fieldset:not([style]) {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
body.payflow-dashboard .card__body fieldset:not([style]) > legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: var(--pf-text-sm);
  font-weight: 600;
}
body.payflow-dashboard fieldset > label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: var(--pf-text-ui);
  line-height: 1.45;
  cursor: pointer;
}
body.payflow-dashboard fieldset > label > input[type="checkbox"] { flex: none; margin-top: 1px; }
body.payflow-dashboard fieldset > :is(p, .field__hint) { margin: 2px 0 6px 28px; }
body.payflow-dashboard fieldset > label.field { margin: 4px 0 8px; }
/* A submit at the end of a stacked form keeps its own width. */
body.payflow-dashboard .stack > .btn { align-self: flex-start; }
body.payflow-dashboard .card__body > form + form { margin-top: 12px; }
body.payflow-dashboard .card__body > p { max-width: 80ch; }
body.payflow-dashboard .card__body :is(p, dd) > code { overflow-wrap: anywhere; }
body.payflow-dashboard fieldset > legend { margin-bottom: 10px; }
body.payflow-dashboard fieldset .row { gap: 10px 22px; }
body.payflow-dashboard label.row { font-size: var(--pf-text-ui); }
body.payflow-dashboard input[type="checkbox"] { width: 18px; height: 18px; }
body.payflow-dashboard input[type="checkbox"]:checked { box-shadow: none; }

/* ----------------------------------------------------------------- tables */

body.payflow-dashboard :is(table.data th, .pl-table thead th) {
  padding: 12px var(--pf-cell-x);
  background: var(--table-head);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
body.payflow-dashboard :is(table.data td, .pl-table tbody td) {
  padding: var(--pf-cell-y) var(--pf-cell-x);
  font-size: var(--pf-text-ui);
  line-height: 1.45;
}
body.payflow-dashboard :is(table.data, .pl-table) tbody tr:hover > :first-child { box-shadow: none; }
body.payflow-dashboard table.data td a:not(.btn) { font-weight: 450; }
body.payflow-dashboard .st-amount a { font-weight: 650; }
body.payflow-dashboard .st-amount__ccy { font-size: 12px; }
/* References are identifiers: one line, never broken mid-code. */
body.payflow-dashboard .payment-identity__ref {
  font-size: 13.5px;
  white-space: nowrap;
  overflow-wrap: normal;
}
body.payflow-dashboard .payment-identity__customer,
body.payflow-dashboard table.data td .payment-identity__customer a:not(.btn) { font-size: 13px; }
body.payflow-dashboard .st-table-card__count { font-size: 12.5px; padding: 1px 9px; }
body.payflow-dashboard .st-table-foot { padding: 14px var(--pf-cell-x); font-size: var(--pf-text-sm); }
body.payflow-dashboard .pl-reference { font-size: 13px; }
body.payflow-dashboard .pl-row__copy strong { font-size: var(--pf-text-ui); }
body.payflow-dashboard .pl-row__copy a { font-size: 13px; }
body.payflow-dashboard .pl-amount { font-size: var(--pf-text-ui); }
body.payflow-dashboard .pl-created span { font-size: 13.5px; }
body.payflow-dashboard .pl-created small { font-size: 12.5px; }
body.payflow-dashboard .pl-table-card__head,
body.payflow-dashboard .pl-table-card__foot { padding: 16px var(--pf-cell-x); }
body.payflow-dashboard .pl-table-card__foot > span { font-size: var(--pf-text-sm); }
body.payflow-dashboard :is(.pl-pager__page, .pagination)[aria-current="page"],
body.payflow-dashboard .pagination [aria-current="page"],
body.payflow-dashboard .pl-pager__page[aria-current="page"] { background: var(--accent); box-shadow: none; }
body.payflow-dashboard :is(.pl-pager__step, .pl-pager__page) { min-width: 34px; height: 34px; font-size: 13.5px; }

/* ------------------------------------------------------------- key/value */

body.payflow-dashboard .kv { gap: 0 24px; font-size: var(--pf-text-ui); }
body.payflow-dashboard .kv > dt,
body.payflow-dashboard .kv > dd { padding: 11px 0; }
body.payflow-dashboard .kv > dt { color: var(--ink-soft); }
body.payflow-dashboard .kv > dd.ref { font-size: 13px; }

/* --------------------------------------------------------- notices, empty */

body.payflow-dashboard .notice {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: var(--pf-text-ui);
  line-height: 1.5;
  box-shadow: none;
  animation: none;
}
body.payflow-dashboard .notice strong { margin-bottom: 4px; }
body.payflow-dashboard .empty { padding: 48px 24px; gap: 8px; }
body.payflow-dashboard .empty__title { font-size: 15px; }
body.payflow-dashboard .empty__hint { font-size: var(--pf-text-sm); }
body.payflow-dashboard .card__body > .empty::before { box-shadow: none; }

/* ----------------------------------------------------------------- tiles */

/* Five stat tiles fit one row at a laptop width instead of leaving one
   orphaned underneath. */
body.payflow-dashboard .tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--pf-gap-sm); }
/* Four tiles in a side-by-side page column read as a 2 x 2 block rather
   than three and an orphan. */
body.payflow-dashboard .split .tiles:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.payflow-dashboard .tile { padding: 20px 22px; gap: 8px; }
body.payflow-dashboard .tile__label { font-size: var(--pf-text-sm); color: var(--ink-soft); }
body.payflow-dashboard .tile__note { font-size: 13px; color: var(--ink-faint); }

/* ================================================================= home */

body.payflow-dashboard .dashboard-welcome.st-hero { padding: 8px 0 0; align-items: center; }
body.payflow-dashboard .st-hero__actions { gap: 10px; }
body.payflow-dashboard .st-today { gap: var(--pf-gap-sm); }
body.payflow-dashboard .st-today__main { padding: var(--pf-pad) calc(var(--pf-pad) + 4px); }
body.payflow-dashboard .st-today__head h1 { font-size: var(--pf-card-title); font-weight: 650; }
body.payflow-dashboard .st-today__metrics { gap: 48px; margin: 16px 0 18px; }
body.payflow-dashboard .st-today__metric-label { font-size: var(--pf-text-sm); }
body.payflow-dashboard .st-today__metric strong { font-size: 32px; }
body.payflow-dashboard .st-today__when { font-size: 13px; }
body.payflow-dashboard .st-today__foot { margin-top: 18px; padding-top: 20px; }
body.payflow-dashboard .st-today__foot-label { font-size: var(--pf-text-sm); }
body.payflow-dashboard .st-today__foot a { padding: 9px 16px; font-size: 14px; background: var(--surface); box-shadow: none; }
/* With one figure (PromptPay receipts) the four-column footer left the label
   half the card to wrap in; the figure takes the row and the link sits at the
   end of it. */
body.payflow-dashboard .st-today__foot:not(:has(> :nth-child(3))) { grid-template-columns: minmax(0, 1fr) auto; }
body.payflow-dashboard .st-chart__line:not(.st-chart__line--dashed) { filter: none; }
body.payflow-dashboard .st-chart__bar:last-of-type { fill: var(--chart); }
body.payflow-dashboard .st-chart__bar:hover { fill: var(--accent-strong); }
body.payflow-dashboard .st-chart__y { font-size: 12px; }
body.payflow-dashboard .st-chart__x { font-size: 12px; }
body.payflow-dashboard .st-chart__legend { font-size: 13px; }
body.payflow-dashboard .st-chart__tooltip { font-size: 13.5px; background: var(--surface-raised); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Quick actions fill the hero row's height so the column ends level with
   the Today card. */
body.payflow-dashboard .st-today__aside { gap: var(--pf-gap-sm); grid-template-rows: 1fr; }
body.payflow-dashboard .st-side-card { padding: 20px var(--pf-pad) var(--pf-pad); display: flex; flex-direction: column; }
body.payflow-dashboard .st-side-card header { margin-bottom: 14px; }
body.payflow-dashboard .st-side-card .quick-links { flex: 1; align-content: start; gap: 10px; }
body.payflow-dashboard .quick-link { padding: 13px 14px; gap: 14px; }
body.payflow-dashboard .quick-link__icon { width: 38px; height: 38px; border-radius: 10px; }
body.payflow-dashboard .quick-link__icon svg { width: 19px; height: 19px; }
body.payflow-dashboard .quick-link__copy { gap: 2px; }
body.payflow-dashboard .quick-link__copy strong { font-size: var(--pf-text-ui); }
body.payflow-dashboard .quick-link__copy span { font-size: 13px; color: var(--ink-faint); }
body.payflow-dashboard .quick-link:hover { background: var(--row-hover); border-color: var(--line-strong); }

/* Attention strip: four queues side by side under the hero, so anything that
   needs a person is seen before the charts. */
body.payflow-dashboard .pf-attention {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
body.payflow-dashboard .pf-attention__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
body.payflow-dashboard .pf-attention__head h2 { margin: 0; font-size: var(--pf-card-title); font-weight: 650; }
body.payflow-dashboard .pf-attention__head p { margin: 2px 0 0; color: var(--ink-faint); font-size: var(--pf-text-sm); }
body.payflow-dashboard .pf-attention__head a { font-size: 14px; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
body.payflow-dashboard .pf-attention .attention-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--pf-gap-sm);
}
body.payflow-dashboard .pf-attention .attention-row {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 6px 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
body.payflow-dashboard .pf-attention .attention-row__signal { display: none; }
body.payflow-dashboard .pf-attention .attention-row__copy { grid-column: 1; grid-row: 1 / span 2; gap: 3px; }
body.payflow-dashboard .pf-attention .attention-row__copy strong { font-size: var(--pf-text-ui); line-height: 1.35; }
body.payflow-dashboard .pf-attention .attention-row__copy small { font-size: 13px; line-height: 1.4; }
body.payflow-dashboard .pf-attention .attention-row__count {
  grid-column: 2;
  grid-row: 1;
  font-size: 24px;
  font-weight: 680;
  line-height: 1.1;
  color: var(--ink-faint);
}
body.payflow-dashboard .pf-attention .attention-row__go { display: none; }
body.payflow-dashboard .pf-attention .attention-row.is-active { border-color: var(--warn-line); background: var(--warn-soft); }
body.payflow-dashboard .pf-attention .attention-row.is-active .attention-row__count { color: var(--warn); }
body.payflow-dashboard .pf-attention .attention-row:hover { border-color: var(--line-strong); background: var(--row-hover); }
body.payflow-dashboard .pf-attention .attention-row.is-active:hover { border-color: var(--warn); background: var(--warn-soft); }

body.payflow-dashboard .st-overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--pf-gap-sm); }
body.payflow-dashboard .st-overview__head { gap: 16px; align-items: center; }
body.payflow-dashboard .st-overview__title h2 { font-size: 21px; font-weight: 680; }
body.payflow-dashboard .st-overview__title p { font-size: var(--pf-text-sm); }
body.payflow-dashboard .st-overview__grid { gap: var(--pf-gap-sm); }
body.payflow-dashboard .st-metric-card { padding: 20px 22px 16px; }
body.payflow-dashboard .st-metric-card header { gap: 8px; margin-bottom: 14px; }
body.payflow-dashboard .st-metric-card h3,
body.payflow-dashboard .st-metric-card header h3 { font-size: var(--pf-text-sm); font-weight: 600; color: var(--ink-soft); }
body.payflow-dashboard .st-metric-card__value strong,
body.payflow-dashboard .st-metric-card header strong { font-size: 26px; }
body.payflow-dashboard .st-metric-card header span { font-size: 13px; }
body.payflow-dashboard .st-metric-card__icon { width: 30px; height: 30px; }

/* Mix and top customers share a row. */
body.payflow-dashboard .pf-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--pf-gap-sm);
  align-items: stretch;
}
body.payflow-dashboard .pf-pair > .card { min-width: 0; }
body.payflow-dashboard .st-top-customers { gap: 0; }
body.payflow-dashboard .st-top-customers li { padding: 12px 0; font-size: var(--pf-text-ui); border-color: var(--line-soft); }
body.payflow-dashboard .st-top-customers a { color: var(--ink); font-weight: 500; }
body.payflow-dashboard .st-top-customers a:hover { color: var(--accent-ink); }
body.payflow-dashboard .status-donut { gap: 32px; }
body.payflow-dashboard .status-donut__item { padding: 9px 10px; font-size: var(--pf-text-ui); }
body.payflow-dashboard .status-donut__item-name { gap: 10px; font-size: var(--pf-text-ui); }
body.payflow-dashboard .status-donut__item-name i { width: 10px; height: 10px; }
body.payflow-dashboard .status-donut__item-value { gap: 10px; font-size: var(--pf-text-ui); }
body.payflow-dashboard .status-donut__item-value small { min-width: 44px; font-size: 13px; text-align: right; }
body.payflow-dashboard .status-donut__center span { font-size: 13px; }

/* The live region holds each home and reporting section as a bare sibling;
   without a gap they touched. */
body.payflow-dashboard [data-live-content],
body.payflow-dashboard .dashboard { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--pf-gap); }
body.payflow-dashboard [data-live-content] > :empty { display: none; }
/* Stated with the .dashboard parent so it outranks the first-child reset in
   app.css and dashboard.css, which stripped the top border and padding from
   whichever panel came first. */
body.payflow-dashboard .st-panel,
body.payflow-dashboard .dashboard > .st-panel:first-child {
  padding: 20px var(--pf-pad) var(--pf-pad);
  border-top: 1px solid var(--line);
}
body.payflow-dashboard .st-panel > .section-heading { margin-bottom: 16px; }
body.payflow-dashboard .st-kpi-row { gap: var(--pf-gap-sm); }
body.payflow-dashboard .st-kpi { padding: 20px; gap: 16px; }
body.payflow-dashboard .st-kpi__label { font-size: var(--pf-text-sm); font-weight: 600; color: var(--ink-soft); }
body.payflow-dashboard .st-kpi__value { font-size: 26px; }
body.payflow-dashboard .st-kpi__foot { font-size: 13px; }
body.payflow-dashboard .metric-card--attention { border-color: var(--warn-line); }

body.payflow-dashboard .health-grid { gap: var(--pf-gap-sm); }
body.payflow-dashboard .health-item { padding: 18px 20px; gap: 6px; }
body.payflow-dashboard .health-item__label { font-size: 13px; }
body.payflow-dashboard .health-item strong { font-size: var(--pf-text-ui); }
body.payflow-dashboard .health-item p { font-size: 13.5px; }
body.payflow-dashboard .health-item a { font-size: 13.5px; }
body.payflow-dashboard .st-panel__foot .freshness { font-size: 12.5px; }

/* ======================================================== other screens */

/* Payment links: the total belongs with the table it counts. */
body.payflow-dashboard .pl-count { width: auto; font-size: var(--pf-text-sm); }
body.payflow-dashboard .payment-links-layout { grid-template-columns: 300px minmax(0, 1fr); gap: var(--pf-gap-sm); }
body.payflow-dashboard .pl-table thead th,
body.payflow-dashboard .pl-table tbody td { padding-inline: 14px; }
body.payflow-dashboard .pl-table :is(thead th, tbody td):first-child { padding-left: 20px; }
body.payflow-dashboard .pl-glyph--tile { width: 38px; height: 38px; }
body.payflow-dashboard .pl-glyph--lg { width: 48px; height: 48px; }
/* The supplied glyph tiles are drawn in the old violet; shifted to the
   OnePayy blue rather than redrawn. */
body.payflow-dashboard .pl-glyph { filter: hue-rotate(-28deg) saturate(.92); }
body.payflow-dashboard .pl-create .card__body { gap: 14px; }
body.payflow-dashboard .pl-create h2 { font-size: var(--pf-card-title); }
body.payflow-dashboard .pl-create p { font-size: 13.5px; }
body.payflow-dashboard .pl-search input { width: 240px; height: 38px; font-size: 14px; }
body.payflow-dashboard .recipient-summary { padding: 14px 16px; }
body.payflow-dashboard .recipient-summary > span { font-size: 13px; }
body.payflow-dashboard .recipient-summary > strong { font-size: 15px; }
body.payflow-dashboard .recipient-summary > div { font-size: 13.5px; }

/* Settings cards. */
body.payflow-dashboard .st-settings__card { padding: 18px 20px; gap: 14px; }
body.payflow-dashboard .st-settings__card:hover { background: var(--row-hover); text-decoration: none; }
body.payflow-dashboard .st-settings__card strong { color: var(--ink); font-size: var(--pf-text-ui); }
body.payflow-dashboard .st-settings__card:hover strong { color: var(--accent-ink); }
body.payflow-dashboard .st-settings__card em { color: var(--ink-faint); font-size: 13.5px; }

/* Customer and balance pages. */
body.payflow-dashboard :is(.st-customer__main, .st-customer__side, .st-balance-main, .st-balance-side) { gap: var(--pf-gap-sm); }
body.payflow-dashboard .st-balance-layout,
body.payflow-dashboard .st-customer,
body.payflow-dashboard .report-grid { gap: var(--pf-gap-sm); }
body.payflow-dashboard .st-insight > div { padding: 14px 16px; }
body.payflow-dashboard .st-insight dt { font-size: 13px; }
body.payflow-dashboard .st-customer-head__avatar { background: var(--accent); box-shadow: none; }
body.payflow-dashboard .st-customer-head__email { font-size: var(--pf-text); }

/* Bars and progress fills are flat. */
body.payflow-dashboard .activity-chart__track > span,
body.payflow-dashboard .activity-chart__column:hover > .activity-chart__track > span,
body.payflow-dashboard .status-breakdown__track > span,
body.payflow-dashboard .st-balance-bar__incoming { background: var(--chart); box-shadow: none; }
body.payflow-dashboard .pf-progress { background: var(--accent); box-shadow: none; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 1240px) {
  body.payflow-dashboard .pf-attention .attention-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.payflow-dashboard .pf-pair { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root, html[data-density="compact"] { --pf-page-x: 16px; --pf-page-top: 22px; --pf-title: 24px; }
  body.payflow-dashboard .shell { grid-template-columns: 1fr; }
  body.payflow-dashboard .content { padding-top: 20px; padding-bottom: 48px; }
  body.payflow-dashboard .st-topbar { padding-inline: 16px; }
  body.payflow-dashboard .payment-links-layout { grid-template-columns: minmax(0, 1fr); }
  body.payflow-dashboard .split { grid-template-columns: minmax(0, 1fr); }
  body.payflow-dashboard .st-today__main { padding: 18px; }
  body.payflow-dashboard .st-today__metrics { flex-wrap: wrap; gap: 16px 28px; }
  body.payflow-dashboard .st-today__metric strong { font-size: 26px; }
  body.payflow-dashboard .st-today__legend { margin-left: 0; }
  body.payflow-dashboard .st-overview__head { align-items: flex-start; }
  body.payflow-dashboard .st-overview__controls { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  body.payflow-dashboard .pf-attention .attention-list { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================================
   12 Oct 2026 pass: hierarchy in both themes.

   White is kept for what you read and type into (cards, tables, fields);
   the page, the rail, card heads, table heads and hovers are grey, so a
   screen reads as rail > page > card > head > rows. Blue marks actions and
   where you are. Shared pieces for row actions and short lists live here
   too, so every page uses the same ones.
   ========================================================================= */

/* ---------------------------------------------------------------- rail */

/* Navy rail, white type. Only the rail's own pieces are recoloured; the
   workspace menu that opens from it keeps the page's light surface. */
body.payflow-dashboard .sidebar {
  background: var(--rail);
  border-right: 1px solid var(--rail);
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
body.payflow-dashboard .st-account > summary,
html[data-theme] body.payflow-dashboard .st-account > summary {
  border: 1px solid var(--rail-line);
  background: rgba(255, 255, 255, .06);
  box-shadow: none;
}
body.payflow-dashboard .st-account > summary:hover,
html[data-theme] body.payflow-dashboard .st-account > summary:hover { background: var(--rail-hover); border-color: rgba(255, 255, 255, .22); }
body.payflow-dashboard .st-account > summary .st-account__copy strong { color: var(--rail-ink); }
body.payflow-dashboard .st-account > summary .st-account__copy span { color: var(--rail-ink-faint); }
body.payflow-dashboard .st-account > summary .st-account__caret { color: var(--rail-ink-faint); stroke: currentColor; }

body.payflow-dashboard .sidebar :is(.nav__link, .st-nav__fold > summary) { color: var(--rail-ink-soft); }
body.payflow-dashboard .sidebar :is(.nav__link svg, .st-nav__fold > summary .nav__label svg) { color: var(--rail-ink-faint); }
body.payflow-dashboard .sidebar :is(.nav__link, .st-nav__fold > summary):hover { background-color: var(--rail-hover); color: var(--rail-ink); }
body.payflow-dashboard .sidebar :is(.nav__link:hover svg, .st-nav__fold > summary:hover .nav__label svg) { color: var(--rail-ink-soft); }
body.payflow-dashboard .sidebar .st-nav__chevron { stroke: var(--rail-ink-faint); }

/* The current page: a lighter band with a bright blue edge. */
html[data-theme] body.payflow-dashboard .sidebar .nav__link[aria-current="page"] {
  background: var(--rail-active);
  color: var(--rail-ink);
  font-weight: 600;
  box-shadow: none;
}
body.payflow-dashboard .sidebar .nav__link[aria-current="page"] svg { color: var(--rail-mark); }
body.payflow-dashboard .sidebar .nav__link[aria-current="page"]::before { background: var(--rail-mark); box-shadow: none; }

/* Folded groups hang off a thin guide line. */
body.payflow-dashboard .sidebar .nav__link--sub { background-image: linear-gradient(var(--rail-line), var(--rail-line)); }
html[data-theme] body.payflow-dashboard .sidebar .nav__link--sub[aria-current="page"] {
  background:
    linear-gradient(var(--rail-mark), var(--rail-mark)) 21px 50% / 2px 60% no-repeat,
    var(--rail-active);
  color: var(--rail-ink);
}

body.payflow-dashboard .sidebar .nav__section { color: var(--rail-ink-faint); }
body.payflow-dashboard .sidebar .nav--foot { border-top-color: var(--rail-line); }
/* Counts stay amber, solid enough to read on navy. */
body.payflow-dashboard .sidebar .nav__count { background: #f5c451; color: #2b1d00; box-shadow: none; }

@media (max-width: 1024px) {
  html[data-theme] body.payflow-dashboard .st-nav-toggle { border-color: var(--rail-line); background: rgba(255, 255, 255, .08); color: var(--rail-ink); }
  html[data-theme] body.payflow-dashboard .st-nav-toggle[aria-expanded="true"] { border-color: var(--rail-mark); background: var(--rail-active); color: var(--rail-ink); }
}

/* ------------------------------------------------------------- top bar */

body.payflow-dashboard .st-topbar { background: var(--surface-veil); border-bottom: 1px solid var(--line); }
body.payflow-dashboard .header-search { border: 1px solid var(--field-line); background: var(--field); }
body.payflow-dashboard .utility-button:hover { background: var(--btn-hover); }

/* ---------------------------------------------------- cards and heads */

body.payflow-dashboard :is(.card, .st-side-card, .st-metric-card, .st-settings__card, .operational-section, .st-today__main, .st-panel, .st-kpi, .metric-card--plain, .tile) {
  border-color: var(--line);
  border-radius: var(--radius);
}
/* Card titles sit on a grey band, so every card starts with a clear line
   between what it is and what it holds. */
body.payflow-dashboard .card > :is(.card__head, .card__header),
body.payflow-dashboard :is(.st-table-card__head, .pl-table-card__head) {
  background: var(--surface-head);
  border-bottom: 1px solid var(--line);
}
body.payflow-dashboard .card > :is(.card__head, .card__header):first-child,
body.payflow-dashboard :is(.st-table-card__head, .pl-table-card__head):first-child {
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
body.payflow-dashboard .card > :is(.card__head, .card__header):last-child { border-bottom: 0; border-radius: calc(var(--radius) - 1px); }
body.payflow-dashboard :is(.card__head, .card__header) {
  min-height: 0;
  padding: 14px var(--pf-pad);
}
body.payflow-dashboard :is(.card__head, .card__header) h2,
body.payflow-dashboard :is(.st-table-card__head, .pl-table-card__head) h2 { font-size: 16px; font-weight: 650; }
body.payflow-dashboard .card__foot { background: var(--surface-head); border-top: 1px solid var(--line); border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
/* Glyph tiles beside card titles: a plain outlined square, not a tinted one. */
body.payflow-dashboard :is(.card__head, .card__header) .st-card-icon {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}
body.payflow-dashboard .pf-head-meta { color: var(--ink-faint); font-size: var(--pf-text-sm); white-space: nowrap; }

/* A description list straight inside a card body had the list's default
   1em margins on top of the body padding: an empty band above the first row. */
body.payflow-dashboard :is(.card__body, .card) > .kv { margin: 0; }
body.payflow-dashboard :is(.card__body, .card) > .kv > :is(dt, dd):nth-child(-n + 2) { padding-top: 0; }
body.payflow-dashboard :is(.card__body, .card) > .kv > :is(dt, dd):nth-last-child(-n + 2) { padding-bottom: 0; }
body.payflow-dashboard .kv > :is(dt, dd) { border-color: var(--line-soft); }

body.payflow-dashboard :is(.health-item, .st-insight > div, .recipient-summary) { background: var(--surface-sunk); border-color: var(--line-soft); }

/* ------------------------------------------------------------- tables */

body.payflow-dashboard :is(table.data, .pl-table) thead th {
  background: var(--table-head);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}
body.payflow-dashboard :is(table.data, .pl-table) tbody td { border-bottom: 1px solid var(--line-soft); }
body.payflow-dashboard :is(table.data, .pl-table) tbody tr:last-child > td { border-bottom: 0; }
body.payflow-dashboard :is(table.data, .pl-table) tbody tr:hover > td { background: var(--row-hover); }
body.payflow-dashboard table.data td.ref,
body.payflow-dashboard table.data td .ref { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
/* A table that is wider than its card scrolls inside the card. */
body.payflow-dashboard .tablewrap { overflow-x: auto; }
body.payflow-dashboard .tablewrap:has(.pf-confirm[open]) { overflow: visible; }

/* Two lines in one cell: the name, then a grey detail line. */
body.payflow-dashboard .pf-sub { display: block; margin-top: 2px; color: var(--ink-faint); font-size: var(--pf-text-sm); }
body.payflow-dashboard .pf-host { font-weight: 600; color: var(--ink); overflow-wrap: break-word; }
body.payflow-dashboard .pf-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* -------------------------------------------------------------- buttons */

body.payflow-dashboard .btn {
  border-color: var(--btn-line);
  background: var(--btn);
  color: var(--ink);
  font-weight: 600;
}
body.payflow-dashboard .btn:hover { background: var(--btn-hover); border-color: var(--line-strong); color: var(--ink); }
body.payflow-dashboard .btn--primary,
html[data-theme] body.payflow-dashboard .btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
body.payflow-dashboard .btn--primary:hover,
html[data-theme] body.payflow-dashboard .btn--primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
body.payflow-dashboard .btn--ghost { background: transparent; border-color: transparent; color: var(--accent-ink); }
body.payflow-dashboard .btn--ghost:hover { background: var(--btn-hover); border-color: transparent; }
body.payflow-dashboard .btn--danger { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
body.payflow-dashboard .btn--danger:hover { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
/* Remove, revoke: an ordinary button until hovered, so a row of actions is
   not a row of red. */
body.payflow-dashboard .btn--quiet-danger { color: var(--bad); }
body.payflow-dashboard .btn--quiet-danger:hover { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
body.payflow-dashboard .btn:disabled,
body.payflow-dashboard .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* --------------------------------------------------------------- fields */

body.payflow-dashboard :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="range"]):not([type="file"]), select, textarea) {
  border-color: var(--field-line);
  background-color: var(--field);
}
body.payflow-dashboard :where(input, select, textarea):is([readonly], :disabled) { background-color: var(--surface-sunk); }
/* A settings form stacks one field per line; a 1,000px box for a number
   or a short name was hard to scan. Grids keep their own widths. */
body.payflow-dashboard .card__body > form > .field > :is(input:not([type="checkbox"]):not([type="radio"]), select) { max-width: 560px; }

/* ------------------------------------------------------- status pills */

body.payflow-dashboard :is(.pill, .pl-status) { border-radius: 6px; }
body.payflow-dashboard .pill--muted { background: var(--surface-sunk); border-color: var(--line); color: var(--ink-soft); }

/* ---------------------------------------------- row actions + confirm */

body.payflow-dashboard .pf-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
body.payflow-dashboard td.num .pf-row-actions { display: flex; }

/* A button that opens a small panel under it with what the action needs
   (password, a reason, a tick) and the real submit. Nothing is sent until
   the panel's own button is pressed. */
body.payflow-dashboard .pf-confirm { position: relative; display: inline-block; }
body.payflow-dashboard .pf-confirm > summary { list-style: none; cursor: pointer; white-space: nowrap; }
body.payflow-dashboard .pf-confirm > summary::-webkit-details-marker { display: none; }
body.payflow-dashboard .pf-confirm[open] > summary { background: var(--btn-hover); border-color: var(--line-strong); }
body.payflow-dashboard .pf-confirm[open] > summary.btn--primary { background: var(--accent-strong); border-color: var(--accent-strong); }
body.payflow-dashboard .pf-confirm__pop {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 12px;
  width: 320px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
  text-align: left;
  white-space: normal;
}
body.payflow-dashboard .pf-confirm--wide > .pf-confirm__pop { width: 400px; }
body.payflow-dashboard .pf-confirm__pop > p { margin: 0; color: var(--ink-soft); font-size: var(--pf-text-sm); line-height: 1.45; }
body.payflow-dashboard .pf-confirm__pop .field { gap: 6px; }
body.payflow-dashboard .pf-confirm__pop :is(input:not([type="checkbox"]), select) { width: 100%; }
body.payflow-dashboard .pf-confirm__pop > .btn { justify-self: start; }
body.payflow-dashboard .pf-confirm__pop > .field__hint { margin: 0; }

body.payflow-dashboard .pf-check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--pf-text-sm); line-height: 1.45; color: var(--ink); cursor: pointer; }
body.payflow-dashboard .pf-check > input { flex: none; margin-top: 1px; }
body.payflow-dashboard .pf-checks { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
body.payflow-dashboard .pf-checks > legend { padding: 0; margin-bottom: 4px; }
body.payflow-dashboard .pf-pair-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* --------------------------------------------- one-line forms in a card */

/* Fields and the submit on one line, the hint underneath. */
body.payflow-dashboard .pf-inline-form > form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; }
body.payflow-dashboard .pf-inline-form > form > .field { flex: 1 1 220px; max-width: 340px; }
body.payflow-dashboard .pf-inline-form > form > .field :is(input, select) { width: 100%; }
body.payflow-dashboard .pf-inline-form > .field__hint { margin: 10px 0 0; }
body.payflow-dashboard .card > .pf-inline-form { border-bottom: 1px solid var(--line); }

/* ------------------------------------------------ segmented list tabs */

body.payflow-dashboard .pf-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px var(--pf-pad);
  border-bottom: 1px solid var(--line);
}
body.payflow-dashboard .pf-segment > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: var(--pf-text-sm);
  font-weight: 600;
  text-decoration: none;
}
body.payflow-dashboard .pf-segment > a:hover { background: var(--btn-hover); color: var(--ink); }
body.payflow-dashboard .pf-segment > a[aria-current="page"] { border-color: var(--line); background: var(--surface-sunk); color: var(--ink); }
body.payflow-dashboard .pf-segment__count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--surface-sunk);
  color: var(--ink-faint);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
body.payflow-dashboard .pf-segment > a[aria-current="page"] .pf-segment__count { background: var(--accent); color: #fff; }

/* -------------------------------------- a closed drawer at a card's end */

/* Old or removed items, out of the way but one click from being seen. */
body.payflow-dashboard .pf-drawer { border-top: 1px solid var(--line); }
body.payflow-dashboard .pf-drawer > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--pf-pad);
  color: var(--ink-soft);
  font-size: var(--pf-text-sm);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
body.payflow-dashboard .pf-drawer > summary::-webkit-details-marker { display: none; }
body.payflow-dashboard .pf-drawer > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
body.payflow-dashboard .pf-drawer[open] > summary::before { transform: rotate(45deg); }
body.payflow-dashboard .pf-drawer > summary:hover { background: var(--row-hover); color: var(--ink); }
body.payflow-dashboard .pf-drawer[open] > summary { border-bottom: 1px solid var(--line-soft); }
body.payflow-dashboard .pf-drawer__count { padding: 0 7px; border-radius: 5px; background: var(--surface-sunk); color: var(--ink-faint); font-size: 12px; }
body.payflow-dashboard .pf-drawer:last-child { border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
body.payflow-dashboard .pf-drawer .data tbody td { color: var(--ink-soft); }

/* ------------------------------------------------------------- phones */

@media (max-width: 700px) {
  body.payflow-dashboard .pf-confirm__pop,
  body.payflow-dashboard .pf-confirm--wide > .pf-confirm__pop { width: min(320px, calc(100vw - 32px)); }
  body.payflow-dashboard .pf-pair-fields { grid-template-columns: 1fr; }
  body.payflow-dashboard .pf-inline-form > form > .field { max-width: none; }
}

/* --------------------------------------------------------- filter bars */

/* A card that only holds filters is grey, so the white results card under
   it reads as the content and the filters as the controls above it. */
body.payflow-dashboard form.card:has(> .card__body > .filters),
body.payflow-dashboard .st-filter-card { background: var(--surface-head); }
body.payflow-dashboard form.card > .card__body:has(> .filters) { padding: 16px var(--pf-pad); }
/* Fields keep a working width instead of one select stretching the row. */
body.payflow-dashboard .filters > .field { flex: 0 1 240px; min-width: 150px; }
body.payflow-dashboard .filters > .field :is(input, select) { width: 100%; }
body.payflow-dashboard .filters > :is(.btn, button) { flex: none; }

/* Bulk trash and restore for a list: one quiet line above the table. */
body.payflow-dashboard .pf-trash-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
}
body.payflow-dashboard .pf-trash-bar .field__hint { margin: 0 0 0 4px; font-size: 13px; }

/* ------------------------------------------------------ wide tables */

/* Lists with many columns: tighter sides so the last column is on screen
   at a laptop width, and names that do not break into a tower of words. */
body.payflow-dashboard table.st-table :is(th, td) { padding-inline: 14px; }
body.payflow-dashboard table.st-table :is(th, td):first-child { padding-left: 20px; }
body.payflow-dashboard table.st-table :is(th, td):last-child { padding-right: 20px; }
body.payflow-dashboard .st-person { min-width: 180px; }
body.payflow-dashboard .st-person__copy > a { white-space: nowrap; }
body.payflow-dashboard .st-person__copy > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
body.payflow-dashboard table.st-table .pf-cell__main { white-space: nowrap; }

/* Payment links: the checkout address is one line with an ellipsis, so the
   amount and status columns stay in view. */
body.payflow-dashboard .pl-table tbody td:first-child { min-width: 260px; max-width: 440px; }
body.payflow-dashboard .pl-row__copy { min-width: 0; }
body.payflow-dashboard .pl-row__copy > :is(strong, a) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Audit log: long ids on one line (the full id is still selected and
   copied), and change details that scroll inside a small box. */
body.payflow-dashboard .pf-audit .ref { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.payflow-dashboard .pf-audit pre.codeblock { width: 300px; max-height: 132px; margin: 0; overflow: auto; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Product QRs and two cards side by side. */
body.payflow-dashboard .pf-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--pf-gap-sm); }
body.payflow-dashboard .pf-qr-thumb { display: inline-block; }
body.payflow-dashboard .pf-qr-thumb img { display: block; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* ---------------------------------------------- sign-in and two-factor */

/* Plain grey page and a white card, no artwork behind it. */
.authpage { background-image: none; background-color: var(--paper); }
.authcard {
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.authcard .btn--primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.authcard .btn--primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); }
.authcard :is(input:not([type="checkbox"]):not([type="radio"]), select) { border-color: var(--field-line); background-color: var(--field); }
.authcard .language-switcher a[aria-current="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--line); }
.authcard__tools .utility-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* A one-line note between cards (where a payment came from). */
body.payflow-dashboard .pf-source-line { margin: 0; color: var(--ink-faint); font-size: var(--pf-text-sm); }

/* The content column already spaces its blocks evenly; older pages also set
   their own card margins inline, which doubled some gaps. One rhythm. */
body.payflow-dashboard .content > :is(section.card, details.card, form.card, div.card) { margin-top: 0 !important; margin-bottom: 0 !important; }

/* A whole card folded to its title (an optional, rarely used form). */
body.payflow-dashboard details.pf-card-fold > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px var(--pf-pad);
  border-radius: calc(var(--radius) - 1px);
  background: var(--surface-head);
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
body.payflow-dashboard details.pf-card-fold > summary::-webkit-details-marker { display: none; }
body.payflow-dashboard details.pf-card-fold > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-faint);
  border-bottom: 1.5px solid var(--ink-faint);
  transform: rotate(-45deg);
}
body.payflow-dashboard details.pf-card-fold[open] > summary { border-bottom: 1px solid var(--line); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
body.payflow-dashboard details.pf-card-fold[open] > summary::before { transform: rotate(45deg); }
body.payflow-dashboard details.pf-card-fold > summary:hover { background: var(--btn-hover); }

/* Phones: short admin tables become one block per row (name and state on
   top, actions underneath) instead of a table scrolled sideways, and page
   actions drop under the title. */
@media (max-width: 700px) {
  body.payflow-dashboard .st-pagehead { flex-direction: column; align-items: stretch; }
  body.payflow-dashboard .st-pagehead__actions { justify-content: flex-start; }
  body.payflow-dashboard table.pf-stack-sm thead { display: none; }
  body.payflow-dashboard table.pf-stack-sm,
  body.payflow-dashboard table.pf-stack-sm tbody { display: block; }
  body.payflow-dashboard table.pf-stack-sm tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
  }
  body.payflow-dashboard table.pf-stack-sm tr:last-child { border-bottom: 0; }
  body.payflow-dashboard table.pf-stack-sm tbody td { display: block; padding: 0; border: 0; background: none; }
  body.payflow-dashboard table.pf-stack-sm tbody td:first-child { flex: 1 0 100%; }
  body.payflow-dashboard table.pf-stack-sm tbody td.num { flex: 1 0 100%; text-align: left; }
  body.payflow-dashboard table.pf-stack-sm .pf-row-actions { justify-content: flex-start; }
  body.payflow-dashboard table.pf-stack-sm .pf-confirm__pop { left: 0; right: auto; }
}
