/* CHAAAM Phase 2 & 3 tools — accessible, responsive workspaces */
:root{--ink:#182d4c;--blue:#3265dc;--line:#dbe5f2;--muted:#62748b}
*{box-sizing:border-box}body{margin:0;font:15px/1.55 system-ui,-apple-system,Segoe UI,sans-serif;color:var(--ink);background:#f8fbff}
a{color:#2459c6}.wrap{max-width:1120px;margin:auto;padding:0 20px}.top{background:#fff;border-bottom:1px solid var(--line);padding:16px 0}.top .wrap{display:flex;justify-content:space-between;align-items:center;gap:16px}.brand{font-size:27px;font-weight:850;text-decoration:none;letter-spacing:-1.7px;color:var(--ink)}.brand b{color:#4f80ef}.top nav{display:flex;gap:15px;flex-wrap:wrap;font-weight:650;font-size:13px}
.hero{padding:34px 0 20px}h1{font-size:clamp(29px,4vw,42px);line-height:1.15;letter-spacing:-1px;margin:4px 0 10px}h2{font-size:19px;margin:0 0 14px}h3{font-size:16px}.hero p{color:var(--muted);max-width:760px;margin:7px 0}.tag{font-size:12px;text-transform:uppercase;letter-spacing:1px;color:var(--blue);font-weight:800}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:13px}.chips span{font-size:12px;padding:5px 10px;background:#e8f6ee;color:#167448;border-radius:40px}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:17px;margin:14px auto 28px}.panel{min-width:0;background:#fff;border:1px solid var(--line);border-radius:15px;padding:22px;box-shadow:0 7px 25px #17376208}.panel p{margin:8px 0 15px}.wide{grid-column:1/-1}
label{font-size:13px;display:block;font-weight:700;margin:13px 0 5px}input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),textarea,select{display:block;width:100%;max-width:100%;font:inherit;padding:10px 12px;border:1px solid #c9d8e9;border-radius:9px;background:#fff;color:#16294c}textarea{min-height:100px;resize:vertical}input[type="range"]{width:100%;accent-color:var(--blue)}
button{cursor:pointer;font:700 14px system-ui,sans-serif;border:1px solid #c8d6ed;background:white;color:#244a84;padding:10px 14px;border-radius:9px}button.primary{background:#3268ea;color:white;border-color:#3268ea}button:disabled{opacity:.45;cursor:not-allowed}:focus-visible{outline:3px solid #79a7ff;outline-offset:2px}.actions{display:flex;gap:9px;flex-wrap:wrap;margin:17px 0 12px}
.status{min-height:20px;color:#2456aa;white-space:pre-wrap;font-size:13px}.status.error{color:#b42d3b}.help{font-size:12px;color:var(--muted)}.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.preview{width:100%;min-height:180px;max-height:560px;overflow:auto;border:1px dashed #aac5e7;border-radius:10px;background:#f1f5fb;padding:13px;text-align:center}.preview canvas,.preview img{display:block;max-width:100%;height:auto;margin:auto;background:white}.rows{display:grid;gap:10px}.rowitem{border:1px solid var(--line);background:#f7faff;border-radius:10px;padding:10px}.rowitem button{margin-top:6px}
#pageBox{position:relative;display:inline-block;max-width:100%;touch-action:none}#pageBox canvas{max-width:100%;height:auto;display:block}#scanOverlay{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
table{width:100%;border-collapse:collapse;font-size:13px}td,th{padding:8px;border-bottom:1px solid var(--line);text-align:left}th{background:#f4f7fd}tr td input{min-width:50px}.tableScroll{overflow:auto}
.docPreview{background:white;color:#18283b;border:1px solid var(--line);padding:28px;line-height:1.6;text-align:left;max-width:800px;margin:0 auto}.docPreview h1{font-size:26px}.docPreview h2{font-size:17px;border-bottom:1px solid #e1e8f4;padding-bottom:5px;margin:16px 0 8px}.docPreview p{white-space:pre-wrap}.docPreview .muted{color:#64748b}.docPreview .right{text-align:right}
.inlineCheck{display:flex;align-items:center;gap:8px;font-size:13px;margin:13px 0;font-weight:550}.footer{border-top:1px solid var(--line);background:#fff;padding:18px 0;font-size:12px;color:#61738c}
@media(max-width:760px){.workspace{grid-template-columns:1fr}.panel{padding:16px}.two,.three{grid-template-columns:1fr}.top .wrap{align-items:flex-start;flex-wrap:wrap}}
@media print{body{background:white}.top,.hero,.actions,.footer,.editPanel,.noPrint{display:none!important}.workspace,.panel{display:block;border:0;box-shadow:none;padding:0;margin:0}.docPreview{border:0;padding:0;max-width:100%;box-shadow:none}main{padding:0!important}}


/* CHAAAM professional invoice — scoped preview matches the downloadable PDF. */
#invoicePreview{padding:25px 24px;min-width:0;background:#fff;color:#162b45;box-shadow:0 2px 10px #182e4c08}
.invoicePreviewHead{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;padding:0 0 18px;border-bottom:2px solid #e5ecf6}
.invoicePreviewBrand{min-width:0;flex:1;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#invoicePreview .invoicePreviewBrand h2{margin:0;border:0;font-size:26px;line-height:1.15;font-weight:850;letter-spacing:-.7px;color:#172947;padding:0}
.invoiceLogoPreview{width:auto;max-width:100px;height:auto;max-height:46px;object-fit:contain}
.invoicePreviewMeta{display:grid;gap:2px;text-align:right;color:#66778e;font-size:12px;white-space:normal;overflow-wrap:anywhere}
.invoicePreviewMeta strong{color:#1a2943;font-size:14px}
.invoicePreviewAddresses{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:24px 0 17px}
.invoicePreviewAddresses>div{min-width:0}
.invoicePreviewAddresses strong,.invoicePreviewNotes>strong{font-size:10px;letter-spacing:1px;color:#3564cc}
#invoicePreview .invoicePreviewAddresses p,#invoicePreview .invoicePreviewNotes p{white-space:pre-line;overflow-wrap:anywhere;margin:7px 0 0;font-size:12px;color:#263b57}
#invoicePreview .invoiceItemsTable{table-layout:fixed;min-width:340px;border-collapse:collapse;width:100%;color:#24384f}
#invoicePreview .invoiceItemsTable th{background:#172947;color:white;font-size:10px;font-weight:700;letter-spacing:.2px;padding:12px 8px;border:0;text-align:right}
#invoicePreview .invoiceItemsTable td{font-size:11px;vertical-align:top;overflow-wrap:anywhere;padding:11px 8px;border-bottom:1px solid #e0e7f1;text-align:right;font-variant-numeric:tabular-nums}
#invoicePreview .invoiceItemsTable th:first-child,#invoicePreview .invoiceItemsTable td:first-child{text-align:left;width:49%}
#invoicePreview .invoiceItemsTable th:nth-child(2){width:14%}
#invoicePreview .invoiceItemsTable th:nth-child(3){width:18%}
#invoicePreview .invoiceItemsTable tr:nth-child(even) td{background:#f7f9fd}
.invoicePreviewTotals{display:grid;gap:0;max-width:270px;margin:18px 0 14px auto;font-variant-numeric:tabular-nums}
.invoiceTotalRow,.invoiceTotalHighlight{display:flex;align-items:center;justify-content:space-between;gap:9px;padding:8px 10px;font-size:12px}
.invoiceTotalRow{color:#65768e}
.invoiceTotalRow strong{color:#1b2d46}
.invoiceTotalHighlight{margin-top:7px;background:#172947;color:#fff;border-radius:5px;font-size:14px;font-weight:800;padding:14px 12px}
.invoicePreviewNotes{margin:12px 0 0;max-width:380px;overflow-wrap:anywhere}
@media(max-width:480px){
 #invoicePreview{padding:15px 11px}
 .invoicePreviewHead{flex-wrap:wrap;gap:8px}
 .invoicePreviewMeta{text-align:left}
 .invoicePreviewAddresses{grid-template-columns:1fr;gap:10px;padding-top:15px}
 #invoicePreview .invoiceItemsTable{min-width:320px}
}
@media print{
 #invoicePreview{box-shadow:none!important;border:0!important;padding:12mm!important}
 .invoicePreviewTotals{break-inside:avoid}
 .invoicePreviewHead,.invoicePreviewAddresses{break-inside:avoid}
 #invoicePreview .invoiceItemsTable thead{display:table-header-group}
 #invoicePreview .invoiceItemsTable tr{break-inside:avoid}
}
