/* Practice. Peter W O'Brien's brand: deep teal and cyan (#007A9A, #08C6D2) from the PWO
   logo, Montserrat throughout, the fan-lines mark. Same frame as the base platform;
   only colours and type changed. */

@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-SemiBold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

:root {
  --accent: #007A9A;
  --accent-dark: #00617A;
  --accent-tint: #DCF0F5;
  --cyan: #08C6D2;
  --aqua: #A8F3F7;
  --grad: linear-gradient(120deg, #006A86 0%, #007A9A 45%, #0397B0 100%);
  --black: #0D2B35;
  --ink: #0D2B35;
  --ink-2: #5B7680;
  --grey-on-black: #A8C4CC;
  --hair: #D5E6EA;
  --line: #B9D0D6;
  --paper: #FFFFFF;
  --ground: #F2F8F9;
  --soft: #EDF3F5;
  --ok: #127A52; --ok-bg: #E3F6EE;
  --bad: #B42318; --bad-bg: #FDECEA;
  --wait: #9A5B00; --wait-bg: #FDF1DC;
  --font-body: "Montserrat", system-ui, sans-serif;
  --font-head: "Montserrat", system-ui, sans-serif;
  --radius: 10px;
  --nav-w: 232px;
  --top-h: 60px;
  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 var(--font-body); color: var(--ink); background: var(--ground); }
img { max-width: 100%; }
a { color: var(--accent-dark); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--focus); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .6em; }
h1 { font-size: 30px; }
h2 { font-size: 19px; display: flex; align-items: center; gap: 10px; }
h3 { font-size: 16px; margin-top: 1.4em; }
p { margin: 0 0 1em; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }

/* --- frame ------------------------------------------------------------------------ */
/* The teal gradient from the PWO logo fade, with the white reverse of the mark. */
.topbar { position: sticky; top: 0; z-index: 5; height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--grad); color: #fff; }
.topbar :focus-visible { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px #fff; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand-logo { height: 30px; width: auto; }
.brand-name { font: 500 24px/1 var(--font-head); letter-spacing: -.005em; }
.brand-name em, .auth-app em { font-style: normal; color: var(--aqua); }
.brand-client { font-size: 13px; padding-left: 14px; margin-left: 2px; border-left: 1px solid rgba(255, 255, 255, .45); color: rgba(255, 255, 255, .9); }
.brand:hover { color: #fff; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 13px; }
.userbox a, .userbox .btn-link { color: #fff; }
.userbox form { margin: 0; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: #fff; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 22px; height: 2px; background: currentColor; position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.sidenav { background: var(--paper); border-right: 1px solid var(--hair); padding: 22px 0; }
.sidenav ul { list-style: none; margin: 0 0 18px; padding: 0; }
.sidenav a { display: block; padding: 8px 22px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; font-size: 14px; }
.sidenav a:hover { background: var(--ground); }
.sidenav a[aria-current="page"] { border-left-color: var(--accent); font-weight: 600; background: var(--ground); }
.nav-heading { margin: 4px 22px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.content { padding: 30px 36px 60px; max-width: 1240px; width: 100%; }
.content-wide { max-width: 1680px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.kicker { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* --- building blocks ---------------------------------------------------------------- */
.panel { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.panel > :last-child { margin-bottom: 0; }
/* position: relative so absolutely positioned children (screen-reader labels in wide
   tables) are clipped by the scroll box instead of widening the whole page. */
.panel-flush { padding: 0; overflow-x: auto; position: relative; }
.table-scroll { overflow-x: auto; position: relative; }
/* The card fills the width (no gap on the right); the form inside keeps a readable measure. */
.panel.narrow > * { max-width: 640px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + .panel, .grid-2 + section { margin-top: 20px; }
.stack > * + * { margin-top: 16px; }
.panel .grid-2 + .field, .panel .field + .grid-2, .panel form + .facts { margin-top: 18px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button-row form { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: 600 14px/1.2 var(--font-body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ground); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.field label, .field .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field input:not([type]),
.filters input, .filters select, .inline-form input, .inline-form select {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font: 400 15px/1.3 var(--font-body); color: var(--ink); }
.field input:focus, .filters input:focus, .filters select:focus, .inline-form input:focus, .inline-form select:focus { border-color: var(--ink); outline: none; box-shadow: var(--focus); }
.field .hint { margin: -2px 0 8px; font-size: 13px; color: var(--ink-2); }
.field .static { margin: 0; padding: 9px 0; }
.field-error input { border-color: var(--bad); }
.error-text { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--bad); }
.checks { border: 0; padding: 0; margin: 0; }
.checks legend { font-weight: 600; margin-bottom: 8px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check-disabled { color: var(--ink-2); cursor: not-allowed; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filters input { width: 280px; }
.filters select { width: auto; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 14px 0 0; }
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.inline-form input, .inline-form select { width: auto; min-width: 140px; max-width: 100%; }
.inline-form label { max-width: 100%; }

.notice { padding: 12px 16px; border-left: 4px solid var(--ink); background: var(--soft); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 18px; }
.notice-ok { border-left-color: var(--ok); background: var(--ok-bg); }
.notice-error { border-left-color: var(--bad); background: var(--bad-bg); }
.notice-info { border-left-color: var(--line); }
.notice-dev { border-left-color: var(--wait); background: var(--wait-bg); font-size: 14px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 600 12px/1.5 var(--font-body); white-space: nowrap; vertical-align: middle; text-transform: none; letter-spacing: 0; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--wait-bg); color: var(--wait); }
.badge-off { background: var(--soft); color: var(--ink-2); }
.badge-info { background: var(--accent-tint); color: var(--accent-dark); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table form { margin: 0; }
.table-dense td { padding: 8px 16px; }
.panel > .table th:first-child, .panel > .table td:first-child { padding-left: 0; }
.panel-flush > .table th:first-child, .panel-flush > .table td:first-child { padding-left: 24px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 1em; font-size: 14px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.access-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; font-size: 14px; }
.access-list dt { font-weight: 600; }
.access-list dd { margin: 0; }
.plain { list-style: none; margin: 0 0 1em; padding: 0; }
.plain li + li { margin-top: 4px; }
.disclosure { margin-top: 12px; border-top: 1px solid var(--hair); padding-top: 12px; }
.disclosure summary { cursor: pointer; font-weight: 600; }
.disclosure form { margin-top: 12px; }
.danger-zone { display: flex; align-items: center; gap: 14px; margin-top: 8px; }

/* auto-fit, so a short row of tiles fills the width instead of leaving a gap on the right. */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px; background: var(--paper); border: 1px solid var(--hair); border-top: 4px solid var(--accent); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.tile:hover { border-top-color: var(--cyan); color: var(--ink); box-shadow: 0 6px 18px rgba(0, 122, 154, .12); }
.tile-label { font: 600 20px/1.15 var(--font-head); }
.tile-text { color: var(--ink-2); font-size: 14px; }

/* --- clients ------------------------------------------------------------------------ */
.client-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.client-card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 20px; background: var(--paper); border: 1px solid var(--hair); border-left: 4px solid var(--accent); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.client-card:hover { border-left-color: var(--cyan); color: var(--ink); }
.client-card-name { font-weight: 600; font-size: 17px; }
.client-card-meta { color: var(--ink-2); font-size: 13px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 12px; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { margin: 0; }
.stack-tight + .stack-tight { margin-top: 30px; }
.scroll-x { overflow-x: auto; position: relative; }
.checks-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; }

/* --- set-up, compliance, timelines -------------------------------------------------- */
.panel-pad { padding: 22px 24px 4px; }
.mono, textarea.mono { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); resize: vertical; }
.field textarea:focus, .field select:focus, .table input:focus, .table select:focus { border-color: var(--ink); outline: none; box-shadow: var(--focus); }
.field select, .select-wide { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font: 400 14px/1.3 var(--font-body); color: var(--ink); max-width: 100%; }
.select-wide { width: 100%; }
.input-short { max-width: 200px; }
.small-list li { font-size: 14px; }
.table input, .table select { min-height: 36px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font: 400 14px/1.2 var(--font-body); color: var(--ink); max-width: 100%; }
.period-table td { white-space: nowrap; vertical-align: middle; }
.period-table input[type="date"] { width: 9.6em; }
.period-table th, .period-table td { padding-left: 10px; padding-right: 10px; }
.row-current td { background: var(--accent-tint); }
.comp-table td { vertical-align: top; }
.comp-table input[name="note"] { min-width: 180px; }
.comp-bad td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.comp-wait td:first-child { box-shadow: inset 4px 0 0 var(--wait); }
.stat-row { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--ink-2); font-size: 13px; }
.stat strong { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-bad strong { color: var(--bad); }
.stat-wait strong { color: var(--wait); }
.stat-ok strong { color: var(--ok); }
.tile-status { margin-top: auto; padding-top: 8px; font-size: 13px; font-weight: 600; }
.tile-status-ok { color: var(--ok); }
.tile-status-warn { color: var(--wait); }
.tile-status-off { color: var(--ink-2); font-weight: 400; }

/* --- the club's sheet (Excel-like) ---------------------------------------------------- */
.xtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 -1px; position: relative; z-index: 1; }
.xtabs a { padding: 8px 14px; border: 1px solid var(--hair); border-bottom-color: var(--line); border-radius: 8px 8px 0 0; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 14px; }
.xtabs a[aria-current="page"] { background: var(--paper); border-bottom-color: var(--paper); font-weight: 600; }
.xwrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); background: var(--paper); position: relative; }
.xgrid { border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.xgrid .xn { position: sticky; top: 0; background: var(--soft); color: var(--ink-2); font-weight: 500; font-size: 12px; padding: 4px 8px; border: 1px solid var(--hair); z-index: 2; text-align: center; }
.xgrid tbody .xn { position: sticky; left: 0; top: auto; z-index: 1; }
.xc { border: 1px solid var(--hair); padding: 0 8px; height: 32px; min-width: 94px; text-align: right; white-space: nowrap; }
.xl { text-align: left; font-weight: 400; min-width: 220px; position: sticky; left: 34px; background: var(--paper); z-index: 1; }
.xh { text-align: right; font-weight: 600; background: var(--accent-tint); }
.xb { font-weight: 600; }
.xf, .xo, .xi-ro { background: #F6F9FA; color: var(--ink); }
.xo { color: var(--accent-dark); }
.xbad { color: var(--bad); font-weight: 600; }
.xerr { color: var(--bad); }
.xi { padding: 0; background: #FFFEF5; }
.xi input { width: 100%; height: 31px; border: 0; padding: 0 8px; background: transparent; text-align: right; font: inherit; color: var(--ink); }
.xi input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--paper); }
.xi input.x-saving { background: var(--wait-bg); }
.xi input.x-bad { outline: 2px solid var(--bad); outline-offset: -2px; }
.xform .button-row { margin-top: 12px; }
.xform.x-full { position: fixed; inset: 0; z-index: 30; background: var(--paper); padding: 12px 16px; overflow: auto; }
.xform.x-full .xwrap { max-height: calc(100vh - 110px); }
.xform.x-full > [data-sheet-full] { margin-bottom: 8px; }
.record .facts { font-size: 16px; }
@media print { .no-print { display: none !important; } .record { border: 0; } }

/* --- data entry ------------------------------------------------------------------------ */
.entry-table td { vertical-align: top; }
.th-sub { font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 400; }
.dots { display: flex; gap: 4px; margin-top: 8px; }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 4px; background: var(--soft); border: 1px solid var(--hair); }
.dot-ok { background: var(--ok); border-color: var(--ok); }
.dot-done { background: var(--accent); border-color: var(--accent); }
.dot-bad { background: var(--bad); border-color: var(--bad); }
.dot-part { background: var(--wait); border-color: var(--wait); }
.dot-missing { background: var(--paper); border-color: var(--line); }
.dot-future { background: transparent; border-style: dashed; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.review-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.review-form input[name="note"] { min-width: 220px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.cal-table td { padding: 0; height: 74px; vertical-align: top; width: 14.28%; }
.cal-table td a { display: flex; flex-direction: column; height: 100%; padding: 8px 10px; text-decoration: none; color: var(--ink); }
.cal-n { font-weight: 600; }
.cal-st { font-size: 12px; color: var(--ink-2); }
.cal-out { background: var(--ground); }
.cal-ready { box-shadow: inset 4px 0 0 var(--ok); }
.cal-exported { box-shadow: inset 4px 0 0 var(--accent); }
.cal-exception { box-shadow: inset 4px 0 0 var(--bad); }
.cal-incomplete { box-shadow: inset 4px 0 0 var(--wait); }
.cal-today { background: var(--accent-tint); }
.day-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.day-grid .perm-table input { width: 100%; max-width: 220px; min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
input.num { text-align: right; }
.row-total td { font-weight: 600; border-top: 2px solid var(--line); }
.row-bad td { color: var(--bad); }
.checks-list li { padding: 6px 0; border-bottom: 1px solid var(--hair); }
.history-list li { font-size: 13px; padding: 3px 0; }
.inline { display: inline; margin: 0; }
.nowrap { white-space: nowrap; }
.lines-table input { min-width: 160px; }
.lines-table select { min-width: 220px; }
.inline-label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.inline-label input { min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; min-width: 260px; }
.sched-table th, .sched-table td { padding-left: 6px; padding-right: 6px; }
.sched-table input[type="date"] { width: 9.4em; }
.sched-table input[name^="desc"] { width: 100%; min-width: 110px; }
.sched-table input.num { width: 96px; }
.sched-table td { vertical-align: middle; }
.evidence-thumb { max-width: 220px; max-height: 160px; border: 1px solid var(--hair); border-radius: 6px; vertical-align: middle; }
.row-warn td { background: var(--wait-bg); }
.col-current { background: var(--accent-tint); }
.prepay-table .cell-form { margin: 0; }
.prepay-table .cell-form input { width: 90px; }
.mail-text { background: var(--soft); padding: 14px 16px; border-radius: var(--radius); }
.check-inline { display: inline-flex; padding: 0 0 0 10px; font-size: 13px; }
.paste-form { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hair); }
.payouts-table input, .payouts-table select { min-width: 90px; }
.payouts-table input[name="notes"], .payouts-table input[name="winner"] { min-width: 150px; }
.payouts-table td form { display: inline; }
.notes li { font-size: 13px; margin-bottom: 6px; }
@media (max-width: 1100px) { .day-grid { grid-template-columns: minmax(0, 1fr); } }

/* --- permission grid ---------------------------------------------------------------- */
.perm-full { padding: 12px 16px; margin-bottom: 16px; background: var(--soft); border-radius: var(--radius); }
.perm-module { border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 18px 8px; margin: 0 0 16px; }
.perm-module legend { font: 600 17px/1 var(--font-head); padding: 0 6px; }
.perm-module > .muted { margin: 0 0 6px; font-size: 13px; }
.perm-all { font-weight: 600; border-bottom: 1px solid var(--hair); padding-bottom: 10px; margin-bottom: 4px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-table th { text-align: left; font-weight: 400; padding: 10px 16px 10px 0; width: 45%; vertical-align: top; }
.perm-table td { padding: 6px 0; }
.perm-table tr + tr th, .perm-table tr + tr td { border-top: 1px solid var(--hair); }
.perm-scopes { display: flex; flex-wrap: wrap; gap: 0 18px; }
.is-covered { opacity: .45; }

/* --- account pieces ------------------------------------------------------------------ */
.steps { padding-left: 20px; }
.steps li { margin-bottom: 14px; }
.qr { width: 200px; margin: 12px 0; padding: 8px; background: #fff; border: 1px solid var(--hair); }
.qr svg { display: block; width: 100%; height: auto; }
.key { display: inline-block; padding: 6px 10px; background: var(--soft); letter-spacing: .08em; }
.manual-key summary { cursor: pointer; font-size: 14px; color: var(--accent-dark); }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 28px; list-style: none; padding: 16px 20px; background: var(--soft); border-radius: var(--radius); }
.codes code { font-size: 16px; letter-spacing: .06em; }
.mail-text { white-space: pre-wrap; font: 14px/1.6 var(--font-body); margin: 0; }

/* --- chart tooltip (any element with data-tip-title / data-tip) --------------------- */
.tip { position: fixed; z-index: 20; pointer-events: none; min-width: 150px; max-width: 280px; padding: 10px 12px; background: var(--black); color: #fff; border-radius: var(--radius); font-size: 13px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.tip[hidden] { display: none; }
.tip-title { display: block; margin-bottom: 4px; color: var(--grey-on-black); font-size: 12px; }
.tip-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-key { display: inline-flex; align-items: center; gap: 6px; color: #D9D9D9; }
.tip-key i { display: inline-block; width: 10px; height: 2px; }

/* --- dialog -------------------------------------------------------------------------- */
.dialog { border: 0; border-top: 6px solid var(--accent); border-radius: var(--radius); padding: 26px 28px; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(13, 43, 53, .6); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* --- signed-out pages ------------------------------------------------------------------ */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--grad); }
.auth-card { width: 100%; max-width: 440px; background: var(--paper); border-radius: var(--radius); padding: 34px 36px 30px; }
.auth-brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--hair); }
.auth-brand { justify-content: flex-start; }
.auth-brand img { height: 46px; width: auto; }
.auth-app { font: 500 30px/1 var(--font-head); letter-spacing: -.01em; color: var(--ink); }
.auth-app em { color: var(--cyan); }
.auth-card h1 { font-size: 24px; }
.auth-foot { margin: 18px 0 0; font-size: 14px; text-align: center; }

/* --- small screens --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .brand-client { display: none; }
  /* minmax(0, 1fr), not 1fr: a plain 1fr track grows to fit a wide table and pushes the whole page off the screen. */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: fixed; top: var(--top-h); left: 0; bottom: 0; width: min(280px, 85vw); z-index: 4; overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  /* Hidden means out of the tab order too, not just off screen. */
  .nav-open .sidenav { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .25); transition: transform .2s ease; }
  .content { padding: 22px 18px 48px; }
  .userbox-name { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .filters input { width: 100%; }
  .inline-form label { flex: 1 1 100%; }
  .inline-form select, .inline-form input { width: 100%; }
  .access-list, .facts { grid-template-columns: 1fr; }
  .access-list dd, .facts dd { margin-bottom: 8px; }
  .perm-table th { width: auto; display: block; padding-bottom: 0; }
  .perm-table td { display: block; }
  .auth-card { padding: 26px 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .topbar, .sidenav, .page-actions, form { display: none !important; } .shell { display: block; } .panel { border: 0; } }
