/* Dental Register — one stylesheet.
   Paper-and-ink neutrals, one deep-teal accent, hairline borders, generous space. */

:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #16191b;
  --ink-2: #464c52;
  --ink-3: #7b8188;
  --line: #e4e1d9;
  --line-2: #d2cec4;
  --accent: #1d4b45;
  --accent-2: #163b36;
  --accent-soft: #e5eeeb;
  --accent-ink: #f4f1ea;
  --ok: #2c6a43;     --ok-soft: #e4f0e7;
  --warn: #8a5a0b;   --warn-soft: #f7eedb;
  --danger: #a3362d; --danger-soft: #f8e7e4;
  --info: #2d4a78;   --info-soft: #e7edf6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(22, 25, 27, .04), 0 4px 16px rgba(22, 25, 27, .04);
  --font: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --serif: "Noto Serif Thai", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
code, .code, .mono, input[data-mono] { font-family: var(--mono); font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex: none; }
.boot { min-height: 100vh; }

/* ---------- typography helpers ---------- */
.display { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.01em; line-height: 1.25; }
.eyebrow { font-size: 12.5px; font-weight: 500; color: var(--ink-3); letter-spacing: .02em; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.lead { color: var(--ink-2); margin-top: 6px; max-width: 62ch; }
.hint { font-size: 13px; color: var(--ink-3); }
.link { color: var(--accent); text-decoration: none; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--ink-2); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 500; font-size: 14.5px; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(22, 25, 27, .05); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: var(--surface); border-color: #e3c2bd; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { --h: 32px; padding: 0 11px; font-size: 13.5px; gap: 6px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { --h: 46px; padding: 0 22px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--accent-ink) transparent var(--accent-ink) transparent; animation: spin .7s linear infinite;
}
.btn-secondary.is-busy::after, .btn-ghost.is-busy::after, .btn-danger-ghost.is-busy::after { border-color: var(--ink-3) transparent var(--ink-3) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: none; border: 0; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; }
.icon-btn:hover { background: rgba(22, 25, 27, .06); color: var(--ink); }

/* ---------- top bar ---------- */
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; }
.skip:focus { top: 10px; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; height: 62px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.brand-mark .icon { width: 19px; height: 19px; }
.brand-name { font-weight: 600; letter-spacing: -.005em; }
.brand-tag { font-size: 11.5px; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 1px 8px; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-size: 14.5px; white-space: nowrap; position: relative; }
.nav a:hover { color: var(--ink); background: rgba(22, 25, 27, .04); }
.nav a.active { color: var(--ink); font-weight: 500; }
.nav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 2px; background: var(--accent); border-radius: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: var(--surface); }
.lang button { border: 0; background: none; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; padding: 4px 9px; border-radius: 6px; cursor: pointer; color: var(--ink-3); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 99px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: rgba(22, 25, 27, .05); }
.usermenu-name { font-size: 14px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; text-transform: uppercase; }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(22, 25, 27, .12); padding: 6px; }
.usermenu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; gap: 2px; font-size: 13px; }
.usermenu-head strong { font-size: 14px; }
.usermenu-panel a, .usermenu-panel button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; text-decoration: none; background: none; border: 0; cursor: pointer; font-size: 14px; color: var(--ink-2); text-align: left; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--surface-2); color: var(--ink); }
.footer { max-width: 1180px; margin: 0 auto; padding: 32px 24px 40px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- page layout ---------- */
#view { outline: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 36px 24px 24px; display: grid; gap: 20px; }
.page-narrow { max-width: 820px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; gap: 4px; align-items: center; color: var(--ink-3); text-decoration: none; font-size: 14px; width: fit-content; margin-bottom: -8px; }
.back-link:hover { color: var(--ink); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.layout-review { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.sticky-col { position: static; }
.stack { display: grid; gap: 20px; align-content: start; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.row-center { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; display: grid; gap: 16px; align-content: start; }
.card-muted { background: var(--surface-2); box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 16.5px; font-weight: 600; }
.section-bar { padding-bottom: 4px; }

/* ---------- notices & badges ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid transparent; }
.notice .icon { margin-top: 2px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice a { color: inherit; font-weight: 500; }
.notice-error { background: var(--danger-soft); color: var(--danger); border-color: #efd0cb; }
.notice-warn { background: var(--warn-soft); color: var(--warn); border-color: #eedfbf; }
.notice-info { background: var(--info-soft); color: var(--info); border-color: #d6e0ef; }
.notice-ok { background: var(--ok-soft); color: var(--ok); border-color: #cde3d3; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 3px 10px 3px 9px; border-radius: 99px; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); }
.chip { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); }

/* ---------- forms ---------- */
.form-card { padding: 0; overflow: clip; }
.form-section { padding: 26px 28px; border-bottom: 1px solid var(--line); display: grid; gap: 18px; }
.form-section:last-of-type { border-bottom: 0; }
.form-section-head { display: grid; gap: 4px; }
.form-section-head h3 { font-size: 15.5px; }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 18px; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s6 { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field-inline { align-self: end; padding-bottom: 10px; }
.label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.req { color: var(--danger); margin-left: 3px; font-weight: 400; }
.input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8188' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.input::placeholder { color: #a9aeb4; }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-msg { font-size: 13px; color: var(--danger); min-height: 0; }
.field-msg:empty { display: none; }
.invalid .input, .invalid .choices .choice, .invalid .schedule table { border-color: var(--danger); }
.invalid .input:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-addon { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border: 0; background: none; border-radius: 6px; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.input-addon:hover, .input-addon.on { color: var(--accent); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; font-size: 14.5px; background: var(--surface); transition: border-color .15s, background .15s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.check { display: inline-flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14.5px; line-height: 1.5; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check-lg { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); width: 100%; }
.check.is-locked { cursor: not-allowed; color: var(--ink-3); }
.check.is-locked input { opacity: .5; }
.read-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--info); }
.read-state .icon { width: 16px; height: 16px; }
.read-state.is-read { color: var(--ok); }
.read-state .btn { margin-left: auto; }
.consent { display: grid; gap: 12px; }
.dialog-body .read-state { position: sticky; bottom: -20px; background: var(--surface); padding: 10px 0 2px; margin-top: 4px; border-top: 1px solid var(--line); }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14.5px; }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.pw-rules { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-3); }
.pw-rules li { display: inline-flex; gap: 5px; align-items: center; }
.pw-rules .icon { width: 14px; height: 14px; opacity: .35; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok .icon { opacity: 1; }

/* repeatable groups */
.repeat { display: grid; gap: 14px; }
.repeat-item { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 18px; background: var(--surface-2); display: grid; gap: 14px; }
.repeat-head { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.repeat-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.add-btn { justify-self: start; }

/* weekly schedule */
.schedule { overflow-x: auto; }
.schedule table { border-collapse: separate; border-spacing: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); min-width: 420px; width: 100%; }
.schedule th, .schedule td { padding: 0; text-align: center; border-bottom: 1px solid var(--line); }
.schedule tr:last-child th, .schedule tr:last-child td { border-bottom: 0; }
.schedule thead th { padding: 9px 6px; font-weight: 500; font-size: 13px; background: var(--surface-2); color: var(--ink-2); }
.schedule thead small { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 400; }
.schedule tbody th { text-align: left; padding: 0 14px; font-weight: 500; font-size: 14px; width: 26%; background: var(--surface-2); border-right: 1px solid var(--line); }
.slot { display: grid; place-items: center; height: 42px; cursor: pointer; position: relative; }
.slot input { position: absolute; opacity: 0; }
.slot span { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); display: grid; place-items: center; color: transparent; transition: all .12s; background: #fff; }
.slot span .icon { width: 15px; height: 15px; }
.slot:hover span { border-color: var(--accent); }
.slot input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
.actionbar-flat { position: static; padding: 4px 0 0; border: 0; background: none; }
.form-actions { margin-top: 8px; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 42%) 1fr; }
.auth-single { grid-template-columns: 1fr; }
.auth-aside { background: var(--accent); color: var(--accent-ink); padding: 36px 48px; display: flex; flex-direction: column; gap: 40px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand-light { color: var(--accent-ink); }
.brand-light .brand-mark { background: rgba(244, 241, 234, .12); }
.auth-aside-body { margin: auto 0; display: grid; gap: 18px; max-width: 440px; }
.auth-aside-body .display { font-size: clamp(28px, 3.2vw, 40px); color: #fbf9f4; }
.auth-aside-body > p { color: rgba(244, 241, 234, .75); }
.auth-steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 0; border-top: 1px solid rgba(244, 241, 234, .16); }
.auth-steps li { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(244, 241, 234, .16); }
.auth-steps li > span { font-family: var(--serif); font-size: 20px; width: 22px; color: rgba(244, 241, 234, .55); }
.auth-steps strong { display: block; font-weight: 500; }
.auth-steps small { color: rgba(244, 241, 234, .65); font-size: 13px; }
.auth-aside-foot .contact { color: rgba(244, 241, 234, .8); }
.auth-aside-foot .contact-label { color: rgba(244, 241, 234, .55); }
.auth-main { padding: 28px 40px 48px; display: flex; flex-direction: column; }
.auth-top { display: flex; justify-content: space-between; align-items: center; min-height: 34px; }
.auth-single .auth-top { max-width: 760px; width: 100%; margin: 0 auto; }
.auth-content { width: 100%; max-width: 480px; margin: auto; padding: 40px 0; display: grid; gap: 20px; }
.auth-single .auth-content { max-width: 760px; margin: 0 auto; }
.auth-content > .display + .lead { margin-top: -12px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.auth-links { display: flex; justify-content: center; gap: 24px; font-size: 14px; }
.auth-links a, .auth-links button { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; font-weight: 400; }
.auth-links a:hover, .auth-links button:hover { color: var(--accent); }
.demo-box { border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.demo-box summary { cursor: pointer; font-weight: 500; color: var(--ink-2); }
.demo-box ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.demo-acc { width: 100%; display: flex; justify-content: space-between; gap: 10px; background: none; border: 0; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; text-align: left; }
.demo-acc:hover { background: var(--surface); }
.demo-acc code { color: var(--ink-3); font-size: 12px; }
.policy { max-height: 46vh; overflow: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 20px 22px; font-size: 14px; color: var(--ink-2); display: grid; gap: 10px; }
.policy h3 { font-size: 14.5px; color: var(--ink); margin-top: 8px; }
.policy ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

.contact { display: grid; gap: 4px; font-size: 14px; }
.contact-label { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: .02em; }
.contact-unit { font-weight: 500; }
.contact-phone { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 13.5px; }
.contact-phone .icon { width: 15px; height: 15px; opacity: .7; }
.contact-hours { font-size: 13px; opacity: .8; }

.guide-steps { list-style: none; counter-reset: g; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.guide-steps li { counter-increment: g; display: grid; grid-template-columns: 44px 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); }
.guide-steps li::before { content: counter(g); font-family: var(--serif); font-size: 22px; color: var(--accent); grid-row: span 2; }
.guide-steps h3 { font-size: 15.5px; }
.guide-steps p { color: var(--ink-2); font-size: 14px; }
.doc-checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; font-size: 14px; }
.doc-checklist li { display: flex; gap: 8px; }
.doc-checklist .icon { color: var(--ink-3); width: 16px; margin-top: 3px; }
.doc-checklist em { color: var(--ink-3); font-style: normal; font-size: 12.5px; }

/* ---------- wizard ---------- */
.wizard { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.wizard-aside { position: sticky; top: 86px; }
.wizard-main { display: grid; gap: 20px; }
.stepper ol { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 2px; }
.stepper a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-size: 14.5px; }
.stepper a:hover { background: rgba(22, 25, 27, .04); color: var(--ink); }
.stepper-dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink-3); background: var(--surface); flex: none; }
.stepper-dot .icon { width: 14px; height: 14px; }
.stepper .is-done .stepper-dot { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.stepper .is-current a { background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); color: var(--ink); font-weight: 500; padding: 8px 9px; }
.stepper .is-current .stepper-dot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stepper-progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.stepper-progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.stepper-count { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
.save-state { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state.is-saving::before { background: var(--warn); }

/* documents */
.docs { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.doc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.doc:last-child { border-bottom: 0; }
.doc-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-3); flex: none; }
.doc.has-file .doc-icon { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.doc.is-missing .doc-icon { border-style: dashed; }
.doc-body { flex: 1; min-width: 0; }
.doc-title { font-size: 14.5px; font-weight: 500; }
.doc-meta { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta a { color: var(--accent); text-decoration: none; }
.doc-meta a:hover { text-decoration: underline; }
.doc-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.upload-btn { cursor: pointer; }
.upload-btn:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.doc.is-uploading { opacity: .55; pointer-events: none; }
.doc.is-uploading .doc-icon { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* review */
.review { padding: 0; overflow: hidden; }
.review-head { display: flex; gap: 20px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.review-name { font-family: var(--serif); font-size: 22px; }
.review-block { padding: 22px 28px; border-bottom: 1px solid var(--line); display: grid; gap: 14px; }
.review-block:last-child { border-bottom: 0; }
.review-block-head { display: flex; justify-content: space-between; align-items: center; }
.review-title { font-size: 15.5px; }
.photo { width: 72px; height: 90px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); flex: none; }
.photo-empty { display: grid; place-items: center; color: var(--ink-3); }
.kv-section { display: grid; gap: 10px; }
.kv-section + .kv-section { margin-top: 10px; }
.kv-section h3 { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.kv-row { display: grid; grid-template-columns: 42% 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv-row dt { color: var(--ink-3); }
.kv-row dd { margin: 0; overflow-wrap: anywhere; }
.kv-wide { grid-column: 1 / -1; grid-template-columns: 21% 1fr; }
.kv-sub { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding-top: 12px; }
.confirm-card .check-lg { margin-top: 4px; }

/* success */
.success { text-align: center; justify-items: center; padding: 48px 32px; }
.success .lead { margin-inline: auto; }
.success-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 8px; }
.success-mark .icon { width: 28px; height: 28px; }
.code-pill { font-size: 14px; color: var(--ink-2); }
.code-pill code { font-size: 15px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 6px; margin-left: 6px; }
.next-steps, .mini-steps { text-align: left; counter-reset: n; list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; max-width: 460px; }
.next-steps li, .mini-steps li { counter-increment: n; display: grid; grid-template-columns: 28px 1fr; font-size: 14px; color: var(--ink-2); }
.next-steps li::before, .mini-steps li::before { content: counter(n); width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; display: grid; place-items: center; margin-top: 1px; }

/* ---------- dashboard ---------- */
.app-list { list-style: none; padding: 0; margin: 0; }
.app-list li + li { border-top: 1px solid var(--line); }
.app-item { display: flex; align-items: center; gap: 16px; padding: 18px 24px; text-decoration: none; transition: background .12s; }
.app-item:hover { background: var(--surface-2); }
.app-item-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.app-item-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.app-item-title { font-weight: 500; }
.app-item-meta { font-size: 13px; color: var(--ink-3); }
.app-item-arrow { color: var(--ink-3); }
.profile-card { justify-items: start; }
.profile-name { font-family: var(--serif); font-size: 19px; }
.mini-kv { margin: 0; width: 100%; display: grid; border-top: 1px solid var(--line); }
.mini-kv div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mini-kv dt { color: var(--ink-3); }
.mini-kv dd { margin: 0; text-align: right; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 48px 24px; }
.empty-icon { width: 34px; height: 34px; color: var(--ink-3); stroke-width: 1.2; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--ink-3); font-size: 14px; margin-bottom: 8px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-size: 14.5px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }

/* ---------- tracker & timeline ---------- */
.tracker { list-style: none; padding: 6px 0 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.tracker-step { position: relative; display: grid; justify-items: center; text-align: center; gap: 6px; padding: 0 6px; }
.tracker-step::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: var(--line); }
.tracker-step:first-child::before { display: none; }
.tracker-step.is-done::before, .tracker-step.is-current::before, .tracker-step.is-rejected::before { background: var(--accent); }
.tracker-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); position: relative; z-index: 1; }
.tracker-dot .icon { width: 16px; height: 16px; }
.is-done .tracker-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.is-current .tracker-dot { border: 2px solid var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.is-rejected .tracker-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.is-returned .tracker-dot { border: 2px solid var(--warn); color: var(--warn); background: var(--warn-soft); }
.is-returned .tracker-meta { color: var(--warn); font-weight: 500; }
.tracker-step.is-returned::before { background: var(--accent); }
.tracker-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.is-todo .tracker-label { color: var(--ink-3); font-weight: 400; }
.tracker-meta { font-size: 12px; color: var(--ink-3); min-height: 18px; }
.is-current .tracker-meta { color: var(--accent); font-weight: 500; }
.tracker-final.is-done .tracker-dot { background: var(--ok); border-color: var(--ok); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 18px 22px; display: grid; gap: 4px; }
.timeline-item::before { content: ""; position: absolute; left: 4px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline-item.is-reject::before { background: var(--danger); }
.timeline-item.is-return::before { background: var(--warn); }
.timeline-item::after { content: ""; position: absolute; left: 8px; top: 22px; bottom: 2px; width: 1px; background: var(--line-2); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::after { display: none; }
.timeline-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.timeline-meta { font-size: 12.5px; color: var(--ink-3); }
.timeline-comment { font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 4px; color: var(--ink-2); }
.committee-summary { display: grid; gap: 8px; margin-top: 6px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.checklist li { display: flex; gap: 6px; align-items: flex-start; }
.checklist .icon { width: 15px; height: 15px; margin-top: 2px; }
.checklist .ok { color: var(--ok); }
.checklist .no { color: var(--ink-3); }
.rate-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table-compact th, .table-compact td { padding: 10px 12px; }
.table-compact th:first-child, .table-compact td:first-child { padding-left: 12px; }
.card-pad .table-wrap { border: 1px solid var(--line); border-radius: 10px; }
.table-click tbody tr { cursor: pointer; transition: background .12s; }
.table-click tbody tr:hover { background: var(--surface-2); }
.cell-link { text-decoration: none; font-weight: 500; }
.cell-link:hover { color: var(--accent); }
.cell-sub { font-size: 12.5px; color: var(--ink-3); }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .muted { margin-right: 8px; }

/* staff dashboard */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 12px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .15s; }
.stat:hover { border-color: var(--ink-3); }
.stat-step { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.stat-step .icon { width: 14px; height: 14px; }
.stat-num { font-family: var(--serif); font-size: 26px; line-height: 1; font-weight: 600; }
.stat-label { font-size: 12.5px; color: var(--ink-3); }
.stat.is-mine { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.stat.is-mine .stat-step { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stat-ok .stat-step { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.stat-danger .stat-step { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters select.input { width: auto; min-width: 150px; }
.search { position: relative; flex: 1; min-width: 240px; }
.search .icon { position: absolute; left: 12px; top: 12px; color: var(--ink-3); }
.search .input { padding-left: 38px; }

/* decision panel */
.decision { padding: 0; overflow: clip; }
.decision-head { padding: 20px 22px 4px; }
.decision > .field, .decision-group, .decision-actions { margin: 0 22px; }
.decision-group { border: 0; border-top: 1px solid var(--line); padding: 16px 0; display: grid; gap: 10px; }
.decision-group legend { font-size: 13.5px; font-weight: 600; padding: 16px 0 4px; float: left; width: 100%; }
.decision-group legend + * { clear: both; }
.decision > .field { border-top: 1px solid var(--line); padding-top: 16px; }
.decision-actions { display: flex; justify-content: space-between; gap: 10px; padding: 16px 0 22px; }
.decision-actions { flex-wrap: wrap; }
.decision-actions .btn { flex: 1; }
.decision-actions .decision-return { flex-basis: 100%; }
.decision.card-pad { padding: 22px; }
.decision-closed, .decision-wait { background: var(--surface-2); }
.card-pad > .badge, .card-pad > .row-between .badge { justify-self: start; }
.rate-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rate-table th, .rate-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.rate-table thead th { font-weight: 600; color: var(--ink-3); text-align: center; }
.rate-table tbody th { text-align: left; font-weight: 400; }
.rate-table tbody th b { font-family: var(--mono); font-size: 12px; display: inline-block; min-width: 26px; }
.rate-table td { text-align: center; width: 38px; }
.rate-table input { accent-color: var(--accent); width: 16px; height: 16px; }
.rate-table .is-applied { background: var(--accent-soft); }
.applicant-head { display: flex; gap: 16px; align-items: center; }
.temp-pw { text-align: center; padding: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; }
.temp-pw code { font-size: 20px; letter-spacing: .04em; user-select: all; }

/* ---------- admin console ---------- */
.console-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-top: -4px; }
.console-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; text-decoration: none; color: var(--ink-2); font-size: 14.5px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.console-tabs a .icon { width: 17px; height: 17px; color: var(--ink-3); }
.console-tabs a:hover { color: var(--ink); }
.console-tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.console-tabs a.active .icon { color: var(--accent); }
.tab-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 11.5px; font-weight: 600; }
.tab-count.is-urgent { background: var(--danger); }
.tab-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.todo { border: 1px solid #eedfbf; background: var(--warn-soft); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 8px; }
.todo .card-title { font-size: 14.5px; color: var(--warn); }
.todo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.todo a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; background: rgba(255,255,255,.6); }
.todo a:hover { background: #fff; }
.todo a > span { flex: 1; }
.todo a .icon:first-child { color: var(--warn); }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .15s; }
.kpi:hover { border-color: var(--ink-3); }
.kpi-num { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpi-label { font-size: 12.5px; color: var(--ink-3); }
.kpi-warn { border-color: #eedfbf; background: var(--warn-soft); }
.kpi-warn .kpi-num { color: var(--warn); }
.kpi-danger { border-color: #efd0cb; background: var(--danger-soft); }
.kpi-danger .kpi-num { color: var(--danger); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: border-color .15s, background .15s; }
.quick:hover { border-color: var(--accent); background: var(--surface-2); }
.quick > span:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.quick strong { font-weight: 500; font-size: 14px; }
.quick small { color: var(--ink-3); font-size: 12.5px; }
.quick > .icon:last-child { color: var(--ink-3); width: 16px; }
.quick-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.log-action { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.log-action .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.tone-ok .dot { background: var(--ok); } .tone-info .dot { background: var(--info); }
.tone-warn .dot { background: #c58a1c; } .tone-danger .dot { background: var(--danger); }
.log-details { font-size: 13px; color: var(--ink-2); max-width: 360px; }
.nowrap { white-space: nowrap; }
.date-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.date-filter .input { width: auto; }
.load-more { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--line); }
.load-more:empty { display: none; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; flex: none; }
.user-panel { display: grid; gap: 18px; }
.user-head { display: flex; gap: 14px; align-items: flex-start; }
.user-head strong { font-size: 17px; }
.user-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.user-section { display: grid; gap: 10px; }
.user-section h3 { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; font-size: 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plain-list li:last-child { border-bottom: 0; }
.row-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.user-panel .table-wrap { border: 1px solid var(--line); border-radius: 10px; }
.workflow { list-style: none; margin: 0; padding: 8px 24px 18px; display: grid; gap: 0; }
.workflow li { display: flex; align-items: center; gap: 14px; padding: 10px 0; position: relative; }
.workflow li + li::before { content: ""; position: absolute; left: 15px; top: -10px; height: 20px; width: 2px; background: var(--line-2); }
.workflow-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 13px; flex: none; position: relative; z-index: 1; }
.workflow-end .workflow-n { background: var(--ok); }
.workflow-n .icon { width: 16px; height: 16px; }
.workflow-body { flex: 1; min-width: 0; }
.workflow-move { display: flex; gap: 2px; }
.workflow-move .icon-btn:disabled { opacity: .3; cursor: default; }
.icon.rot90 { transform: rotate(90deg); }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 460px; }
.perm-chips .chip { font-size: 12px; padding: 2px 8px; }
.role-form { display: grid; gap: 16px; }
.role-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 16px; display: grid; gap: 12px; margin: 0; }
.role-group legend { font-size: 13.5px; font-weight: 600; padding: 0 6px; }
.stage-opts { display: grid; gap: 12px; padding-left: 50px; }
.perm-check span { display: grid; gap: 1px; }
.perm-check small { font-size: 12.5px; }
@media (max-width: 1024px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr 1fr; } .quick-grid { grid-template-columns: 1fr; } }

/* ---------- expiry alerts ---------- */
.nav-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 11.5px; font-weight: 600; vertical-align: 1px; }
.nav-count.is-urgent { background: var(--danger); }
.alert-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); border: 1px solid #eedfbf; background: var(--warn-soft); color: var(--warn); text-decoration: none; }
.alert-card:hover { border-color: var(--warn); }
.alert-card > span:nth-child(2) { flex: 1; display: grid; }
.alert-card strong { font-weight: 600; }
.alert-card small { font-size: 13px; opacity: .85; }
.alert-card .link { color: var(--warn); }
.alert-card-icon { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.ack { display: grid; justify-items: end; gap: 2px; white-space: normal; }
.ack-text { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; color: var(--ok); }
.ack-text .icon { width: 14px; height: 14px; }

/* ---------- events ---------- */
.events-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; transition: border-color .15s; }
.events-link:hover { border-color: var(--ink-3); }
.events-link > span:nth-child(2) { flex: 1; display: grid; }
.events-link strong { font-weight: 500; font-size: 14.5px; }
.events-link small { color: var(--ink-3); font-size: 13px; }
.events-link-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.event-card { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 22px; align-items: start; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.date-tile { display: grid; justify-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-align: center; }
.date-tile-m { width: 100%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 500; padding: 3px 0; }
.date-tile-d { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.2; padding-top: 4px; }
.date-tile-y { font-size: 11.5px; color: var(--ink-3); padding-bottom: 6px; }
.event-card-body { display: grid; gap: 4px; min-width: 0; }
.event-card-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.event-card-title { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.35; }
.event-card-title a { text-decoration: none; }
.event-card-title a:hover { color: var(--accent); }
.event-card-meta { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.event-card-meta .icon { width: 15px; height: 15px; color: var(--ink-3); }
.event-card-side { display: grid; justify-items: end; gap: 8px; text-align: right; }
.event-fee { font-family: var(--serif); font-size: 18px; font-weight: 600; white-space: nowrap; }
.seats { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.seats-bar { width: 120px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; flex: none; }
.seats-bar span { display: block; height: 100%; background: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.facts dt { font-size: 12.5px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.prose { display: grid; gap: 10px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 16px; max-width: 68ch; }
.reg-panel .seats-bar { flex: 1; width: auto; }
.pay { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.pay-cell { display: grid; gap: 6px; justify-items: start; }
.btn-pair { display: flex; gap: 4px; }
.card-head-tools { gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: var(--surface-2); }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }
.search-sm { flex: 0 1 260px; min-width: 180px; }
.search-sm .input { height: 36px; }
.search-sm .icon { top: 9px; }
.input-sm { height: 34px; width: auto; min-width: 96px; padding-left: 10px; font-size: 13.5px; }
.table .is-cancelled td { color: var(--ink-3); }
.table .is-cancelled strong { font-weight: 400; text-decoration: line-through; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stats-4 .stat { grid-template-columns: 1fr; }

@media (max-width: 640px) {
  .event-card { grid-template-columns: 60px minmax(0, 1fr); padding: 16px; gap: 14px; }
  .event-card-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .facts { grid-template-columns: 1fr 1fr; }
  .stats-4 { grid-template-columns: 1fr 1fr; }
}

/* ---------- dialog & toast ---------- */
.dialog { border: 0; padding: 0; border-radius: 14px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(22, 25, 27, .24); background: var(--surface); color: var(--ink); }
.dialog-wide { width: min(720px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(22, 25, 27, .42); }
.dialog { max-height: calc(100dvh - 32px); overflow: hidden; }
.dialog-inner { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 32px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 6px 24px; }
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 8px 24px 20px; overflow: auto; display: grid; gap: 12px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.terms { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ok .icon { color: #8fd3a6; }
.toast-error { background: var(--danger); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .topbar .brand-name, .topbar .brand-tag, .usermenu-name { display: none; }
  .topbar-inner { gap: 16px; }
}
@media (max-width: 1024px) {
  .layout-2, .layout-review { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { position: static; height: auto; padding: 24px 20px; gap: 16px; }
  .auth-aside-body { margin: 0; }
  .auth-aside-body .display { font-size: 24px; }
  .auth-steps, .auth-aside-foot { display: none; }
  .auth-main { padding: 20px 16px 32px; }
  .auth-content { padding: 16px 0; }
  .wizard { grid-template-columns: 1fr; }
  .wizard-aside { position: static; }
  .stepper ol { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .stepper li:not(.is-current) .stepper-label { display: none; }
  .stepper a { padding: 6px; }
  .usermenu-name { display: none; }
  .topbar-inner { gap: 12px; padding: 0 16px; }
  .nav a.active::after { bottom: -14px; }
  .brand-name { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px 0; row-gap: 4px; }
  .nav { order: 3; flex: 1 0 100%; margin: 0 -12px; }
  .nav a { padding: 8px 12px 12px; }
  .nav a.active::after { bottom: 0; }
  .nav:empty { display: none; }
  .topbar-inner:has(.nav:empty) { padding-bottom: 10px; }
  .page { padding: 24px 16px 16px; gap: 16px; }
  .grid { grid-template-columns: 1fr; }
  .s2, .s3, .s4, .s6 { grid-column: 1 / -1; }
  .form-section { padding: 20px 16px; }
  .actionbar { padding: 12px 16px; }
  .card-pad { padding: 18px 16px; }
  .card-head { padding: 14px 16px; }
  .kv { grid-template-columns: 1fr; }
  .kv-row, .kv-wide { grid-template-columns: 40% 1fr; }
  .review-head, .review-block { padding: 18px 16px; }
  .tracker { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
  .tracker-label { font-size: 11.5px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .doc { flex-wrap: wrap; }
  .doc-actions { width: 100%; justify-content: flex-end; }
  .doc-checklist { grid-template-columns: 1fr; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .app-item { padding: 16px; }
  .lang button { padding: 4px 7px; }
}

/* ---------- send back / signed copy / batch print ---------- */
.return-comment { margin: 4px 0; padding: 8px 12px; border-left: 3px solid var(--warn); background: var(--surface); color: var(--ink); border-radius: 4px; white-space: pre-wrap; }
.notice .btn { margin-top: 8px; }
.notice .btn-primary, .notice .btn-primary .icon { color: var(--accent-ink); }
.signed-card { display: grid; gap: 8px; }
.signed-card.is-uploading { opacity: .6; pointer-events: none; }
.signed-actions { display: flex; gap: 6px; }
.signed-mark { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 12px; color: var(--ok); white-space: nowrap; }
.signed-mark .icon { width: 13px; height: 13px; }
.cell-check { width: 36px; padding-right: 0 !important; }
.cell-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.print-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.print-tools #sel-count { margin-right: auto; font-size: 13.5px; }

/* ---------- printable form (A4) ---------- */
.print-root { background: #e9e6df; min-height: 100vh; padding: 0 0 40px; }
.print-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet { width: 210mm; min-height: 297mm; margin: 24px auto 0; background: #fff; padding: 10mm 12mm 8mm; box-shadow: 0 2px 12px rgba(0,0,0,.08); font-size: 12px; line-height: 1.4; color: #111; }
.sheet > * + * { margin-top: 2.8mm; }
.sheet { position: relative; padding-bottom: 14mm; }
.pf-foot { position: absolute; left: 12mm; right: 12mm; bottom: 7mm; display: flex; justify-content: space-between; gap: 6mm; border-top: 1px solid #bbb; padding-top: 1.5mm; font-size: 10px; color: #444; }
.pf-clinic + .pf-clinic { margin-top: 2.5mm; }
.pf-clinic h3 { font-size: 12.5px; font-weight: 600; margin: 1mm 0; }
.pf-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 1mm; }
.pf-brand b { display: block; font-size: 14px; }
.pf-brand small { color: #555; font-size: 11px; }
.pf-box { border: 1px solid #222; padding: 2mm 4mm; display: grid; gap: .4mm; align-content: start; break-inside: avoid; }
.pf-box h2 { font-size: 12.5px; font-weight: 600; margin-bottom: .5mm; }
.pf-box h2 em { font-style: normal; font-weight: 400; color: #444; }
.pf-top { grid-template-columns: 1fr 32mm; gap: 4mm; }
.pf-top h1 { font-size: 15px; text-align: center; margin-bottom: 2mm; }
.pf-photo { border: 1px solid #222; height: 36mm; display: grid; place-items: center; color: #999; overflow: hidden; }
.pf-photo img { width: 100%; height: 100%; object-fit: cover; }
.pf-row { padding-left: 3mm; }
.pf-row span { color: #333; }
.pf-row b { font-weight: 500; }
.pf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4mm; }
.pf-gap { gap: 4mm; }
.pf-sep { border-top: 1px dotted #888; margin: 1mm 0; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pf-table th, .pf-table td { border-bottom: 1px solid #bbb; padding: 1.2mm 2mm; text-align: left; vertical-align: top; }
.pf-table th { font-weight: 600; border-bottom-color: #222; }
.pf-rates td:not(:first-child), .pf-rates th:not(:first-child) { text-align: center; width: 14mm; }
.pf-note { padding-left: 3mm; }
.pf-declare { display: grid; gap: 2mm; text-indent: 10mm; text-align: justify; }
.pf-docs, .pf-checks { margin: 0; padding-left: 7mm; display: grid; gap: .8mm; }
.pf-checks { list-style: none; padding-left: 3mm; }
.pf-sign { text-align: center; display: grid; gap: .5mm; width: 100%; max-width: 100mm; margin: 2mm auto 0; text-indent: 0; }
.pf-sign-right { margin-right: 0; max-width: 80mm; }
.pf-sign-line { border-bottom: 1px solid #222; min-height: 8mm; }
.pf-sign-row { display: flex; align-items: flex-end; gap: 2mm; min-height: 9mm; }
.pf-sign-row i { flex: 1; border-bottom: 1px solid #222; }
.pf-sign small { color: #333; font-size: 11px; }
.pf-blank { display: inline-block; width: 50mm; }
.pf-panel { border: 1px solid #222; break-inside: avoid; }
.pf-panel h2 { font-size: 13px; font-weight: 600; padding: 1.5mm 4mm; border-bottom: 1px solid #222; }
.pf-panel .pf-body { padding: 2mm 4mm; display: grid; gap: .5mm; align-content: start; }
.pf-center { text-align: center; }
.pf-pair { display: grid; grid-template-columns: 1fr 1fr; }
.pf-pair > div { display: flex; flex-direction: column; }
.pf-pair > div + div { border-left: 1px solid #222; }
.pf-pair .pf-body { flex: 1; }
.pf-pair .pf-sign { margin-top: auto; padding-top: 3mm; }
.pf-line { border-bottom: 1px dotted #555; min-height: 6mm; }
.pf-title { border: 1px solid #222; text-align: center; font-size: 14px; font-weight: 500; padding: 3mm; }
.sheet-rates h3 { font-size: 12.5px; font-weight: 600; margin-bottom: 1mm; }
.sheet-rates .pf-table th, .sheet-rates .pf-table td { padding-block: .9mm; }
.pf-split { display: flex; justify-content: space-between; align-items: baseline; gap: 4mm; }
.pf-split small { font-size: 9px; color: #444; text-align: right; }
.pf-table tr { break-inside: avoid; }
.sheet-rates .pf-rates + p { margin-top: 1.5mm; }
.pf-sessions td:nth-child(1), .pf-sessions td:nth-child(2), .pf-sessions td:nth-child(5) { white-space: nowrap; }

@media print {
  @page { size: A4; margin: 0; }
  body, .print-root { background: #fff; padding: 0; }
  .no-print, .topbar, .footer { display: none !important; }
  .sheet { margin: 0; box-shadow: none; page-break-after: always; break-after: page; }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
}
@media screen and (max-width: 860px) {
  .sheet { width: 100%; min-height: 0; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- bulk actions ---------- */
.sel-cell { width: 36px; padding-right: 0 !important; }
.sel-cell input { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: middle; }
.table tr.is-selected td { background: var(--accent-soft); }
.bulk-bar { position: sticky; top: 62px; z-index: 4; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 24px; background: var(--ink); color: #fff; }
.bulk-count { font-weight: 600; font-size: 14px; white-space: nowrap; }
.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.bulk-bar .btn-secondary { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.bulk-bar .btn-secondary:hover { background: rgba(255,255,255,.18); }
.bulk-bar .btn-ghost { color: rgba(255,255,255,.8); }
.bulk-bar .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.bulk-bar .btn-danger-ghost { background: transparent; border-color: rgba(255,170,160,.5); color: #ffb4a8; }
.bulk-bar .btn-primary { background: #fff; color: var(--ink); }

/* ---------- arrange & download ---------- */
.arrange-row { border-top: 1px solid var(--line); }
.arrange { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.arrange-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.arrange-field .input { min-width: 170px; }
.table .group-row th { background: var(--surface-2); color: var(--ink); font-size: 13.5px; font-weight: 600; padding-top: 14px; border-top: 1px solid var(--line); }
.group-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 99px; background: var(--line); color: var(--ink-2); font-size: 12px; }
.auto-note { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-3); }
.auto-note .icon { width: 15px; height: 15px; }
.auto-note.is-sent { color: var(--ok); }

/* ---------- notification bell ---------- */
.bell { position: relative; }
.bell summary { list-style: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative; }
.bell summary::-webkit-details-marker { display: none; }
.bell summary:hover { background: rgba(22, 25, 27, .05); color: var(--ink); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.bell-count[hidden] { display: none; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(22, 25, 27, .12); padding: 12px; display: grid; gap: 10px; z-index: 30; }
.bell-head { padding: 2px 4px; }
.bell-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.bell-list li { display: flex; gap: 10px; padding: 8px 6px; border-radius: 8px; font-size: 13.5px; }
.bell-list li p { color: var(--ink); }
.bell-list li small { color: var(--ink-3); font-size: 12px; }
.bell-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 6px; flex: none; }
.bell-list li.is-unread { background: var(--warn-soft); }
.bell-list li.is-unread .bell-dot { background: var(--danger); }
.bell-list li.is-done p { color: var(--ink-3); text-decoration: line-through; }
@media (max-width: 640px) { .bell-panel { width: min(320px, calc(100vw - 32px)); right: -60px; } }
.alert-card-info { border-color: #d6e0ef; background: var(--info-soft); color: var(--info); }
.alert-card-info .link { color: var(--info); }
.alert-card-info:hover { border-color: var(--info); }

/* ---------- paper approval & document versions ---------- */
.paper-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.paper-opt + .paper-opt { margin-top: 6px; }
.paper-opt input { margin-top: 3px; accent-color: var(--accent); }
.paper-opt span { display: grid; gap: 1px; }
.paper-opt strong { font-weight: 500; font-size: 14px; }
.paper-opt small { font-size: 12.5px; color: var(--ink-3); }
.paper-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.paper-opt.is-disabled { opacity: .55; cursor: not-allowed; }
.paper-fields { display: grid; gap: 12px; }
.paper-note { margin: 0 22px; }
.version-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.version-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.version-list li a { color: var(--accent); text-decoration: none; }
.version-list li.is-purged { color: var(--ink-3); background: var(--surface-2); }
.version-list li.is-purged span { text-decoration: line-through; }
.doc-staff { align-items: flex-start; }
.doc-versions { margin-top: 4px; font-size: 13px; }
.doc-versions summary { cursor: pointer; color: var(--ink-3); }
.doc-versions ul { margin: 4px 0 0; padding-left: 18px; }
.doc-versions a { color: var(--accent); text-decoration: none; }
.doc-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-3); }
.doc-lock .icon { width: 14px; height: 14px; }
.approval-mode { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
