:root {
  --gold: #F9B800;
  --charcoal: #333333;
  --ink: #1B1F1D;
  --muted: #5A625E;
  --line: #E2DED4;
  --line-soft: #EFECE4;
  --cream: #FFF3CC;
  --cream-line: #EAD48C;
  --red: #A8321E;
  --red-bg: #F8E3DE;
  --green: #2E7D32;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Fira Sans', system-ui, sans-serif; color: var(--ink); background: #FFFFFF; font-size: 15px; }
a { color: var(--charcoal); text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
h1 { font-size: 26px; margin: 4px 0 0; letter-spacing: -0.4px; }
h2 { font-size: 15px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.stripe { height: 14px; background: repeating-linear-gradient(-45deg, var(--charcoal) 0 14px, var(--gold) 14px 28px); }
.wordmark { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; color: #FFFFFF; }
.wordmark span { color: var(--gold); }
.wordmark.dark { color: var(--charcoal); }

/* Sign-in and simple pages */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #F7F6F2; }
.auth-card { width: 100%; max-width: 420px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.auth-card.wide { max-width: 560px; }
.auth-body { padding: 28px 32px 32px; display: flex; flex-direction: column; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input[type=email], input[type=password], input[type=text] {
  height: 46px; padding: 0 18px; border: 1px solid var(--cream-line); border-radius: 999px;
  background: var(--cream); font: inherit; color: var(--ink);
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--charcoal); outline-offset: 2px; }
.btn { height: 46px; border: 0; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.btn-primary { background: var(--gold); color: var(--charcoal); }
.alert { background: var(--red-bg); color: #8F2917; padding: 10px 14px; border-radius: 10px; margin: 0; font-weight: 600; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: #D6D6D6; text-decoration: underline; cursor: pointer; }
.link-button.dark { color: var(--charcoal); }
.site-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; }
.site-list li + li { border-top: 1px solid var(--line-soft); }
.site-list a { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; text-decoration: none; }
.site-list span { font-size: 13px; color: var(--muted); }

/* App shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex-shrink: 0; background: var(--charcoal); color: #F2F2F2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-inner { overflow-y: auto; }
.sidebar-inner { padding: 20px 16px; display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.brand { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.tagline { font-size: 12px; color: #D6D6D6; line-height: 1.35; }
.nav-item { display: block; padding: 8px 12px; border-radius: 6px; color: #D6D6D6; text-decoration: none; font-size: 14px; }
.nav-item.active { background: var(--gold); color: var(--charcoal); font-weight: 700; }
.nav-item.soon { opacity: 0.7; cursor: default; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.nav-item.soon em { font-style: normal; font-size: 11px; padding: 1px 6px; flex-shrink: 0; border-radius: 6px; background: #4D4D4D; }
.nav-label { display: flex; align-items: center; gap: 10px; margin: 18px 12px 6px; font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); }
.nav-label::after { content: ''; flex-grow: 1; height: 1px; background: #4D4D4D; }
.grow { flex-grow: 1; }
.hotline { background: var(--gold); color: var(--charcoal); border-radius: 8px; padding: 10px 14px; margin: 12px 0 10px; font-size: 12px; font-weight: 600; }
.hotline strong { display: block; font-size: 16px; font-weight: 800; white-space: nowrap; }
.site-foot { padding: 10px 12px 0; border-top: 1px solid #4D4D4D; font-size: 13px; color: #D6D6D6; display: flex; flex-direction: column; gap: 4px; }
.site-name { font-weight: 700; color: #FFFFFF; }

.content { flex-grow: 1; padding: 28px 36px; display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
.pill { font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--cream); color: #5C4200; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.clause-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.clause-row .dot { width: 10px; height: 10px; border-radius: 5px; background: #CFC9BC; flex-shrink: 0; }
.clause-row .ref { width: 60px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.clause-row .clause-title { flex-grow: 1; font-weight: 600; font-size: 14px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: #EDEAE2; color: var(--charcoal); white-space: nowrap; }

/* Menu: always open on desktop; behind a Menu button on phones (no JavaScript needed) */
.nav-links { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-toggle-label { display: none; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; position: static; height: auto; }
  .sidebar-inner { overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 16px; }
  .brand { padding: 0; }
  .tagline { display: none; }
  .nav-toggle-label { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; height: 40px; line-height: 1; margin: 0; padding: 0 18px; border-radius: 999px; background: var(--gold); color: var(--charcoal); font-weight: 700; cursor: pointer; }
  .nav-toggle:focus-visible + .nav-toggle-label { outline: 3px solid #FFFFFF; outline-offset: 2px; }
  .nav-links { display: none; width: 100%; padding-top: 8px; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .content { padding: 20px 16px; }
}

/* Week 1: statuses, forms, records */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.chip.green, .badge.green { background: #E3F1E4; color: #1E5B25; }
.chip.amber, .badge.amber { background: #FFE9A6; color: #5C4200; }
.chip.red, .badge.red { background: var(--red-bg); color: #8F2917; }
.chip.grey, .badge.grey { background: #EDEAE2; color: var(--charcoal); }
.badge.big { font-size: 14px; padding: 6px 14px; border-radius: 999px; }
.clause-row .dot.green { background: var(--green); }
.clause-row .dot.amber { background: #E0A300; }
.clause-row .dot.red { background: var(--red); }
.clause-row.link { color: inherit; text-decoration: none; }
.clause-row.link:hover { background: #FBFAF6; }
.banner { display: flex; flex-direction: column; gap: 2px; background: #FFF6DA; border: 1px solid #F0DC9C; border-radius: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.banner span { font-size: 13px; color: #3F4542; }
.notice { background: #E3F1E4; color: #1E5B25; padding: 10px 14px; border-radius: 10px; margin: 0; font-weight: 600; }
.back { font-size: 13px; text-decoration: none; color: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.wide-form { max-width: 980px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
input[type=number], input[type=date] {
  height: 46px; padding: 0 18px; border: 1px solid var(--cream-line); border-radius: 999px; background: var(--cream); font: inherit; color: var(--ink);
}
textarea { padding: 10px 16px; border: 1px solid var(--cream-line); border-radius: 14px; background: var(--cream); font: inherit; color: var(--ink); resize: vertical; }
input:disabled, textarea:disabled { opacity: 0.75; }
input.file { padding: 10px 0; font: inherit; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--charcoal); margin-top: 1px; flex-shrink: 0; }
.provider { border: 0; border-top: 1px solid var(--line-soft); padding: 10px 0 0; margin: 0; }
.provider legend { font-weight: 700; font-size: 14px; padding: 0 0 6px; }
.btn-ghost { background: #FFFFFF; color: var(--charcoal); border: 1px solid #CFC9BC; height: 40px; }
.doc { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.doc-main { display: flex; flex-direction: column; gap: 4px; }
.doc-title { font-weight: 700; }
.files { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.row-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.grow-label { flex: 1 1 320px; }

@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4, .checks { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* Week 2: users, certificates, what's due */
select { width: 100%; max-width: 100%; min-width: 0; height: 46px; padding: 0 40px 0 18px; border: 1px solid var(--cream-line); border-radius: 999px; background: var(--cream); font: inherit; color: var(--ink); }
.member { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.member.disabled { opacity: 0.65; }
.doc-title .badge { margin-left: 6px; vertical-align: 1px; }
.btn-link { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.invite-link { margin-top: 6px; font-weight: 500; color: var(--ink); }
.invite-link code { font-family: 'IBM Plex Mono', monospace; font-size: 12px; word-break: break-all; }
.perm-table { display: flex; flex-direction: column; }
.perm-row { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-weight: 600; }
.perm-row select { width: auto; min-width: 220px; }
.due-list { list-style: none; margin: 0; padding: 0; }
.due-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.due-list li a { flex-grow: 1; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.due-list .ref { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); width: 60px; flex-shrink: 0; }
.person { padding: 12px 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.person-name { font-weight: 700; }
.cert { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 8px 0 8px 14px; border-left: 3px solid var(--line); }
.cert.pending { border-left-color: #E0A300; }
.inline-forms { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 760px) {
  .member, .cert { flex-direction: column; align-items: flex-start; }
  .perm-row { flex-direction: column; align-items: stretch; }
}

/* Week 3: visitor kiosk and log */
.kiosk-body { background: #F7F6F2; }
.kiosk { max-width: 1100px; margin: 0 auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.kiosk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.kiosk-site { font-size: 15px; color: var(--muted); margin-top: 4px; }
.kiosk-hotline { background: var(--gold); color: var(--charcoal); border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600; text-align: right; }
.kiosk-hotline strong { font-size: 18px; font-weight: 800; }
.kiosk-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; align-items: start; }
.kiosk-card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.kiosk-card h1 { font-size: 28px; margin: 0; }
.kiosk-welcome { font-size: 17px; margin: 0; }
.kiosk-text { background: #FBFAF6; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 16px; }
.kiosk-text h2 { font-size: 15px; margin: 0 0 6px; }
.kiosk-text pre { font: inherit; white-space: pre-wrap; margin: 0; font-size: 15px; line-height: 1.45; max-height: 240px; overflow: auto; }
.check.big { font-size: 17px; }
.check.big input { width: 26px; height: 26px; }
.btn-big { height: 60px; font-size: 20px; padding: 0 32px; }
.btn-wide { width: 100%; text-align: left; justify-content: flex-start; }
.kiosk-person { height: auto; min-height: 60px; padding: 12px 22px; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.25; }
.kiosk-person .who { font-size: 20px; font-weight: 700; }
.kiosk-person .meta { font-size: 14px; font-weight: 500; color: var(--muted); }
.kiosk-confirm { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 40px; text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.kiosk-confirm h1 { font-size: 30px; margin: 0; }
.kiosk-confirm .row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.kiosk-done { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 40px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.kiosk-done h1 { font-size: 32px; margin: 0; }
.kiosk-done p { font-size: 18px; margin: 0; }
.kiosk-foot a { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.nowrap { white-space: nowrap; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
input[type=datetime-local] { height: 46px; padding: 0 18px; border: 1px solid var(--cream-line); border-radius: 999px; background: var(--cream); font: inherit; color: var(--ink); }
@media (max-width: 900px) { .kiosk-grid { grid-template-columns: 1fr; } }

/* Week 4: containers, checks, registers */
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 14px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--charcoal); }
.tab.active { background: var(--gold); }
.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; align-items: start; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.input-sm, input.input-sm { height: 38px; font-size: 14px; padding: 0 14px; }
.card-red { border-color: #E6B8AE; background: #FFF8F6; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.timeline li { padding: 6px 0; border-top: 1px solid var(--line-soft); }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.check-item { padding: 10px 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.check-item-text { font-weight: 600; font-size: 14px; }
.radio { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; }
.radio input { width: 20px; height: 20px; accent-color: var(--charcoal); }
.grow-input { flex: 1 1 240px; }
.inline-label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }
.input-num { width: 90px; padding: 0 12px; }
.check.small { font-size: 14px; }
.plain { margin: 6px 0 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.banner-red { background: #FFF1EE; border-color: #E6B8AE; }
.nav-item.sub { padding-left: 24px; font-size: 13px; }

/* Read-only notice when a page belongs to a feature the plan no longer includes (records stay readable). */
.plan-readonly { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; max-width: min(720px, calc(100vw - 32px)); background: #333333; color: #FFFFFF; border-left: 6px solid #F9B800; padding: 10px 16px; border-radius: 12px; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.plan-readonly a { color: #F9B800; font-weight: 700; }

/* Operator admin: grouped lists */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; }
.section-head h2 { margin: 0; }
.mono { font-family: 'IBM Plex Mono', monospace; font-weight: 500; letter-spacing: 0.3px; }
.page-head .inline-forms { align-items: center; }
.page-head .inline-forms select { width: auto; max-width: 320px; height: 38px; }
