:root{--bg:#f5f7fb;--card:#fff;--ink:#14213d;--muted:#6b7280;--line:#e5e9f2;--primary:#2459d3;--primary2:#1746b0;--green:#138a56;--orange:#b96912;--red:#b42318;--shadow:0 12px 35px rgba(18,31,58,.07)}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.45}.topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 max(22px,calc((100vw - 1180px)/2));position:sticky;top:0;z-index:10}.brand{display:flex;gap:11px;align-items:center;text-decoration:none;color:var(--ink)}.brandmark{width:40px;height:40px;border-radius:11px;background:var(--ink);color:#fff;display:grid;place-items:center;font-weight:900;font-size:21px}.brand strong,.brand small{display:block}.brand small{color:var(--muted);font-size:12px}.topbar nav{display:flex;gap:18px}.topbar nav a{color:var(--ink);text-decoration:none;font-size:14px}.shell{max-width:1180px;margin:0 auto;padding:34px 22px 70px}.card,.subcard{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.card{padding:26px}.subcard{padding:20px;box-shadow:none}.hero{display:grid;grid-template-columns:1.4fr .8fr;gap:34px;align-items:center;padding:42px}.hero h1,.pagehead h1,.loginwrap h1,.qrshare h1{font-size:clamp(32px,5vw,54px);line-height:1.04;margin:6px 0 15px}.lead{font-size:18px;max-width:680px;color:#44506a}.heroaction{display:flex;flex-direction:column;align-items:stretch;gap:10px;text-align:center}.heroaction small,.hint,.legalhint,.muted{color:var(--muted)}.eyebrow{font-size:12px;letter-spacing:.14em;font-weight:800;color:#63708b;margin:0 0 4px}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:20px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.compact{gap:12px;margin-top:0}.narrow{max-width:760px;margin:0 auto}.pagehead,.cardhead,.listrow{display:flex;justify-content:space-between;align-items:center;gap:18px}.pagehead{margin-bottom:22px}.pagehead h1{font-size:38px;margin:2px 0 2px}.pagehead p{margin:0;color:var(--muted)}h2{font-size:22px;margin:5px 0 12px}h3{margin:0 0 8px}.btn{appearance:none;border:1px solid #ccd4e3;background:#fff;color:var(--ink);padding:10px 15px;border-radius:11px;text-decoration:none;font:inherit;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.btn:hover{background:#f7f9fc}.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}.btn.primary:hover{background:var(--primary2)}.btn.huge{padding:15px 20px;font-size:17px}.btn.full{width:100%}.btn.small{padding:7px 10px;font-size:13px}.actions{display:flex;gap:9px;flex-wrap:wrap}.formstack{display:flex;flex-direction:column;gap:16px}label{display:flex;flex-direction:column;gap:7px;font-weight:700;font-size:14px}input,select{width:100%;border:1px solid #cfd7e5;background:#fff;border-radius:10px;padding:12px 13px;font:inherit;color:var(--ink);outline:none}input:focus,select:focus{border-color:#6e91e7;box-shadow:0 0 0 3px rgba(36,89,211,.11)}.firsttime{border:1px dashed #c8d3e6;background:#f8faff;border-radius:13px;padding:15px}.firsttime>div:first-child{display:flex;flex-direction:column}.firsttime span{font-size:13px;color:var(--muted)}#pad{width:100%;height:220px;border:2px dashed #cbd4e4;border-radius:14px;background:#fff;touch-action:none;display:block}.sigactions{margin-top:9px;display:flex;justify-content:flex-end}.notice{border-radius:13px;padding:14px 16px;margin-bottom:16px;border:1px solid}.notice.good{background:#effaf5;border-color:#b8e7d2;color:#106b45}.notice.warn{background:#fff7e8;border-color:#f3d299;color:#8d520d}.statusline{display:inline-flex;align-items:center;gap:8px;margin-top:10px;font-weight:750;font-size:14px}.statusline span{width:10px;height:10px;border-radius:50%;background:currentColor}.statusline.good{color:var(--green)}.statusline.warn{color:var(--orange)}.statusline.off{color:#7b8496}.pill,.badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:800;white-space:nowrap}.pill{background:#edf2ff;color:#315bbb}.badge.ok{background:#e8f7ef;color:#137148}.badge.late{background:#fff2dc;color:#9b5c0d}.badge.off{background:#edf0f5;color:#697386}.centered{text-align:center}.bigicon{font-size:45px}.schedulebox{display:grid;gap:10px;text-align:left;margin:22px 0}.schedulebox>div{display:flex;justify-content:space-between;gap:15px;padding:12px;background:#f7f9fc;border-radius:10px}.schedulebox span{color:var(--muted)}.tablewrap{overflow:auto;border-radius:12px;border:1px solid var(--line)}table{border-collapse:collapse;width:100%;min-width:700px;background:#fff}th,td{text-align:left;padding:12px 13px;border-bottom:1px solid var(--line);vertical-align:middle}th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#667085;background:#fafbfc}tr:last-child td{border-bottom:0}.loginwrap{max-width:480px;margin:30px auto}.demobox{font-size:13px;background:#f7f9fc;border-radius:11px;padding:13px;color:#59647a}.qrshare{text-align:center;max-width:760px;margin:0 auto;padding:38px}.qrshare img{width:min(390px,82vw);height:auto}.qrshare .statusline{font-size:18px;margin:15px 0}.qrurl{font-size:12px;word-break:break-all;color:var(--muted)}.qrgrid{margin-bottom:20px}.statgrid{margin-bottom:20px}.statgrid .card{display:flex;flex-direction:column}.statgrid span,.statgrid small{color:var(--muted)}.statgrid strong{font-size:34px;margin:5px 0}.list{display:flex;flex-direction:column}.listrow{padding:12px 0;border-bottom:1px solid var(--line)}.listrow:last-child{border-bottom:0}.flashstack{display:grid;gap:8px;margin-bottom:18px}.flash{padding:12px 14px;border-radius:11px;border:1px solid}.flash.success{background:#eaf8f1;border-color:#bce7d2;color:#126d48}.flash.error{background:#fff0ef;border-color:#f0c0bc;color:#9f251b}footer{text-align:center;color:#8b95a8;font-size:12px;padding:0 20px 35px}
@media(max-width:800px){.topbar{padding:0 14px;height:64px}.topbar nav a:not(:last-child){display:none}.brandmark{width:36px;height:36px}.shell{padding:22px 14px 55px}.hero{grid-template-columns:1fr;padding:25px}.grid2,.grid3{grid-template-columns:1fr}.pagehead,.cardhead{align-items:flex-start;flex-direction:column}.card{padding:19px}.schedulebox>div{flex-direction:column;gap:2px}.qrshare{padding:22px}.actions{width:100%}.actions .btn{flex:1}.pagehead h1{font-size:32px}}

/* V3 */
.dashboard>section{margin-bottom:22px}.dashboard>section:last-child{margin-bottom:0}.btn.danger{border-color:#e6b7b3;color:var(--red);background:#fff}.btn.danger:hover{background:#fff3f2}.tuto-fab{position:fixed;right:24px;bottom:24px;z-index:20;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;background:var(--ink);color:#fff;font-weight:900;letter-spacing:.06em;border-radius:999px;padding:13px 18px;box-shadow:0 10px 28px rgba(18,31,58,.22)}.tuto-fab:hover{transform:translateY(-1px)}.tutorial-page{display:grid;gap:20px}.tutorial-page .pagehead{margin-bottom:0}.tutorial-intro p:last-child,.tutorial-steps p:last-child{margin-bottom:0}.tutorial-steps ol,.tutorial-steps ul{padding-left:22px}.tutorial-steps li{margin:9px 0}.tutorial-bottom-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.inline-setting{display:flex;align-items:flex-end;gap:12px;max-width:520px}.inline-setting label{flex:1}.attendance-self-grid{margin-top:14px}.self-status{margin-top:10px}.self-help{margin:14px 0 0}.identity-summary{display:flex;flex-direction:column;gap:3px;border:1px solid var(--line);background:#f8faff;border-radius:13px;padding:15px}.identity-summary span,.identity-summary small{color:var(--muted)}
@media(max-width:800px){.tuto-fab{right:14px;bottom:14px;padding:11px 15px}.inline-setting{align-items:stretch;flex-direction:column}.tutorial-bottom-actions .btn{flex:1}.dashboard>section{margin-bottom:18px}}
@media print{.topbar,footer,.tuto-fab,.tutorial-bottom-actions,.tutorial-page .pagehead button{display:none!important}.shell{max-width:none;padding:0}.card{box-shadow:none;break-inside:avoid}.tutorial-page{gap:12px}}

/* V4 */
textarea{width:100%;border:1px solid #cfd7e5;background:#fff;border-radius:10px;padding:12px 13px;font:inherit;color:var(--ink);outline:none;resize:vertical;min-height:100px}textarea:focus{border-color:#6e91e7;box-shadow:0 0 0 3px rgba(36,89,211,.11)}
.qr-image-wrap{display:flex;justify-content:center;align-items:center;width:100%}.qr-status-wrap{display:flex;justify-content:center;align-items:center;width:100%}.qrshare .statusline{margin:14px auto;justify-content:center}.qr-hours{text-align:center;margin-top:22px}
.badge.manual{background:#edf2ff;color:#315bbb}.attendance-cell-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.smalltext{font-size:12px;margin-top:4px}
.history-mobile{display:none}.history-reason{font-size:12px;color:var(--muted);margin-top:5px;max-width:360px}.history-card{border:1px solid var(--line);border-radius:14px;padding:15px;background:#fff}.history-card+.history-card{margin-top:12px}.history-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.history-card dl{margin:0;display:grid;gap:9px}.history-card dl>div{display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px}.history-card dt{color:var(--muted);font-size:13px}.history-card dd{margin:0;font-weight:650;overflow-wrap:anywhere}
.legal-content h2{margin-top:28px}.legal-content h2:first-child{margin-top:4px}.legal-content a,.legalhint a{color:var(--primary)}.legal-admin h3{margin-top:10px}.footer-links{display:inline-flex;gap:14px;margin-left:16px}.footer-links a{color:inherit;text-decoration:none}.footer-links a:hover{text-decoration:underline}
footer{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap}

@media(max-width:800px){
  .history-desktop{display:none}.history-mobile{display:block}.history-card dl>div{grid-template-columns:96px minmax(0,1fr)}
  .qrshare h1{font-size:clamp(32px,10vw,48px)}.qrshare img{width:min(340px,88vw)}
  .attendance-cell-actions{align-items:stretch;flex-direction:column}.attendance-cell-actions .btn{width:100%}
  .footer-links{margin-left:0;width:100%;justify-content:center}
}
