/* OnPaper — see docs/BRAND.md before changing anything here. */

:root {
  --ink: #14273E;
  --ink-deep: #0C1A2B;
  --paper: #F7F5F0;
  --surface: #FFFFFF;
  --text: #1F2D3D;
  --text-muted: #5A6A7A;
  --brass: #A8823C;
  --line: #DCD8CE;
  --line-cool: #E3E7EC;
  --ok: #1E6B4F;
  --warn: #8A6A0F;
  --alert: #9E3B32;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 3px rgba(12, 26, 43, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 16px; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 48px; line-height: 1.15; }
h2 { font-size: 32px; line-height: 1.25; max-width: 640px; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
p { margin: 0 0 16px; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 12px;
}
.eyebrow-light { color: #C9A75F; }

.lead { font-size: 19px; color: var(--text-muted); max-width: 560px; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  padding: 13px 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
}
.btn:hover { text-decoration: none; }
.btn { white-space: nowrap; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-deep); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--paper); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--paper); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.btn-ghost:hover { border-color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }

/* Top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line-cool);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; display: block; }
.logo-word {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.logo-light .logo-word { color: #fff; }
.topnav { display: flex; gap: 24px; margin-left: auto; }
.topnav + .topbar-signin { margin-left: 0; }
.topnav a { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.topnav a:hover { color: var(--ink); text-decoration: none; }
.topbar-signin { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.topbar-signin:hover { color: var(--ink); text-decoration: none; }
.topbar-user { color: var(--text-muted); font-size: 14px; margin: 0 12px; }
.signout-form { margin-left: auto; display: flex; align-items: center; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--ink) 0%, var(--ink-deep) 100%); color: #fff; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 96px;
}
.hero h1 { color: #fff; margin-bottom: 20px; }
.hero .lead { color: rgba(255, 255, 255, 0.78); }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; }
.hero-note { font-size: 14px; color: rgba(255, 255, 255, 0.6); margin: 14px 0 0; }

.panel-card {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 20px 24px;
  color: var(--text);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-cool);
}
.panel-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-cool);
}
.panel-row:last-child { border-bottom: 0; }
.panel-item { font-size: 15px; font-weight: 500; }
.panel-sub { font-size: 13px; color: var(--text-muted); }

/* Status chips */
.chip {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-ok { color: var(--ok); background: rgba(30, 107, 79, 0.12); }
.chip-warn { color: var(--warn); background: rgba(138, 106, 15, 0.12); }
.chip-alert { color: var(--alert); background: rgba(158, 59, 50, 0.12); }

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line-cool); border-bottom: 1px solid var(--line-cool); }
.section h2 { margin-bottom: 40px; }

.card-grid { display: grid; gap: 24px; }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.section-alt .card { border-color: var(--line-cool); box-shadow: none; }
.card p { margin: 0; color: var(--text-muted); font-size: 15px; }
.card-quiet { background: var(--paper); border-style: dashed; box-shadow: none; }
.card-icon { color: var(--ink); margin-bottom: 16px; }
.card-icon svg { width: 28px; height: 28px; }

/* Aim band */
.aimband { background: var(--ink-deep); color: #fff; }
.aimband-inner { padding: 88px 24px; text-align: center; }
.aimband h2 { margin: 0 auto 16px; color: #fff; }
.aimband .lead { margin: 0 auto 32px; color: rgba(255, 255, 255, 0.78); }

/* Footer */
.footer { background: var(--ink-deep); color: rgba(255, 255, 255, 0.7); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 48px;
  padding-bottom: 24px;
}
.footer-tag { margin: 12px 0 0; font-size: 14px; }
.footer-links a { color: rgba(255, 255, 255, 0.85); font-size: 15px; }
.footer-small {
  padding-top: 16px;
  padding-bottom: 32px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

/* Auth pages */
.auth-page { background: var(--paper); }
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-logo { margin-bottom: 32px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.auth-card h1 { font-size: 28px; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 24px; }
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text);
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 150ms ease-out;
}
.field input:focus { border-color: var(--ink); outline: 2px solid var(--brass); outline-offset: 1px; }
.field-error { color: var(--alert); font-size: 13px; margin: 6px 0 0; }
.form-error {
  background: rgba(158, 59, 50, 0.1);
  color: var(--alert);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}
.auth-note { color: var(--text-muted); font-size: 13px; margin: 20px 0 0; text-align: center; }
.auth-back { margin-top: 24px; font-size: 14px; color: var(--text-muted); }

/* Responsive */
@media (max-width: 900px) {
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding-top: 64px; padding-bottom: 64px; }
  .card-grid-3 { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .section { padding: 56px 0; }
  .footer-inner { flex-direction: column; gap: 24px; }
}

/* ===== Workspace ===== */
.appbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line-cool);
  position: sticky;
  top: 0;
  z-index: 10;
}
.appbar-inner { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo-compact .logo-mark { width: 26px; height: 26px; }
.appbar-org { font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--ink); border-left: 1px solid var(--line-cool); padding-left: 20px; }
.appnav { display: flex; gap: 18px; }
.appnav a { font-size: 14px; font-weight: 500; color: var(--text-muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.appnav a:hover { color: var(--ink); text-decoration: none; }
.appnav a.is-active { color: var(--ink); border-bottom-color: var(--brass); }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.signout-form-inline { display: flex; align-items: center; gap: 10px; }
.btn-link { background: none; border: none; padding: 0; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--ink-deep); }
.btn-link-danger { color: var(--alert); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.app-main { padding: 40px 0 72px; }
.toast { background: var(--ink); color: #fff; border-radius: 8px; padding: 12px 16px; margin: 16px 0 0; font-size: 15px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h2 { margin-bottom: 0; }
.page-actions { display: flex; gap: 10px; }
.narrow { max-width: 640px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.panel h3 { margin-bottom: 12px; }
.panel-flush { padding: 0; overflow-x: auto; }
.panel-flush .table { margin: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.notice { background: rgba(168, 130, 60, 0.1); border: 1px solid rgba(168, 130, 60, 0.35); color: var(--text); border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: 15px; }
.notice-action { background: rgba(158, 59, 50, 0.08); border-color: rgba(158, 59, 50, 0.3); }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--line-cool); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-cool); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(20, 39, 62, 0.02); }
.cell-right { text-align: right; }
.cell-detail { color: var(--text-muted); max-width: 320px; }
.empty-row { text-align: center; color: var(--text-muted); padding: 32px 16px; }
.record-link { font-weight: 600; font-variant-numeric: tabular-nums; }
.record-title { font-variant-numeric: tabular-nums; }
.flag-dot { color: var(--warn); margin-left: 6px; font-size: 10px; vertical-align: middle; }
.chip-muted { color: var(--text-muted); background: rgba(90, 106, 122, 0.12); }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input[type="search"] { font-family: var(--sans); font-size: 14px; color: var(--text); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.filter-bar input[type="search"] { flex: 1; min-width: 180px; }

.field select, .field textarea { width: 100%; font-family: var(--sans); font-size: 16px; color: var(--text); padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.field textarea { resize: vertical; }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 20px; }
.field ul label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.form-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { margin-bottom: 0; }
.form-row .field-grow { flex: 1; min-width: 220px; }
.inline-form { display: inline; }
.cancel-link { margin-left: 16px; }

.detail-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: start; }
.facts { margin: 0 0 16px; display: grid; gap: 10px; }
.facts div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.facts dt { color: var(--text-muted); font-size: 14px; }
.facts dd { margin: 0; font-size: 15px; }
.detail-description { background: var(--paper); border-radius: 8px; padding: 14px 16px; font-size: 15px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 15px; }
.timeline-note { background: var(--paper); border-radius: 6px; padding: 8px 12px; margin-top: 6px; font-size: 14px; }
.timeline-audit { font-size: 13px; gap: 10px; }
.audit-event { background: rgba(20, 39, 62, 0.06); border-radius: 4px; padding: 2px 6px; font-size: 12px; }
.flag-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel-flag { border-left: 3px solid var(--warn); }
.panel-flag.is-dismissed { border-left-color: var(--line); opacity: 0.75; }

.panel-assurance { border-left: 3px solid var(--brass); }
.panel-assurance.is-clean { border-left-color: var(--ok); }
.assurance-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.assurance-statement { font-family: var(--serif); font-size: 21px; line-height: 1.5; margin: 8px 0 10px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; display: block; box-shadow: var(--shadow); }
.stat:hover { text-decoration: none; border-color: var(--ink); }
.stat-number { font-family: var(--serif); font-size: 32px; font-weight: 600; display: block; line-height: 1.1; }
.stat-number.is-warn { color: var(--warn); }
.stat-number.is-alert { color: var(--alert); }
.stat-label { font-size: 13px; color: var(--text-muted); }
.progress { height: 8px; background: var(--line-cool); border-radius: 999px; overflow: hidden; margin: 10px 0 14px; }
.progress-fill { height: 100%; background: var(--ok); border-radius: 999px; transition: width 200ms ease-out; }
.confirm-actions { display: flex; gap: 14px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-link:hover { text-decoration: none; border-color: var(--ink); }
.card-link h3 { color: var(--ink); }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .card-grid-2 { grid-template-columns: 1fr; }
  .appbar-org { border-left: 0; padding-left: 0; }
  .facts div { grid-template-columns: 130px 1fr; }
}

@media (max-width: 700px) {
  .topbar-inner { gap: 12px; }
  .topbar-inner .logo-word { font-size: 19px; }
  .topbar-signin { white-space: nowrap; }
  .topbar-inner .btn { padding: 10px 14px; font-size: 14px; margin-left: auto; }
  .topbar-signin { margin-left: auto; }
  .topbar-inner .btn { margin-left: 0; }
  .appbar-inner { gap: 10px; row-gap: 6px; }
  .appbar-org {
    order: 2;
    flex: 1;
    min-width: 0;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .appbar-right { order: 3; margin-left: 0; gap: 10px; }
  .appnav { order: 4; width: 100%; gap: 16px; margin-left: 0; padding-bottom: 2px; }
  .topbar-user { display: none; }
}

/* ===== Register report (print) ===== */
.report-page { background: #fff; }
.report { max-width: 800px; margin: 0 auto; padding: 40px 32px; }
.report-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.report-cover { border-bottom: 2px solid var(--ink); padding-bottom: 28px; margin-bottom: 32px; }
.report-mark { width: 40px; height: 40px; margin-bottom: 16px; }
.report-cover h1 { font-size: 34px; margin-bottom: 4px; }
.report-asat { color: var(--text-muted); margin-bottom: 24px; }
.report-assurance { background: var(--paper); border-left: 3px solid var(--brass); border-radius: 6px; padding: 18px 22px; margin-bottom: 16px; }
.report-assurance h2 { font-size: 16px; font-family: var(--sans); font-weight: 600; margin-bottom: 6px; }
.report-assurance p { font-family: var(--serif); font-size: 18px; margin: 0; }
.report-verify { font-size: 13px; color: var(--text-muted); }
.report-item { border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; margin-bottom: 20px; break-inside: avoid; }
.report-item-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.report-item-head h3 { margin: 0; font-family: var(--serif); }
.report-status { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.report-facts { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 8px; }
.report-facts th { text-align: left; width: 170px; color: var(--text-muted); font-weight: 500; padding: 5px 0; vertical-align: top; }
.report-facts td { padding: 5px 0; }
.report-actions { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.report-actions th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line-cool); }
.report-actions td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line-cool); vertical-align: top; }
.report-footer { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-muted); }
@media print {
  .noprint { display: none; }
  .report { padding: 0; max-width: none; }
  body { background: #fff; }
}
