.cost-filters{display:flex;align-items:end;flex-wrap:wrap;gap:14px;margin-bottom:22px}.cost-filters label{display:grid;gap:6px;min-width:145px}.cost-filters input,.cost-filters select,.cost-form input,.cost-form select,.cost-form textarea{width:100%;box-sizing:border-box;font:inherit;padding:12px;border:1px solid #d5d0c8;border-radius:9px;color:#24211d;background:#fff}.cost-actions{display:flex;gap:10px;flex-wrap:wrap}.cost-row{display:grid;grid-template-columns:1fr auto;gap:12px;padding:18px 0;border-bottom:1px solid #e5dfd5}.cost-row h3{margin:0 0 7px}.cost-row p{margin:5px 0;color:#5a554e}.cost-row .cost-amount{font-size:1.2rem;font-weight:600;text-align:right}.cost-badge{display:inline-block;border-radius:20px;background:#eeeae3;padding:5px 10px;font-size:.78rem;margin:5px 5px 8px 0}.cost-badge.review{background:#fff0cf;color:#6b4700}.cost-badge.confirmed{background:#dceee2;color:#1b5636}.cost-note{padding:15px 18px;background:#f3efe8;border-radius:12px;line-height:1.6;margin:16px 0}.cost-note p{margin:0}.cost-form{display:grid;grid-template-columns:1fr 1fr;gap:16px}.cost-form label{display:grid;gap:7px}.cost-wide{grid-column:1/-1}.cost-check{display:flex!important;align-items:start;gap:10px!important}.cost-check input{width:auto;margin-top:5px}.cost-form textarea{min-height:80px;resize:vertical}.cost-dialog{width:min(720px,94vw);max-height:90dvh;box-sizing:border-box;overflow:auto;padding:25px;border:0;border-radius:16px;color:#29251e;background:#fff}.cost-dialog::backdrop{background:#0008}.cost-dialog h2{margin-top:0}.cost-dialog-head{display:flex;justify-content:space-between;align-items:start;gap:15px}.cost-dialog-head button{padding:7px 12px}.cost-receipts{display:flex;flex-wrap:wrap;gap:8px}.cost-receipts button{max-width:100%;overflow-wrap:anywhere}.cost-status{min-height:24px;color:#6b4700;margin:12px 0}.cost-totals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin-bottom:20px}.cost-totals article{padding:20px;border:1px solid #e3ddd3;border-radius:14px;background:#fff}.cost-totals strong{display:block;font-size:1.65rem;margin:10px 0}.cost-totals small{color:#625b52}.cost-month-empty{padding:35px 10px;text-align:center;color:#686157}#cost-fiscal[hidden]{display:none}.cost-file-controls{display:flex;flex-wrap:wrap;gap:10px}.cost-file-controls label{flex:1;min-width:200px}.cost-dialog button,.cost-actions button{min-height:44px}.cost-form button[type=submit]{background:#655138;color:#fff;border:0;border-radius:9px;padding:14px}.cost-guide{line-height:1.7}.cost-guide summary{cursor:pointer;font-weight:600}.cost-guide li{margin-bottom:7px}@media(max-width:600px){.cost-totals{grid-template-columns:1fr}.cost-totals article{padding:15px}.cost-totals strong{margin:5px 0}.cost-form{grid-template-columns:1fr}.cost-wide{grid-column:auto}.cost-row{grid-template-columns:1fr}.cost-row .cost-amount{text-align:left}.cost-dialog{padding:18px}.cost-filters label{flex:1;min-width:125px}.cost-actions button{flex:1}.cost-receipts button{width:100%}}
#cost-confirm-label[hidden]{display:none!important}

.cost-form input[aria-invalid="true"]{border-color:#a32d22}.cost-money-error{color:#a32d22;line-height:1.4}

#cost-receipt-panel[hidden],#cost-receipt-review[hidden]{display:none!important}.cost-queued-receipt{display:flex;align-items:center;flex-wrap:wrap;gap:8px;width:100%}.cost-queued-receipt span{flex:1;overflow-wrap:anywhere}.cost-ocr-filled{border-color:#468a68!important;background:#f4fbf6!important}#cost-receipt-panel pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.8rem;max-height:180px;overflow:auto}#cost-receipt-panel progress{width:100%;margin:10px 0}#cost-receipt-review{margin-top:16px}#cost-receipt-warnings{padding-left:20px;font-size:.85rem}

.cost-dialog{width:min(1220px,96vw)}#cost-form{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:start}.cost-details{min-width:0}.cost-upload{padding:16px;background:#f3efe8;border-radius:12px}.cost-upload p{font-size:.85rem;margin:10px 0;line-height:1.5}.cost-upload-options{display:flex;gap:10px;margin-top:10px;flex-wrap:wrap}.cost-upload-options[hidden],.receipt-viewer[hidden],.cost-upload input[hidden]{display:none!important}.cost-details:only-child{grid-column:1/-1}.receipt-viewer[hidden]+.cost-details{grid-column:1/-1}.receipt-viewer{min-width:0;border:1px solid #d5d0c8;border-radius:12px;padding:12px;background:#eeeae3;position:sticky;top:0}.receipt-viewer-bar{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.receipt-viewer-bar strong{flex:1 0 100%;overflow-wrap:anywhere;font-size:.9rem}.receipt-viewer button{border:1px solid #bfb5a6;border-radius:7px;padding:7px 10px;background:#fff;color:#302a22;letter-spacing:normal;text-transform:none}.receipt-viewer-bar output{font-size:.8rem}.receipt-viewer [data-viewer-status],.receipt-help{font-size:.82rem;line-height:1.45;margin:10px 0}.receipt-viewport{height:62dvh;min-height:260px;overflow:auto;background:#c9c4ba;border-radius:8px;overscroll-behavior:contain}.receipt-sheet{position:relative;min-height:200px;line-height:0}.receipt-sheet img,.receipt-sheet canvas{display:block;width:100%;height:auto}.receipt-overlay{position:absolute;inset:0;pointer-events:none}.receipt-region{position:absolute;background:#c6f8d740;outline:2px solid #2d8257;pointer-events:none}.receipt-field{border:1px solid #2d8257;border-radius:8px;background:#fffffff5;box-shadow:0 2px 8px #0002;padding:7px;box-sizing:border-box;line-height:1.3;color:#24211d;min-width:0}.receipt-overlay .receipt-field{position:absolute;width:40%;min-width:112px;max-width:230px;pointer-events:auto}.receipt-field label{font-size:.72rem;font-weight:600;display:block}.receipt-field input{font-size:14px!important;font-weight:400;min-height:35px!important;padding:6px!important;line-height:1.3;letter-spacing:normal!important;background:#fff!important;color:#24211d!important}.receipt-field input[aria-invalid=true]{border-color:#a32d22}.receipt-field button{font-size:.7rem;min-height:28px!important;padding:3px 5px;margin-top:4px;width:100%}.receipt-unplaced{display:grid;grid-template-columns:1fr 1fr;gap:8px}.receipt-marking{cursor:crosshair}.receipt-expanded{position:fixed;inset:8px;z-index:1000;overflow:auto;max-width:1300px;margin:auto;background:#eeeae3}.receipt-expanded .receipt-viewport{height:72dvh}.cost-check small{font-size:.8rem;font-weight:400}#cost-form:has(.receipt-expanded){min-height:70dvh}@media(max-width:850px){#cost-form{grid-template-columns:1fr}.receipt-viewer{position:relative}.receipt-viewport{height:65dvh}.cost-details{grid-template-columns:1fr 1fr}.cost-dialog{padding:14px;width:96vw}.receipt-overlay .receipt-field{width:40%}.receipt-expanded{position:fixed}}@media(max-width:600px){.cost-details{grid-template-columns:1fr}.cost-upload>button{width:100%}.cost-upload-options button{flex:1}.cost-check{flex-wrap:wrap}.cost-check small{flex-basis:100%}.receipt-viewer-bar button{font-size:.8rem}.receipt-viewer{padding:8px}.receipt-unplaced{grid-template-columns:1fr 1fr}}
.receipt-connector{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.receipt-connector line{stroke:#2d8257;stroke-width:1;stroke-dasharray:4 3;vector-effect:non-scaling-stroke}.receipt-expanded{width:auto;box-sizing:border-box}.receipt-overlay .receipt-field:focus-within{z-index:3;box-shadow:0 3px 12px #0005}.receipt-field input:focus{outline:2px solid #725934;outline-offset:1px}

.receipt-overlay .receipt-field{width:52%;min-width:155px;max-width:260px}.receipt-overlay[hidden]{display:none!important}
#cost-document-viewer.receipt-expanded{width:min(1300px,calc(100dvw - 16px));max-width:calc(100dvw - 16px);min-width:0;right:8px}
/* Override the site's global full-width section rule in expanded mode. */
#cost-document-viewer.receipt-expanded{width:min(1300px,calc(100dvw - 16px))!important;max-width:calc(100dvw - 16px)!important}

/* Compact annotations: a short label and one editable value. */
.receipt-field{display:flex;align-items:center;gap:4px;padding:3px 5px;border:1px solid #258448;border-radius:6px;background:#f4fff4f2;box-shadow:0 1px 5px #0002;line-height:1.2;color:#123d22}
.receipt-field label{display:flex;align-items:center;gap:4px;min-width:0;flex:1;font-size:12px!important;font-weight:600;white-space:nowrap;letter-spacing:0}
.receipt-field input{width:0;min-width:0;flex:1;font-size:16px!important;min-height:30px!important;height:30px;padding:2px 3px!important;border:0!important;border-radius:3px;background:transparent!important;color:#123d22!important;box-shadow:none}
.receipt-field input[aria-invalid=true]{outline:2px solid #a32d22}.receipt-overlay .receipt-field{width:228px;min-width:0;max-width:calc(100% - 4px);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab}.receipt-overlay .receipt-field[data-field=amount]{width:192px}.receipt-overlay .receipt-field[data-field=document_date]{width:218px}.receipt-overlay .receipt-field[data-field=document_number]{width:205px}
.receipt-field .receipt-drag-handle{width:18px;min-width:18px;min-height:30px!important;height:30px;padding:0;margin:0;border:0;background:transparent;color:#258448;font-size:19px;cursor:grab;touch-action:none}.receipt-field.receipt-dragging{z-index:5;cursor:grabbing;box-shadow:0 5px 15px #0004;opacity:.94}.receipt-field.receipt-dragging *{cursor:grabbing}
.receipt-region{background:#78e79c22;outline:1.5px solid #20944c}.receipt-region-label{position:absolute;left:0;bottom:100%;font:600 10px/1.2 Arial,sans-serif;color:#fff;background:#218447;padding:1px 3px;border-radius:3px 3px 0 0;white-space:nowrap;letter-spacing:0}.receipt-unplaced{grid-template-columns:1fr;gap:6px}.receipt-unplaced .receipt-field{min-width:0}.receipt-unplaced [data-locate]{width:auto;padding:3px 6px;min-height:30px!important;margin:0;font-size:11px}
@media(prefers-color-scheme:dark){.receipt-field{background:#12331ff5;border-color:#5add89;color:#d8ffe4}.receipt-field input{color:#d8ffe4!important}.receipt-field .receipt-drag-handle{color:#7ee89f}}
.receipt-overlay>.receipt-region{z-index:0}.receipt-overlay>.receipt-field{z-index:1}
.receipt-viewport{position:relative}.receipt-read-banner{position:sticky;top:0;z-index:100;background:#254f34;color:#fff;padding:7px 10px;font-size:12px;line-height:1.4;pointer-events:none}.receipt-read-banner[hidden]{display:none!important}.receipt-field[data-unlocated]{border-style:dashed}.receipt-field[data-unlocated][data-field=supplier_document]{width:255px}.receipt-field .receipt-locate{flex:0 0 22px;width:22px;min-height:30px!important;height:30px;padding:0;margin:0;border:0;background:transparent;color:#258448;font-size:20px}.receipt-field input::placeholder{font-size:12px;color:#687e6c}.receipt-field input[readonly]{opacity:.75}
.receipt-read-banner.receipt-read-notice{background:#fff0ce;color:#684510}
.receipt-locate svg{display:block;width:18px;height:18px}
/* Keep the receipt readable in system dark mode and Chrome automatic darkening. */
.receipt-sheet{color-scheme:only light}.receipt-overlay .receipt-field{background:rgba(166,244,184,.32)!important;color:#103b1d!important;border-color:#33a95b;box-shadow:none}.receipt-overlay .receipt-field input{color:#103b1d!important;background:transparent!important}.receipt-overlay .receipt-field input:focus{background:rgba(255,255,255,.92)!important}.receipt-overlay .receipt-drag-handle,.receipt-overlay .receipt-locate{color:#176734!important}.receipt-overlay>.receipt-region{background:rgba(112,239,147,.26)!important;outline:2px solid #2ba652}.receipt-region-label{background:#b6f1c4;color:#104820}

/* Cost analysis: no chart library or external requests. */
.cost-analysis{margin:24px 0 28px;padding:22px;border:1px solid #49392e;border-radius:18px;background:#17110d;color:#f4ece5;min-width:0}
.cost-analysis-heading,.cost-chart-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.cost-analysis h2{font-size:1.65rem;margin:0}.cost-analysis h3{font-family:inherit;font-size:1rem;letter-spacing:normal;margin:0;font-weight:600}.cost-analysis-heading p,.cost-chart-caption{font-size:.82rem;line-height:1.5;color:#c2b2a4;margin:6px 0 15px;letter-spacing:normal}.cost-analysis-heading label{display:grid;gap:5px;font-size:.8rem}.cost-analysis select{font:inherit;color:#f4ece5;background:#292019;border:1px solid #6b5140;border-radius:8px;padding:9px 13px;min-width:100px}
.cost-analysis-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:18px 0 24px;border-bottom:1px solid #49392e;margin-bottom:22px}.cost-analysis-summary>div{min-width:0}.cost-analysis-summary span,.cost-analysis-summary small{display:block;color:#c2b2a4;font-size:.78rem;line-height:1.5;letter-spacing:normal}.cost-analysis-summary strong{display:block;font-size:clamp(1.1rem,2vw,1.55rem);font-variant-numeric:tabular-nums;margin:5px 0;overflow-wrap:anywhere}.cost-analysis-summary>div:last-child strong{color:#edb781}
.cost-analysis-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:20px}.cost-chart{padding:18px;border:1px solid #463328;border-radius:12px;min-width:0;background:#1e1611}.cost-chart-properties{grid-column:1/-1}.cost-chart-properties .cost-chart-rows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 24px}
.cost-analysis button{font-family:inherit;letter-spacing:normal;text-transform:none;color:inherit;box-shadow:none}.cost-month-chart{height:205px;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:5px;align-items:stretch}.cost-analysis .cost-month-bar{min-width:0;border:0;background:transparent;padding:0;display:flex;flex-direction:column;align-items:stretch;gap:9px;font-size:.7rem;cursor:pointer;border-radius:5px}.cost-month-column{height:175px;display:flex;align-items:flex-end;border-bottom:1px solid #6c5140;background:repeating-linear-gradient(to top,transparent 0,transparent 42px,#ffffff09 42px,#ffffff09 43px)}.cost-month-column>span{display:block;width:100%;background:#966947;border-radius:5px 5px 0 0;min-height:0}.cost-month-bar.is-selected .cost-month-column>span,.cost-month-bar:hover .cost-month-column>span{background:#edb781}.cost-month-bar.is-selected{color:#ffd6ab}.cost-analysis button:focus-visible,.cost-analysis select:focus-visible{outline:2px solid #f5c28c;outline-offset:3px}
.cost-analysis .cost-chart-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 12px;width:100%;padding:11px 0;background:transparent;border:0;border-radius:0;min-height:48px;text-align:left;cursor:pointer;font-size:.85rem}.cost-chart-row-label{overflow-wrap:anywhere}.cost-chart-row strong{font-size:.85rem;font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums}.cost-chart-track{grid-column:1/-1;height:9px;background:#3b2c21;border-radius:5px;overflow:hidden}.cost-chart-track>span{display:block;height:100%;background:#966947;border-radius:5px}.cost-chart-row.is-selected .cost-chart-track>span,.cost-chart-row:hover .cost-chart-track>span{background:#edb781}.cost-chart-row.is-selected .cost-chart-row-label{color:#ffd6ab}.cost-chart-period{display:flex;gap:4px;background:#100c09;border:1px solid #59402f;padding:3px;border-radius:9px}.cost-analysis .cost-chart-period button{padding:7px 14px;border:0;border-radius:6px;font-size:.8rem;background:transparent;cursor:pointer}.cost-analysis .cost-chart-period button[aria-pressed=true]{background:#b77d4b;color:#120d0a}.cost-analysis .cost-chart-reset{background:transparent;border:1px solid #705039;border-radius:7px;margin-top:16px;padding:9px 12px;cursor:pointer;font-size:.8rem}.cost-chart-empty{font-size:.85rem;color:#c2b2a4}.cost-chart-table{margin-top:14px;font-size:.8rem}.cost-chart-table summary{cursor:pointer;color:#e4b17e}.cost-chart-table table{width:100%;border-collapse:collapse;margin-top:10px;font-variant-numeric:tabular-nums}.cost-chart-table th,.cost-chart-table td{padding:7px 0;border-bottom:1px solid #49392e;text-align:left}.cost-chart-table td:last-child,.cost-chart-table th:last-child{text-align:right}
@media(max-width:1000px){.cost-analysis-grid{grid-template-columns:1fr}.cost-chart-properties{grid-column:auto}}
@media(max-width:600px){.cost-analysis{padding:14px 10px;border-radius:12px}.cost-analysis h2{font-size:1.4rem}.cost-analysis-summary{grid-template-columns:1fr 1fr;gap:10px}.cost-analysis-summary>div:last-child{grid-column:1/-1;border-top:1px solid #49392e;padding-top:12px}.cost-chart{padding:14px 10px}.cost-chart-properties .cost-chart-rows{grid-template-columns:1fr;gap:0}.cost-month-chart{gap:4px}.cost-analysis .cost-month-bar{font-size:.62rem}.cost-analysis-heading{align-items:start}.cost-chart-row strong{font-size:.8rem}}
.cost-tax-actions{padding:14px;border:1px solid #40855a;border-radius:12px;background:#143021;color:#e0ffe8;margin-top:12px}.cost-tax-actions strong{font-size:.9rem}.cost-tax-actions small{font-size:.75rem;line-height:1.4}.cost-tax-actions button{border-color:#5bba78}.cost-channels{margin-top:0}.cost-channel-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.cost-channel-grid .cost-chart p{font-size:.85rem;margin:10px 0;color:#d8c6b6}.cost-channel-grid .cost-chart strong{color:#f6d0a4}.cost-channel-grid .cost-chart-track{margin-top:14px}@media(max-width:650px){.cost-channel-grid{grid-template-columns:1fr}.cost-tax-actions{align-items:stretch}.cost-tax-actions button{width:100%}}
.cost-import-body{padding:1rem 1.25rem 1.5rem;display:grid;gap:1rem;max-height:75vh;overflow:auto}.cost-import-body label{display:grid;gap:.4rem}.cost-import-body input,.cost-import-body select{width:100%;min-height:2.75rem;padding:.5rem;background:#303030;color:#fff;border:1px solid #666;border-radius:8px}.cost-import-map{border:1px solid #555;border-radius:8px;padding:.7rem}
