/* THMG Onboarding — brand stylesheet (THMG digital UI guidelines) */
@font-face { font-family: 'Source Serif 4'; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/source-serif-4-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/source-serif-4-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/source-serif-4-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/source-sans-3-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/source-sans-3-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 700; font-style: normal; font-display: swap; src: url(../fonts/source-sans-3-latin-700-normal.woff2) format('woff2'); }

:root {
  --purple: #3D275C; --purple-mid: #6E5690; --purple-light: #AC9BC4;
  --black: #1A1A1A; --black-mid: #4D4D4D; --black-light: #8C8C8C;
  --sand: #D4C2AC; --beige-mid: #FAE8D2; --beige-light: #FFF4E6;
  --white: #FFFFFF; --white-grey: #F4F4F4; --white-light: #DEDEDE;
  --olive: #394537; --olive-mid: #5C6F57; --olive-light: #93A68D;
  --pearl: #74807D; --pearl-light: #D3E0DC;
  --red: #B4372F; --red-dark: #76201B; --yellow: #FBDC70; --yellow-pale: #FFF8E0;
  --serif: 'Source Serif 4', 'Source Serif', Georgia, serif;
  --sans: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  --radius: 4px; --radius-lg: 8px;
  --shadow: 0 2px 12px rgba(26,26,26,0.08); --shadow-hover: 0 4px 20px rgba(26,26,26,0.12);
  --ease: 180ms ease-out;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--black); background: var(--white); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; color: var(--purple); margin: 0 0 16px; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: clamp(20px, 2.4vw, 24px); }
h3 { font-size: 18px; font-weight: 400; color: var(--black); }
p { margin: 0 0 16px; }
a { color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--purple-mid); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--purple); color: #fff; padding: 8px 16px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--black-mid); }
.small { font-size: 14px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 24px; }
.mb { margin-bottom: 16px; }
.text-error { color: var(--red); }
.text-success { color: var(--olive-mid); }
.eyebrow { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--black-mid); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.lead { font-size: 18px; color: var(--black-mid); }
.wordmark, .wordmark-sm { font-family: var(--serif); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3em; color: var(--purple); }
.wordmark { font-size: 15px; line-height: 1.8; }
.wordmark-sm { font-size: 12px; letter-spacing: 0.22em; }
.ico { width: 22px; height: 22px; flex: none; }
.ico-sm { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.stack > * + * { margin-top: 16px; }
.stack { display: block; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.grid-2.align-start { align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 22px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 15px/1.2 var(--sans); cursor: pointer; text-decoration: none; transition: background var(--ease), color var(--ease), border-color var(--ease); }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-mid); color: #fff; }
.btn-primary:active { background: var(--black); }
.btn-primary:disabled, .btn:disabled { background: var(--white-grey); color: var(--black-light); border-color: var(--white-grey); cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--purple); border-color: var(--purple); }
.btn-secondary:hover { background: var(--beige-light); color: var(--purple); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); color: #fff; }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 8px; color: var(--black-mid); cursor: pointer; display: inline-flex; align-items: center; font: inherit; }
.btn-link:hover { color: var(--purple); }
.btn-icon { background: none; border: 0; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: var(--black-light); cursor: pointer; border-radius: var(--radius); font-size: 16px; }
.btn-icon:hover { color: var(--black); background: var(--white-grey); }
.btn-icon:disabled { opacity: .35; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
form.inline, .inline { display: inline-block; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, fieldset.field legend { font-weight: 600; font-size: 14px; color: var(--black); }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { margin-bottom: 6px; padding: 0; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--white-light); border-radius: var(--radius); background: #fff; color: var(--black);
  font: 16px/1.4 var(--sans); transition: border-color var(--ease), box-shadow var(--ease); }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234D4D4D' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--white-grey); color: var(--black-mid); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.error-text { color: var(--red); font-size: 14px; margin: 0; }
.help { font-size: 14px; color: var(--black-mid); margin: 0; }
.req { color: var(--red); }
.choice { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; line-height: 1.45; }
.choice input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--purple); flex: none; }
.choice.small { font-size: 14px; align-items: center; }
.choice.small input { margin-top: 0; }
.consent { background: var(--beige-light); padding: 14px 16px; border-radius: var(--radius); }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.form-section { font-family: var(--serif); color: var(--purple); font-size: 20px; margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--white-light); }
.form-dyn .form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-narrow { max-width: 760px; }
.checklist { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; font-size: 14px; }
.checklist li.ok { color: var(--olive); }
.checklist li.ko { color: var(--red); font-weight: 600; }
.check-list { max-height: 280px; overflow: auto; border: 1px solid var(--white-light); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Flash & callouts ---------- */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 15px; border: 1px solid; }
.flash > span { flex: 1; }
.flash-success { background: #EEF2EC; border-color: var(--olive-light); color: var(--olive); }
.flash-error { background: #FDF0EF; border-color: #E8B4B0; color: var(--red-dark); }
.flash-info { background: var(--beige-light); border-color: var(--sand); color: var(--black); }
.flash-close { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; opacity: .6; }
.callout { display: flex; gap: 14px; padding: 16px 20px; border-radius: var(--radius-lg); margin-bottom: 24px; border-left: 3px solid; }
.callout p { margin: 4px 0 0; }
.callout-success { background: #EEF2EC; border-color: var(--olive); color: var(--olive); }
.callout-success strong { color: var(--olive); }
.callout-error { background: #FDF0EF; border-color: var(--red); }
.callout-error strong { color: var(--red-dark); }
.callout-info { background: var(--beige-light); border-color: var(--sand); }
.note { background: var(--beige-light); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.note p { margin: 4px 0 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 3px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge-pending { background: var(--white-grey); color: var(--black-mid); }
.badge-submitted { background: #EFEAF5; color: var(--purple); }
.badge-approved { background: #EEF2EC; color: var(--olive); }
.badge-rejected { background: #FDF0EF; color: var(--red); }
.badge-overdue { background: var(--yellow-pale); color: #7A5A00; }
.badge-emp-draft { background: var(--white-grey); color: var(--black-mid); }
.badge-emp-invited { background: var(--beige-light); color: #6B4E2A; }
.badge-emp-active { background: #EFEAF5; color: var(--purple); }
.badge-emp-completed { background: #EEF2EC; color: var(--olive); }
.badge-emp-archived { background: var(--white-grey); color: var(--black-light); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; letter-spacing: .04em; background: var(--white-grey); color: var(--black-mid); }
.tag-default { background: #EFEAF5; color: var(--purple); }
.tag-adhoc { background: var(--beige-light); color: #6B4E2A; }
.tag-private { background: #EEF2EC; color: var(--olive); }
.count-pill { display: inline-block; min-width: 24px; padding: 0 8px; border-radius: 12px; background: var(--beige-mid); color: var(--black); font: 600 13px/24px var(--sans); text-align: center; vertical-align: 4px; }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--white-grey); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--purple); border-radius: 4px; transition: width 400ms ease-out; }
.progress-sm { height: 6px; margin-bottom: 4px; }
.w-progress { min-width: 160px; }
.progress-inline { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.progress-inline .progress { flex: 1; margin: 0; }

/* ---------- Cards & tables ---------- */
.card { background: #fff; border: 1px solid var(--white-light); border-radius: var(--radius-lg); padding: 24px; }
.card.flush { padding: 0; overflow: hidden; }
@media (max-width: 640px) { .card { padding: 20px 16px; } .pdf-frame iframe { height: 60vh; min-height: 360px; } }
.card .pad, .card-head.pad { padding: 20px 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card.flush .card-head { margin: 0; border-bottom: 1px solid var(--white-light); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { background: var(--purple); color: #fff; font-weight: 600; text-align: left; padding: 12px 16px; font-size: 13px; letter-spacing: .04em; white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--white-light); vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: var(--beige-light); }
.table tbody tr:hover td { background: var(--beige-mid); }
.table tr.is-inactive td { color: var(--black-light); }
.table-compact td { padding: 8px 16px; }
.dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 20px; margin: 0 0 16px; font-size: 15px; }
.dl dt { color: var(--black-mid); }
.dl dd { margin: 0; word-break: break-word; }
.dl-wide { grid-template-columns: minmax(180px, 40%) 1fr; }
.dl-wide dt, .dl-wide dd { padding: 8px 0; border-bottom: 1px solid var(--white-grey); }
.dl .dl-section { font-family: var(--serif); color: var(--purple); font-size: 18px; border-bottom: 1px solid var(--sand); padding-top: 16px; }
.empty { text-align: center; padding: 48px 24px; color: var(--black-mid); }
.empty .ico { width: 36px; height: 36px; color: var(--sand); margin-bottom: 8px; }
.empty.small { padding: 24px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--beige-mid); color: var(--purple); font: 600 13px var(--sans); flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; margin-right: 10px; vertical-align: middle; float: left; margin-top: 2px; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; font-family: var(--serif); }

/* ---------- Public layout ---------- */
body.public { background: var(--beige-light); }
.public-wrap { display: grid; grid-template-columns: minmax(280px, 38%) 1fr; min-height: 100vh; }
.public-brand { background: var(--purple); color: var(--beige-light); padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.public-brand::after { content: ''; position: absolute; right: -160px; bottom: -160px; width: 480px; height: 480px; border: 1px solid rgba(212,194,172,.25); border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(212,194,172,.05), 0 0 0 120px rgba(212,194,172,.04); }
.public-brand .wordmark { color: #fff; margin: 24px 0 32px; max-width: 320px; }
.brand-mark { background: #fff; width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.brand-mark img { max-height: 56px; }
.public-tagline { font-family: var(--serif); font-size: 26px; line-height: 1.3; color: #fff; max-width: 380px; }
.public-motto { font-family: var(--serif); font-style: italic; color: var(--sand); }
.public-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; position: relative; }
.public-card { background: #fff; width: 100%; max-width: 460px; padding: 40px; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.public-card.wide { max-width: 760px; }
.public-card h1 { font-size: 32px; }
.public-card h2 { font-size: 20px; margin-top: 32px; }
.public-footer { margin-top: 24px; font-size: 13px; }
.top-right { position: absolute; top: 24px; right: 24px; }
@media (max-width: 860px) {
  .public-wrap { grid-template-columns: 1fr; }
  .public-brand { padding: 32px 24px; flex-direction: row; align-items: center; gap: 16px; }
  .public-brand .brand-mark { width: 56px; height: 56px; }
  .public-brand .brand-mark svg, .public-brand .brand-mark img { width: 36px; height: 36px; }
  .public-brand .wordmark { margin: 0; font-size: 12px; }
  .public-tagline, .public-motto { display: none; }
  .public-main { padding: 24px 16px 48px; justify-content: flex-start; }
  .public-card { padding: 28px 20px; }
  .top-right { position: static; align-self: flex-end; margin-bottom: 16px; }
}
.lang-switch { display: inline-flex; gap: 2px; font-size: 13px; font-weight: 600; letter-spacing: .1em; }
.lang-switch a { padding: 6px 8px; text-decoration: none; color: var(--black-light); border-radius: 3px; }
.lang-switch a.active { color: var(--purple); background: var(--beige-light); }
.prose { max-width: 720px; }
.prose h3 { color: var(--purple); margin-top: 24px; }

/* ---------- Employee layout ---------- */
.topbar { border-bottom: 1px solid var(--white-light); background: #fff; position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 32px; }
.topbar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.topbar-nav { display: flex; gap: 24px; font-size: 15px; }
.topbar-nav a { text-decoration: none; color: var(--black); padding: 8px 0; }
.topbar-nav a:hover { color: var(--purple); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.container { max-width: 1040px; margin: 0 auto; padding: 40px 24px 64px; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--black-mid); border-top: 1px solid var(--white-light); padding-top: 24px; padding-bottom: 40px; }
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 16px; gap: 12px; }
  .topbar-nav { display: none; }
  .topbar-brand .wordmark-sm { font-size: 11px; letter-spacing: .16em; }
  .container { padding: 24px 16px 48px; }
}
.hero-welcome { display: grid; grid-template-columns: 1fr 260px; gap: 48px; align-items: end; padding: 16px 0 40px; border-bottom: 1px solid var(--sand); margin-bottom: 40px; }
.hero-welcome h1 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 8px; }
.hero-date { font-size: 18px; color: var(--black-mid); }
.hero-text { max-width: 600px; color: var(--black-mid); }
.big-number { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--purple); margin-bottom: 12px; }
.big-number small { font-size: 28px; margin-left: 4px; }
@media (max-width: 760px) { .hero-welcome { grid-template-columns: 1fr; gap: 24px; } .big-number { font-size: 48px; } }
.doc-section { margin-bottom: 48px; }
.doc-section h2 { display: flex; align-items: center; gap: 12px; }
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-card { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 20px 24px; background: #fff; border: 1px solid var(--white-light);
  border-radius: var(--radius-lg); text-decoration: none; color: var(--black); transition: box-shadow var(--ease), border-color var(--ease); }
.doc-card:hover { box-shadow: var(--shadow-hover); border-color: var(--sand); color: var(--black); }
.doc-card.is-rejected { border-left: 3px solid var(--red); }
.doc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-type { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--black-mid); }
.doc-title { font-family: var(--serif); font-size: 19px; color: var(--purple); }
.doc-desc { font-size: 14px; color: var(--black-mid); }
.doc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.due { font-size: 13px; color: var(--black-mid); }
@media (max-width: 640px) {
  .doc-card { grid-template-columns: auto 1fr; padding: 16px; gap: 14px; }
  .doc-meta { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
.doc-icon { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.doc-icon.sm { width: 30px; height: 30px; margin-right: 8px; vertical-align: middle; }
.doc-icon.lg { width: 64px; height: 64px; }
.doc-icon.lg .ico { width: 28px; height: 28px; }
.type-read { background: var(--beige-light); color: #6B4E2A; }
.type-form { background: #EFEAF5; color: var(--purple); }
.type-upload { background: #EEF2EC; color: var(--olive); }
.type-sign { background: #E8EEEC; color: var(--pearl); }
.crumbs { margin-bottom: 24px; font-size: 14px; }
.crumbs a { text-decoration: none; color: var(--black-mid); }
.crumbs a:hover { color: var(--purple); }
.doc-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 32px; }
.doc-header h1 { margin-bottom: 8px; }
.doc-header-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.doc-main { max-width: 820px; }
.file-list { list-style: none; padding: 0; margin: 0 0 16px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--white-light); border-radius: var(--radius); margin-bottom: 8px; flex-wrap: wrap; }
.file-row.compact { padding: 8px 12px; }
.file-name { flex: 1; min-width: 140px; word-break: break-all; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 24px; border: 1.5px dashed var(--sand); border-radius: var(--radius-lg);
  background: var(--beige-light); cursor: pointer; text-align: center; position: relative; transition: background var(--ease), border-color var(--ease); }
.dropzone .ico { width: 32px; height: 32px; color: var(--purple); }
.dropzone:hover, .dropzone.is-over { background: var(--beige-mid); border-color: var(--purple); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.is-uploading { opacity: .6; pointer-events: none; }
.dz-title { font-weight: 600; color: var(--purple); }
.dz-hint { font-size: 13px; color: var(--black-mid); }
.pdf-frame { border: 1px solid var(--white-light); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; background: var(--white-grey); }
.pdf-frame iframe { width: 100%; height: 70vh; min-height: 420px; border: 0; display: block; }
.sign-form { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--sand); }
.sigpad { position: relative; }
.sigpad canvas { width: 100%; height: 180px; border: 1px solid var(--white-light); border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; display: block;
  background-image: linear-gradient(to right, var(--white-light), var(--white-light)); background-size: calc(100% - 48px) 1px; background-position: 24px 75%; background-repeat: no-repeat; }
.sigpad canvas.sig-error { border-color: var(--red); }
.sigpad [data-sig-clear] { position: absolute; top: 4px; right: 4px; }
.sig-summary { margin-top: 24px; padding: 16px; background: var(--beige-light); border-radius: var(--radius); }
.sig-box { border: 1px solid var(--white-light); border-radius: var(--radius); padding: 8px; margin-bottom: 16px; background: #fff; text-align: center; }
.sig-box img { max-height: 160px; }

/* ---------- Admin layout ---------- */
body.admin { background: #FCFCFC; }
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--white-light); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 24px 20px; text-decoration: none; border-bottom: 1px solid var(--white-light); }
.sidebar-brand > span { display: flex; flex-direction: column; }
.sidebar-sub { font-size: 13px; color: var(--black-mid); margin-top: 2px; }
.sidebar nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); text-decoration: none; color: var(--black); font-size: 15px; }
.sidebar nav a .ico { color: var(--black-mid); width: 20px; height: 20px; }
.sidebar nav a:hover { background: var(--beige-light); color: var(--purple); }
.sidebar nav a.active { background: #EFEAF5; color: var(--purple); font-weight: 600; }
.sidebar nav a.active .ico { color: var(--purple); }
.sidebar nav .count { margin-left: auto; background: var(--purple); color: #fff; font-size: 12px; font-weight: 600; min-width: 22px; padding: 0 7px; line-height: 22px; border-radius: 11px; text-align: center; }
.sidebar-foot { border-top: 1px solid var(--white-light); padding: 16px 20px; }
.me { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.me-name { font-size: 14px; font-weight: 600; }
.sidebar-actions { display: flex; align-items: center; justify-content: space-between; }
.admin-main { min-width: 0; }
.admin-topbar { display: none; }
.admin-content { padding: 40px 48px 64px; max-width: 1320px; }
.menu-toggle { background: none; border: 0; width: 44px; height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 10px; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; background: var(--black); }
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform 200ms ease-out; box-shadow: var(--shadow-hover); }
  .sidebar.open { transform: none; }
  .admin-topbar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--white-light); background: #fff; position: sticky; top: 0; z-index: 20; }
  .admin-content { padding: 24px 16px 48px; }
}
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.person-head { display: flex; gap: 20px; align-items: center; }
.person-head p { margin: 0 0 8px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid var(--white-light); border-radius: var(--radius-lg); padding: 20px 24px; text-decoration: none; color: var(--black); display: flex; flex-direction: column; transition: box-shadow var(--ease); }
.kpi:hover { box-shadow: var(--shadow-hover); color: var(--black); }
.kpi-num { font-family: var(--serif); font-size: 44px; line-height: 1.1; color: var(--purple); }
.kpi-label { font-size: 14px; color: var(--black-mid); }
.kpi-alert .kpi-num { color: var(--red); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.queue { list-style: none; margin: 0; padding: 0; }
.queue li a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--white-grey); text-decoration: none; color: var(--black); }
.queue li a:hover strong { color: var(--purple); }
.setup { margin-bottom: 24px; background: var(--beige-light); border-color: var(--sand); }
.setup-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 12px 32px; }
.setup-list li { display: flex; align-items: center; gap: 10px; }
.setup-list .tick { width: 22px; height: 22px; border: 1.5px solid var(--sand); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; }
.setup-list li.ok .tick { background: var(--olive); border-color: var(--olive); color: #fff; }
.setup-list li.ok a { color: var(--black-mid); text-decoration: line-through; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; align-items: center; }
.filters .field { min-width: 200px; }
.filters select, .filters input { min-width: 200px; width: auto; }
.legend { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--black-mid); margin-bottom: 24px; }
.tabs .tab-list { display: flex; border-bottom: 1px solid var(--white-light); margin-bottom: 16px; }
.tabs [role=tab] { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: 600 14px var(--sans); color: var(--black-mid); cursor: pointer; margin-bottom: -1px; }
.tabs [role=tab][aria-selected=true] { color: var(--purple); border-bottom-color: var(--purple); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--white-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-hover);
  min-width: 260px; z-index: 30; padding: 6px; text-align: left; }
.dropdown-menu a, .dropdown-menu button { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 10px 12px; border-radius: var(--radius); text-decoration: none; color: var(--black);
  background: none; border: 0; font: 15px var(--sans); cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--beige-light); }
.dropdown-menu form { display: block; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 14px; max-height: 360px; overflow-y: auto; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--beige-mid); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--sand); }
.danger-zone { border-color: #E8B4B0; }
.danger-zone summary { cursor: pointer; color: var(--red); font-weight: 600; font-size: 15px; }
.entity-card summary { cursor: pointer; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; list-style: none; }
.entity-card summary::-webkit-details-marker { display: none; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 24px; }
.logo-preview { display: inline-flex; padding: 8px; border: 1px solid var(--white-light); border-radius: var(--radius); }

/* Form builder */
.builder { display: flex; flex-direction: column; gap: 10px; }
.bf { border: 1px solid var(--white-light); border-radius: var(--radius); padding: 12px; background: #fff; }
.bf-heading { background: var(--beige-light); border-color: var(--sand); }
.bf-row { display: grid; grid-template-columns: 170px 1fr 1fr auto auto; gap: 8px; align-items: center; }
.bf-row input, .bf-row select { min-height: 40px; padding: 8px 10px; font-size: 15px; }
.bf-row select { padding-right: 30px; }
.bf-tools { display: flex; }
.bf-more { margin-top: 8px; font-size: 14px; }
.bf-more summary { cursor: pointer; color: var(--black-mid); }
.bf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.bf-grid input, .bf-grid textarea { min-height: 40px; padding: 8px 10px; font-size: 14px; }
@media (max-width: 760px) { .bf-row { grid-template-columns: 1fr 1fr; } .bf-grid { grid-template-columns: 1fr; } }

/* ---------- Certificate / print ---------- */
body.print-page { background: var(--white-grey); }
.print-toolbar { text-align: center; padding: 16px; }
.certificate { max-width: 820px; margin: 0 auto 48px; background: #fff; padding: 56px 64px; box-shadow: var(--shadow); }
.certificate header { border-bottom: 1px solid var(--sand); padding-bottom: 24px; margin-bottom: 32px; }
.cert-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.certificate h2 { font-size: 20px; margin-top: 32px; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cert-table th { text-align: left; width: 34%; color: var(--black-mid); font-weight: 400; padding: 8px 12px 8px 0; vertical-align: top; border-bottom: 1px solid var(--white-grey); }
.cert-table td { padding: 8px 0; border-bottom: 1px solid var(--white-grey); word-break: break-word; }
.cert-sig { border: 1px solid var(--white-light); padding: 12px; text-align: center; }
.cert-sig img { max-height: 180px; }
.cert-foot { margin-top: 40px; font-size: 12px; color: var(--black-mid); border-top: 1px solid var(--white-light); padding-top: 16px; }
@media print {
  body.print-page { background: #fff; }
  .no-print { display: none; }
  .certificate { box-shadow: none; padding: 0; margin: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
