/* Real Compliance design system. Brand colour comes from the office (set at runtime). */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-display: swap; src: url(/vendor/fonts/files/plus-jakarta-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url(/vendor/fonts/files/plus-jakarta-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url(/vendor/fonts/files/plus-jakarta-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url(/vendor/fonts/files/plus-jakarta-sans-latin-800-normal.woff2) format('woff2'); }

:root {
  --brand: #0F5E63;
  --brand-ink: #0F5E63;
  --brand-tint: rgba(15, 94, 99, 0.10);
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --line: #E2E8F0;
  --line-soft: #EEF2F6;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #475569;
  --faint: #64748B;
  --ok-bg: #DCFCE7; --ok: #166534;
  --att-bg: #FEF3C7; --att: #92400E;
  --over-bg: #FEE2E2; --over: #B91C1C;
  --info-bg: #E0E7FF; --info: #3730A3;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Plus Jakarta Sans', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.4px; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #CBD5E1; background: #F8FAFC; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand-ink); border-color: var(--brand-ink); color: #FFFFFF; }
.btn-primary:hover { background: var(--brand-ink); filter: brightness(1.08); border-color: var(--brand-ink); }
.btn-danger { color: var(--over); border-color: #FECACA; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-soft); border-color: transparent; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { min-width: 44px; min-height: 44px; padding: 0; border-radius: 12px; border: 1.5px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--line-soft); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 15px; font-weight: 700; }
.input, select.input, textarea.input {
  min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #CBD5E1; background: #FFFFFF; width: 100%;
}
textarea.input { padding: 12px 14px; min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-tint); }
.hint { font-size: 13px; color: var(--muted); }
.error-text { font-size: 14px; color: var(--over); font-weight: 600; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--brand-ink); }

/* Cards and layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-tight { padding: 18px; }
.page { max-width: 1360px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.crumb { font-size: 14px; font-weight: 700; color: var(--muted); }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.col-side { flex: 1 1 340px; min-width: 0; }
.col-main { flex: 999 1 560px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* Header */
.app-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.app-header-inner { max-width: 1360px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); flex: 0 1 auto; }
.brand-lockup:hover { text-decoration: none; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-ink); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex-shrink: 0; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.brand-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.brand-sub { font-size: 13px; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 520px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { background: var(--line-soft); text-decoration: none; }
.nav a.active { background: var(--brand-tint); color: var(--brand-ink); font-weight: 700; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #E2E8F0; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: 50px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); min-width: 240px; padding: 8px; z-index: 30; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--line-soft); text-decoration: none; }
.menu-panel .menu-head { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }

/* Pills and status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-att { background: var(--att-bg); color: var(--att); }
.pill-over { background: var(--over-bg); color: var(--over); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-neutral { background: #F1F5F9; color: var(--ink-2); }
.pill-brand { background: var(--brand-tint); color: var(--brand-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync-pill { min-height: 36px; }

/* Health */
.ring { position: relative; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-value { font-size: 44px; font-weight: 800; line-height: 1; }
.count-boxes { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; }
.count-box { flex: 1 1 80px; border-radius: 12px; padding: 12px; text-align: center; }
.count-box b { display: block; font-size: 24px; font-weight: 800; }
.bar { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand-ink); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.tile p { color: var(--muted); font-size: 15px; flex-grow: 1; }

/* Lists */
.list-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.list-row:first-child { border-top: 0; }
.date-chip { width: 58px; flex-shrink: 0; text-align: center; border-radius: 12px; padding: 7px 0; background: #F1F5F9; color: var(--ink-2); }
.date-chip .dow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; }
.date-chip .dom { font-size: 20px; font-weight: 800; line-height: 1.1; }
.date-chip.over { background: var(--over-bg); color: var(--over); }
.date-chip.soon { background: var(--brand-tint); color: var(--brand-ink); }
.file-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line-soft); color: var(--ink); }
.file-row:first-child { border-top: 0; }
.file-row:hover { background: #F8FAFC; text-decoration: none; }
.type-badge { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--brand-tint); color: var(--brand-ink); }

/* Tabs and segmented controls */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 9px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: #FFFFFF; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink-2); min-height: 40px; }
.tab[aria-pressed="true"] { background: var(--brand-ink); border-color: var(--brand-ink); color: #FFFFFF; }

/* Checklists */
.checklist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.checklist-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: transparent; border: 0; cursor: pointer; text-align: left; }
.checklist-head:hover { background: #F8FAFC; }
.checklist-body { padding: 0 22px 20px; border-top: 1px solid var(--line-soft); }
.section-title { margin: 20px 0 6px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.section-lead { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.item { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-soft); align-items: flex-start; }
.item:first-of-type { border-top: 0; }
.tick { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #CBD5E1; background: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; color: #FFFFFF; margin-top: 1px; }
.tick:hover:not(:disabled) { border-color: var(--brand); }
.tick.done { background: var(--ok); border-color: var(--ok); }
.tick.na { background: #E2E8F0; border-color: #E2E8F0; color: var(--ink-2); font-size: 11px; font-weight: 800; }
.tick:disabled { cursor: default; }
.item-text { font-size: 15px; font-weight: 600; line-height: 1.4; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; font-size: 13px; color: var(--faint); align-items: center; }
.item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.item-extra { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.yesno { display: inline-flex; border: 1.5px solid #CBD5E1; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.yesno button { min-width: 54px; min-height: 38px; border: 0; background: #FFFFFF; font-weight: 700; cursor: pointer; }
.yesno button + button { border-left: 1.5px solid #CBD5E1; }
.yesno button[aria-pressed="true"] { background: var(--brand-ink); color: #FFFFFF; }
.evidence-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.flag { color: var(--att); font-weight: 700; }
.pending-badge { color: var(--info); font-weight: 700; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #FFFFFF; border-radius: 20px; width: 100%; max-width: 560px; padding: 26px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); display: flex; flex-direction: column; gap: 18px; }
.modal-wide { max-width: 760px; }

/* Toasts and banners */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(92vw, 520px); }
.toast { background: var(--ink); color: #FFFFFF; padding: 14px 18px; border-radius: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3); }
.toast.error { background: #7F1D1D; }
.banner { padding: 14px 18px; border-radius: 14px; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.banner-att { background: var(--att-bg); color: #78350F; }
.banner-info { background: var(--info-bg); color: #312E81; }
.banner-over { background: var(--over-bg); color: #7F1D1D; }

/* Auth pages */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; background: #FFFFFF; }
.auth-brand { flex: 1 1 420px; background: var(--brand-ink); color: #FFFFFF; padding: 52px 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-brand .brand-mark { background: #FFFFFF; color: var(--brand-ink); width: 56px; height: 56px; font-size: 20px; }
.auth-brand h1 { font-size: 38px; color: #FFFFFF; }
.auth-form { flex: 1 1 480px; padding: 52px 44px; display: flex; align-items: center; justify-content: center; }
.auth-form > div { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.qr { width: 200px; height: 200px; border-radius: 12px; border: 1px solid var(--line); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; font-weight: 700; background: #F8FAFC; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.swatch { width: 46px; height: 46px; border-radius: 14px; border: none; cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 6px var(--ink); }

@media (max-width: 900px) {
  /* Phones and small tablets: brand and account on the first row, a scrolling nav below. */
  .header-tools { order: 2; margin-left: auto; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -8px; padding: 0 8px; }
  .nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 20px 16px 48px; }
  .app-header-inner { padding: 10px 16px; }
  .brand-sub, .hide-sm { display: none; }
  .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 36vw; }
  .app-header-inner { gap: 8px 10px; }
  .brand-lockup { gap: 10px; }
  .item { flex-wrap: wrap; }
  .item > .grow { flex: 1 1 calc(100% - 50px); }
  .item-actions { flex-basis: 100%; padding-left: 46px; margin-top: -4px; }
  .item-actions .icon-btn { min-width: 40px; }
  .brand-lockup .brand-mark { width: 40px; height: 40px; }
  h1 { font-size: 26px; }
  .card { padding: 18px; }
  .auth-brand, .auth-form { padding: 32px 22px; }
  .auth-brand h1 { font-size: 30px; }
  .file-row { padding: 14px 16px; }
  .checklist-head { padding: 16px; }
  .checklist-body { padding: 0 16px 16px; }
}

/* Print */
@media print {
  @page { margin: 14mm; }
  body { background: #FFFFFF; font-size: 11pt; }
  .no-print, .app-header, .toasts { display: none !important; }
  .print-page { padding: 0 !important; max-width: none !important; }
  .card, .checklist, .tile { box-shadow: none; break-inside: avoid; }
  a { color: inherit; }
}
.print-page { max-width: 900px; margin: 0 auto; padding: 32px 24px 64px; background: #FFFFFF; }
.print-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--brand-ink); padding-bottom: 14px; margin-bottom: 18px; }
.print-box { width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 3px; font-size: 12px; font-weight: 800; }
.print-item { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid #E5E7EB; break-inside: avoid; font-size: 11pt; }
.print-sign { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #94A3B8; margin-top: 18px; break-inside: avoid; }
.print-sign div { padding: 8px; min-height: 52px; border-right: 1px solid #94A3B8; font-size: 9pt; color: var(--muted); }
.print-sign div:last-child { border-right: 0; }
