/* ===========================================================================
   Hotel Desk - Super Admin
   Design system

   One file, ordered tokens -> base -> layout -> components -> screens ->
   responsive. Everything is driven from the custom properties at the top, so
   a palette change is one block rather than a search across the file.
   =========================================================================== */

:root {
  color-scheme: light;

  /* --- Neutrals ---------------------------------------------------------
     A cool ramp with a trace of blue in it. Pure greys read as cheap on a
     screen full of white cards; the tint is what makes the surfaces look
     deliberate rather than undecided. */
  --c-bg:        #f5f7fb;
  --c-bg-2:      #eef1f8;
  --c-surface:   #ffffff;
  --c-surface-2: #fafbfd;
  --c-surface-3: #f4f6fa;
  --c-line:      #e8ecf4;
  --c-line-2:    #d9e0ec;

  --c-text:   #0d1424;
  --c-text-2: #454f68;
  --c-muted:  #7d879c;

  /* --- Accent ----------------------------------------------------------- */
  --c-accent:      #4f46e5;
  --c-accent-2:    #6366f1;
  --c-accent-dark: #4338ca;
  --c-accent-soft: #eef1ff;
  --c-accent-line: #d5daff;
  --c-ring:        rgba(79, 70, 229, .16);

  /* --- Semantic ---------------------------------------------------------
     Each state carries a text, a wash and a border so pills, alerts and
     flags stay in step without three separate sets of hex codes. */
  --c-ok:   #04785a;  --c-ok-bg:   #e6f7f1;  --c-ok-line:   #b2e5d4;
  --c-warn: #9a5a08;  --c-warn-bg: #fdf3e5;  --c-warn-line: #f5dcb3;
  --c-bad:  #bd2b39;  --c-bad-bg:  #fdecee;  --c-bad-line:  #f7cbcf;
  --c-info: #1d4ed8;  --c-info-bg: #e9f0ff;  --c-info-line: #c7d8ff;

  /* --- Sidebar ---------------------------------------------------------- */
  --c-side-1:    #12152350;
  --c-side-top:  #151929;
  --c-side-bot:  #1b2033;
  --c-side-line: rgba(255, 255, 255, .07);
  --c-side-dim:  #98a2b8;
  --c-side-lit:  #eef1f8;

  /* --- Elevation --------------------------------------------------------
     Two shadows per level: a tight one for the edge, a wide soft one for the
     lift. A single shadow always looks either hard or muddy. */
  --sh-xs: 0 1px 2px rgba(13, 20, 36, .04);
  --sh-sm: 0 1px 2px rgba(13, 20, 36, .05), 0 2px 6px rgba(13, 20, 36, .035);
  --sh-md: 0 1px 3px rgba(13, 20, 36, .05), 0 8px 22px rgba(13, 20, 36, .055);
  --sh-lg: 0 4px 10px rgba(13, 20, 36, .07), 0 20px 48px rgba(13, 20, 36, .12);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, .6);

  /* --- Geometry ---------------------------------------------------------- */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sidebar-w: 252px;
  --topbar-h:  60px;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui,
               -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  /* cv11 gives Inter a single-storey g and a straight-tailed l, which stops
     "Il1" reading as one shape in a table of codes. tnum is set locally on
     figures rather than globally - tabular digits in prose look mechanical. */
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A single wash behind everything. Fixed rather than scrolled, so a long
   report does not drag the gradient up the page with it. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 520px at 78% -8%, #e7ebfa 0%, transparent 62%),
    radial-gradient(760px 420px at 4% 4%, #eef1f9 0%, transparent 58%),
    var(--c-bg);
}

h1, h2, h3 {
  /* Negative tracking is what separates a heading that was set from one that
     was merely made bold. */
  letter-spacing: -.021em;
  color: var(--c-text);
}

a { color: var(--c-accent); }

/* One visible focus ring for everything reachable by keyboard. :focus-visible
   rather than :focus, so a mouse click does not leave a ring behind. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--c-accent-soft); color: var(--c-accent-dark); }

/* Left at default width on purpose - a thin scrollbar on a wide report
   table is a usability tax, not a refinement. */
* { scrollbar-color: var(--c-line-2) transparent; }

/* ===========================================================================
   Layout
   =========================================================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--c-side-top) 0%, var(--c-side-bot) 100%);
  /* A hairline of light down the inner edge. Without it the dark panel meets
     the light page as a dead butt-join. */
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .05), 4px 0 24px rgba(13, 20, 36, .06);
  z-index: 60;
}

.sidebar__brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--c-side-line);
}
.sidebar__brand img {
  max-width: 100%;
  height: auto;
  max-height: 56px;
  object-fit: contain;

  /* The logo is a colour mark with a BLACK wordmark beside it, drawn for a
     white page. On this panel it would be a coloured blob next to nothing.
     A white plate keeps the brand colours intact and makes the wordmark
     readable, which recolouring the file with a filter would not. */
  padding: 9px 14px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
}
.sidebar__brand span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  /* The wordmark is the one place a gradient earns its keep. */
  background: linear-gradient(90deg, #8ea2ff, #c0b3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px 10px;
  overflow-y: auto;
}

.sidebar__nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--c-side-dim);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.sidebar__nav a:hover {
  background: rgba(255, 255, 255, .055);
  color: var(--c-side-lit);
}

/* The page you are on. A filled pill plus a marker on the rail - colour alone
   is not enough to carry "you are here" for anyone who cannot see it well. */
.sidebar__nav a.is-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(99, 102, 241, .08));
  color: #fff;
  font-weight: 600;
}
.sidebar__nav a.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #8b93ff, #6366f1);
}

.sidebar__foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--c-side-line);
}
.who {
  display: grid;
  gap: 1px;
  padding: 2px 2px 0;
  min-width: 0;
}
.who strong {
  display: block;
  color: var(--c-side-lit);
  font-size: 13px;
  font-weight: 600;
  /* Long operator names must not push the Log out button off the panel. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who em {
  font-style: normal;
  color: #7d879c;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sidebar__foot button {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .04);
  color: var(--c-side-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.sidebar__foot button:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
  color: #fff;
}

.shell {
  margin-left: var(--sidebar-w);
  padding: 30px 34px 56px;
  max-width: 1420px;
}

/* Mobile chrome. In the markup at every width and hidden here on desktop, so
   it cannot flash in partway through a slow load. */
.topbar { display: none; }
.scrim  { display: none; }

/* ===========================================================================
   Page furniture
   =========================================================================== */

.page-title {
  margin: 0 0 22px;
  font-size: 25px;
  font-weight: 700;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-head .page-title { margin: 0; }
.page-head > div { display: flex; gap: 8px; flex-wrap: wrap; }

.section-title {
  margin: 30px 0 13px;
  font-size: 16px;
  font-weight: 650;
}

.muted { color: var(--c-muted); margin: 0; }

.note {
  margin-top: 16px;
  max-width: 78ch;
  color: var(--c-muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.toolbar-note {
  margin: -8px 0 16px;
  color: var(--c-muted);
  font-size: 12.5px;
}

.sub {
  margin-top: 2px;
  color: var(--c-muted);
  font-size: 12px;
  font-weight: 450;
  line-height: 1.4;
}

.code {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, "Cascadia Mono",
               Menlo, Consolas, monospace;
  font-size: .92em;
  letter-spacing: .01em;
}

/* ---- Stat tiles ----------------------------------------------------------
   The row of figures at the top of every report. A hairline of colour along
   the top edge carries the state, so the tiles stay quiet and the numbers do
   the talking. */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--c-surface) 0%, var(--c-surface-2) 100%);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}
.stat:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent-2));
  opacity: .85;
}

.stat__label {
  color: var(--c-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.stat__value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat--green::before { background: linear-gradient(90deg, #0f9d76, #34d399); }
.stat--red::before   { background: linear-gradient(90deg, #dc2b3c, #f87171); }
.stat--blue::before  { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.stat--amber::before { background: linear-gradient(90deg, #d97706, #fbbf24); }

.stat--green .stat__value { color: var(--c-ok); }
.stat--red   .stat__value { color: var(--c-bad); }
.stat--blue  .stat__value { color: var(--c-info); }
.stat--amber .stat__value { color: var(--c-warn); }

/* ---- Card ---------------------------------------------------------------- */

.card {
  padding: 22px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--sh-sm);
}
.card h2 {
  margin: 0 0 16px;
  font-size: 15.5px;
  font-weight: 650;
}
.card + .card { margin-top: 18px; }

/* ===========================================================================
   Tables
   =========================================================================== */

/* The scroll container. Negative margins let a wide table run to the card's
   edges rather than stopping short inside its padding, which is what makes a
   sideways scroll look intended. */
.table-wrap {
  overflow-x: auto;
  margin: 0 -22px -22px;
  padding: 0 22px 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.8px;
}

th {
  position: relative;
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--c-line-2);
  color: var(--c-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-text-2);
  vertical-align: top;
}
/* The first cell of a row is its subject, so it gets the ink. */
tbody td:first-child { color: var(--c-text); font-weight: 550; }

tbody tr { transition: background .12s var(--ease); }
tbody tr:hover td { background: var(--c-surface-3); }
tbody tr:last-child td { border-bottom: 0; }

th:first-child, td:first-child { padding-left: 4px; }
th:last-child,  td:last-child  { padding-right: 4px; }

/* Figures right-aligned and tabular, so a column of money lines up digit
   under digit and a wrong order of magnitude is visible at a glance. */
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.num--due { color: var(--c-warn); font-weight: 650; }

.big-num { font-size: 15px; font-weight: 650; color: var(--c-text); }

.total-row td {
  border-top: 2px solid var(--c-line-2);
  border-bottom: 0;
  background: var(--c-surface-3);
  color: var(--c-text);
  font-weight: 700;
}
tbody tr:hover ~ tfoot .total-row td { background: var(--c-surface-3); }

td.actions { white-space: nowrap; }
td.actions form { display: inline; }
td.actions .btn { padding: 6px 11px; font-size: 12.5px; }

/* ===========================================================================
   Status chrome - pills, chips, flags, secrets
   =========================================================================== */

.pill {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
}
.pill--on,  .pill--ok   { background: var(--c-ok-bg);   color: var(--c-ok);   border-color: var(--c-ok-line); }
.pill--off, .pill--bad  { background: var(--c-bad-bg);  color: var(--c-bad);  border-color: var(--c-bad-line); }
.pill--warn             { background: var(--c-warn-bg); color: var(--c-warn); border-color: var(--c-warn-line); }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-xs);
  background: var(--c-surface-3);
  color: var(--c-muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* A short warning line under a row - "no users", "expired 12 days ago". */
.flag {
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.flag--warn { color: var(--c-warn); }
.flag--bad  { color: var(--c-bad); }

/* A masked credential. Monospace so two keys are visibly different. */
.secret {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-xs);
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: .08em;
}
.secret--none {
  border-style: dashed;
  background: transparent;
  color: var(--c-muted);
  letter-spacing: 0;
}

/* Seats used, as one figure rather than two. */
.ratio { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ratio strong { font-size: 15px; font-weight: 700; color: var(--c-text); }
.ratio em { font-style: normal; color: var(--c-muted); font-weight: 500; }
.ratio--over strong { color: var(--c-bad); }

/* ===========================================================================
   Buttons
   =========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              box-shadow .15s var(--ease), transform .1s var(--ease);
}
/* Pressing moves the button. A state change you can feel is worth more than
   one you have to look for. */
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(180deg, var(--c-accent-2), var(--c-accent));
  border-color: var(--c-accent-dark);
  color: #fff;
  box-shadow: 0 1px 2px rgba(67, 56, 202, .28), var(--sh-inset);
}
.btn--primary:hover {
  background: linear-gradient(180deg, var(--c-accent), var(--c-accent-dark));
  box-shadow: 0 3px 14px rgba(79, 70, 229, .32), var(--sh-inset);
}

.btn--plain {
  background: var(--c-surface);
  border-color: var(--c-line-2);
  color: var(--c-text-2);
  box-shadow: var(--sh-xs);
}
.btn--plain:hover {
  background: var(--c-surface-2);
  border-color: var(--c-line-2);
  color: var(--c-text);
}

.btn--ok {
  background: linear-gradient(180deg, #10b07f, #059669);
  border-color: #047857;
  color: #fff;
  box-shadow: var(--sh-xs), var(--sh-inset);
}
.btn--ok:hover { background: linear-gradient(180deg, #059669, #047857); }

.btn--warn {
  background: linear-gradient(180deg, #f7a723, #e08c07);
  border-color: #c2760a;
  color: #fff;
  box-shadow: var(--sh-xs), var(--sh-inset);
}
.btn--warn:hover { background: linear-gradient(180deg, #e08c07, #c2760a); }

/* Fixed width, so swapping the label to "Copied" does not shift the row under
   the pointer just as it is being clicked again. */
.btn--copy {
  min-width: 78px;
  padding: 5px 10px;
  font-size: 11.5px;
}
.btn--copied {
  background: var(--c-ok-bg);
  border-color: var(--c-ok-line);
  color: var(--c-ok);
}

/* ===========================================================================
   Forms and filters
   =========================================================================== */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 13px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--sh-sm);
}

.filters input,
.filters select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 9px 12px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.filters input::placeholder,
.form-grid input::placeholder { color: #a6afc0; }

.filters input:focus,
.filters select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-ring);
}

.filters input { min-width: 250px; }
.filters select { min-width: 158px; cursor: pointer; }

/* Checkbox-and-label pairs sitting in a filter bar. */
.inline-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  color: var(--c-text-2);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
}
/* min-width is reset explicitly. The filter bar gives its text inputs a
   250px floor, and a bare "input" selector catches the checkbox in here too -
   which does not widen the box, it just parks the caption 250px away from it. */
.inline-label input { min-width: 0; }
.inline-label input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-accent);
  cursor: pointer;
}

.form-grid { display: grid; gap: 15px; max-width: 780px; }
.form-grid h2 {
  margin: 12px 0 0;
  color: var(--c-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.form-grid .row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--c-text-2);
  font-size: 12.5px;
  font-weight: 600;
}
.form-grid input[readonly] {
  background: var(--c-surface-3);
  color: var(--c-muted);
  cursor: not-allowed;
}
/* A hint under a field caption. Inside a grid label it takes its own row,
   which is what keeps it off the end of a long caption on a narrow screen. */
.form-grid label .note {
  margin: -3px 0 0;
  font-size: 11.5px;
  font-weight: 450;
  line-height: 1.4;
}
.form-grid > .note { margin-top: 0; font-weight: 450; }

/* A checkbox with an explanation beside it.

   The selector carries .form-grid label deliberately. Nearly every .check on
   the site sits inside a .form-grid, whose own "label" rule is a class plus a
   type and therefore outranks a bare .check - which quietly turned the row
   into a grid and stacked the box above its own caption. */
.check,
.form-grid label.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.check:hover { border-color: var(--c-line-2); background: var(--c-surface-3); }
.check:has(input:checked) {
  border-color: var(--c-accent-line);
  background: var(--c-accent-soft);
}
.check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--c-accent); }
.check span strong { display: block; font-size: 13.5px; font-weight: 650; color: var(--c-text); }
.check span em { font-style: normal; font-size: 12.5px; color: var(--c-muted); line-height: 1.5; }

.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 8px; }

/* ===========================================================================
   Alerts
   =========================================================================== */

.alert {
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: var(--sh-xs);
}
.alert--error { background: var(--c-bad-bg); color: var(--c-bad); border-color: var(--c-bad-line); }
.alert--ok    { background: var(--c-ok-bg);  color: var(--c-ok);  border-color: var(--c-ok-line); }

/* ===========================================================================
   Sign in

   A split: brand on the left, form on the right. The brand half is not
   decoration - it is the only chance the panel gets to say what it is before
   anyone is allowed inside it, and an unbranded box on a dark page could be
   any login on the internet.
   =========================================================================== */

/* The shell a signed-OUT page gets. Full bleed: no sidebar offset, no
   padding, no max width - the auth grid below manages its own.

   place-items is reset deliberately. An earlier version of this rule centred
   a small login card, and Chrome now honours justify-items in BLOCK layout
   too - so a leftover "center" here gives .auth an effective justify-self of
   center, which quietly makes a full-bleed grid shrink to fit its text. */
.shell--bare {
  display: block;
  place-items: normal;
  margin: 0;
  padding: 0;
  max-width: none;
  min-height: 100vh;
  /* dvh second, so a browser that does not know it keeps the vh above. On a
     phone 100vh is measured against the viewport WITHOUT the address bar, so
     the panel ends short of the fold until the bar collapses. */
  min-height: 100dvh;
}

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  /* The brand half takes slightly more. An even split makes the form look
     like an afterthought pinned to the side. */
  grid-template-columns: 1.06fr .94fr;
}

/* ---- Brand half ---------------------------------------------------------- */

.auth__brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 52px 56px;
  background: linear-gradient(155deg, #0a0f1f 0%, #141b38 48%, #0c1225 100%);
  color: var(--c-side-lit);
}

/* Two colour blooms, sitting under everything. */
.auth__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(680px 520px at 12% 6%, rgba(109, 116, 245, .5) 0%, transparent 62%),
    radial-gradient(580px 470px at 94% 98%, rgba(56, 189, 248, .26) 0%, transparent 60%);
}

/* A faint grid, faded out with a mask. Without it a large flat gradient just
   reads as an empty div; with it the panel has a surface. */
.auth__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(900px 640px at 18% 16%, #000 0%, transparent 78%);
  mask-image: radial-gradient(900px 640px at 18% 16%, #000 0%, transparent 78%);
}

/* The logo has a black wordmark, so it keeps its white plate here too. */
.auth__logo {
  align-self: flex-start;
  max-width: 178px;
  height: auto;
  padding: 11px 16px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .38);
}

.auth__head { max-width: 32ch; }

.auth__eyebrow {
  margin: 0 0 13px;
  color: #9aa6ff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.auth__title {
  margin: 0 0 14px;
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.032em;
}
.auth__blurb {
  margin: 0;
  color: #aab4cd;
  font-size: 15px;
  line-height: 1.62;
}

.auth__points {
  display: grid;
  gap: 11px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.auth__points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #c3cbdf;
  font-size: 13.5px;
}
.auth__points li::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: linear-gradient(180deg, #8b90ff, #6d74f5);
  box-shadow: 0 0 0 3px rgba(109, 116, 245, .18);
}

.auth__foot { margin: 0; color: #66718a; font-size: 12px; }

/* ---- Form half ----------------------------------------------------------- */

.auth__panel {
  display: grid;
  place-items: center;
  padding: 48px 40px;
  background: var(--c-bg);
}

.auth__form {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 376px;
}
.auth__form h1 { margin: 0; font-size: 24px; font-weight: 700; }
.auth__form .muted { margin: -9px 0 6px; font-size: 13.5px; }
.auth__form label {
  display: grid;
  gap: 7px;
  color: var(--c-text-2);
  font-size: 12.5px;
  font-weight: 600;
}
.auth__form input {
  padding: 12px 13px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.auth__form input::placeholder { color: #a6afc0; }
.auth__form input:focus {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-ring);
}
.auth__form .btn { margin-top: 6px; padding: 13px 16px; font-size: 15px; }
.auth__form .alert { margin-bottom: 0; }

/* ===========================================================================
   Referral screens
   =========================================================================== */

.link-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.link-box {
  width: 224px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-xs);
  background: var(--c-surface-3);
  color: var(--c-muted);
  font-size: 11.5px;
}
.link-box.link-box--wide { width: 430px; }

.pay-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 8px;
}
.pay-agent { display: block; font-size: 20px; font-weight: 650; margin: 2px 0; }
.pay-amount { text-align: right; }
.pay-amount strong {
  display: block;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--c-warn);
}

/* ===========================================================================
   Plan / menu matrix

   Deliberately NOT a card table. The point of this grid is reading one key
   across every plan, which a stack of cards destroys. It scrolls sideways
   with the key column pinned instead.
   =========================================================================== */

.matrix {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}
.matrix th, .matrix td { white-space: nowrap; }

.matrix th.matrix__plan {
  min-width: 104px;
  padding-inline: 10px;
  text-align: center;
  vertical-align: bottom;
}
.matrix th.matrix__plan .sub { text-align: center; text-transform: none; letter-spacing: 0; }

.matrix td.matrix__cell {
  text-align: center;
  padding-inline: 10px;
  border-bottom: 1px solid var(--c-line);
}

/* The pinned column. The scrolling cells pass underneath, so it needs an edge
   of its own or the two run together mid-scroll. */
.matrix th.matrix__key,
.matrix td.matrix__key {
  position: sticky;
  left: 0;
  z-index: 2;
  max-width: 250px;
  padding-left: 4px;
  background: var(--c-surface);
  text-align: left;
  white-space: normal;
  word-break: break-word;
  box-shadow: 1px 0 0 var(--c-line-2);
}
.matrix thead th.matrix__key { z-index: 3; }

.matrix tbody tr:hover td { background: var(--c-surface-3); }
.matrix tbody tr:hover td.matrix__key { background: var(--c-surface-3); }

/* A key granted by nothing - usually a typo, and the reason to open this
   report at all. */
.matrix tr.is-orphan td.matrix__key { color: var(--c-warn); font-weight: 650; }

.tick { font-weight: 700; font-size: 12.5px; color: var(--c-ok); }
.tick--no { color: #ccd4e0; font-weight: 500; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--c-line);
  color: var(--c-muted);
  font-size: 12.5px;
}

/* ---- Drill-down panel ---------------------------------------------------- */

.drill { margin-top: 18px; }
.drill__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.drill__head h2 { margin: 0; }
.drill__head > div { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===========================================================================
   Plan editor menu picker

   Ninety-odd checkboxes. One column is a list nobody scrolls to the end of,
   so they flow into as many columns as the width allows, split under a
   heading per property type - the only grouping the catalogue carries.
   =========================================================================== */

.menu-pick { display: grid; gap: 10px; }

.menu-pick__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--c-line);
}
.menu-pick__head strong {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.menu-pick__head .note { margin-top: 0; }

.menu-pick__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 2px 12px;
}

/* The whole row is the target, not just the box. */
.menu-pick__item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  cursor: pointer;
  transition: background .12s var(--ease), border-color .12s var(--ease);
}
.menu-pick__item:hover { background: var(--c-surface-3); }
.menu-pick__item input {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  accent-color: var(--c-accent);
  cursor: pointer;
}
.menu-pick__item span { word-break: break-word; }

/* A ticked row is tinted, so the shape of what a plan grants is readable at a
   glance instead of one box at a time. */
.menu-pick__item:has(input:checked) {
  background: var(--c-accent-soft);
  border-color: var(--c-accent-line);
  color: var(--c-accent-dark);
  font-weight: 600;
}

/* ===========================================================================
   Responsive

   Two breakpoints, and they are deliberately different numbers.

   900px is where the sidebar stops fitting BESIDE the content and becomes a
   drawer. 760px is where a table stops being readable as a grid and becomes a
   stack of cards. A tablet in portrait wants the first and not the second, so
   collapsing them into one breakpoint would either waste its width or shred
   its tables.
   =========================================================================== */

@media (max-width: 1180px) {
  .shell:not(.shell--bare) { padding: 26px 24px 48px; }
  .table-wrap { margin-inline: -22px; padding-inline: 22px; }
}

@media (max-width: 900px) {
  .topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 14px 0 6px;
    background: linear-gradient(180deg, var(--c-side-top), var(--c-side-bot));
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 4px 20px rgba(13, 20, 36, .16);
    color: var(--c-side-lit);
  }
  /* Same white plate as the sidebar, for the same reason. */
  .topbar img {
    max-height: 30px;
    width: auto;
    padding: 4px 7px;
    border-radius: 7px;
    background: #fff;
  }
  .topbar__title {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 44px square: the smallest target a thumb hits reliably. The icon is drawn
     with borders rather than an image so it cannot fail to load. */
  .navbtn {
    flex: 0 0 44px;
    width: 44px; height: 44px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 0 11px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  .navbtn span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--c-side-dim);
    transition: transform .2s var(--ease), opacity .2s var(--ease), background .2s var(--ease);
  }
  .navbtn:hover span { background: #fff; }

  /* Open, the three bars fold into a cross. The button is the close control
     too, so it should not still be claiming it opens something. */
  body.nav-open .navbtn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .navbtn span:nth-child(2) { opacity: 0; }
  body.nav-open .navbtn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(11, 16, 30, .5);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s var(--ease);
  }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }

  /* Off-canvas rather than hidden. It keeps its place in the tab order and
     animates in, so the drawer reads as the same navigation moving rather
     than a different menu appearing. */
  .sidebar {
    width: 270px;
    transform: translateX(-100%);
    transition: transform .24s var(--ease);
    box-shadow: 0 0 60px rgba(11, 16, 30, .45);
  }
  body.nav-open .sidebar { transform: none; }

  .shell:not(.shell--bare) {
    margin-left: 0;
    max-width: none;
    padding: calc(var(--topbar-h) + 20px) 16px 44px;
  }

  .page-title { font-size: 20px; }
  .page-head { flex-wrap: wrap; gap: 12px; }

  /* Two across rather than auto-fit. A phone-width auto-fit gives one very
     wide tile per row and turns five figures into five screens of scrolling. */
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
  .stat { padding: 13px 14px; border-radius: var(--r-md); }
  .stat__value { font-size: 21px; }
  .stat__label { font-size: 10.5px; }

  .card { padding: 16px; border-radius: var(--r-md); }
  .table-wrap { margin: 0 -16px -16px; padding: 0 16px 4px; }

  /* Filters become one control per row and full width. Side by side at this
     size they end up too narrow to read the selected value in. */
  .filters { flex-direction: column; align-items: stretch; padding: 12px; }
  .filters input,
  .filters select,
  .filters .btn { width: 100%; min-width: 0; }

  /* iOS zooms the page in when a focused input is under 16px. */
  .filters input,
  .filters select,
  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .auth__form input { font-size: 16px; padding: 12px 13px; }

  .btn { padding: 11px 15px; }
  td.actions .btn { padding: 9px 13px; font-size: 13px; }

  .form-grid .row { grid-template-columns: 1fr; }
  .pay-amount { text-align: left; }
  .link-box, .link-box.link-box--wide { width: 100%; }
  .menu-pick__grid { grid-template-columns: 1fr 1fr; gap: 2px 8px; }

  /* The split collapses. The brand half becomes a short header rather than a
     screen of its own - a form the reader has to scroll to find is a worse
     first impression than a smaller logo. */
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth__brand {
    gap: 20px;
    padding: 30px 22px 28px;
  }
  .auth__logo { max-width: 148px; padding: 9px 13px; }
  .auth__title { font-size: 26px; }
  .auth__blurb { font-size: 14px; }

  /* Both are cut so the fields stay above the fold on a phone. */
  .auth__points,
  .auth__foot { display: none; }

  .auth__panel { padding: 30px 22px 48px; place-items: start center; }
}

/* Anyone who has asked for less motion gets the drawer without the slide. It
   still opens; it simply stops moving. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Card tables

   Below 760px a row stops being a row and becomes a card, with each cell
   carrying its own column heading. The heading text comes from data-label on
   the cell, so it is written once in the markup beside the value it names and
   cannot drift out of step with the <th> above it.

   Opt-in via .table--cards, so the plan/menu matrix keeps scrolling instead.
   --------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .table--cards { border-collapse: separate; border-spacing: 0; }

  /* Off-screen rather than display:none. The headings are still the
     accessible name for each cell and a screen reader should keep reading
     them. */
  .table--cards thead {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .table--cards,
  .table--cards tbody,
  .table--cards tfoot,
  .table--cards tr,
  .table--cards td { display: block; width: 100%; }

  .table--cards tr {
    margin-bottom: 11px;
    padding: 14px 15px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    background: var(--c-surface);
    box-shadow: var(--sh-xs);
  }
  .table--cards tbody tr:last-child { margin-bottom: 0; }
  .table--cards tbody tr:hover td { background: transparent; }

  .table--cards td {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    align-items: baseline;
    justify-content: space-between;
    padding: 7px 0;
    border: 0;
    text-align: right;
    color: var(--c-text);
    overflow-wrap: anywhere;
  }
  .table--cards td + td { border-top: 1px dashed var(--c-line); }

  .table--cards td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    text-align: left;
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  /* A cell with no label is a spacer or an action column - it gets the full
     width instead of a heading and a gap where one should be. */
  .table--cards td:not([data-label]),
  .table--cards td[data-label=""] { display: block; text-align: left; }
  .table--cards td:not([data-label])::before,
  .table--cards td[data-label=""]::before { content: none; }

  /* The identifying cell of the card. Reads as a heading rather than as one
     more labelled field. */
  .table--cards td.cell--title {
    display: block;
    padding-top: 0;
    border-top: 0;
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--c-text);
  }
  .table--cards td.cell--title::before { content: none; }

  /* The title cell is a block, not a flex row, so its secondary line stays
     left under the name rather than being pushed to the right edge by the
     rule that stacks .sub inside ordinary labelled cells. */
  .table--cards td.cell--title > .sub,
  .table--cards td.cell--title > .flag { text-align: left; }

  .table--cards .num { text-align: right; }

  /* A secondary line inside a cell takes a row of its own.

     The cell is a flex row carrying its label and its value, so without this
     a .sub becomes a third item on that line and the phone number ends up
     sitting alongside the email rather than under it. flex-basis 100% is what
     pushes it onto the next line; the cell wraps to accommodate it. */
  .table--cards td > .sub,
  .table--cards td > .flag {
    flex: 1 0 100%;
    text-align: right;
  }

  /* Actions stack across the bottom of the card, each wide enough to hit. */
  .table--cards td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    white-space: normal;
  }
  .table--cards td.actions::before { content: none; }
  .table--cards td.actions .btn,
  .table--cards td.actions form { flex: 1 1 auto; }
  .table--cards td.actions form .btn { width: 100%; }

  /* The totals row is a card too, tinted so it does not read as one more
     record in the list. */
  .table--cards tfoot .total-row {
    margin-top: 11px;
    border-color: var(--c-accent-line);
    background: var(--c-accent-soft);
  }
  .table--cards tfoot .total-row td { border-top: 0; background: transparent; }
  .table--cards tfoot .total-row td + td { border-top: 1px dashed var(--c-accent-line); }

  /* Cells a card has no room for - a column repeating something already in
     the title. */
  .table--cards td.cell--hide { display: none; }

  .matrix th.matrix__plan { min-width: 78px; font-size: 10px; }
  .matrix th.matrix__key,
  .matrix td.matrix__key { max-width: 152px; font-size: 12.5px; }
  .legend { gap: 12px; }
}

@media (max-width: 420px) {
  /* The stat grid deliberately STAYS at two columns here. Dropping to one
     turns five figures into five screens of scrolling, and at 390px two
     tiles are still wide enough for a wrapped label and a 21px number.
     Only the checkbox grid, whose items are full menu keys, gives up. */
  .menu-pick__grid { grid-template-columns: 1fr; }
  .stat { padding: 12px 12px; }
  .stat__label { font-size: 10px; letter-spacing: .04em; }
}

/* ---------------------------------------------------------------------------
   Selects

   The native control brings its own chevron in the OS style, which is the one
   thing on a filter bar that gives away that the rest was designed. Replaced
   with an inline SVG - a data URI rather than a file, so there is no second
   request and nothing to lose in a deploy.
   --------------------------------------------------------------------------- */

.filters select,
.form-grid select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%237d879c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.filters select:hover,
.form-grid select:hover { border-color: var(--c-line-2); }

/* Firefox keeps a dotted focus ring on the text inside a select. */
.filters select:-moz-focusring,
.form-grid select:-moz-focusring { color: transparent; text-shadow: 0 0 0 var(--c-text); }

/* A date input's own picker button, toned down to match. */
input[type=date]::-webkit-calendar-picker-indicator {
  opacity: .45;
  cursor: pointer;
  transition: opacity .15s var(--ease);
}
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: .9; }

/* ---------------------------------------------------------------------------
   Pager

   Sits under a table and says where you are in the set. The count matters as
   much as the buttons: "Next" alone tells a reader nothing about whether they
   are near the end.
   --------------------------------------------------------------------------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--c-line);
}
.pager__count { color: var(--c-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pager__links { display: flex; align-items: center; gap: 10px; }
.pager__page {
  color: var(--c-text-2);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A sortable column heading. Underlined only on hover, so a row of headings
   does not read as a row of links. */
thead th a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
thead th a:hover { color: var(--c-accent); border-bottom-color: currentColor; }

@media (max-width: 760px) {
  .pager { flex-direction: column; align-items: stretch; }
  .pager__links { justify-content: space-between; }
}

/* ---------------------------------------------------------------------------
   Credentials panel

   Shown once, on the screen that created a partner. The password exists
   nowhere else a person can read it, so this is deliberately a panel rather
   than a line in a toast - it has to survive a glance away and a scroll.
   --------------------------------------------------------------------------- */

.cred {
  margin-bottom: 20px;
  border: 1px solid var(--c-accent-line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--c-accent-soft), var(--c-surface) 70%);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

.cred__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--c-accent-line);
}
.cred__head h2 { margin: 0 0 3px; font-size: 16.5px; }
.cred__head p { margin: 0; max-width: 60ch; font-size: 13.5px; color: var(--c-text-2); }

.cred__body {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 18px 20px;
  align-items: flex-start;
}
.cred__fields { flex: 1 1 340px; display: grid; gap: 12px; min-width: 0; }

.cred__field { display: grid; gap: 4px; min-width: 0; }
.cred__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.cred__value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.cred__value strong { font-size: 15.5px; font-weight: 700; letter-spacing: .02em; }

/* The password gets its own treatment. It is the one value on this panel that
   cannot be looked up again, so it should not read as one more field. */
.cred__field--secret .cred__value strong {
  padding: 4px 11px;
  border: 1px solid var(--c-warn-line);
  border-radius: var(--r-sm);
  background: var(--c-warn-bg);
  color: var(--c-warn);
  font-size: 16px;
}

.cred__qr { flex: 0 0 auto; display: grid; gap: 9px; justify-items: center; }
.cred__qr img {
  display: block;
  width: 170px;
  height: 170px;
  padding: 10px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: #fff;
}

.cred__warn {
  margin: 0;
  padding: 11px 20px;
  border-top: 1px solid var(--c-line);
  background: var(--c-surface-2);
  font-size: 12.5px;
  color: var(--c-muted);
}

@media (max-width: 700px) {
  .cred__head { flex-direction: column; }
  .cred__body { flex-direction: column-reverse; }
  .cred__qr { justify-self: center; width: 100%; }
}

/* ---------------------------------------------------------------------------
   Grouped sidebar

   Seventeen flat links is a list nobody reads to the bottom of. The headings
   split it into the four things this panel is for, and the nav scrolls
   independently so a long menu never pushes the sign-out button off screen.
   --------------------------------------------------------------------------- */

.sidebar__group {
  margin: 16px 0 4px;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  /* Dimmer than the links themselves. A heading that competes with the items
     under it makes the list harder to scan, not easier. */
  color: #5c6780;
}
.sidebar__group:first-child { margin-top: 4px; }

/* Tighter than before: with headings doing the separating, the links no longer
   need space between them to read as distinct. */
.sidebar__nav { gap: 0; padding: 10px 10px 16px; }
.sidebar__nav a { padding: 7.5px 12px; font-size: 13.5px; }

/* The rail marker sits flush against the panel edge rather than floating in
   the padding. */
.sidebar__nav a.is-active::before { left: -10px; height: 18px; }

@media (max-width: 900px) {
  .sidebar__nav a { padding: 10px 12px; font-size: 14.5px; }
  .sidebar__group { margin-top: 14px; }
}

/* The referral code and its QR, side by side in the partner list. */
.code-qr { display: flex; align-items: center; gap: 10px; }
.code-qr .code { font-size: 14px; font-weight: 700; letter-spacing: .04em; }

.qr-thumb {
  display: block;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-xs);
  background: #fff;
  line-height: 0;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.qr-thumb:hover { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-ring); }
.qr-thumb img { display: block; width: 54px; height: 54px; }

/* ---------------------------------------------------------------------------
   Section tabs

   The sidebar carries six groups; these move between the screens inside one.
   Rendered by the layout, so every page in a group gets them without knowing
   they exist.
   --------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 22px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--c-line);
  /* Scrolls rather than wraps. A tab strip that reflows onto two lines stops
     reading as one row of siblings, and Partners has six. */
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 9px 14px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--c-muted);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.tab:hover { color: var(--c-text); background: var(--c-surface-3); }

/* The underline sits ON the container's border rather than above it, so the
   active tab reads as joined to the page below it. */
.tab--on {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
  background: transparent;
}
.tab--on:hover { background: transparent; }

@media (max-width: 900px) {
  .tabs {
    margin: 0 -16px 18px;
    padding: 0 16px;
  }
  .tab { padding: 10px 13px 11px; font-size: 14px; }
}

/* WhatsApp share. Given its own colour because it is the one action here that
   leaves the panel - it hands off to another app, and should not look like the
   buttons that stay put. */
.btn--wa {
  border-color: #b7e4c7;
  background: #eefaf1;
  color: #1a7f4b;
}
.btn--wa:hover { background: #dff4e6; border-color: #8fd4ab; color: #14653b; }
