/* Wilk Business Insurance — Client Portal
   Brand: navy #10244E, gold #A69462, navy-deep #061327, charcoal #2A2F36,
   slate #5B6472, mist #E3E7EE, cloud #F5F7FA. Fraunces (display) + Source Sans 3 (body). */

:root {
  --navy: #10244E; --navy-deep: #061327; --navy-600: #1B3568; --navy-050: #EEF2F9;
  --gold: #A69462; --gold-light: #D2C59E; --gold-ink: #6B5B2E; --gold-200: #E6DEC6; --gold-100: #F5F0E2; --gold-050: #FBF9F2;
  --charcoal: #2A2F36; --slate: #5B6472; --mist: #E3E7EE; --cloud: #F5F7FA; --paper: #FFFFFF;
  --line: #D5DAE3;
  --ok: #17663F; --ok-bg: #E7F4EC; --ok-line: #BBDFC9;
  --warn: #7A5200; --warn-bg: #FFF6DF; --warn-line: #EBD59A;
  --danger: #A8221A; --danger-bg: #FBEFED; --danger-line: #EDC5C0;
  --radius: 12px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(6, 19, 39, .06);
  --shadow: 0 1px 2px rgba(6, 19, 39, .05), 0 8px 24px -8px rgba(6, 19, 39, .12);
  --shadow-lg: 0 2px 4px rgba(6, 19, 39, .06), 0 24px 48px -16px rgba(6, 19, 39, .28);
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1240px; --gutter: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--charcoal); background: var(--cloud);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column; overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--navy); text-decoration-color: rgba(16, 36, 78, .35); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { color: var(--navy); margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); letter-spacing: -.015em; }
h2 { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
code, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--navy-050); border-radius: 5px; padding: .1em .4em; color: var(--navy); overflow-wrap: anywhere; }
.muted { color: var(--slate); }
.small { font-size: .875rem; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; margin-bottom: .35rem; }
.eyebrow a { color: inherit; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.topbar :focus-visible, .hero :focus-visible, .guest-brand :focus-visible { outline-color: var(--gold-light); }
::selection { background: var(--gold-200); color: var(--navy-deep); }

/* ---------- Shell ---------- */
.topbar {
  background: linear-gradient(90deg, var(--navy-deep), var(--navy) 55%, var(--navy-600));
  color: #fff; position: relative; z-index: 30;
  box-shadow: inset 0 -2px 0 var(--gold), 0 1px 0 rgba(6, 19, 39, .2);
}
.topbar-inner { max-width: var(--wrap); margin: 0 auto; padding: .7rem var(--gutter); display: flex; align-items: center; gap: .5rem 1.5rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 1rem; color: #fff; text-decoration: none; border-radius: 6px; }
.brand-mark { height: 40px; width: auto; display: block; }
.brand-app {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); font-weight: 600;
  padding-left: 1rem; border-left: 1px solid rgba(255, 255, 255, .22); line-height: 1.6; white-space: nowrap;
}
.nav { display: flex; gap: .25rem; margin-left: auto; align-items: center; }
.nav a { color: #D5DDEC; text-decoration: none; padding: .45rem .85rem; border-radius: 999px; font-weight: 600; font-size: .95rem; transition: background-color .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: inset 0 0 0 1px rgba(210, 197, 158, .45); }

.usermenu { position: relative; margin-left: auto; }
.nav + .usermenu { margin-left: .5rem; }
.usermenu summary {
  cursor: pointer; list-style: none; color: #fff; display: flex; align-items: center; gap: .6rem;
  padding: .3rem .7rem .3rem .3rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18);
  font-weight: 600; font-size: .95rem; transition: background-color .15s, border-color .15s; user-select: none;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .32); }
.usermenu summary::after { content: ""; width: .45rem; height: .45rem; border-right: 2px solid var(--gold-light); border-bottom: 2px solid var(--gold-light); transform: translateY(-2px) rotate(45deg); transition: transform .15s; margin-left: .1rem; }
.usermenu[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.avatar {
  width: 2rem; height: 2rem; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-light), var(--gold)); color: var(--navy-deep);
  font-weight: 700; font-size: .95rem; line-height: 1;
}
.who { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + .6rem); background: #fff; color: var(--charcoal);
  border: 1px solid var(--mist); border-radius: var(--radius); min-width: 260px; max-width: calc(100vw - 2rem);
  box-shadow: var(--shadow-lg); z-index: 40; padding: .4rem; animation: pop .14s ease-out;
}
.usermenu-pop::before { content: ""; position: absolute; top: -6px; right: 1.4rem; width: 10px; height: 10px; background: #fff; border-left: 1px solid var(--mist); border-top: 1px solid var(--mist); transform: rotate(45deg); }
.usermenu-head { padding: .65rem .75rem .75rem; border-bottom: 1px solid var(--mist); margin-bottom: .4rem; font-size: .9rem; font-weight: 600; color: var(--navy); overflow-wrap: anywhere; line-height: 1.4; }
.usermenu-head .muted { font-weight: 400; }
.usermenu-pop form { margin: 0; }
.usermenu-pop a, .usermenu-pop button {
  display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: .95rem; cursor: pointer;
  color: var(--charcoal); text-decoration: none; padding: .55rem .75rem; border-radius: var(--radius-sm);
}
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--cloud); color: var(--navy); }
.usermenu-pop form { border-top: 1px solid var(--mist); margin-top: .4rem; padding-top: .4rem; }
.usermenu-pop form button { color: var(--danger); font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

main { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 1.75rem var(--gutter) 3rem; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--mist); position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 2px; background: var(--gold); }
.page-head h1 { margin-bottom: .3rem; }
.page-head p { margin: 0; color: var(--slate); max-width: 80ch; }
.page-head > div { min-width: 0; flex: 1 1 320px; }

.site-footer { border-top: 1px solid var(--mist); background: #fff; color: var(--slate); font-size: .875rem; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 1.1rem var(--gutter); display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; align-items: center; }
.footer-inner > :first-child { margin-right: auto; }
.footer-inner a { color: var(--navy); }

/* ---------- Cards ---------- */
.card { background: var(--paper); border: 1px solid var(--mist); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.card + .card, .stack > .card + .card { margin-top: 1.25rem; }
.admin-grid > .card + .card { margin-top: 0; }
.card > h2:first-child { margin-bottom: 1rem; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.card-narrow { max-width: 540px; }
.card-mid { max-width: 660px; }
.empty { text-align: center; padding: 3rem 1.5rem; }
.empty p { color: var(--slate); max-width: 46ch; margin: 0 auto; }

/* ---------- Notices ---------- */
.notice { border-radius: var(--radius); padding: .85rem 1.1rem; border: 1px solid var(--line); background: #fff; margin-bottom: 1.25rem; color: var(--charcoal); }
.notice a { font-weight: 600; white-space: nowrap; margin-left: .35rem; }
.notice strong { color: inherit; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok-line); color: #114D2F; }
.notice-info { background: var(--navy-050); border-color: #CBD5EA; color: var(--navy); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-line); color: #4F3600; }
.notice-danger { background: var(--danger-bg); border-color: var(--danger-line); color: #7A1C14; }
.notice-key { background: var(--gold-050); border-color: var(--gold-200); border-left: 4px solid var(--gold); align-items: flex-start; }
.notice-key strong { display: block; color: var(--navy); }
.temp-pass { display: inline-block; font-size: 1.25rem; letter-spacing: .06em; margin: .45rem 0; padding: .35rem .7rem; background: #fff; border: 1px dashed var(--gold); color: var(--navy-deep); user-select: all; }
.preview-bar { display: flex; gap: .75rem 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid #C99A1E; box-shadow: var(--shadow-sm); }
.preview-bar > div:first-child { flex: 1 1 320px; min-width: 0; }
.preview-bar strong { display: block; }
.preview-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.preview-actions form { margin: 0; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--navy); color: #fff; border: 1px solid var(--navy); padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { background: var(--navy-600); border-color: var(--navy-600); }
.btn:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(180deg, #B5A473, var(--gold)); border-color: #94834F; color: var(--navy-deep); box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 1px 2px rgba(6, 19, 39, .15); }
.btn-gold:hover { background: linear-gradient(180deg, #C2B283, #B09E6C); border-color: #94834F; }
.btn-outline { background: #fff; color: var(--navy); border-color: #B9C2D3; }
.btn-outline:hover { background: var(--navy-050); border-color: var(--navy); }
.btn-sm { padding: .4rem .8rem; font-size: .875rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.inline-form .btn { min-height: 2.75rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--navy); cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(16, 36, 78, .3); text-underline-offset: .18em; padding: .15rem .3rem; border-radius: 4px; }
button.link:hover { text-decoration-color: currentColor; background: var(--navy-050); }
button.link.danger { color: var(--danger); text-decoration-color: rgba(168, 34, 26, .3); }
button.link.danger:hover { background: var(--danger-bg); }

label { display: block; font-weight: 600; font-size: .9rem; color: var(--charcoal); margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; min-height: 2.75rem; padding: .6rem .8rem; border: 1px solid #B9C2D3; border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--charcoal); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #7B8494; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #8E99AE; }
input:focus, select:focus, textarea:focus, input:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(166, 148, 98, .45); }
input[type=file] { padding: .3rem .4rem; line-height: 1.4; background: var(--cloud); border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: .9rem; margin-right: .75rem; padding: .35rem .8rem; border-radius: 6px; border: 1px solid #B9C2D3; background: #fff; color: var(--navy); cursor: pointer; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--navy); flex: none; margin: 0; }
.field { margin-bottom: 1rem; min-width: 0; }
.error { color: var(--danger); font-size: .875rem; font-weight: 600; margin-top: .35rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; color: var(--charcoal); cursor: pointer; margin: 0; }
.inline-form { display: flex; gap: 0 .75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .5rem; }
.grow { flex: 1 1 240px; }
.doc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--mist); }
.span-2 { grid-column: span 2; }
.form-narrow { max-width: 300px; }

/* ---------- Pills ---------- */
.pill { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .16rem .55rem; border-radius: 999px; background: var(--navy-050); color: var(--navy); border: 1px solid #D3DBEB; white-space: nowrap; vertical-align: middle; line-height: 1.5; }
.pill-published { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.pill-draft { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pill-off, .pill-discarded, .pill-archived, .pill-superseded { background: #EEF0F4; color: var(--slate); border-color: var(--line); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; }
th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); font-weight: 700; padding: .65rem .75rem; border-bottom: 1px solid var(--line); background: var(--cloud); white-space: nowrap; }
td { padding: .7rem .75rem; border-bottom: 1px solid var(--mist); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFBFD; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compact td { padding: .55rem .75rem; }
td a { font-weight: 600; }
td.mono { font-family: var(--mono); font-size: .875rem; letter-spacing: .02em; white-space: nowrap; color: var(--navy-deep); }
.table-scroll { overflow-x: auto; border: 1px solid var(--mist); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 540px; }
.table-scroll th:first-child, .table-scroll td:first-child { padding-left: 1rem; }
.table-scroll th:last-child, .table-scroll td:last-child { padding-right: 1rem; }
.card > .table-scroll + form, .card > .table-scroll + .doc-form { margin-top: 1.25rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0; }
.pagination li > * { display: block; padding: .4rem .9rem; border: 1px solid #B9C2D3; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; text-decoration: none; background: #fff; color: var(--navy); }
.pagination li a:hover { background: var(--navy-050); border-color: var(--navy); }
.pagination li.disabled > * { color: #7B8494; background: var(--cloud); border-color: var(--mist); }

/* ---------- Client page: hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff; border-radius: 16px;
  background:
    url("../brand/arcs.svg") right -40px bottom -60px / 460px auto no-repeat,
    radial-gradient(90% 140% at 100% 100%, rgba(166, 148, 98, .22), transparent 60%),
    linear-gradient(120deg, var(--navy-deep) 0%, var(--navy) 58%, var(--navy-600) 100%);
  padding: 2.25rem 2.25rem 2.25rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-lg);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1.25rem 2rem; flex-wrap: wrap;
}
.hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.hero.has-stats { padding-bottom: 5rem; margin-bottom: 0; }
.hero-text { min-width: 0; flex: 1 1 340px; }
.hero .eyebrow { color: var(--gold-light); }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.75rem); margin-bottom: .5rem; }
.hero-sub { margin: 0; color: #CED7E8; font-size: 1.05rem; }
.hero-sub strong { color: #fff; font-weight: 600; white-space: nowrap; }
.hero .btn { flex: none; }

/* ---------- Client page: stats ---------- */
.stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin: -3.25rem 1.25rem 1.5rem; }
.stat {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label icon" "value icon" "sub sub"; column-gap: .75rem;
  background: #fff; border: 1px solid var(--mist); border-radius: var(--radius); padding: 1.1rem 1.25rem 1rem; text-decoration: none; color: var(--charcoal);
  box-shadow: var(--shadow); position: relative; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.stat::before { content: ""; position: absolute; left: 1.25rem; right: 1.25rem; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); opacity: .0; transition: opacity .18s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--gold-200); }
.stat:hover::before, .stat:focus-visible::before { opacity: 1; }
.stat:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 0; box-shadow: 0 0 0 5px var(--navy), var(--shadow-lg); }
.stat-label { grid-area: label; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--slate); }
.stat-value { grid-area: value; font-family: var(--display); font-weight: 600; font-size: 2.5rem; line-height: 1.1; color: var(--navy); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; }
.stat-icon { grid-area: icon; align-self: start; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--gold-100); color: var(--gold-ink); }
.stat-sub { grid-area: sub; margin-top: .55rem; padding-top: .6rem; border-top: 1px solid var(--mist); font-size: .9rem; color: var(--charcoal); font-weight: 600; display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.stat-sub::after { content: "View list \2192"; font-weight: 600; font-size: .8rem; color: var(--gold-ink); white-space: nowrap; }

/* ---------- Client page: schedule ---------- */
.schedule { padding: 0; overflow: hidden; scroll-margin-top: 1rem; }
.tabbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--mist); background: linear-gradient(180deg, #fff, #FBFCFD); }
.tab {
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .5rem .6rem .5rem 1rem; font: inherit; font-size: .95rem; font-weight: 600; color: var(--charcoal);
  cursor: pointer; display: inline-flex; align-items: center; gap: .55rem; transition: background-color .15s, color .15s, border-color .15s; text-align: left;
}
.tab:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-050); }
.tab-count { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--cloud); color: var(--slate); border-radius: 999px; padding: .08rem .55rem; min-width: 1.9rem; text-align: center; border: 1px solid var(--mist); }
.tab[aria-selected=true] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 2px 6px -2px rgba(16, 36, 78, .5); }
.tab[aria-selected=true] .tab-count { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.tab-search { margin-left: auto; position: relative; flex: 0 1 300px; min-width: 200px; }
.tab-search svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--slate); pointer-events: none; }
.tab-search input { padding-left: 2.4rem; border-radius: 999px; min-height: 2.5rem; padding-top: .45rem; padding-bottom: .45rem; }
.panel-head { padding: 1.25rem 1.5rem .25rem; }
.panel-head h2 { margin-bottom: .35rem; }
.panel-head p { color: var(--slate); margin: 0 0 .75rem; font-size: .95rem; }
.table-wrap { overflow: auto; max-height: min(70vh, 760px); margin: .5rem 1.25rem 1.25rem; border: 1px solid var(--mist); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; scrollbar-color: #B9C2D3 transparent; }
.table-wrap th { position: sticky; top: 0; z-index: 2; background: #EEF1F6; color: var(--navy); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); padding-top: .75rem; padding-bottom: .75rem; }
.table-wrap td { padding: .6rem .75rem; }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 1.1rem; }
.table-wrap tbody tr:nth-child(even) td { background: #FAFBFD; }
.table-wrap tbody tr:hover td { background: var(--navy-050); }
.table-wrap td:not(.note) { white-space: nowrap; }
tr.has-note td, .table-wrap tbody tr.has-note:nth-child(even) td { background: var(--gold-100); border-bottom-color: var(--gold-200); }
.table-wrap tbody tr.has-note:hover td { background: #EFE8D4; }
tr.has-note td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
td.note { min-width: 16rem; color: var(--charcoal); }
tr.has-note td.note { font-weight: 600; color: #4A3D17; }
.no-match { margin: 0; padding: 2rem 1rem; text-align: center; color: var(--slate); }

/* ---------- Client page: documents ---------- */
.documents { margin-top: 1.5rem; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc { display: flex; gap: .9rem 1rem; align-items: center; padding: 1rem 0; border-top: 1px solid var(--mist); }
.doc:last-child { padding-bottom: 0; }
.doc-icon { flex: none; width: 2.75rem; height: 3.25rem; border-radius: 6px; background: var(--navy-050); border: 1px solid #CBD5EA; position: relative; display: grid; place-items: end center; padding-bottom: .4rem; }
.doc-icon::before { content: ""; position: absolute; top: -1px; right: -1px; width: .85rem; height: .85rem; background: linear-gradient(225deg, #fff 50%, #CBD5EA 50%); border-bottom-left-radius: 4px; }
.doc-icon::after { content: attr(data-ext); font-size: .62rem; font-weight: 700; letter-spacing: .04em; color: var(--navy); }
.doc-body { flex: 1; min-width: 0; }
.doc-title { font-weight: 700; font-size: 1.02rem; color: var(--navy); text-decoration: none; }
.doc-title:hover { text-decoration: underline; }
.doc-meta { color: var(--slate); font-size: .875rem; margin-top: .15rem; display: flex; flex-wrap: wrap; gap: .2rem .5rem; align-items: center; }
.doc-desc { margin: .35rem 0 0; color: var(--charcoal); font-size: .95rem; }

/* ---------- Disclaimer ---------- */
.disclaimer { display: flex; gap: .85rem; align-items: flex-start; margin-top: 1.5rem; padding: 1.1rem 1.25rem; background: var(--gold-050); border: 1px solid var(--gold-200); border-left: 4px solid var(--gold); border-radius: var(--radius); color: var(--charcoal); font-size: .98rem; line-height: 1.6; }
.disclaimer svg { flex: none; margin-top: .2rem; color: var(--gold-ink); width: 20px; height: 20px; }
.disclaimer p { margin: 0; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.25rem; align-items: start; }
.stack { min-width: 0; }
.user-list, .activity { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.user-list li { padding: .85rem 0; border-bottom: 1px solid var(--mist); }
.user-list li:first-child { padding-top: 0; }
.user-list .muted { overflow-wrap: anywhere; margin-top: .1rem; }
.user-actions { display: flex; flex-wrap: wrap; gap: .1rem .5rem; margin-top: .4rem; margin-left: -.3rem; }
.user-actions form { margin: 0; }
.activity { margin-bottom: 0; }
.activity li { padding: .6rem 0 .6rem 1rem; border-bottom: 1px solid var(--mist); font-size: .93rem; position: relative; overflow-wrap: anywhere; }
.activity li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.activity li:last-child { border-bottom: 0; padding-bottom: 0; }
.activity li > .small:first-child { display: block; }
.steps { padding-left: 1.3rem; line-height: 1.75; margin: 0 0 1.25rem; }
.steps li { margin-bottom: .4rem; padding-left: .2rem; }
.steps li::marker { color: var(--gold-ink); font-weight: 700; }
.key { font-size: 1.05rem; letter-spacing: .08em; display: inline-block; overflow-wrap: normal; }
.codes { font-size: 1.1rem; line-height: 1.9; letter-spacing: .06em; margin: 0 0 1.25rem; padding: 1rem 1.25rem; background: var(--cloud); border: 1px dashed #B9C2D3; border-radius: var(--radius-sm); color: var(--navy-deep); columns: 2; overflow-x: auto; }

/* ---------- Sign-in (guest) ---------- */
body.guest { background: #fff; display: block; }
.guest-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.guest-brand {
  position: relative; overflow: hidden; color: #fff; padding: 3rem clamp(2rem, 5vw, 4.5rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem;
  background:
    url("../brand/arcs.svg") right -120px bottom -120px / min(820px, 115%) auto no-repeat,
    radial-gradient(70% 60% at 100% 100%, rgba(166, 148, 98, .26), transparent 65%),
    radial-gradient(60% 50% at 0% 0%, rgba(43, 76, 143, .55), transparent 70%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
}
.guest-brand::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); }
.guest-logo { height: 64px; width: auto; display: block; align-self: flex-start; }
.guest-pitch { max-width: 31rem; }
.guest-pitch .eyebrow { color: var(--gold-light); margin-bottom: 1rem; display: flex; align-items: center; gap: .75rem; }
.guest-pitch .eyebrow::before { content: ""; width: 2.25rem; height: 2px; background: var(--gold); }
.guest-headline { font-family: var(--display); font-weight: 500; font-size: clamp(2rem, 1.2rem + 2.4vw, 3.1rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 1.75rem; color: #fff; }
.guest-headline em { font-style: italic; color: var(--gold-light); }
.guest-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; color: #D5DDEC; font-size: 1.05rem; }
.guest-points li { display: flex; gap: .8rem; align-items: flex-start; }
.guest-points svg { flex: none; margin-top: .22rem; color: var(--gold-light); }
.guest-contact { color: #AEBAD2; font-size: .9rem; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; position: relative; }
.guest-contact a { color: #D5DDEC; }
.guest-main { display: grid; place-items: center; padding: 2.5rem 1.5rem; background: linear-gradient(180deg, #fff, var(--cloud)); }
.guest-card { width: 100%; max-width: 400px; }
.guest-card h1 { font-size: 2.1rem; margin-bottom: .4rem; }
.guest-sub { color: var(--slate); margin-bottom: 1.75rem; font-size: 1.05rem; }
.guest-card .field { margin-bottom: 1.1rem; }
.guest-card input[type=text], .guest-card input[type=email], .guest-card input[type=password] { min-height: 3rem; }
.guest-card .btn { width: 100%; min-height: 3rem; font-size: 1.05rem; margin-top: .35rem; }
.guest-foot { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--mist); color: var(--slate); font-size: .9rem; }
.guest-foot form { display: inline; margin: 0; }
.guest-secure { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; color: var(--slate); font-size: .85rem; }
.guest-secure svg { color: var(--gold-ink); flex: none; }
.code-input { font-family: var(--mono); font-size: 1.35rem !important; letter-spacing: .3em; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .guest-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .guest-brand { padding: 1.75rem 1.5rem 2rem; gap: 1.5rem; background-size: 420px auto, auto, auto, auto; background-position: right -140px bottom -220px, 0 0, 0 0, 0 0; }
  .guest-brand::after { top: auto; left: 0; right: 0; width: auto; height: 3px; background: var(--gold); }
  .guest-logo { height: 48px; }
  .guest-points, .guest-contact { display: none; }
  .guest-headline { font-size: 1.6rem; margin-bottom: 0; }
  .guest-pitch .eyebrow { margin-bottom: .6rem; }
  .guest-main { place-items: start center; padding: 2rem 1.5rem 3rem; }
}
@media (max-width: 760px) {
  :root { --gutter: 1rem; }
  .topbar-inner { flex-wrap: wrap; min-height: 60px; }
  .brand-mark { height: 34px; }
  .nav { order: 3; flex: 1 0 100%; margin: 0 -.35rem; overflow-x: auto; padding-bottom: .15rem; }
  .nav a { white-space: nowrap; }
  .nav + .usermenu { margin-left: auto; }
  .who { display: none; }
  .usermenu summary { padding-right: .6rem; }
  main { padding-top: 1.1rem; padding-bottom: 2rem; }
  .card { padding: 1.1rem; }
  .schedule { padding: 0; }
  .hero { padding: 1.5rem 1.25rem 1.5rem 1.4rem; border-radius: 14px; background-size: 300px auto, auto, auto; background-position: right -80px bottom -90px, 0 0, 0 0; }
  .hero.has-stats { padding-bottom: 3.75rem; }
  .hero .btn { width: 100%; }
  .stats { margin: -2.5rem .6rem 1.1rem; gap: .6rem; grid-template-columns: minmax(0, 1fr); }
  .stat { grid-template-columns: auto 1fr; grid-template-areas: "value label" "value sub"; align-items: center; column-gap: 1rem; padding: .75rem 1rem; }
  .stat-icon { display: none; }
  .stat-value { font-size: 2rem; min-width: 3.6rem; text-align: left; }
  .stat-label { align-self: end; }
  .stat-sub { margin: 0; padding: 0; border: 0; align-self: start; }
  .tabbar { padding: .85rem; }
  .tab { flex: 1 1 100%; justify-content: space-between; }
  .tab-search { flex: 1 1 100%; margin: .15rem 0 0; min-width: 0; }
  .panel-head { padding: 1rem 1rem 0; }
  .table-wrap { margin: .5rem .85rem .85rem; max-height: 68vh; }
  .doc { flex-wrap: wrap; align-items: flex-start; }
  .doc-body { flex: 1 1 calc(100% - 4rem); }
  .doc .btn { margin-left: calc(2.75rem + 1rem); }
  .doc-form { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .inline-form .field { flex: 1 1 100%; }
  .inline-form .btn, .card form > .btn { width: 100%; }
  .codes { columns: 1; }
  .footer-inner > :first-child { flex: 1 0 100%; }
}
@media (max-width: 400px) {
  .brand { gap: .65rem; }
  .brand-app { padding-left: .65rem; letter-spacing: .12em; font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .stat:hover, .btn:active { transform: none; }
}

@media print {
  .topbar, .site-footer, .tab-search, .btn, .notice { display: none !important; }
  body { background: #fff; }
  .hero { background: none; color: #000; box-shadow: none; padding: 0 0 1rem; }
  .hero h1, .hero-sub, .hero-sub strong, .hero .eyebrow { color: #000; }
  .stats { margin: 0 0 1rem; }
  .table-wrap { max-height: none; overflow: visible; }
  .card, .stat { box-shadow: none; }
}

/* Authenticator setup QR */
.qr { margin: .75rem 0 .5rem; width: 200px; height: 200px; padding: 8px; background: #fff; border: 1px solid var(--mist, #E3E7EE); border-radius: 8px; box-sizing: content-box; }
.qr svg { display: block; width: 100%; height: 100%; }
.steps .hint { display: block; font-size: .9rem; color: var(--slate, #5B6472); margin-top: .25rem; }
