/* =====================================================================
   Cadence — admin dashboard
   COMPONENTS — every visual piece with a shape of its own: brand, buttons,
   form fields, login, revenue band, stat tiles, charts, tables, dialogs,
   badges, toast/loading, skeleton, entrance, trend chips, slide-over,
   empty states, tooltips, filters, notices, and the bank-details block.
   Styled to Material Design 3: pill controls with state layers, filled
   text fields with bottom indicators, tonal chip/badge containers, and
   the token-driven shape/elevation scales from tokens.css.
   No media queries here — every one lives in responsive.css.
   ===================================================================== */

/* ---------- Brand ---------- */
.brand__logo { width: 40px; height: 40px; display: block; flex: none; }
.brand__logo svg { width: 100%; height: 100%; }
.brand__word { font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; }
.brand__tag {
  font-size: .62rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-tint); padding: 2px 8px; border-radius: 999px;
}

/* ---------- Buttons — M3 pill buttons; filled primary + outlined/tonal kinds ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: var(--type-label-lg); padding: 12px 24px;
  border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: transform .14s var(--ease), background .18s var(--ease),
              border-color .18s var(--ease), color .18s var(--ease),
              box-shadow .18s var(--ease);
}
.btn .ic { width: var(--ic-sm); height: var(--ic-sm); }
.btn--sm { padding: 10px 18px; font-size: var(--type-body-md); }
.btn--block { width: 100%; }
.btn--primary { color: #fff; background: var(--accent); }
/* Filled button hover = M3 state layer: a translucent on-primary wash over
   the same fill (the base colour never changes underneath). */
.btn--primary:hover {
  background-image: linear-gradient(rgb(255 255 255 / .12), rgb(255 255 255 / .12));
  box-shadow: var(--shadow-hair);
}
.btn--primary:active {
  transform: scale(.98);
  background-image: linear-gradient(rgb(255 255 255 / .20), rgb(255 255 255 / .20));
  box-shadow: none;
}
.btn--ghost { color: var(--text); background: transparent; border-color: var(--border); }
.btn--ghost:hover {
  border-color: var(--accent); color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
/* Compact per-row action buttons (Approve / Reject in tables). */
.btn--row { padding: 8px 16px; font-size: var(--type-body-md); }
.btn--approve { color: var(--accent-ink); border-color: transparent; background: var(--accent-tint); }
.btn--approve:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--danger { color: var(--bad-ink); border-color: transparent; background: var(--bad-tint); }
.btn--danger:hover { background: var(--bad-ink); color: #fff; border-color: var(--bad-ink); }
/* Cautionary support action (Unbind device) — warn tone, not destructive-red. */
.btn--warn { color: var(--warn-ink); border-color: transparent; background: var(--warn-tint); }
.btn--warn:hover { background: var(--warn-ink); color: #fff; border-color: var(--warn-ink); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* The mobile-drawer hamburger is hidden on desktop. This must live after the
   .btn rules so it wins the equal-specificity cascade (base.css was too early);
   the under-900px block in responsive.css re-shows it. */
.pagehead__menu { display: none; }

/* ---------- Form fields — M3 filled style: tonal fill + bottom indicator ---------- */
.field { display: grid; gap: 6px; }
.field__label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.field__opt { color: var(--faint); font-weight: 500; }
.field__input {
  width: 100%; padding: 14px 16px 12px; background: var(--surface-2); color: var(--text);
  border: none; border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease),
              background .16s var(--ease);
}
.field__input::placeholder { color: var(--faint); }
.field__input:hover { background: color-mix(in srgb, var(--text) 4%, var(--surface-2)); }
.field__input:focus {
  outline: none; border-bottom-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.field__input:read-only { background: var(--surface-3); color: var(--muted); cursor: default; }
.field__input--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .32em; text-align: center; font-size: 1.2rem;
}
.field__select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2352525B' stroke-width='1.8' stroke-linecap='square'/%3E%3C/svg%3E");
  background-position: calc(100% - 16px) center;
  background-size: 10px 6px; background-repeat: no-repeat;
}
/* Search input with a leading icon */
.field--search { position: relative; }
.field__affix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--faint); pointer-events: none;
}
.field__input--affixed { padding-left: 38px; }
.field__hint { font-size: .78rem; color: var(--muted); margin-top: -8px; }
.field__textarea { resize: vertical; min-height: 76px; line-height: 1.45; }

/* ---------- Login — single centered elevated card on the tonal canvas ---------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; background: var(--bg);
}
.login__card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: clamp(28px, 5vw, 40px);
}
.login__logo { width: 52px; height: 52px; display: block; margin: 0 auto 16px; }
.login__logo svg { width: 100%; height: 100%; }
.login__title { text-align: center; font-size: 1.35rem; letter-spacing: -.02em; margin-bottom: 6px; }
.login__lead { color: var(--muted); text-align: center; font-size: .95rem; margin-bottom: 24px; }
.login__form { display: grid; gap: 15px; }
.login__code-row { display: grid; gap: 15px; }
.login__error { color: var(--bad-ink); font-size: .9rem; font-weight: 500; min-height: 1.2em; }
.login__error:empty { min-height: 0; }

/* ---------- Revenue band — the honest-money headline ----------
   Elevated card; the green appears only on the eyebrow icon and the MRR
   figure, so revenue is never shouted in a tinted panel. */
.revenue {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 30px);
  align-items: center;
  margin-bottom: 22px;
  padding: clamp(18px, 3vw, 28px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-2);
  background: var(--surface);
  box-shadow: var(--shadow-hair);
}
.revenue__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.revenue__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .82rem; font-weight: 600; color: var(--muted);
}
.revenue__eyebrow-icon {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--accent);
}
.revenue__eyebrow-icon .ic { width: 16px; height: 16px; }
.revenue__value {
  font-size: clamp(2.1rem, 5vw, 3rem); font-weight: 750; line-height: 1.02;
  letter-spacing: -.03em; color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.revenue__note { color: var(--muted); font-size: .82rem; max-width: 50ch; margin-top: 2px; }
.revenue__side {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 22px);
  padding-left: clamp(12px, 2vw, 24px);
  border-left: 1px solid var(--border-2);
}
.revenue__metric { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.revenue__metric-value {
  font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 750; line-height: 1;
  letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums;
}
.revenue__metric--pay .revenue__metric-value { color: var(--accent-ink); }
.revenue__metric-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.revenue__metric-note { font-size: .72rem; color: var(--faint); }

/* ---------- Stat tiles — tonal cards that lift on hover ---------- */
.stat-grid {
  display: grid; gap: var(--space-lg); margin-bottom: var(--space-xl);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.stat-tile {
  display: flex; flex-direction: column; gap: var(--space-sm);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow-hair);
  transition: box-shadow .18s var(--ease), transform .18s var(--ease),
              border-color .18s var(--ease);
}
.stat-tile:hover {
  border-color: var(--ok-line);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.stat-tile__top { display: flex; align-items: center; gap: var(--space-sm); }
.stat-tile__icon {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent-ink);
  background: var(--accent-tint);
}
.stat-tile__icon .ic { width: 22px; height: 22px; }
.stat-tile__label { font-size: var(--type-body-md); font-weight: 600; color: var(--muted); }
.stat-tile__value {
  font-size: clamp(1.8rem, 2.8vw, 2.2rem); font-weight: 750; line-height: 1;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.stat-tile__sub { font-size: var(--type-body-sm); color: var(--faint); }
.stat-tile--accent { border-color: var(--accent-line); }
.stat-tile--accent .stat-tile__value { color: var(--accent-ink); }
.stat-tile--accent .stat-tile__icon { background: var(--accent); color: #fff; }

/* Group labels inside the stat grid — a hairline-divided heading that gives
   the long flat list of tiles some hierarchy. Span the full grid width. */
.section-label {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-md);
  margin: var(--space-lg) 0 var(--space-sm);
  font-size: var(--type-label-md); font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }
.section-label:first-child { margin-top: 0; }

/* ---------- Chart cards ---------- */
.chart-grid { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.chart-card {
  margin: 0; background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: var(--space-lg);
  box-shadow: var(--shadow-hair);
}
.chart-card figcaption {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: var(--space-md); padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-2);
}
.chart-card__title { font-size: var(--type-title-lg); font-weight: 700; }
.chart-card__sub { font-size: var(--type-body-sm); color: var(--faint); }
/* Let the SVG drive its own height via viewBox — no fixed height.
   min-height keeps an empty chart from collapsing to 0. */
.chart { display: block; width: 100%; min-height: 160px; height: auto; overflow: visible; }
.chart-card--wide { min-width: 320px; }

/* ---------- Tables — rounded sheet with a tonal header and state-layer rows ---------- */
.table-wrap {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hair);
}
.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: var(--type-body-md); }
.table thead th {
  position: sticky; top: 0; z-index: 1; text-align: left;
  font-size: var(--type-label-md); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2); padding: 14px 16px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s var(--ease); }
/* Row hover = 5% primary state layer, the M3 way to mark interactive rows. */
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Identity cell: avatar + email + secondary line */
.id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.id__avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff;
  background: var(--accent);
}
.id__main { display: flex; flex-direction: column; min-width: 0; }
.id__primary { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.id__secondary { font-size: .78rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Device cell: bound badge stacked over a last-seen / bound-since line */
.devcell { display: inline-flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }

/* Row action cells */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table__empty { text-align: center; padding: 46px 16px; color: var(--faint); }
.table__empty .ic { width: 30px; height: 30px; color: var(--faint); margin: 0 auto 10px; }
.table__empty strong { display: block; color: var(--muted); font-weight: 600; }

/* ---------- Dialog — M3 basic dialog: large shape, level-3 elevation ---------- */
.dialog { width: min(460px, calc(100vw - 32px)); padding: 0; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}
.dialog::backdrop { background: rgba(13,16,12,.55); }
.dialog__form { display: grid; gap: var(--space-md); padding: clamp(22px, 4vw, 28px); }
/* Reuses .dialog__form's grid/gap/padding outside a <dialog> (Offers panel:
   campaign toggle + banner copy), just capped to a readable width. */
.offer-form { max-width: 520px; padding-left: 0; padding-right: 0; }
.dialog__head { display: flex; align-items: center; gap: var(--space-md); }
.dialog__icon { width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; background: var(--accent); }
.dialog__icon .ic { width: 24px; height: 24px; }
.dialog__title { font-size: var(--type-title-lg); }
.dialog__intro { color: var(--muted); font-size: var(--type-body-md); margin-top: -6px; }
.dialog__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.dialog__error { color: var(--bad-ink); font-size: var(--type-body-md); font-weight: 500; min-height: 1.2em; }
.dialog__error:empty { min-height: 0; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 2px; }

/* Dialog additions — wide variant, sub-title, danger icon, left action */
.dialog--wide { width: min(600px, calc(100vw - 32px)); }
.dialog__heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dialog__sub { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.dialog__icon--danger { background: var(--bad-ink); }
/* Pushes a secondary action (e.g. "Close — pay later") away from the commit
   button, so the destructive-adjacent pair never sits under a stray click. */
.dialog__actions .btn--left { margin-right: auto; }

/* ---------- Badges — M3 tonal pills with status dots ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); background: var(--surface-2); border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge--active  { color: var(--ok-ink);   background: var(--ok-tint);   border-color: var(--ok-line); }
.badge--trial   { color: var(--info-ink); background: var(--info-tint); border-color: var(--info-line); }
.badge--pending { color: var(--warn-ink); background: var(--warn-tint); border-color: var(--warn-line); }
.badge--expired { color: var(--bad-ink);  background: var(--bad-tint);  border-color: var(--bad-line); }
.badge--device  { color: var(--info-ink); background: var(--info-tint); border-color: var(--info-line); }

/* Plan pill (plain, no dot) */
.plan-pill { font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  color: var(--accent-ink); background: var(--accent-tint); text-transform: capitalize; }

/* Payout status badges. Distinct from the subscription statuses on purpose —
   a payout's "paid" is not a subscription's "active". */
.badge--requested  { color: var(--warn-ink); background: var(--warn-tint); border-color: var(--warn-line); }
.badge--processing { color: var(--info-ink); background: var(--info-tint); border-color: var(--info-line); }
.badge--paid       { color: var(--ok-ink);   background: var(--ok-tint);   border-color: var(--ok-line); }
.badge--rejected   { color: var(--bad-ink);  background: var(--bad-tint);  border-color: var(--bad-line); }
.badge--cancelled  { color: var(--faint);    background: var(--surface-2); border-color: var(--border); }

/* Affiliate tier badges. Distinct from subscription/payout statuses: these
   say what a person IS in the programme, not what a row's state is. */
.badge--affiliate { color: var(--info-ink); background: var(--info-tint); border-color: var(--info-line); }
.badge--creator   { color: var(--accent-ink); background: var(--accent-tint); border-color: var(--accent-line, var(--border)); }
.badge--muted     { color: var(--faint);    background: var(--surface-2); border-color: var(--border); }

/* Affiliate slide-over extras: hero action row + ledger flourishes. */
.detail-hero__actions { display: flex; gap: 8px; margin-top: 10px; }
.detail-row--bad { opacity: .6; }
.detail-row--bad .detail-row__amount { text-decoration: line-through; }
.detail-note {
  font-size: .82rem; color: var(--muted); padding: 6px 12px;
  border-left: 2px solid var(--border); margin-top: -4px;
}

/* ---------- Toast + loading — M3 snackbar (inverse surface) + top progress ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 80;
  display: inline-flex; align-items: center; gap: 10px;
  max-width: min(92vw, 460px); padding: 13px 18px; font-size: .92rem; font-weight: 500;
  color: var(--inv-ink); background: var(--inv-bg);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-float);
  opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
/* Leading status dot replaces the old accent edge-bar. */
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex: none; }
/* The stylesheet reveals the toast when non-empty; clearing the text hides it. */
.toast:not(:empty) { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error::before { background: var(--bad-ink); }

.loading { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 90;
  background: transparent; overflow: hidden; opacity: 0; transition: opacity .2s var(--ease); }
.loading.is-busy { opacity: 1; }
.loading__bar { display: block; height: 100%; width: 40%;
  background: var(--accent); border-radius: 999px;
  transform: translateX(-100%); }
.loading.is-busy .loading__bar { animation: loading-slide 1.1s var(--ease) infinite; }
@keyframes loading-slide { 0%{transform:translateX(-100%);} 50%{transform:translateX(130%);} 100%{transform:translateX(320%);} }

/* ---------- Skeleton loading — pulsing placeholder for stat tiles ---------- */
.skeleton {
  background: var(--surface-3);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.skeleton--text { height: 14px; width: 80px; }
.skeleton--value { height: 32px; width: 100px; }
.skeleton--chart { height: 180px; width: 100%; border-radius: var(--radius); }
/* Tile-shaped skeleton pair (label + value) for the slide-over's async
   Activity/Payments sections. */
.skeleton-block { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skeleton--tile {
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px; border: 1px solid var(--border-2);
  border-radius: var(--radius);
}
.skeleton--tile .skeleton--text { width: 44%; }
.skeleton--tile .skeleton--value { width: 60%; height: 20px; }
.stat-tile.is-loading .stat-tile__value,
.stat-tile.is-loading .stat-tile__sub {
  visibility: hidden;
  position: relative;
}
.stat-tile.is-loading::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 18px;
  height: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.stat-tile.is-loading .stat-tile__value::before {
  content: "";
  display: block;
}
.revenue.is-loading .revenue__value,
.revenue.is-loading .revenue__metric-value {
  visibility: hidden;
}

/* ---------- Entrance — quiet rise-and-fade on first paint ----------
   Motion is invisible: short, transform/opacity only, and disabled for
   prefers-reduced-motion. */
@keyframes fade-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-tile, .revenue, .chart-card {
  animation: fade-rise .5s cubic-bezier(.16,1,.3,1) both;
}
.stat-tile:nth-child(1)  { animation-delay: .02s; }
.stat-tile:nth-child(2)  { animation-delay: .05s; }
.stat-tile:nth-child(3)  { animation-delay: .08s; }
.stat-tile:nth-child(4)  { animation-delay: .11s; }
.stat-tile:nth-child(5)  { animation-delay: .14s; }
.stat-tile:nth-child(6)  { animation-delay: .17s; }
.stat-tile:nth-child(7)  { animation-delay: .20s; }
.stat-tile:nth-child(8)  { animation-delay: .23s; }
.stat-tile:nth-child(9)  { animation-delay: .26s; }
.stat-tile:nth-child(10) { animation-delay: .29s; }
.stat-tile:nth-child(11) { animation-delay: .32s; }
.stat-tile:nth-child(12) { animation-delay: .35s; }
.stat-tile:nth-child(13) { animation-delay: .38s; }
.stat-tile:nth-child(14) { animation-delay: .41s; }
.stat-tile:nth-child(15) { animation-delay: .44s; }
.stat-tile:nth-child(16) { animation-delay: .47s; }

/* ---------- Trend indicators — tonal up/down chips ---------- */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
}
.trend--up {
  color: var(--ok-ink);
  background: var(--ok-tint);
}
.trend--down {
  color: var(--bad-ink);
  background: var(--bad-tint);
}
.trend--flat {
  color: var(--muted);
  background: var(--surface-2);
}
.trend__arrow {
  width: 12px;
  height: 12px;
}
.trend--up .trend__arrow { transform: rotate(-45deg); }
.trend--down .trend__arrow { transform: rotate(45deg); }
.trend--flat .trend__arrow { opacity: 0.5; }

/* Stat tile with trend */
.stat-tile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-tile__header .stat-tile__top { flex: 1; }

/* ---------- Slide-over panel — M3 side sheet rounding into the viewport ---------- */
.slideover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.slideover.is-open {
  pointer-events: auto;
  opacity: 1;
}
.slideover__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13,16,12,.55);
}
.slideover__panel {
  position: relative;
  width: min(520px, 92vw);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border-2);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: var(--shadow-float);
  transform: translateX(100%);
  transition: transform .3s var(--ease);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.slideover.is-open .slideover__panel {
  transform: translateX(0);
}
.slideover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-2);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.slideover__title {
  font-size: 1.1rem;
  font-weight: 700;
}
.slideover__heading { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.slideover__sub {
  font-size: .84rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slideover__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.slideover__close:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}
.slideover__body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* User detail sections */
.detail-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* A hairline between stacked sections gives the long panel vertical rhythm
   instead of a flat run of floating cards. */
.detail-section + .detail-section {
  border-top: 1px solid var(--border-2);
  padding-top: 20px;
}
.detail-section__title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.detail-item--bad { background: var(--bad-tint); border-color: var(--bad-line); }
.detail-item--bad .detail-item__label { color: var(--bad-ink); }
.detail-item--bad .detail-item__value { color: var(--bad-ink); }
.detail-item__label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.detail-item__value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.detail-item--wide {
  grid-column: 1 / -1;
}

/* Identity hero at the top of the slide-over */
.detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0 4px;
}
.detail-hero .id__avatar { width: 48px; height: 48px; font-size: .95rem; }
.detail-hero__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.detail-hero__name {
  font-size: 1.15rem; font-weight: 750; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-hero__email { font-size: .86rem; color: var(--muted); }
.detail-hero__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.badge__sub { font-weight: 600; text-transform: none; letter-spacing: 0; }
.badge__sub::before { content: none; }

/* Payment ledger / request rows inside the slide-over */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-list__label { margin-top: 4px; }
.detail-empty { font-size: .86rem; padding: 2px 0 4px; }
.detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
}
.detail-row__amount {
  font-weight: 700;
  margin-left: auto;
}
.detail-row__ref {
  color: var(--muted);
  font-size: .8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-row__date {
  color: var(--faint);
  font-size: .78rem;
  white-space: nowrap;
}

/* Quick actions in slide-over */
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border-2);
}

/* ---------- Empty state — tonal circular icon well ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-state__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent-tint);
}
.empty-state__icon .ic { width: 100%; height: 100%; }
.empty-state__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state__sub {
  font-size: .92rem;
  color: var(--muted);
  max-width: 32ch;
}

/* ---------- Tooltip — inverse-surface, like the snackbar ---------- */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 11px;
  background: var(--inv-bg);
  color: var(--inv-ink);
  font-size: .76rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s var(--ease);
  z-index: 10;
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* ---------- Quick filters — M3 filter chips (pill, tonal when selected) ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.filter-chip.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.filter-chip__count {
  font-size: .72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgb(255 255 255 / .22);
}

/* ---------- Notification dot — for sidebar badges ---------- */
.nav__item {
  position: relative;
}
.nav__dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad-ink);
  border: 2px solid var(--surface);
}

/* ---------- Improved table row hover — show action buttons on hover ---------- */
.table tbody tr .row-actions {
  opacity: 0;
  transition: opacity .15s var(--ease);
}
.table tbody tr:hover .row-actions {
  opacity: 1;
}

/* ---------- Payouts — money leaving the business ----------
   The band reuses .revenue's layout but flips the tone from green to warn:
   the Overview band is money coming in, this one is money going out, and the
   two must never be mistaken for each other at a glance. */
.revenue--out {
  border-color: var(--warn-line);
}
.revenue--out .revenue__eyebrow-icon { background: var(--warn-ink); }
.revenue--out .revenue__value { color: var(--warn-ink); }
.revenue--out .revenue__side { border-left-color: var(--border-2); }

/* Queue actions are the job, not a hover affordance — never fade them out. */
.table tbody tr .row-actions--always { opacity: 1; }

/* Secondary line stacked directly under a plain cell's value (the amount and
   reference columns), rather than inside an .id__main flex column. */
.table td > .id__secondary { display: block; }

/* Aging: an open request that has waited too long gets a warn-toned wait cell. */
.wait--old { color: var(--warn-ink); font-weight: 600; }

/* ---------- Notice — an inline callout inside a dialog ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius);
  font-size: .85rem; line-height: 1.45;
  color: var(--muted); background: var(--surface-2); border: 1px solid transparent;
}
.notice .ic { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.notice strong { color: var(--text); font-weight: 700; }
.notice--warn {
  color: var(--warn-ink); background: var(--warn-tint); border-color: var(--warn-line);
}
.notice--warn strong { color: var(--warn-ink); }
.notice--calm {
  color: var(--ok-ink); background: var(--ok-tint); border-color: var(--ok-line);
}
.notice--calm strong { color: var(--ok-ink); }

/* ---------- Bank details block — read by claiming the request; gone once
   it's settled. Values are mono + user-select:all so a click-drag grabs the
   whole field cleanly; each row also has its own copy button. ---------- */
.bank {
  display: grid; gap: 1px; overflow: hidden;
  background: var(--border-2);
  border: 1px solid var(--border-2); border-radius: var(--radius);
}
.bank__row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface);
}
.bank__cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bank__label {
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--faint);
}
.bank__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95rem; font-weight: 600; letter-spacing: .01em;
  user-select: all; -webkit-user-select: all;
  overflow-wrap: anywhere;
}
.bank__copy {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 12px; font-size: .76rem; font-weight: 600;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.bank__copy .ic { width: 13px; height: 13px; }
.bank__copy:hover { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-tint); }
.bank__copy.is-copied { color: var(--ok-ink); border-color: var(--ok-line); background: var(--ok-tint); }
.bank__foot {
  display: flex; justify-content: flex-end; padding: 8px 12px;
  background: var(--surface-2);
}
