/* IIMI Freelancer Agreement portal. Brand: IIMI red #cb1313, ink #141310, warm paper #f5f2ec (iimdirect.com). */
:root {
  color-scheme: light;
  --red: #cb1313;
  --red-600: #ad0f0f;
  --red-50: #fcefee;
  --red-100: #fbdcd9;
  --ink: #141310;
  --ink-2: #3b3934;
  --muted: #6b6760;
  --line: #e6e1d8;
  --line-2: #d6d0c4;
  --bg: #f5f2ec;
  --card: #ffffff;
  --ok: #1d7a45;
  --ok-50: #e9f6ee;
  --ok-100: #cfeeda;
  --amber: #a85b06;
  --amber-50: #fff5e6;
  --amber-100: #fbe3bd;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 19, 16, .05), 0 10px 30px -12px rgba(20, 19, 16, .14);
  --font: Inter, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --display: Poppins, Inter, system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
       font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(24px, 3.2vw, 30px); font-weight: 600; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 600; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { margin: 0 0 8px; font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.eyebrow.light { color: #ff8a80; }
.eyebrow.ok { color: var(--ok); }

/* ---------- header ---------- */
.top { background: var(--bg); position: relative; z-index: 2; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand img { display: block; height: 40px; width: auto; }
.brand-sep { width: 1px; height: 34px; background: var(--line-2); }
.brand-sub { font: 500 13px/1.25 var(--display); color: var(--ink-2); }
.who { display: flex; align-items: center; gap: 12px; margin: 0; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ok-50);
        color: var(--ok); font-size: 13px; font-weight: 500; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip svg { width: 15px; height: 15px; }
.band { background: var(--ink); color: #f5f2ec; text-align: center; font: 500 13px/1 var(--display); padding: 11px 16px; letter-spacing: .02em; }
.band i { font-style: normal; color: #8a857c; margin: 0 6px; }

/* ---------- layout ---------- */
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 56px; position: relative; z-index: 1; }
.page-head { margin: 0 0 22px; max-width: 720px; }
.page-head .muted { margin: 8px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 26px; }
.card + .card { margin-top: 18px; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; position: relative; z-index: 1; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding-top: 16px; padding-bottom: 18px; }
.foot a { color: var(--muted); }

/* ---------- stepper ---------- */
.steps { list-style: none; display: flex; margin: 0 0 30px; padding: 0; counter-reset: s; }
.steps li { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 500; position: relative; }
.steps li:last-child { flex: none; }
.steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--line-2); margin: 0 12px; border-radius: 2px; }
.steps li.done:not(:last-child)::after { background: var(--red); }
.steps .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--display);
              background: var(--card); border: 2px solid var(--line-2); color: var(--muted); flex: none; }
.steps .dot svg { width: 16px; height: 16px; }
.steps li.done .dot { background: var(--red); border-color: var(--red); color: #fff; }
.steps li.current .dot { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 4px var(--red-50); }
.steps li.current, .steps li.done { color: var(--ink); }
.steps .label { white-space: nowrap; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px;
       padding: 12px 20px; font: 600 15px/1.2 var(--display); background: var(--red); color: #fff; text-decoration: none;
       cursor: pointer; transition: background .15s, transform .05s, box-shadow .15s; box-shadow: 0 6px 16px -8px rgba(203, 19, 19, .7); }
.btn:hover { background: var(--red-600); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .link-btn:focus-visible, .pill:focus-visible, .icon-btn:focus-visible, .stat:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(203, 19, 19, .28); outline-offset: 2px; }
.btn[disabled] { background: #c9c4bb; box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--ink); }
.btn.ghost[disabled] { background: var(--card); color: var(--muted); border-color: var(--line); }
.btn.sm { padding: 9px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 4px 2px; font: 600 14px var(--font); color: var(--red); cursor: pointer;
            display: inline-flex; align-items: center; gap: 6px; text-decoration: none; border-radius: 6px; }
.link-btn:hover { text-decoration: underline; }
.link-btn[disabled] { color: var(--muted); cursor: default; text-decoration: none; }
.link-btn.quiet { color: var(--muted); font-weight: 500; }
.link-btn svg { width: 16px; height: 16px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 9px; background: none;
            color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: #f1eee8; color: var(--ink); }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
        display: inline-block; animation: spin .7s linear infinite; flex: none; }
.btn.ghost .spin, .link-btn .spin, .spin.dark { border-color: rgba(20, 19, 16, .2); border-top-color: var(--ink); }
.spin.dark { vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; color: var(--ink-2); }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 12px 14px; font: 15px/1.4 var(--font); color: var(--ink); background: #fff;
  border: 1.5px solid var(--line-2); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
input:hover, textarea:hover, select:hover { border-color: #bdb6a9; }
input:focus, textarea:focus, select:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-50); outline: none; }
input[readonly] { background: #f8f6f2; color: var(--ink-2); }
textarea { resize: vertical; min-height: 76px; }
::placeholder { color: #aaa49a; }
.upper { text-transform: uppercase; }
.upper::placeholder { text-transform: none; }
.err { color: var(--red); font-size: 13px; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }
.err.center { text-align: center; }
.err.denied { background: var(--red-50); border: 1px solid #f3c9c5; color: #8f1010; padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.alert { display: flex; gap: 10px; align-items: flex-start; background: var(--red-50); border: 1px solid #f3c9c5; color: #8f1010;
         padding: 13px 16px; border-radius: 12px; margin: 0 0 18px; font-weight: 500; }
.alert svg { margin-top: 2px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 16px 0 0; font-size: 14px; }
.note svg { margin-top: 2px; }
.note.warn { background: var(--amber-50); border: 1px solid var(--amber-100); color: #6f3c04; }
.note.good { background: var(--ok-50); border: 1px solid var(--ok-100); color: #14552f; }
.note ul { margin: 4px 0 0; padding-left: 18px; }
.field.bad input, .field.bad textarea, .field.bad .drop { border-color: var(--red); background: #fffafa; }

/* ---------- sign-in ---------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; max-width: 940px; margin: 0 auto; }
.auth-aside { background: var(--ink); color: #f5f2ec; padding: 44px 40px; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; right: -70px; bottom: -80px; width: 300px; height: 320px;
                     background: url("iimi_mark.png") center / contain no-repeat; opacity: .16; }
.auth-aside h1 { color: #fff; font-size: 28px; max-width: 380px; position: relative; z-index: 1; overflow-wrap: anywhere; }
.aside-lead { color: #c9c4bb; margin: 12px 0 26px; position: relative; z-index: 1; }
.ticks { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 12px; position: relative; z-index: 1; }
.ticks li { padding-left: 30px; position: relative; color: #e7e3dc; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--red)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='white' d='m8.2 14.3-4.5-4.5 1.4-1.4 3.1 3.1 6.7-6.7 1.4 1.4-8.1 8.1Z'/%3E%3C/svg%3E") center / 14px no-repeat; }
.ticks b { color: #fff; }
.auth-main { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.auth-main h2 { font-size: 24px; }
.auth-main .muted { margin: 8px 0 24px; }
.auth-main .btn.block { margin-top: 18px; }
.auth-main .locked-input { margin-top: 0; }
.auth-main .locked-input + .muted { margin-top: 14px; }
.auth-main h2 + label { margin-top: 18px; }
.auth-main .note { margin: 0 0 4px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 44px; }
.otp { display: flex; gap: 12px; justify-content: center; margin: 4px 0 6px; }
.otp input { width: 62px; height: 70px; text-align: center; font: 600 28px/1 var(--display); padding: 0; border-radius: 12px; caret-color: var(--red); }
.otp.six { gap: 8px; }
.otp.six input { width: 48px; height: 60px; font-size: 24px; }
.otp input.filled { border-color: var(--ink); }
.otp.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.code-links { display: flex; justify-content: space-between; margin-top: 16px; }
.locked-input { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1.5px dashed var(--line-2); border-radius: 10px;
                background: #f8f6f2; color: var(--ink-2); min-width: 0; font-weight: 500; }
.locked-input svg { color: var(--muted); }
.locked-input span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- check & sign ---------- */
.watermark { position: fixed; inset: 0; z-index: 0; pointer-events: none;
             background: url("iimi_mark.png") center 58% / min(62vmin, 560px) no-repeat; opacity: .055; }
body:has(.watermark) .card { background: rgba(255, 255, 255, .92); }
.card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.card-head > div:not(.zoom) { flex: 1; min-width: 0; }
.card-head .muted { margin: 2px 0 0; }
.card-head .muted svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.num { width: 34px; height: 34px; border-radius: 10px; background: var(--red); color: #fff; display: grid; place-items: center;
       font: 600 15px/1 var(--display); flex: none; margin-top: 3px; }
.card.checked .num { background: var(--ok); }
.details { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.details div { padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.details div.wide { grid-column: span 2; }
.details dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.details dd { margin: 3px 0 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; white-space: normal; }
.actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.actions.split { justify-content: space-between; align-items: center; gap: 16px; margin-top: 22px; }
.actions.split p { margin: 0; }
.zoom { display: inline-flex; border: 1.5px solid var(--line-2); border-radius: 10px; overflow: hidden; flex: none; }
.zoom button { border: 0; background: #fff; padding: 8px 12px; font: 600 14px var(--display); color: var(--ink); cursor: pointer; }
.zoom button + button { border-left: 1.5px solid var(--line-2); }
.zoom button[disabled] { color: #c0b9ad; cursor: default; }
.pdf-frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f0ede7; }
.pdf-pages { height: min(560px, 72vh); overflow: auto; overscroll-behavior: contain; padding: 14px; --zoom: 1; }
.pdf-pages:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }
.pdf-pages img { display: block; width: calc(100% * var(--zoom)); max-width: none; height: auto; margin: 0 0 14px; background: #fff;
                 border-radius: 3px; box-shadow: 0 1px 3px rgba(20, 19, 16, .16); }
.pdf-pages img:last-child { margin-bottom: 0; }
.read-bar { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--muted); font-weight: 500; }
.read-bar.done { color: var(--ok); }
.meter { flex: none; width: 120px; height: 8px; border-radius: 99px; background: #ebe7df; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--red); border-radius: 99px; transition: width .15s; }
.read-bar.done .meter i { background: var(--ok); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#card-sign.locked .num { background: #c9c4bb; }
#card-sign.locked fieldset { opacity: .4; pointer-events: none; filter: grayscale(1); }
.tabs { display: inline-flex; background: #f1eee8; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; max-width: 100%; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 9px 16px; border-radius: 9px;
               font: 600 14px var(--display); color: var(--muted); cursor: pointer; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 19, 16, .15); }
.sig-pad { position: relative; height: 210px; border: 2px dashed var(--line-2); border-radius: 12px; background: #fff; overflow: hidden; }
.sig-pad canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; position: relative; z-index: 1; }
.pad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #b3ac9f; font-size: 15px; pointer-events: none; padding-bottom: 30px; }
.pad-line { position: absolute; left: 7%; right: 7%; bottom: 26%; border-bottom: 1.5px solid #d9d3c8; pointer-events: none; }
.pad-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; min-height: 28px; }
.drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 20px; min-height: 150px; padding: 20px;
        border: 2px dashed var(--line-2); border-radius: 12px; background: #fbfaf7; cursor: pointer; font-weight: 400; margin: 0;
        transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-50); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--ink-2); }
.drop-empty svg { width: 30px; height: 30px; color: var(--red); margin-bottom: 4px; }
.drop.picked .drop-empty svg { color: var(--ok); }
.drop.picked { justify-content: space-between; }
.drop.picked .drop-empty { align-items: flex-start; text-align: left; }
.drop img { max-width: 240px; max-height: 96px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.agree { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0 0; font-weight: 500; font-size: 15px; color: var(--ink); cursor: pointer; }
.agree input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.agree .box { width: 24px; height: 24px; border: 2px solid var(--line-2); border-radius: 6px; flex: none; margin-top: 0; background: #fff;
              transition: background .15s, border-color .15s; }
.agree input:checked + .box { background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='white' d='m8.2 14.3-4.5-4.5 1.4-1.4 3.1 3.1 6.7-6.7 1.4 1.4-8.1 8.1Z'/%3E%3C/svg%3E") center / 16px no-repeat; border-color: var(--red); }
.agree input:focus-visible + .box { box-shadow: 0 0 0 4px var(--red-50); }

/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: 20px; padding: 32px; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
         overflow: auto; box-shadow: 0 30px 80px -20px rgba(20, 19, 16, .5); color: var(--ink); }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(20, 19, 16, .55); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--amber-50); color: var(--amber); display: grid; place-items: center; margin-bottom: 16px; }
.dlg-icon svg { width: 28px; height: 28px; }
.dlg-icon.mail { background: var(--red-50); color: var(--red); }
.dlg-icon.big { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; }
.dlg-icon.big svg { width: 38px; height: 38px; }
dialog h2 { font-size: 22px; margin-bottom: 8px; }
dialog p { margin: 0 0 10px; color: var(--ink-2); }
dialog textarea { margin-top: 6px; }
.dlg-list { margin: 0 0 18px; padding-left: 20px; color: var(--ink-2); display: grid; gap: 4px; }
.dlg-list.notes { font-size: 14px; }
.dlg-list .warn { color: #8a4a05; }
.dlg-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }

/* ---------- done / messages ---------- */
.done-card { max-width: 620px; margin: 0 auto; padding: 48px 40px 36px; text-align: center; position: relative; overflow: hidden; }
.done-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--ink) 0 30%, var(--red) 30% 100%); }
.done-card h1 { margin-top: 4px; }
.lead { font-size: 16px; color: var(--ink-2); margin: 12px auto 26px; max-width: 460px; }
.tick { width: 88px; height: 88px; margin: 0 auto 18px; }
.tick svg { width: 88px; height: 88px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tick circle { stroke: var(--ok); stroke-width: 3; fill: var(--ok-50); stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s ease-out forwards; }
.tick path { stroke: var(--ok); stroke-width: 4; stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .35s .5s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.receipt { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 22px; text-align: left; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.receipt div { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.receipt div:nth-child(odd) { border-right: 1px solid var(--line); }
.receipt div:nth-last-child(-n+2) { border-bottom: 0; }
.receipt dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.receipt dd { margin: 2px 0 0; font-weight: 600; }
.done-actions { margin: 0 0 18px; }
.done-actions .btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- HR console ---------- */
body.console .wrap { max-width: 1640px; }
.hr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.hr-head .muted { margin: 6px 0 0; }
.hr-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { flex: 1 1 150px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 18px; text-align: left;
        background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font: inherit; color: var(--ink);
        transition: border-color .15s, box-shadow .15s; }
.stat b { font: 600 26px/1.1 var(--display); }
.stat span { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat:hover { border-color: var(--line-2); }
.stat.on { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 19, 16, .08); }
.stat.ready b, .stat.sent b { color: var(--red); }
.stat.signed b { color: var(--ok); }
.stat.attention b { color: var(--amber); }
.table-card { overflow: hidden; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filters input, .filters select { padding: 9px 12px; font-size: 14px; width: auto; }
.filters .search { flex: 1 1 260px; max-width: 380px; }
.filters .search input { width: 100%; padding-left: 40px; }
.filters .search svg { left: 12px; }
.sel-bar { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; min-height: 64px; padding: 10px 16px;
           background: #faf7f1; border-bottom: 1px solid var(--line); }
.sel-hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.sel-picked { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.sel-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sel-actions .btn { white-space: nowrap; border: 1.5px solid transparent; }
.sel-actions .btn.ghost { border-color: var(--line-2); }
.sel-actions .btn.ghost:hover { border-color: var(--ink); }
.sel-actions .btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.btn .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .24); font: 700 12px/1.5 var(--font); text-align: center; }
.btn.ghost .count { background: var(--ink); color: #fff; }
.btn[aria-disabled="true"] { background: #c9c4bb; box-shadow: none; cursor: not-allowed; }
/* status labels: flat, no border, so they never look like buttons */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px;
       font: 600 12.5px/1.3 var(--font); white-space: nowrap; }
.tag svg { width: 14px; height: 14px; fill: currentColor; }
.tag.ready { background: #efebe3; color: var(--ink-2); }
.tag.sent { background: var(--red-50); color: #9c0f0f; }
.tag.ok { background: var(--ok-50); color: #14552f; }
.tag.file { background: #efebe3; color: var(--ink); }
.table-scroll { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.grid th { position: sticky; top: 0; background: #faf8f4; text-align: left; font: 600 12px/1.2 var(--font); letter-spacing: .06em;
                text-transform: uppercase; color: var(--muted); padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: #fbf9f5; }
table.grid tbody tr.picked { background: #fdf5f4; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid .chk { width: 40px; padding-right: 0; cursor: default; }
table.grid .chk input { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; display: block; }
table.grid .num-col { width: 64px; color: var(--muted); font-variant-numeric: tabular-nums; }
table.grid .name { min-width: 190px; max-width: 260px; }
table.grid .act { white-space: nowrap; }
table.grid td.clip { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-btn { display: block; max-width: 100%; border: 0; background: none; padding: 0; font: 600 14px var(--font); color: var(--ink); cursor: pointer;
            text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-btn:hover { color: var(--red); text-decoration: underline; }
.dash { color: #c0b9ad; }
.sub { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.sub.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.sub.bad { color: var(--red); }
.sub.good { color: var(--ok); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid transparent;
        font: 600 13px/1.2 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s; }
.pill svg { width: 15px; height: 15px; }
.pill.intim { background: var(--red-100); border-color: #f5bdb8; color: #9c0f0f; }
.pill.intim:hover { background: #f8c9c4; border-color: #ec9d96; }
.pill.intim.sent { background: var(--red-50); }
.pill.ok { background: var(--ok-100); border-color: #a9dcbc; color: #14552f; cursor: default; }
.pill.warn { background: var(--amber-50); border-color: var(--amber-100); color: #7a4204; }
.pill.warn:hover { background: var(--amber-100); }
.pill.doc { background: #fff; border-color: var(--line-2); color: var(--ink); }
.pill.doc:hover { border-color: var(--ink); }
.pill.flat { padding: 3px 10px; font-size: 12px; cursor: default; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); display: grid; gap: 4px; }
.empty b { font: 600 17px var(--display); color: var(--ink); }
.table-foot { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.group-title { margin: 20px 0 10px; font: 600 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.group-title .hint { text-transform: none; letter-spacing: 0; margin-left: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.span2 { grid-column: span 2; }
dialog .field input, dialog .field textarea, dialog .field select { padding: 10px 12px; }
.tally { display: flex; gap: 10px; margin: 6px 0 16px; }
.tally span { flex: 1; display: flex; flex-direction: column; padding: 12px 14px; background: #f8f6f2; border-radius: 12px; font-size: 13px; color: var(--muted); }
.tally b { font: 600 24px/1.1 var(--display); color: var(--ink); }
.tally .good b { color: var(--ok); }
.tally .bad b { color: var(--red); }
.progress { height: 8px; border-radius: 99px; background: #ebe7df; overflow: hidden; margin: 14px 0 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s; }
dialog.drawer { margin: 0 0 0 auto; padding: 0; width: min(600px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: 20px 0 0 20px;
                overflow: hidden; }
dialog.drawer[open] { display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0 0 4px; overflow-wrap: anywhere; }
.drawer-head p { margin: 0; }
.drawer-body { padding: 4px 24px 28px; overflow-y: auto; flex: 1; }
.drawer-body h3 { font: 600 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin: 26px 0 10px; }
.drawer-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.kv { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.kv div { padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.kv div.wide { grid-column: span 2; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 1px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.copy { display: flex; gap: 8px; }
.copy input { font-size: 13px; padding: 9px 12px; }
.trail { list-style: none; margin: 0 0 14px; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.trail li { position: relative; font-size: 14px; }
.trail li::before { content: ""; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); }
.trail li.signed::before { background: var(--ok); border-color: var(--ok); }
.trail li.invite_sent::before { background: var(--red); border-color: var(--red); }
.trail li.issue_reported::before, .trail li.invite_failed::before, .trail li.otp_failed::before, .trail li.hr_email_failed::before { background: var(--amber); border-color: var(--amber); }
.trail .when { display: block; font-size: 12px; color: var(--muted); }
.trail b { font-weight: 600; overflow-wrap: anywhere; }
.trail .meta { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; white-space: normal; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 20px;
         border-radius: 12px; font-weight: 500; font-size: 14px; box-shadow: 0 14px 40px -12px rgba(20, 19, 16, .5); max-width: calc(100vw - 32px); }
.toast.bad { background: #8f1010; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { padding: 30px 24px; }
  .auth-aside h1 { font-size: 23px; }
  .ticks { display: none; }
  .aside-lead { margin-bottom: 0; }
  .auth-main { padding: 30px 24px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top-row { min-height: 64px; }
  .brand img { height: 32px; }
  .brand-sep, .brand-sub { display: none; }
  .chip { max-width: 150px; }
  .band { font-size: 11px; padding: 9px 8px; }
  .band i { margin: 0 3px; }
  main.wrap { padding-top: 20px; }
  .steps { margin-bottom: 22px; }
  .steps .label { display: none; }
  .steps li.current .label { display: inline; }
  .pad { padding: 20px 18px; }
  .details { grid-template-columns: 1fr; }
  .details div.wide { grid-column: auto; }
  .details dd { font-size: 16px; }
  .card-head { flex-wrap: wrap; }
  .card-head > div:not(.zoom) { flex-basis: calc(100% - 50px); }
  .card-head .zoom { margin-left: 48px; }
  .pdf-pages { padding: 8px; height: min(520px, 68vh); }
  .read-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .meter { width: 100%; }
  .actions.split { flex-direction: column-reverse; align-items: stretch; }
  .actions.split .btn, .actions .btn { width: 100%; }
  .actions.split .link-btn { justify-content: center; }
  .tabs { display: flex; }
  .tabs button { flex: 1; justify-content: center; padding: 10px 8px; }
  .sig-pad { height: 190px; }
  .pad-foot .hint { display: none; }
  .pad-foot { justify-content: flex-end; }
  .otp input { width: 56px; height: 62px; }
  .otp.six input { width: 42px; height: 54px; font-size: 22px; }
  dialog { padding: 24px 20px; }
  .dlg-btns { flex-direction: column-reverse; }
  .dlg-btns .btn { width: 100%; }
  .auth-aside::after { width: 190px; height: 200px; right: -50px; bottom: -70px; opacity: .1; }
  .drop.picked { flex-direction: column; }
  .done-card { padding: 40px 20px 28px; }
  .receipt { grid-template-columns: 1fr; }
  .receipt div:nth-child(odd) { border-right: 0; }
  .receipt div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .grid2, .grid3, .kv { grid-template-columns: 1fr; }
  .span2, .kv div.wide { grid-column: auto; }
  .hr-actions, .hr-actions .btn { width: 100%; }
  dialog.drawer { border-radius: 0; }
  .drawer-head, .drawer-body { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; }
  .tick circle, .tick path { stroke-dashoffset: 0; } }
