/* PRVNT consent: brand styles. Black on white, Standerd typeface. */
@font-face { font-family: 'Standerd'; font-weight: 400; font-display: swap; src: url('/fonts/Standerd-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Standerd'; font-weight: 500; font-display: swap; src: url('/fonts/Standerd-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Standerd'; font-weight: 600; font-display: swap; src: url('/fonts/Standerd-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Standerd'; font-weight: 700; font-display: swap; src: url('/fonts/Standerd-Bold.ttf') format('truetype'); }

:root {
  --ink: #0a0a0a;
  --ink-2: #262626;
  --muted: #5c5c5c;
  --faint: #8f8f8f;
  --line: #e5e5e5;
  --panel: #f5f5f5;
  --bg: #fafafa;
  --card: #ffffff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Standerd', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }
[hidden] { display: none !important; }

/* ── layout ─────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px; max-width: 760px; margin: 0 auto;
}
.topbar img { height: 15px; width: auto; display: block; }
.topbar .tag { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }

.wrap { max-width: 760px; margin: 0 auto; padding: 6px 16px 48px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 22px;
}
@media (min-width: 640px) { .card { padding: 40px 44px; } }

.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.lead { color: var(--muted); font-size: 15.5px; font-weight: 500; }
h1 { font-size: 27px; margin-bottom: 10px; }
.subtitle { font-size: 15px; font-weight: 600; color: var(--muted); margin: -2px 0 10px; }
@media (min-width: 640px) { h1 { font-size: 32px; } }

.details {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px;
  padding: 20px 0; margin: 26px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.details .k { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.details .v { font-size: 15.5px; font-weight: 600; margin-top: 3px; word-break: break-word; }

/* consent body */
#intro { margin: 18px 0 8px; }
#intro p { color: var(--ink-2); }
.section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.section h2 { font-size: 19px; font-weight: 700; margin-bottom: 12px; display: flex; gap: 12px; align-items: baseline; }
.section h2 .num { color: var(--ink); font-weight: 700; min-width: 26px; }
.section p { color: var(--ink-2); font-size: 15px; }
.section p.bullet { position: relative; padding-left: 22px; margin-bottom: 8px; }
.section p.bullet::before { content: '•'; position: absolute; left: 6px; top: 0; color: var(--ink); }

.ack {
  display: flex; align-items: flex-start; gap: 12px; margin-top: 18px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); cursor: pointer; user-select: none; font-size: 14.5px; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.ack:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.ack:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.ack input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ok); flex: none; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field input {
  font: inherit; font-size: 16px; font-weight: 500; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); width: 100%;
}
.field input::placeholder { color: var(--faint); opacity: .6; font-weight: 400; }
.toolbar .search input::placeholder { color: var(--faint); opacity: .7; }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.08); }
.hint { font-size: 13px; font-weight: 500; color: var(--muted); }
.hint.note { color: var(--ink-2); }
.hint.note b { color: var(--danger); font-weight: 700; margin-right: 2px; }

.sigwrap { position: relative; border: 1px dashed #bdbdbd; border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.sigwrap canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sigwrap .baseline { position: absolute; left: 20px; right: 20px; bottom: 44px; border-top: 1px solid var(--line); pointer-events: none; }
.sigwrap .placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 14px; pointer-events: none; }
.sigbar { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:disabled { color: var(--faint); cursor: default; text-decoration: none; }
.linkbtn.danger { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; padding: 14px 22px; border-radius: 12px;
  border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; width: 100%;
  text-decoration: none; transition: opacity .15s, transform .05s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #d4d4d4; border-color: #d4d4d4; color: #fff; cursor: not-allowed; opacity: 1; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--ink); opacity: 1; }
.btn.sm { width: auto; padding: 9px 14px; font-size: 13.5px; border-radius: 10px; }

.progress { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 10px 0 16px; }
.progress .bar { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 2px; transition: width .25s; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; margin: 12px 0; border: 1px solid; }
.alert.error { background: var(--danger-bg); border-color: #fecaca; color: var(--danger); }
.alert.ok { background: var(--ok-bg); border-color: #bbf7d0; color: var(--ok); }
.alert.info { background: var(--panel); border-color: var(--line); color: var(--ink-2); }

.foot { text-align: center; color: var(--faint); font-size: 12.5px; font-weight: 500; margin-top: 24px; line-height: 1.7; }

.done { text-align: center; padding: 20px 0 8px; }
.done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.done h1 { margin-bottom: 8px; }
.done .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ── staff: login (split layout) ───────────────────────────── */
.login-wrap { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }

.login-visual {
  position: relative; overflow: hidden; background: #0a0a0a url('/assets/login-bg.jpg') center / cover no-repeat;
  min-height: 100vh; min-height: 100svh;
}
.login-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.05) 40%, rgba(0,0,0,.45) 100%); }
.login-visual > * { position: relative; z-index: 1; }
.pill {
  position: absolute; top: 24px; left: 24px; display: flex; align-items: center; gap: 12px;
  padding: 9px 18px 9px 9px; border-radius: 999px; color: #fff;
  background: rgba(12,12,12,.42);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.pill-icon { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #0a0a0a; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pill-text { display: flex; flex-direction: column; gap: 4px; line-height: 1.2; }
.pill-text b { font-size: 13px; font-weight: 600; }
.pill-text small { font-size: 11px; color: rgba(255,255,255,.78); font-weight: 500; }
.visual-copy { position: absolute; right: 26px; bottom: 30px; font-size: 11.5px; color: rgba(255,255,255,.7); font-weight: 500; }

.login-panel { display: flex; flex-direction: column; padding: 28px 8vw 24px; min-height: 100vh; min-height: 100svh; }
.panel-top { display: flex; flex-direction: column; gap: 6px; line-height: 1.3; }
.panel-top img { height: 14px; width: auto; display: block; align-self: flex-start; }
.panel-top span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 420px; padding: 40px 0; }
.login h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 28px; }
.lfield { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.lfield label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.lfield input {
  font: inherit; font-size: 15px; font-weight: 500; width: 100%; padding: 14px 20px;
  border: 1px solid transparent; border-radius: 999px; background: #ececec; color: var(--ink);
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 54px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.lfield input::placeholder { color: var(--faint); opacity: .7; font-weight: 400; }
.lfield input:focus { outline: none; background: #f4f4f4; border-color: var(--ink); }
.login .check { margin: 0; font-size: 13.5px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
.login-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.btn.pillbtn { width: auto; padding: 14px 28px; border-radius: 999px; background: var(--ink); border-color: var(--ink); font-size: 14px; }
.btn.pillbtn:hover { background: #262626; border-color: #262626; opacity: 1; }
.login-actions .minor { font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.panel-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 500; padding-top: 16px; border-top: 1px solid var(--line); }
.panel-foot a { color: var(--ink-2); text-decoration: none; }
.panel-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-visual { min-height: 220px; height: 220px; }
  .visual-copy { display: none; }
  .pill { top: 16px; left: 16px; }
  .login-panel { min-height: 0; padding: 22px 22px 18px; }
  .login { flex: 0 0 auto; padding: 22px 0 26px; max-width: none; }
  .panel-foot { margin-top: auto; }
  .login h1 { font-size: 26px; margin-bottom: 22px; }
  .login-actions { flex-direction: column; align-items: stretch; gap: 18px; }
  .login-actions .btn.pillbtn { width: 100%; }
  .login-actions .check { justify-content: flex-start; padding-left: 2px; }
}

/* ── staff: dashboard ───────────────────────────────────────── */
.dash { max-width: 1120px; margin: 0 auto; padding: 0 20px 56px; }
.dash-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.dash-top .brand { display: flex; align-items: center; gap: 14px; }
.dash-top .brand img { height: 15px; display: block; }
.dash-top .brand span { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line); white-space: nowrap; }
.dash-top .actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; flex: none; }
.updated { font-size: 12.5px; color: var(--faint); }
.linkbtn:disabled { color: var(--muted); text-decoration: none; }
.linkbtn .spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; margin-right: 6px; vertical-align: -1px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head h1 { font-size: 28px; margin: 0; }
.dash-head .lead { font-size: 14.5px; margin-top: 4px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.tile .k { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin-top: 8px; }
.tile .s { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 240px; position: relative; }
.toolbar .search input {
  font: inherit; font-size: 14px; font-weight: 500; width: 100%; padding: 10px 14px 10px 38px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.toolbar .search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.06); }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.chips { display: flex; gap: 6px; }
.chipbtn {
  font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
}
.chipbtn.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.tablecard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fcfcfc; white-space: nowrap; }
td { padding: 9px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.4; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafafa; }
td .name { font-weight: 600; }
td .code { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; font-weight: 600; color: var(--ink-2); vertical-align: 1px; }
td .sub { color: var(--muted); font-size: 12px; margin-top: 1px; white-space: nowrap; }
td.phone { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: -0.01em; white-space: nowrap; }
td.right { text-align: right; white-space: nowrap; }
td.right .linkbtn { margin-left: 14px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.chip.pending { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.chip.signed { background: var(--ok-bg); color: var(--ok); border: 1px solid #bbf7d0; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager .pg { display: flex; gap: 6px; }
.pager button { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.pager button:disabled { color: var(--faint); cursor: default; }

/* modal */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,10,10,.45); }
dialog .dlg { padding: 28px 28px 24px; }
dialog h2 { font-size: 21px; margin-bottom: 4px; }
dialog .lead { font-size: 14px; margin-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.dlg-actions { display: flex; gap: 10px; margin-top: 6px; }
.dlg-actions .btn { flex: 1; }
.result { margin-top: 4px; }
.result .url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin: 12px 0 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

.dt-short { display: none; }

/* ── dashboard: mobile ─────────────────────────────────────── */
@media (max-width: 720px) {
  .dash { padding: 0 14px 40px; }
  .dash-top { padding: 14px 0; margin-bottom: 20px; gap: 10px; }
  .dash-top .brand { gap: 10px; }
  .dash-top .brand span { padding-left: 10px; font-size: 12px; }
  .dash-top .actions { gap: 12px; }
  .updated { display: none; }
  .dash-head { flex-direction: column; align-items: stretch; margin-bottom: 18px; }
  .dash-head h1 { font-size: 24px; }
  .dash-head .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .dash-head .row .btn { width: 100%; }
  .stats { gap: 10px; margin-bottom: 18px; }
  .tile { padding: 14px 16px; }
  .tile .v { font-size: 26px; }
  .tile .s { display: none; }
  .toolbar .search { flex-basis: 100%; }
  .chips { width: 100%; }
  .chipbtn { flex: 1; text-align: center; padding: 8px 10px; }
  table { min-width: 0; }
  th, td { padding: 10px 10px; }
  td .name { line-height: 1.3; }
  .dt-full { display: none; }
  .dt-short { display: inline; }
  /* hide phone + sent columns; the rest fits a phone */
  th:nth-child(3), td:nth-child(3), th:nth-child(5), td:nth-child(5) { display: none; }
  td .sub { white-space: normal; overflow-wrap: anywhere; }
  td.right { white-space: normal; }
  td.right .linkbtn { display: block; margin: 0 0 4px; text-align: right; }
  .pager { flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
  .pager .pg button { flex: 1; }
  dialog .dlg { padding: 22px 18px 18px; }
  dialog h2 { font-size: 19px; }
}
@media (max-width: 400px) {
  .dash-top .brand span { display: none; }
}
