/* OIS Forms Portal — OIS brand tokens and components. Colours come only from the tokens below. */

@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EEFF; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root{
  --t:#00647D; --td:#003C50; --tm:#004F65; --tl:#E2F1F5; --txl:#F3FAFB;
  --g:#1A7A32; --gl:#EBF5EE;
  --gold:#D4960A; --goldb:#F5C800; --goldl:#FEF7DC;
  --red:#C0392B; --redl:#FDECEA; --orange:#E67E22; --orangel:#FEF0E6;
  --purple:#6C3483; --purplel:#F5EEF8;
  --white:#FFFFFF; --bg:#F0F4F6; --card:#FFFFFF;
  --border:#C8DDE3; --borderl:#DFF0F4;
  --muted:#5E7C88; --text:#18303A; --texts:#3A5A68;
  --sh1:0 1px 3px rgba(0,60,90,.06); --sh2:0 3px 14px rgba(0,60,90,.10);
  --sh3:0 8px 32px rgba(0,60,90,.14); --r:6px;

  --font: "Outfit", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-ar: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  --topbar-h: 60px;
  --nav-w: 232px;
  --focus: 0 0 0 3px var(--tl), 0 0 0 4px var(--t);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
}
h1, h2, h3, h4 { margin: 0 0 .5rem; color: var(--td); line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--t); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--td); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 3px; }
img { max-width: 100%; }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .9em; }
.ar, [lang="ar"] { font-family: var(--font-ar); direction: rtl; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--goldb); color: var(--td); padding: 8px 12px; border-radius: var(--r); font-weight: 600; }
.skip-link:focus { top: 8px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--t); color: var(--white); box-shadow: var(--sh2);
  border-bottom: 3px solid var(--goldb);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--white); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--white); }
.brand-logo { background: var(--white); border-radius: var(--r); padding: 4px 8px; display: flex; align-items: center; height: 44px; }
.brand-logo img { height: 34px; width: auto; display: block; }
.brand-name { font-size: 1.1rem; font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 12px; min-width: 0; }
.userbox-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.userbox form { margin: 0; }
.role-chip { background: var(--goldb); color: var(--td); font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.btn-topbar { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.55); }
.btn-topbar:hover { background: var(--tm); color: var(--white); }
.topbar .nav-toggle { display: none; }

/* ---------- Shell ---------- */
.shell { flex: 1; display: flex; min-height: 0; }
.sidenav {
  width: var(--nav-w); flex-shrink: 0; background: var(--card); border-right: 1px solid var(--border);
  padding: 16px 10px; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
}
.sidenav h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 14px 10px 6px; font-weight: 600; }
.sidenav h2:first-child { margin-top: 0; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r);
  color: var(--texts); text-decoration: none; font-weight: 500; border-left: 3px solid transparent;
}
.sidenav a:hover { background: var(--txl); color: var(--td); }
.sidenav a[aria-current="page"] { background: var(--tl); color: var(--td); border-left-color: var(--t); }
.sidenav svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.content { flex: 1; min-width: 0; padding: 24px; max-width: 1400px; }
.shell--no-nav .content { margin: 0 auto; width: 100%; }

/* ---------- Footer ---------- */
.footer {
  background: var(--td); color: rgba(255,255,255,.85); padding: 14px 24px; font-size: .85rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; align-items: center;
}
.footer .ar { font-size: .95rem; }

/* ---------- Page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-header p { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh1); margin-bottom: 20px; overflow: hidden; }
.card-header { background: var(--txl); border-bottom: 1px solid var(--borderl); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 16px; }
.card--info { border-left: 4px solid var(--t); }
.card--important { border-left: 4px solid var(--gold); }
.card--important .card-header { background: var(--goldl); }
.card--success { border-left: 4px solid var(--g); }
.card--success .card-header { background: var(--gl); }
.card--critical { border-left: 4px solid var(--red); }
.card--critical .card-header { background: var(--redl); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cards .card { margin: 0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh1); padding: 14px 16px; border-top: 3px solid var(--t); }
.stat--gold { border-top-color: var(--gold); } .stat--green { border-top-color: var(--g); } .stat--red { border-top-color: var(--red); }
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-value { font-size: 1.75rem; font-weight: 600; color: var(--td); line-height: 1.2; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 500; font-size: .9rem; line-height: 1.2;
  padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--border);
  background: var(--white); color: var(--td); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--txl); color: var(--td); }
.btn--primary { background: var(--t); border-color: var(--t); color: var(--white); }
.btn--primary:hover { background: var(--tm); color: var(--white); }
.btn--cta { background: var(--goldb); border-color: var(--gold); color: var(--td); font-weight: 600; }
.btn--cta:hover { background: var(--gold); color: var(--white); }
.btn--danger { background: var(--white); border-color: var(--red); color: var(--red); }
.btn--danger:hover { background: var(--redl); color: var(--red); }
.btn--sm { padding: 4px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--tl); color: var(--td); white-space: nowrap; }
.badge--green { background: var(--gl); color: var(--g); }
.badge--gold { background: var(--goldl); color: #8A6100; }
.badge--red { background: var(--redl); color: var(--red); }
.badge--orange { background: var(--orangel); color: #A0520F; }
.badge--purple { background: var(--purplel); color: var(--purple); }
.badge--muted { background: var(--bg); color: var(--muted); }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; border: 1px solid var(--border); border-left-width: 4px; background: var(--txl); border-left-color: var(--t); }
.alert--success { background: var(--gl); border-color: #BFDCC7; border-left-color: var(--g); }
.alert--warning { background: var(--goldl); border-color: #F0DC9A; border-left-color: var(--gold); }
.alert--error { background: var(--redl); border-color: #F2C1BB; border-left-color: var(--red); }

/* ---------- Tables / grids ---------- */
.table-wrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
.grid th { text-align: left; font-weight: 600; color: var(--td); background: var(--txl); border-bottom: 2px solid var(--border); padding: 9px 12px; white-space: nowrap; }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--borderl); vertical-align: top; }
.grid tbody tr:hover { background: var(--txl); }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .actions { text-align: right; white-space: nowrap; }
.grid .details { max-width: 420px; overflow-wrap: anywhere; color: var(--texts); font-size: .82rem; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--borderl); background: var(--white); }
.filters .field { margin: 0; min-width: 150px; }
.filters .field--grow { flex: 1; min-width: 200px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 500; font-size: .88rem; color: var(--texts); margin-bottom: 4px; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; font-size: .92rem; color: var(--text); background: var(--white);
  border: 1px solid var(--border); border-radius: var(--r); padding: 7px 10px; min-height: 36px;
}
.input:hover { border-color: #A9C7D0; }
.input:focus { outline: none; border-color: var(--t); box-shadow: 0 0 0 3px var(--tl); }
.input[aria-invalid="true"] { border-color: var(--red); }
.help { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.field-error { font-size: .82rem; color: var(--red); margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 20px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; }
.required::after { content: " *"; color: var(--red); }

/* ---------- Key/value lists ---------- */
.kv { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Health ---------- */
.health-list { list-style: none; margin: 0; padding: 0; }
.health-item { display: grid; grid-template-columns: 22px 160px 1fr; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--borderl); }
.health-item:last-child { border-bottom: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--muted); }
.dot--healthy { background: var(--g); } .dot--degraded { background: var(--gold); } .dot--unhealthy { background: var(--red); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h2 { color: var(--texts); }

/* ---------- Pager ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--borderl); font-size: .85rem; color: var(--muted); }
.pager-links { display: flex; gap: 6px; }

/* ---------- Sign-in / standalone pages ---------- */
.standalone { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.standalone-card { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh3); overflow: hidden; border-top: 4px solid var(--t); }
.standalone-card .card-body { padding: 28px; }
.standalone-logo { display: block; margin: 0 auto 16px; width: 220px; }
.standalone-card h1 { text-align: center; }
.standalone-card .lead { text-align: center; color: var(--muted); }
.persona-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.persona-list button { width: 100%; justify-content: space-between; text-align: left; padding: 10px 14px; }
.persona-list .persona-desc { font-size: .8rem; color: var(--muted); font-weight: 400; }
.dev-banner { background: var(--orangel); color: #A0520F; border-bottom: 1px solid #F3C9A2; text-align: center; font-size: .82rem; font-weight: 600; padding: 4px 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topbar .nav-toggle { display: inline-flex; }
  .sidenav { position: fixed; left: 0; top: var(--topbar-h); z-index: 40; transform: translateX(-100%); transition: transform .15s ease; box-shadow: var(--sh3); }
  .sidenav[data-open="true"] { transform: none; }
  .content { padding: 16px; }
  .brand-name { display: none; }
  .userbox-name { display: none; }
  .health-item { grid-template-columns: 22px 1fr; }
  .health-item > :last-child { grid-column: 2; }
}
@media (max-width: 520px) {
  .brand-logo img { height: 28px; }
  .role-chip { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .footer { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .topbar, .sidenav, .footer, .page-actions, .filters, .pager { display: none !important; } body { background: var(--white); } }

/* ---------- Utilities (no inline styles: CSP style-src 'self') ---------- */
.center { text-align: center; }
.form-actions--center { justify-content: center; }
.form-actions--start { justify-content: flex-start; flex-wrap: wrap; }
.steps-inline { margin: 0 0 12px; padding-left: 20px; }
.steps-inline li { margin-bottom: 4px; }
form.inline { display: inline; margin: 0; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.role-pill { display: inline-flex; align-items: center; gap: 4px; margin: 2px 10px 2px 0; }
.input--inline { width: auto; min-width: 150px; display: inline-block; margin-right: 6px; }

/* ---------- Sign-in page ---------- */
.login-body { background: var(--bg); }
.login { flex: 1; display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 1fr); min-height: 100vh; }
.login-brand {
  position: relative; overflow: hidden; color: var(--white);
  background: linear-gradient(150deg, var(--td) 0%, var(--t) 55%, var(--tm) 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px;
}
.login-brand::after {
  content: ""; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%;
  border: 56px solid rgba(245, 200, 0, .12); pointer-events: none;
}
.login-brand-inner { position: relative; z-index: 1; max-width: 520px; margin: auto 0; }
.login-mark { width: 148px; height: 148px; border-radius: 24px; background: var(--white); display: flex; align-items: center; justify-content: center; box-shadow: var(--sh3); margin-bottom: 28px; padding: 14px; }
.login-mark img { max-width: 100%; max-height: 100%; }
.login-brand h1 { color: var(--white); font-size: 2.1rem; font-weight: 600; margin-bottom: 10px; }
.login-tagline { font-size: 1.1rem; color: rgba(255,255,255,.88); margin-bottom: 26px; }
.login-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.login-points li { position: relative; padding-left: 30px; color: rgba(255,255,255,.92); }
.login-points li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--goldb); box-shadow: inset 0 0 0 5px var(--td); }
.login-brand-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .88rem; color: rgba(255,255,255,.8); margin: 32px 0 0; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--white); }
.login-card { width: 100%; max-width: 400px; }
.login-logo { display: block; width: 240px; max-width: 100%; margin-bottom: 32px; }
.login-card h2 { font-size: 1.6rem; margin-bottom: 6px; }
.login-lead { color: var(--texts); margin-bottom: 22px; }
.btn-ms {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  padding: 13px 18px; border-radius: var(--r); border: 1px solid #8C8C8C; background: var(--white);
  color: #1F1F1F; font-weight: 600; font-size: .98rem; text-decoration: none; box-shadow: var(--sh1);
}
.btn-ms:hover { background: #F3F3F3; color: #1F1F1F; border-color: #5E5E5E; }
.btn-ms:focus-visible { box-shadow: var(--focus); }
.login-note { margin-top: 18px; font-size: .85rem; color: var(--muted); }
.login-foot { margin-top: 40px; font-size: .8rem; color: var(--muted); }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 24px; }
  .login-mark { width: 88px; height: 88px; border-radius: 16px; margin-bottom: 16px; }
  .login-brand h1 { font-size: 1.5rem; }
  .login-points, .login-tagline { display: none; }
  .login-brand-foot { margin-top: 12px; }
}

/* ---------- Users & access ---------- */
.role-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 20px; margin: 0; }
.role-legend dt { font-weight: 600; color: var(--td); }
.role-legend dd { margin: 2px 0 0; font-size: .85rem; color: var(--texts); }
.chip { display: inline-flex; white-space: nowrap; align-items: center; gap: 2px; border-radius: 999px; background: var(--tl); color: var(--td); font-size: .78rem; font-weight: 600; padding: 2px 4px 2px 10px; margin: 2px 6px 2px 0; }
.chip--admin { background: var(--goldl); color: #8A6100; }
.chip--muted { background: var(--bg); color: var(--muted); padding-right: 10px; }
.chip form { display: inline; margin: 0; }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; width: 20px; height: 20px; border-radius: 50%; padding: 0; }
.chip-x:hover { background: rgba(0,0,0,.08); }
.person-name { font-weight: 600; color: var(--text); }
.person-mail { font-size: .82rem; color: var(--muted); }
.add-role { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.add-role select { width: auto; min-width: 130px; min-height: 30px; padding: 3px 8px; font-size: .85rem; }

/* ---------- Branding ---------- */
.brand-assets { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.brand-preview { height: 120px; display: flex; align-items: center; justify-content: center; background: var(--txl); border: 1px dashed var(--border); border-radius: var(--r); margin-bottom: 10px; padding: 10px; }
.brand-preview img { max-height: 100%; max-width: 100%; }
.brand-preview--dark { background: var(--t); }

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--border); margin: 0 0 16px; }
.tabs a, .tabs .tab-soon { padding: 9px 16px; text-decoration: none; color: var(--texts); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a:hover { color: var(--td); background: var(--txl); }
.tabs a[aria-current="page"] { color: var(--td); border-bottom-color: var(--t); font-weight: 600; }
.tabs .tab-soon { color: var(--muted); opacity: .6; cursor: default; }
.changes { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* ---------- Form renderer (preview and, later, fill) ---------- */
.ofv { max-width: 820px; }
.ofv-head { background: var(--card); border: 1px solid var(--border); border-top: 6px solid var(--t); border-radius: var(--r); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--sh1); }
.ofv-head h1 { font-size: 1.6rem; margin: 0 0 4px; }
.ofv-ar { font-size: 1.15rem; color: var(--texts); margin: 0 0 8px; }
.ofv-instructions { white-space: pre-line; color: var(--texts); margin: 8px 0; }
.ofv-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 4px 24px 12px; margin: 0 0 16px; box-shadow: var(--sh1); min-width: 0; }
.ofv-section-title { font-size: 1.05rem; font-weight: 600; color: var(--white); background: var(--t); padding: 6px 14px; border-radius: var(--r); margin-top: 14px; }
.ofv-section-desc { white-space: pre-line; color: var(--texts); margin-top: 10px; }
.ofv-q { padding: 14px 0; border-bottom: 1px solid var(--borderl); }
.ofv-q:last-child { border-bottom: 0; }
.ofv-label { display: block; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.ofv-label-ar { color: var(--texts); margin: -2px 0 6px; }
.ofv-q .help { margin: -2px 0 8px; white-space: pre-line; }
.ofv-q .input { max-width: 560px; }
.ofv-choices { display: grid; gap: 6px; }
.ofv-choices--inline { grid-auto-flow: column; justify-content: start; gap: 24px; }
.ofv-choice { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ofv-choice input[type=radio], .ofv-choice input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--t); }
.ofv-other { max-width: 300px; min-height: 30px; padding: 3px 8px; }
.ofv-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.ofv-scale-item { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .85rem; cursor: pointer; }
.ofv-scale-item input { width: 20px; height: 20px; accent-color: var(--t); }
.ofv-scale-label { font-size: .82rem; color: var(--muted); }
.ofv-static { padding: 14px 0 4px; }
.ofv-static h3 { color: var(--td); margin: 0 0 4px; }
.ofv-calc { display: inline-block; background: var(--bg); font-weight: 600; min-width: 120px; }
.ofv-off { display: none !important; }

/* ---------- Preview ---------- */
.preview-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.preview-bar [aria-pressed="true"] { background: var(--t); color: var(--white); border-color: var(--t); }
.preview-frame { background: var(--bg); transition: max-width .2s; }
.preview-frame--phone { max-width: 400px; margin: 0 auto; border: 10px solid var(--td); border-radius: 28px; padding: 12px 8px; background: var(--bg); }
.preview-frame--phone .ofv-section, .preview-frame--phone .ofv-head { padding-left: 12px; padding-right: 12px; }
.preview-frame--phone .ofv-choices--inline { grid-auto-flow: row; }
.ofv-q--error { border-left: 3px solid var(--red); padding-left: 12px; margin-left: -15px; }
.ofv-submit { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--border); }
.submitted { text-align: center; padding: 28px 16px; }
.submitted-check { width: 64px; height: 64px; border-radius: 50%; background: var(--gl); color: var(--g); font-size: 2rem; line-height: 64px; margin: 0 auto 12px; font-weight: 700; }
.submitted-number { font-size: 1.8rem; font-weight: 700; color: var(--td); letter-spacing: .5px; }
.step-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.step-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--borderl); padding: 6px 0; }
.answers { width: 100%; border-collapse: collapse; }
.answers th { text-align: left; width: 38%; color: var(--texts); font-weight: 500; padding: 8px 12px 8px 0; vertical-align: top; border-bottom: 1px solid var(--borderl); }
.answers td { padding: 8px 0; border-bottom: 1px solid var(--borderl); white-space: pre-line; overflow-wrap: anywhere; }
.answers .answers-section th { color: var(--td); font-weight: 600; padding-top: 16px; }
.form-cards .card { display: flex; flex-direction: column; }
.form-cards .card-body { flex: 1; display: flex; flex-direction: column; }
.form-cards .card-body .btn { margin-top: auto; align-self: flex-start; }
.cards--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 20px; }
.access-rights { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; margin-right: 8px; }
.row-warn td { background: var(--redl); }
.doc-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }

/* ---------- E-mail tab ---------- */
.mail-recipients { border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px 10px; margin: 12px 0; }
.mail-recipients legend { font-weight: 600; color: var(--td); padding: 0 4px; }
.mail-recipients textarea { margin-bottom: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toolbar .tabs { margin-bottom: 0; }
.toolbar form.inline { display: flex; gap: 6px; align-items: center; }

/* ---------- Access overview ---------- */
.matrix th[scope=row] { background: var(--white); position: sticky; left: 0; z-index: 1; }
.matrix-head { white-space: normal; min-width: 90px; max-width: 140px; font-size: .8rem; vertical-align: bottom; }
.matrix-cell { text-align: center; font-family: ui-monospace, Consolas, monospace; font-weight: 600; color: var(--td); background: var(--tl); white-space: nowrap; }
.matrix-cell a { text-decoration: none; color: inherit; display: block; }
.matrix-cell--none { background: transparent; }
.reasons { margin: 0; padding-left: 18px; }
.row-highlight td { background: var(--goldl); }
.access-check { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }

/* ---------- Approval ---------- */
.approval-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.approval-step { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--r); padding: 10px 14px; background: var(--card); }
.approval-step--current { border-left-color: var(--gold); background: var(--goldl); }
.approval-step--done { border-left-color: var(--g); }
.approval-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--td); }
.approval-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.approval-people li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.approval-people .person-mail { color: var(--muted); font-size: .85rem; }
.decision-form { border-top: 1px solid var(--borderl); padding-top: 12px; display: grid; gap: 8px; }
.approval-notice ol { margin: 6px 0 0; padding-left: 20px; }
.approval-notice li { margin-bottom: 4px; }
.topbar-approvals { color: var(--white); text-decoration: none; font-weight: 600; white-space: nowrap; }
.topbar-approvals:hover { color: var(--white); text-decoration: underline; }
.count-chip { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--goldb); color: var(--td); font-size: .75rem; font-weight: 700; text-align: center; margin-left: 4px; }
.mt-1 { margin-top: 8px; }

/* ---------- QR code ---------- */
.qr-card { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.qr-preview { width: 180px; height: 180px; border: 1px solid var(--border); border-radius: var(--r); background: var(--white); }
.qr-card > div { flex: 1; min-width: 240px; }

/* ---------- Reports ---------- */
.report-chart { display: grid; gap: 6px; margin-bottom: 16px; }
.report-bar { display: grid; grid-template-columns: minmax(120px, 28%) 1fr 90px; align-items: center; gap: 10px; }
.report-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.report-bar-track { width: 100%; height: 18px; background: var(--txl); border-radius: 3px; }
.report-bar-fill { fill: var(--t); }
.report-bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--td); }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-save { border-top: 1px solid var(--borderl); flex-wrap: wrap; }
@media (max-width: 640px) { .report-bar { grid-template-columns: 1fr 70px; } .report-bar-track { grid-column: 1 / -1; grid-row: 2; } }

/* ---------------------------------------------------------------- check your answers (Fill page) */
.review .card-header h1 { font-size: 1.35rem; margin: 0; }
.review h1:focus { box-shadow: none; }
.review-section { margin: 18px 0 6px; font-size: 1rem; color: var(--t); }
.review-table { display: grid; grid-template-columns: minmax(180px, 38%) 1fr; margin: 0; border-top: 1px solid var(--borderl); }
.review-table dt, .review-table dd { margin: 0; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--borderl); overflow-wrap: anywhere; }
.review-table dt { color: var(--texts); font-weight: 500; }
.review-table dd { white-space: pre-line; }
.review-ar { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
.review-files { display: flex; flex-wrap: wrap; gap: 10px; white-space: normal; }
.review-file { margin: 0; width: 120px; }
.review-file img { display: block; width: 120px; height: 90px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--r); background: var(--txl); }
.review-file figcaption { overflow-wrap: anywhere; color: var(--muted); }
.review-next { margin-top: 20px; padding: 14px 16px; background: var(--txl); border: 1px solid var(--borderl); border-radius: var(--r); }
.review-next h2 { font-size: 1rem; }
.review-steps { margin: 6px 0 10px; padding-left: 1.3rem; }
@media (max-width: 640px) {
  .review-table { grid-template-columns: 1fr; }
  .review-table dt { border-bottom: 0; padding-bottom: 0; }
}

/* ---------------------------------------------------------------- document actions (regenerate, cancel, restore) */
.action-panel { margin: 10px 0; }
.action-panel > summary { list-style: none; display: inline-flex; cursor: pointer; }
.action-panel > summary::-webkit-details-marker { display: none; }
.action-panel[open] > summary { margin-bottom: 8px; }
.action-panel-body { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid var(--goldb); border-radius: var(--r); background: var(--goldl); }
#cancel .action-panel-body { border-left-color: var(--red); background: var(--redl); }
.action-panel-body p { margin: 0; }
.audience { padding: 8px 10px; background: var(--white); border: 1px solid var(--borderl); border-radius: var(--r); }
.audience-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; overflow-wrap: anywhere; }
.doc-history { margin: 8px 0; }
.doc-history .doc-list { margin-top: 6px; }
.cancelled-banner strong { color: var(--red); }

/* ---------------------------------------------------------------- QR scan: document not valid */
.verify-invalid { text-align: center; padding: 18px 16px; margin: 0 0 16px; border: 2px solid var(--red); border-radius: var(--r); background: var(--redl); color: var(--text); }
.verify-invalid h1 { color: var(--red); font-size: 1.5rem; margin: 4px 0 10px; }
.verify-invalid p { margin: 0 0 8px; }
.verify-invalid-icon { font-size: 2.6rem; line-height: 1; }
.verify-contact { margin: 0 0 14px; padding-left: 1.2rem; }
