:root{--bg:#f4f7fb;--panel:#fff;--ink:#172033;--muted:#667085;--line:#dbe2ea;--blue:#2256d8;--blue2:#143da3;--soft:#eef4ff;--danger:#b42318;--green:#067647}
*{box-sizing:border-box}html,body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--bg);font-size:13px}button,input,select{font:inherit}.hidden{display:none!important}.app-bg{min-height:100vh;background:radial-gradient(circle at 15% 15%,#e9f0ff 0,transparent 35%),#f4f7fb}
.auth-shell{width:min(1080px,94vw);min-height:100vh;margin:auto;display:grid;grid-template-columns:.9fr 1.1fr;gap:48px;align-items:center}.brand-panel{display:flex;gap:18px;align-items:center}.brand-panel h1{font-size:40px;margin:0;letter-spacing:-1.5px}.brand-panel p{color:var(--muted);font-size:15px;margin:4px 0}.brand-mark{width:58px;height:58px;border-radius:18px;background:linear-gradient(145deg,var(--blue),#6f8df0);display:grid;place-items:center;color:white;font-weight:800;font-size:26px;box-shadow:0 16px 40px #2256d833}.brand-mark.small{width:42px;height:42px;border-radius:13px;font-size:19px}.brand-mark.mini{width:28px;height:28px;border-radius:9px;font-size:13px;box-shadow:none}
.auth-card,.join-card,.modal-card{background:var(--panel);border:1px solid #e4e9f0;border-radius:18px;box-shadow:0 18px 60px #263a5a14}.auth-card{padding:32px}.auth-card h2,.join-card h2{font-size:23px;margin:7px 0 8px}.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:10px;font-weight:800;color:var(--blue)}.muted{color:var(--muted);line-height:1.5}.note{padding:10px;border-radius:9px;background:#fff7ed;color:#9a3412}
label{display:block;font-size:11px;font-weight:700;color:#475467;margin:16px 0 6px}input,select{width:100%;border:1px solid #ccd5e0;border-radius:8px;background:#fff;padding:9px 10px;outline:none;color:var(--ink)}input:focus,select:focus{border-color:#7799ef;box-shadow:0 0 0 3px #2256d812}.btn{border:1px solid #cfd7e3;border-radius:8px;background:white;color:#344054;padding:8px 11px;font-weight:700;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px}.btn:hover{background:#f8fafc}.btn.primary{background:var(--blue);border-color:var(--blue);color:white}.btn.primary:hover{background:var(--blue2)}.btn.danger{border-color:#f1b4b0;color:var(--danger);background:#fff}.btn.ghost{background:#fff}.auth-card form .btn{width:100%;margin-top:17px;padding:10px}.msg{min-height:18px;margin-top:12px;font-size:12px}.msg.bad{color:var(--danger)}.msg.good{color:var(--green)}
.dash-title,.create-line,.doc-card,.doc-actions{display:flex;align-items:center}.dash-title{justify-content:space-between}.create-line{gap:8px;margin:18px 0}.docs-list{display:grid;gap:8px;max-height:54vh;overflow:auto}.doc-card{justify-content:space-between;border:1px solid var(--line);border-radius:10px;padding:11px 12px}.doc-card>div:first-child{display:grid;gap:3px}.doc-card span{color:var(--muted);font-size:11px}.doc-actions{gap:6px}.empty{padding:24px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:10px}
.sheet-body{overflow:hidden}.topbar{height:178px;background:#f9fbfe;border-bottom:1px solid var(--line);display:flex;flex-direction:column}.topline{height:54px;display:flex;align-items:center;padding:0 12px;gap:18px;border-bottom:1px solid #e8edf3;background:white}.brand-inline{display:flex;align-items:center;gap:7px;font-weight:800;color:var(--ink);text-decoration:none}.doc-title{display:flex;align-items:baseline;gap:9px;min-width:0}.doc-title strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:360px}.doc-title span{font-size:10px;color:var(--green)}.doc-title span.bad{color:var(--danger)}.actions{margin-left:auto;display:flex;gap:6px}.topline .btn{padding:6px 9px;font-size:11px}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:8px 12px}.kpi{min-width:0;border:1px solid #e0e7ef;border-radius:10px;background:white;padding:7px 10px;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:1px 10px}.kpi span{grid-row:1/3;color:#475467;font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.04em}.kpi strong{font-size:14px;text-align:right;white-space:nowrap}.kpi small{font-size:10px;color:var(--muted);text-align:right}
.filters{height:52px;display:flex;align-items:end;gap:8px;padding:0 12px 8px}.filters label{margin:0;width:150px}.filters label.search{width:min(330px,28vw)}.filters label{font-size:9px}.filters select,.filters input{height:29px;padding:5px 7px;font-size:11px;border-radius:6px}.filter-actor{font-size:10px;color:var(--muted);margin:0 0 7px 4px}
.grid-wrap{height:calc(100vh - 203px);overflow:auto;background:white}.grid{width:max-content;min-width:100%}.grid table{border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:11px}.grid th,.grid td{border-right:1px solid #e1e6ed;border-bottom:1px solid #e1e6ed;padding:0;overflow:hidden;vertical-align:middle;background:#fff}.grid thead th{position:sticky;top:0;z-index:6;background:#eef2f7;color:#344054;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.02em;height:38px}.grid .rownum{position:sticky;left:0;z-index:5;width:42px;min-width:42px;max-width:42px;text-align:center;background:#f6f8fb;color:#667085}.grid thead .rownum{z-index:8}.th-inner{height:38px;display:flex;align-items:center;gap:4px;padding:4px 9px;position:relative}.th-inner>span{overflow:hidden;text-overflow:ellipsis;line-height:1.15}.fx{margin-left:auto;font-size:8px;color:#2256d8;background:#dfe9ff;border-radius:4px;padding:1px 3px}.col-menu{border:0;background:transparent;cursor:pointer;color:#667085;padding:1px 3px}.col-resize{position:absolute;right:-3px;top:0;width:7px;height:100%;cursor:col-resize;z-index:9}.row-resize{position:absolute;left:0;bottom:-3px;height:7px;width:100%;cursor:row-resize}.grid tbody .rownum{position:sticky}.cell-input{width:100%;height:100%;min-height:29px;padding:6px 7px;border:0;border-radius:0;background:transparent;outline:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cell-input:focus{box-shadow:inset 0 0 0 2px #5b7fea;background:#f8fbff}.cell-input.calculated{background:#f7f9fc;color:#475467}.grid select.cell-input{appearance:none;font-size:10px}.row-actions-head,.row-actions{width:34px;min-width:34px;max-width:34px}.row-actions button{border:0;background:transparent;color:#98a2b3;cursor:pointer;width:100%;height:100%}.row-actions button:hover{color:var(--danger);background:#fff1f0}
.statusbar{height:25px;display:flex;align-items:center;gap:18px;padding:0 12px;background:#f8fafc;border-top:1px solid var(--line);font-size:10px;color:#667085}.statusbar span:nth-child(3){margin-left:auto}
.join-overlay{position:fixed;inset:0;z-index:100;background:#edf2f8;display:grid;place-items:center}.join-card{width:min(430px,92vw);padding:28px}.join-card .btn{width:100%;margin-top:14px}
.modal{position:fixed;inset:0;background:#10182866;z-index:200;display:grid;place-items:center}.modal-card{width:min(620px,92vw);max-height:82vh;overflow:auto;padding:18px}.modal-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:10px}.modal-head h3{margin:0;font-size:16px}.modal-head button{border:0;background:transparent;font-size:24px;color:#667085;cursor:pointer}.copybox{display:flex;gap:8px}.copybox input{margin:0}.history{display:grid;margin-top:8px}.history>div{display:grid;grid-template-columns:110px 1fr 145px;gap:8px;padding:8px 2px;border-bottom:1px solid #eef1f5}.history small{color:var(--muted);text-align:right}
@media(max-width:800px){.auth-shell{grid-template-columns:1fr}.brand-panel{display:none}.topbar{height:auto}.kpis{grid-template-columns:1fr 1fr}.filters{overflow-x:auto}.actions .btn{padding:5px}.brand-inline span:last-child{display:none}.grid-wrap{height:calc(100vh - 230px)}}