/* IPSCOM Joining Checklist: Microsoft 365 (Fluent) style shared by the HR app and the joinee form */
:root{
  --bg:#f5f5f5; --surface:#ffffff; --surface2:#fafafa; --fg:#242424; --fg2:#424242; --muted:#616161; --line:#e0e0e0; --line2:#d1d1d1;
  --brand:#0f6cbd; --brand-hover:#115ea3; --brand-soft:#ebf3fc; --on-brand:#ffffff; --appbar:#0f548c;
  --ok:#0e700e; --ok-soft:#f1faf1; --warn:#bc4b09; --warn-soft:#fff9f5; --bad:#c50f1f; --bad-soft:#fdf3f4; --info-soft:#ebf3fc;
  --paper:#ffffff; --shadow:0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.14);
  --font:"Segoe UI Variable Text","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",Arial,sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root{
  --bg:#1f1f1f; --surface:#292929; --surface2:#2e2e2e; --fg:#ffffff; --fg2:#d6d6d6; --muted:#adadad; --line:#3d3d3d; --line2:#525252;
  --brand:#479ef5; --brand-hover:#62abf5; --brand-soft:#0e2a47; --on-brand:#0a1a2c; --appbar:#0c3b5e;
  --ok:#54b054; --ok-soft:#052505; --warn:#f98845; --warn-soft:#411200; --bad:#f1707b; --bad-soft:#3b0509; --info-soft:#0e2a47;
  --shadow:0 0 2px rgba(0,0,0,.4),0 2px 4px rgba(0,0,0,.5); color-scheme:dark}}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--fg);font:14px/20px var(--font)}
[hidden]{display:none!important}

.appbar{background:var(--appbar);color:#fff;display:flex;align-items:center;gap:12px;min-height:48px;padding:6px 16px;flex-wrap:wrap}
.logo{width:28px;height:28px;border-radius:4px;background:#fff;color:#0f548c;display:grid;place-items:center;font:700 12px var(--font);flex:none}
.appname{font-weight:600;font-size:15px}
.appsub{opacity:.85;font-size:13px}
.appbar .sep{width:1px;height:20px;background:rgba(255,255,255,.35)}
.appright{margin-left:auto;display:flex;align-items:center;gap:12px;font-size:12px;line-height:16px;text-align:right}
.appright .meta{opacity:.85}
.appright button{background:transparent;color:#fff;border-color:rgba(255,255,255,.5)}
.appright button:hover{background:rgba(255,255,255,.12);border-color:#fff}

.shell{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:calc(100vh - 48px)}
.shell.norail{grid-template-columns:minmax(0,1fr)}
.rail{background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0}
.railhead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 12px 6px 16px}
.railhead h2{font-size:16px;font-weight:600;margin:0}
.railfilter{padding:6px 12px 8px 16px}
main{min-width:0;padding:0 16px 32px}
.inner{max-width:1080px;margin:0 auto;display:grid;gap:16px}
@media (max-width:800px){
  .shell{grid-template-columns:minmax(0,1fr)}
  .rail{border-right:0;border-bottom:1px solid var(--line)}
  body.form-open .rail{display:none}
  body:not(.form-open) #main-empty{display:none}
  .appright .meta{display:none}
}

.cmdbar{position:sticky;top:0;z-index:4;background:var(--bg);display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}
.cmdbar .title{font-size:20px;line-height:28px;font-weight:600;margin-right:auto;min-width:0}
.btns{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

button{font:600 14px/20px var(--font);border-radius:4px;padding:5px 12px;min-height:32px;cursor:pointer;border:1px solid var(--line2);background:var(--surface);color:var(--fg)}
button:hover{background:var(--surface2);border-color:var(--muted)}
button.primary{background:var(--brand);border-color:transparent;color:var(--on-brand)}
button.primary:hover{background:var(--brand-hover)}
button.danger{color:var(--bad)}
button.subtle{border-color:transparent;background:transparent}
button.subtle:hover{background:var(--surface2)}
button.big{min-height:40px;padding:8px 20px;font-size:15px}
button:disabled{opacity:.45;cursor:not-allowed}
:focus-visible{outline:2px solid var(--fg);outline-offset:1px}

.notice{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--line);border-radius:4px;padding:8px 12px;background:var(--info-soft);font-size:14px}
.notice::before{content:"i";flex:none;width:16px;height:16px;margin-top:2px;border-radius:50%;background:var(--brand);color:var(--on-brand);font:700 11px/16px var(--font);text-align:center}
.notice.warn{background:var(--warn-soft)} .notice.warn::before{content:"!";background:var(--warn)}
.notice.bad{background:var(--bad-soft)} .notice.bad::before{content:"!";background:var(--bad)}
.notice.ok{background:var(--ok-soft)} .notice.ok::before{content:"\2713";background:var(--ok)}
.notice b{font-weight:600}

.card{background:var(--surface);border-radius:8px;box-shadow:var(--shadow);padding:16px 20px 20px;min-width:0}
.card h2{font-size:16px;line-height:22px;font-weight:600;margin:0 0 14px}
.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px 20px}
label.f{display:grid;gap:4px;font-size:14px;font-weight:600;color:var(--fg2)}
.req{color:var(--bad)}
input[type=text],input[type=tel],input[type=date],input[type=search],textarea{font:400 14px/20px var(--font);color:var(--fg);background:var(--surface);border:1px solid var(--line2);border-bottom-color:var(--muted);border-radius:4px;padding:5px 10px;min-height:32px;width:100%}
input:focus,textarea:focus{outline:none;border-bottom:2px solid var(--brand);padding-bottom:4px}
input:disabled,textarea:disabled{color:var(--fg);background:var(--surface2);border-color:var(--line)}
input[type=checkbox]{width:18px;height:18px;accent-color:var(--brand);cursor:pointer;margin:0}
input[type=checkbox]:disabled{cursor:default}

.progress{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 16px;align-items:center}
.count{font-weight:600;font-variant-numeric:tabular-nums}
.bar{height:4px;background:var(--line);border-radius:2px;overflow:hidden}
.bar i{display:block;height:100%;width:0;background:var(--brand);transition:width .25s}

.table{overflow-x:auto;margin:0 -20px;padding:0 20px}
table{width:100%;border-collapse:collapse;min-width:640px}
table.hr{min-width:860px}
th{font-weight:600;font-size:13px;color:var(--fg2);text-align:left;padding:8px;border-bottom:1px solid var(--line2);white-space:nowrap}
th.hrcol{color:var(--brand)}
th.c,td.c{text-align:center;width:72px}
td{padding:10px 8px;border-bottom:1px solid var(--line);vertical-align:top}
tbody tr:hover td{background:var(--surface2)}
td.hrcell,tbody tr:hover td.hrcell{background:var(--brand-soft)}
tr.done td.no{box-shadow:inset 3px 0 0 var(--ok)}
.no{color:var(--muted);width:30px;font-variant-numeric:tabular-nums}
.doc{font-weight:600}
.hint{font-size:13px;color:var(--muted);line-height:18px}
.opt{display:inline-block;font-size:11px;font-weight:600;line-height:16px;color:var(--warn);background:var(--warn-soft);border-radius:4px;padding:0 6px;margin-left:6px;vertical-align:1px}
td textarea{min-height:32px;resize:vertical;font-size:13px}
/* joinee table on phones: each document becomes a stacked row so the tick boxes stay visible */
@media (max-width:640px){
  table:not(.hr){min-width:0}
  table:not(.hr) thead{display:none}
  table:not(.hr) tr{display:grid;grid-template-columns:28px 1fr 1fr;gap:8px 10px;padding:12px 0;border-bottom:1px solid var(--line)}
  table:not(.hr) td{border:0;padding:0}
  table:not(.hr) tbody tr:hover td{background:none}
  table:not(.hr) td:nth-child(2){grid-column:2/4}
  table:not(.hr) td.c{grid-row:2;width:auto;text-align:left;display:flex;align-items:center;gap:8px;font-size:14px}
  table:not(.hr) td:nth-child(3){grid-column:2}
  table:not(.hr) td:nth-child(4){grid-column:3}
  table:not(.hr) td:nth-child(3)::after{content:"Soft copy"}
  table:not(.hr) td:nth-child(4)::after{content:"Hard copy"}
  table:not(.hr) td:nth-child(5){grid-column:2/4}
  table:not(.hr) td:nth-child(5) textarea::placeholder{color:var(--muted)}
}

.sign{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}
.sigbox{border:1px solid var(--line);border-radius:8px;padding:16px;display:grid;gap:12px;align-content:start;background:var(--surface2)}
.sigbox h3{font-size:14px;font-weight:600;margin:0}
.pad{position:relative;user-select:none;-webkit-user-select:none;background:var(--paper);border:1px solid var(--line2);border-radius:4px;aspect-ratio:16/5;max-width:100%;touch-action:none}
.pad canvas{position:absolute;inset:0;width:100%;height:100%;cursor:crosshair}
.pad img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.pad .line{position:absolute;left:8%;right:8%;bottom:22%;border-bottom:1px dashed #9e9e9e;pointer-events:none}
.pad .ph{position:absolute;left:8%;bottom:6%;font-size:12px;color:#757575;pointer-events:none}
.stamp{font-size:12px;color:var(--muted)}
.decl{display:flex;gap:8px;align-items:flex-start;font-size:14px}
.decl input{flex:none;margin-top:1px}

.list{display:grid;padding:0 8px 12px}
.lrow{display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:2px 10px;align-items:center;padding:8px;border:0;border-radius:4px;cursor:pointer;text-align:left;background:none;font-weight:400;width:100%;min-height:auto}
.lrow:hover{background:var(--surface2)}
.lrow[aria-current=true]{background:var(--brand-soft)}
.avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:600;background:var(--brand-soft);color:var(--brand);grid-row:span 2}
.lrow .nm{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lrow .sub{font-size:12px;color:var(--muted);grid-column:2/4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chip{font-size:11px;font-weight:600;line-height:16px;padding:1px 6px;border-radius:4px;white-space:nowrap}
.chip.invited{color:var(--fg2);background:var(--surface2);border:1px solid var(--line)}
.chip.awaiting{color:var(--warn);background:var(--warn-soft)}
.chip.reopened{color:var(--bad);background:var(--bad-soft)}
.chip.completed{color:var(--ok);background:var(--ok-soft)}
.empty{color:var(--muted);font-size:14px;padding:8px}
.main-empty{text-align:center;color:var(--muted);padding:64px 16px;display:grid;gap:8px;justify-items:center}
.main-empty b{color:var(--fg);font-size:16px}
footer{font-size:12px;color:var(--muted);text-align:center;padding-top:8px}

dialog{border:0;border-radius:8px;box-shadow:0 0 2px rgba(0,0,0,.12),0 32px 64px rgba(0,0,0,.24);background:var(--surface);color:var(--fg);padding:24px;width:min(560px,calc(100vw - 32px));max-height:calc(100vh - 32px)}
dialog::backdrop{background:rgba(0,0,0,.4)}
dialog h2{font-size:20px;line-height:28px;font-weight:600;margin:0 0 4px}
dialog p{margin:0 0 16px;color:var(--fg2)}
dialog .btns{justify-content:flex-end;margin-top:20px}
.qr{display:grid;place-items:center;background:#fff;border-radius:8px;padding:12px;margin:0 auto 12px;width:max-content;max-width:100%}
.qr svg{display:block;width:220px;height:220px;max-width:100%}
.linkbox{font:12px/18px Consolas,"Cascadia Mono",monospace;background:var(--surface2);border:1px solid var(--line);border-radius:4px;padding:8px;word-break:break-all;user-select:all}

.toast{position:fixed;right:20px;bottom:20px;background:var(--surface);color:var(--fg);box-shadow:0 0 2px rgba(0,0,0,.12),0 8px 16px rgba(0,0,0,.14);border-left:4px solid var(--brand);padding:10px 16px;border-radius:4px;font-size:14px;z-index:20;max-width:calc(100vw - 40px)}
.toast.bad{border-left-color:var(--bad)}
.timerbar{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;font-weight:600;color:var(--fg2);padding:0 4px}
.timerbar #saved{font-weight:400;color:var(--muted)}
.timerbar.late #timer{color:var(--bad)}
.center{max-width:560px;margin:48px auto;text-align:center;display:grid;gap:12px;justify-items:center}
.center .big-icon{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;font-size:28px;font-weight:700;background:var(--ok-soft);color:var(--ok)}
.center .big-icon.bad{background:var(--bad-soft);color:var(--bad)}
.center h1{font-size:24px;line-height:32px;margin:0}
@media (prefers-reduced-motion:reduce){.bar i{transition:none}}
