:root{
  --bg:#f3f6f9;--panel:#fff;--panel2:#f8fafc;--line:#d9e1e8;--text:#17212b;--muted:#667788;
  --brand:#17385d;--brand2:#245984;--accent:#2b6f9f;--ok:#2f7d4a;--warn:#a86b14;--danger:#a13b3b;
  --shadow:0 10px 30px rgba(20,40,60,.08);--r:14px;--r2:10px;
}
*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell{display:grid;grid-template-columns:248px 1fr;min-height:100vh}.sidebar{background:#102b49;color:#eaf2f8;padding:18px 14px;position:sticky;top:0;height:100vh}.brand{display:flex;gap:11px;align-items:center;padding:5px 8px 20px}.brand-mark{width:38px;height:38px;border-radius:10px;background:#fff;color:var(--brand);display:grid;place-items:center;font-weight:800;font-size:20px}.brand-title{font-weight:760;font-size:15px;line-height:1.1}.brand-sub{font-size:11px;color:#a9c0d3;margin-top:3px}.nav-section{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:#7fa2bd;padding:17px 10px 8px}.nav-item{display:flex;align-items:center;gap:10px;color:#cfe0ec;padding:10px 11px;border-radius:9px;margin:2px 0;text-decoration:none}.nav-item:hover,.nav-item.active{background:#1a446c;color:#fff}.nav-icon{width:20px;text-align:center}.side-footer{position:absolute;left:14px;right:14px;bottom:15px;border-top:1px solid rgba(255,255,255,.12);padding-top:13px;color:#9bb3c6;font-size:11px}.content{min-width:0}.topbar{height:66px;background:rgba(255,255,255,.93);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:8;backdrop-filter:blur(8px)}.top-title{font-weight:700;font-size:17px}.top-actions{display:flex;align-items:center;gap:9px}.user-pill{padding:7px 11px;background:#eef3f7;border-radius:999px;color:#456070;font-size:12px}.main{padding:26px 30px 50px;max-width:1500px;margin:auto}.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:21px}.page-head h1{font-size:24px;margin:0 0 6px;letter-spacing:-.02em}.page-head p{margin:0;color:var(--muted);max-width:780px}.btn{border:1px solid var(--line);background:#fff;color:#26394b;border-radius:9px;padding:9px 13px;font-weight:650;box-shadow:0 1px 2px rgba(0,0,0,.02)}.btn:hover{background:#f7fafc}.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}.btn.primary:hover{background:#214c76}.btn.ghost{background:transparent;box-shadow:none}.btn.danger{border-color:#e1bcbc;color:#923737}.btn.small{padding:6px 9px;font-size:12px}.btn-row{display:flex;gap:8px;flex-wrap:wrap}.grid{display:grid;gap:16px}.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow)}.card-pad{padding:18px}.metric{padding:17px 18px}.metric-label{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.metric-value{font-size:27px;font-weight:760;margin-top:6px}.metric-sub{font-size:12px;color:var(--muted);margin-top:4px}.section-title{font-size:13px;font-weight:760;margin:0 0 13px;display:flex;align-items:center;justify-content:space-between}.series-list{display:grid;gap:12px}.series-card{padding:17px 18px;display:grid;grid-template-columns:1.6fr .85fr .75fr auto;gap:14px;align-items:center}.series-name{font-weight:730;font-size:15px}.series-meta{font-size:12px;color:var(--muted);margin-top:4px}.badge{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:700}.badge.ok{background:#e8f4ec;color:#2a6840}.badge.warn{background:#fff1d8;color:#8b5b13}.badge.info{background:#e7f0f7;color:#315c7e}.badge.muted{background:#eef2f5;color:#667783}.badge.danger{background:#f8e5e5;color:#913c3c}.progress-dots{display:flex;gap:6px;align-items:center}.dot{width:9px;height:9px;border-radius:50%;background:#d7e0e7}.dot.done{background:#3f8a59}.dot.pending{background:#c99a46}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:11px}.table{width:100%;border-collapse:collapse;min-width:650px}.table th,.table td{padding:10px 12px;border-bottom:1px solid #e7edf2;text-align:left;vertical-align:middle}.table th{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#637686;background:#f7f9fb}.table tr:last-child td{border-bottom:0}.table td.num{text-align:right;font-variant-numeric:tabular-nums}.kpi-positive{color:var(--ok);font-weight:700}.kpi-warn{color:var(--warn);font-weight:700}.toolbar{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.search{min-width:250px;border:1px solid var(--line);background:#fff;border-radius:9px;padding:9px 11px}.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:18px}.tab{border:0;background:transparent;padding:10px 12px;color:#617383;font-weight:650;border-bottom:2px solid transparent}.tab.active{color:var(--brand);border-bottom-color:var(--brand)}.series-header{padding:19px 20px}.series-header-line{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.series-title{font-size:20px;font-weight:760}.construction{display:flex;gap:8px;flex-wrap:wrap;margin-top:11px}.chip{background:#f0f4f7;border:1px solid #dde6ed;border-radius:8px;padding:6px 8px;font-size:12px}.ageing-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:9px;margin-top:14px}.age-cell{border:1px solid var(--line);border-radius:10px;padding:11px;text-align:center;background:#fafcfd}.age-cell strong{display:block;font-size:15px}.age-cell span{font-size:11px;color:var(--muted)}.age-cell.done{border-color:#b8d5c2;background:#f2f8f4}.test-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.test-tile{border:1px solid var(--line);border-radius:12px;padding:13px;background:#fff}.test-tile h3{margin:0;font-size:14px}.test-tile .value{font-size:22px;font-weight:750;margin-top:8px}.test-tile .sub{font-size:11px;color:var(--muted);margin-top:3px}.spark{height:65px;margin-top:7px}.svg-chart{width:100%;height:100%;overflow:visible}.chart-card{padding:17px}.chart-box{height:245px}.legend{display:flex;gap:13px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-top:8px}.legend span:before{content:"";display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--brand2);margin-right:5px}.test-head{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:start}.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:11px}.field label{display:block;font-size:11px;color:#627586;margin-bottom:5px;font-weight:650}.field input,.field select,.field textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:8px 9px;background:#fff;color:var(--text)}.field textarea{min-height:86px;resize:vertical}.file-drop{border:1.5px dashed #b7c7d3;border-radius:12px;padding:19px;text-align:center;background:#f9fbfc}.file-drop.drag{background:#eef6fb;border-color:#6c9dbc}.file-list{display:grid;gap:8px;margin-top:12px}.file-item{display:flex;justify-content:space-between;gap:10px;align-items:center;border:1px solid var(--line);border-radius:9px;padding:8px 10px;background:#fff}.file-meta{font-size:11px;color:var(--muted)}.callout{border-left:4px solid var(--brand2);background:#eef5fa;padding:12px 14px;border-radius:8px}.callout.warn{border-left-color:#c58928;background:#fff7e7}.callout.ok{border-left-color:#4f8d62;background:#eff8f2}.interpretation{white-space:pre-wrap;line-height:1.55;color:#293c4b}.status-row{display:flex;gap:8px;flex-wrap:wrap}.chat{display:grid;gap:9px}.bubble{max-width:90%;padding:10px 12px;border-radius:11px;line-height:1.45}.bubble.user{margin-left:auto;background:#e7eff6}.bubble.system{background:#f1f4f6;border:1px solid #dfe6eb}.modal-back{position:fixed;inset:0;background:rgba(13,28,43,.48);display:grid;place-items:center;z-index:30;padding:24px}.modal{background:#fff;border-radius:16px;box-shadow:0 30px 80px rgba(0,0,0,.25);width:min(1050px,96vw);max-height:92vh;overflow:auto}.modal-head{position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);padding:15px 18px;display:flex;justify-content:space-between;z-index:2}.modal-body{padding:18px}.preview-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:16px}.excel-preview{max-height:360px;overflow:auto}.mapping-box{background:#f7fafc;border:1px solid var(--line);border-radius:10px;padding:13px}.empty{padding:38px;text-align:center;color:var(--muted)}.report-sheet{background:#fff;max-width:900px;margin:auto;border:1px solid #ccd7df;box-shadow:var(--shadow);padding:44px 50px;min-height:1050px}.report-head{display:flex;justify-content:space-between;border-bottom:3px solid var(--brand);padding-bottom:17px;margin-bottom:25px}.report-title{font-size:26px;font-weight:800;color:var(--brand)}.report-section{margin:26px 0}.report-section h2{font-size:16px;color:var(--brand);border-bottom:1px solid #dbe3ea;padding-bottom:6px}.note{font-size:11px;color:var(--muted)}.toast{position:fixed;right:24px;bottom:24px;background:#17385d;color:#fff;padding:11px 14px;border-radius:9px;box-shadow:var(--shadow);z-index:50}.prototype-banner{background:#fff5dc;color:#7d5a1b;border-bottom:1px solid #ead4a3;padding:7px 28px;font-size:11px}.hide{display:none!important}.text-right{text-align:right}.muted{color:var(--muted)}.strong{font-weight:740}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mb16{margin-bottom:16px}
@media(max-width:1050px){.app-shell{grid-template-columns:76px 1fr}.brand-title,.brand-sub,.nav-item span:last-child,.nav-section,.side-footer{display:none}.brand{justify-content:center}.nav-item{justify-content:center}.grid.cols-4{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:repeat(2,1fr)}.series-card{grid-template-columns:1fr auto}.series-card>div:nth-child(2),.series-card>div:nth-child(3){display:none}.preview-grid{grid-template-columns:1fr}}
@media(max-width:720px){.app-shell{display:block}.sidebar{height:auto;position:static;display:flex;padding:8px;overflow:auto}.brand{padding:0 10px}.brand-mark{width:32px;height:32px}.nav-section,.side-footer{display:none}.nav-item{min-width:43px;padding:8px}.topbar{padding:0 14px}.main{padding:18px 13px 40px}.grid.cols-4,.grid.cols-3,.grid.cols-2,.test-grid,.ageing-grid,.form-grid{grid-template-columns:1fr}.page-head{display:block}.page-head .btn-row{margin-top:12px}.series-header-line,.test-head{display:block}.report-sheet{padding:24px 20px}.top-actions .user-pill{display:none}}
@media print{.sidebar,.topbar,.prototype-banner,.page-head,.tabs,.no-print{display:none!important}.app-shell{display:block}.main{padding:0;background:#fff}.report-sheet{border:0;box-shadow:none;max-width:none;padding:0}}

/* v0.4 project / report additions */
.report-variant{margin:24px 0;padding-top:8px;border-top:1px solid var(--line)}
.report-variant h3{font-size:15px;color:var(--brand);margin:0 0 10px}
.table.compact{min-width:0}.table.compact td{padding:7px 10px}
.force-appendix{display:grid;gap:20px}.curve-page{break-inside:avoid;border:1px solid var(--line);border-radius:10px;padding:12px;background:#fff}.curve-caption{font-size:12px;margin-bottom:9px}.force-curve-img{display:block;width:100%;height:auto;border:1px solid #d8e0e6;background:#fff}
.status-row .badge{white-space:nowrap}
@media print{.curve-page{page-break-inside:avoid}.force-curve-img{max-height:330px;object-fit:contain}.report-variant{page-break-inside:avoid}.report-sheet{font-size:11px}.report-title{font-size:22px}.report-section{margin:18px 0}.table th,.table td{padding:6px 7px}}
