:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;color:#203d33;background:#f5f4ef;font-synthesis:none;--green:#16634f;--muted:#69746b;--line:#dce2d9;--orange:#a85e30}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;min-height:44px;border:1px solid var(--line);background:#fff;color:var(--green);border-radius:9px;padding:9px 15px;font-weight:600}button:hover{background:#edf3eb}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid #d69655;outline-offset:2px}button:disabled{opacity:.5;cursor:wait}.primary{color:#fff;background:var(--green);border-color:var(--green)}.primary:hover{background:#124e40}.quiet{background:transparent}.danger{color:#a23d37}.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:14px 0}header{display:flex;align-items:center;gap:28px;padding:21px 34px;border-bottom:1px solid var(--line);background:#f5f4ef;position:sticky;top:0;z-index:5}.brand{color:#203d33;text-decoration:none;font-size:34px;letter-spacing:-2px;font-weight:750;min-width:220px}.brand span{display:block;font-size:9px;font-weight:600;letter-spacing:1.9px;margin-top:3px;color:var(--muted)}nav{display:flex;gap:5px;flex:1}nav button{border:0;background:transparent;font-size:13px}nav button.active{background:#dfe9df}#notice{padding:10px 34px;font-size:12px;background:#e9eee5;color:#43594d;min-height:36px}#notice.error{background:#f7e9de;color:#874221}main{padding:30px 34px;max-width:1880px;margin:auto;min-height:75vh}h1{font-size:34px;letter-spacing:-1.2px;font-weight:600;margin:0 0 12px}h2{font-size:22px;font-weight:600;letter-spacing:-.5px;margin:0 0 12px}h3{font-size:16px;margin:0 0 10px}p{line-height:1.6;color:var(--muted);margin:0 0 15px}.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:1.7px;color:var(--green);font-weight:650;margin-bottom:12px}.hero{padding:36px;background:#e7ecdf;border:1px solid #dce3d3;border-radius:20px;display:grid;grid-template-columns:1.5fr 1fr;gap:40px}.hero h1{max-width:620px;font-size:clamp(32px,3vw,48px);line-height:1.12}.hero p{max-width:530px}.stat{font-size:46px;font-weight:550;letter-spacing:-2px}.stat small{font-size:12px;letter-spacing:0;color:var(--muted);display:block;margin-top:10px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;align-items:center}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:22px}.card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:22px;min-width:0}.muted{color:var(--muted);font-size:13px}.empty{padding:32px;text-align:center;border:1px dashed #bdc9b8;border-radius:12px}.workspace{display:grid;grid-template-columns:260px minmax(0,1fr);gap:20px}.inbox{align-self:start;position:sticky;top:112px;max-height:calc(100vh - 135px);overflow:auto}.receipt-choice{display:flex;align-items:start;gap:10px;padding:12px 0;border-top:1px solid var(--line);font-size:13px}.receipt-choice input{margin-top:4px;min-height:auto;width:20px;height:20px}.receipt-choice span{display:block}.pill{display:inline-block!important;padding:3px 7px;border-radius:5px;background:#e9eee5;color:var(--green);font-size:10px;margin:5px 0}.pill.warning{background:#faeadb;color:#935026}.editor-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,440px),1fr));gap:18px;align-items:start}.receipt-editor{padding:18px;overflow:hidden}.receipt-editor h2{font-size:20px}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}label{font-size:11px;font-weight:600;color:var(--muted);display:block;min-width:0}input,select,textarea{display:block;min-width:0;width:100%;min-height:42px;margin-top:5px;border:1px solid #cad4c6;border-radius:7px;padding:9px;background:#fff;color:#203d33;font-size:13px}textarea{min-height:72px;resize:vertical}.full{grid-column:1/-1}.table-scroll{overflow:auto;margin:12px -5px;padding:4px 5px}table{border-collapse:collapse;width:100%;font-size:12px;text-align:left}th{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;font-weight:650}td,th{padding:9px 7px;border-bottom:1px solid var(--line);vertical-align:top}table input,table select{min-width:75px;margin:0;font-size:12px}table .product{min-width:170px}table .size{min-width:120px}table .tiny{min-width:60px;width:65px}.item-table{min-width:840px}.item-table td:first-child{position:sticky;left:0;background:#fff;z-index:1}.item-table th:first-child{position:sticky;left:0;background:#fff;z-index:2}.price-cell{white-space:nowrap;min-width:115px}.raw{font-size:10px;display:block;color:var(--muted);max-width:180px;margin-top:4px}.reconcile{padding:11px;border-radius:8px;font-size:12px;background:#e9f0e5}.reconcile.warning{background:#f8eadf;color:#985429}.toolbar{display:flex;justify-content:space-between;align-items:start;gap:15px;flex-wrap:wrap;margin-bottom:18px}.toolbar h1{margin:0}.import-zone{padding:15px;border:1px dashed #b6c4ad;border-radius:11px;margin-bottom:18px;background:#edf0e7;font-size:13px}.import-zone.over{background:#dcebd6}.prices-layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:20px}.product-button{width:100%;text-align:left;margin:7px 0;padding:14px}.product-button span{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:5px}.product-button.active{background:#e7efdf;border-color:#a7bd9d}.chart{width:100%;height:290px;display:block;overflow:visible}.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11px;margin:10px 0 24px}.chart-label{font-family:system-ui,sans-serif;font-size:11px;fill:#69746b}.monthly-row{display:grid;grid-template-columns:70px 1fr 120px;gap:15px;align-items:center;font-size:12px;margin:17px 0}.monthly-row progress{width:100%;height:12px;accent-color:var(--green)}.advice-text{white-space:pre-wrap;line-height:1.65;font-size:15px}.warning-list{font-size:12px;color:#a15b30;line-height:1.6;padding-left:17px}.photo{display:block;max-width:100%;max-height:350px;object-fit:contain;margin:15px auto;border:1px solid var(--line)}dialog{border:1px solid var(--line);border-radius:18px;padding:26px;max-width:560px;width:calc(100vw - 32px);color:#203d33;max-height:92vh;overflow:auto}dialog::backdrop{background:#1d352980}#template-dialog{max-width:1060px}.template-layout{display:grid;grid-template-columns:260px 1fr;gap:24px}.crop-stage{position:relative;background:#e6eadf;touch-action:none;min-height:220px}.crop-stage img{display:block;width:100%;height:auto;max-height:65vh;object-fit:contain}.crop-canvas{display:block;max-width:100%;max-height:65vh;width:auto;margin:auto;touch-action:none}.template-entry{display:flex;align-items:center;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}.template-entry span{flex:1}footer{padding:20px 34px;font-size:11px;color:var(--muted);border-top:1px solid var(--line)}.no-wrap{white-space:nowrap}@media(min-width:1500px){.editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:1800px){.editor-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:1000px){header{padding:15px 20px;gap:15px;flex-wrap:wrap}.brand{min-width:0;flex:1}header nav{order:3;width:100%;overflow:auto}main{padding:22px 18px}#notice{padding:10px 18px}.hero{grid-template-columns:1fr;padding:25px;gap:25px}.workspace{grid-template-columns:220px minmax(0,1fr)}.prices-layout{grid-template-columns:240px minmax(0,1fr)}}@media(max-width:650px){header{position:static}.brand{font-size:30px}nav button{font-size:11px;padding:8px;white-space:nowrap}.workspace,.prices-layout,.grid,.template-layout{grid-template-columns:1fr}.inbox{position:static;max-height:270px}.fields{gap:10px}.stats{gap:10px}.stat{font-size:35px}.hero h1{font-size:32px}.card{padding:16px}.toolbar{gap:10px}.actions button{flex:1}dialog{padding:18px}.editor-grid{grid-template-columns:1fr}.chart{height:250px}.monthly-row{grid-template-columns:60px 1fr 100px;gap:7px}.template-layout{gap:14px}}

/* Custom receipt controls keep the browser's native file input hidden. */
[hidden] { display: none !important; }
.receipt-upload {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px 16px;
  padding: 22px;
  margin: 18px 0;
  border: 2px dashed #aec9b6;
  border-radius: 16px;
  background: linear-gradient(120deg, #fff, #f0f7ee);
  box-shadow: 0 4px 16px #203d3308;
  transition: background .15s, border-color .15s;
}
.hero .receipt-upload { margin-bottom: 0; }
.receipt-upload.over { background: #dcf0dd; border-color: var(--green); }
.receipt-upload-icon {
  width: 54px;
  height: 60px;
  padding: 11px;
  border-radius: 13px;
  color: var(--green);
  background: #e0edde;
}
.receipt-upload-copy { align-self: center; min-width: 0; }
.receipt-upload .eyebrow { margin-bottom: 6px; font-size: 10px; letter-spacing: 1.2px; }
.receipt-upload-status { font-size: 20px; font-weight: 650; line-height: 1.3; color: var(--green); }
.receipt-upload .receipt-upload-hint { font-size: 13px; line-height: 1.5; margin: 6px 0 0; }
.receipt-upload-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.receipt-upload-actions button { min-height: 54px; padding: 13px 22px; font-size: 16px; border-radius: 11px; }
.receipt-upload-actions .primary { box-shadow: 0 3px 8px #16634f22; }
.receipt-camera { border-color: #aec9b6; background: #fff; }
.receipt-upload .receipt-upload-footnote { grid-column: 1 / -1; font-size: 12px; margin: -3px 0 0; }
@media (max-width: 650px) {
  .receipt-upload { padding: 16px; gap: 12px; grid-template-columns: 44px minmax(0, 1fr); }
  .receipt-upload-icon { width: 44px; height: 52px; padding: 8px; }
  .receipt-upload-status { font-size: 18px; }
  .receipt-upload-actions button { flex: 1; padding: 12px 14px; }
}

.ui-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; padding: 10px; }
.actions .icon-button { flex: 0 0 44px; }
.receipt-upload-actions .icon-button { flex: 0 0 54px; min-width: 54px; padding: 12px; }
.receipt-upload-actions .primary { flex: 0 1 auto; width: auto; max-width: 100%; }
.hero { padding: 28px; gap: 28px; }
.hero h1 { font-size: clamp(28px, 3vw, 40px); }
.brand { min-width: 150px; }
nav button { font-size: 14px; }
@media(max-width:650px) {
  .brand { min-width: 0; }
  .hero { padding: 20px; }
  nav button { flex: 1; gap: 6px; padding: 9px 6px; font-size: 12px; }
  nav .ui-icon { width: 17px; height: 17px; }
}

#connect.connected { color: var(--green); background: #dfeee1; border-color: #b4d0bb; }
.login-feedback { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #e9eee5; font-size: 14px; }
.login-feedback.error { background: #f7e9de; color: #874221; }
.page-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.page-heading h1 { margin: 0; }
.page-heading button { min-height: 44px; padding: 9px 12px; }
.toolbar .page-heading { margin-bottom: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { flex: 0 0 auto; border-radius: 9px; }
.price-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.price-tabs .active { background: var(--green); border-color: var(--green); color: #fff; }
.product-button.changed { border-left: 4px solid #ce7738; }
.product-button .change-badge { display: inline-block; font-weight: 650; font-size: 12px; border-radius: 6px; padding: 4px 8px; background: #f9eadc; color: #914a25; }
.product-button .change-badge.down { background: #e2eee1; color: #16634f; }
.price-change { padding: 12px; border-radius: 9px; margin: 10px 0; background: #f9eadc; color: #914a25; font-size: 14px; }
.price-change.down { background: #e2eee1; color: #16634f; }
.changed-observation { background: #f4f2e7; }

/* Receipt review is a compact sheet; extra fields open below their item. */
.receipt-choice-label { display: flex; align-items: flex-start; gap: 10px; flex: 1; cursor: pointer; }
.receipt-choice > button { flex: 0 0 44px; }
.sheet-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sheet-heading h2 { flex: 1; margin: 0; }
.sheet-heading .photo { flex-basis: 100%; }
.receipt-primary { grid-template-columns: 2fr 1fr 1fr; margin-bottom: 12px; }
.receipt-primary input { border: 0; border-bottom: 1px solid #cad4c6; border-radius: 0; padding: 8px 0; font-size: 16px; }
.receipt-more { margin: 10px 0 18px; }
.receipt-more > .fields { padding-top: 12px; }
summary { cursor: pointer; min-height: 36px; padding: 8px 0; font-size: 13px; color: var(--muted); }
.receipt-sheet .table-scroll { margin: 0 -6px; padding: 0 6px; }
.receipt-sheet .item-table { min-width: 0; table-layout: fixed; border: 1px solid var(--line); }
.sheet-col-quantity { width: 60px; }
.sheet-col-amount { width: 88px; }
.sheet-col-each { width: 85px; }
.sheet-col-more { width: 44px; }
.receipt-sheet .item-table th { text-transform: none; letter-spacing: 0; font-size: 12px; background: #edf3eb; }
.receipt-sheet .item-table td, .receipt-sheet .item-table th { padding: 0; border-right: 1px solid var(--line); }
.receipt-sheet .item-table th { padding: 10px 7px; }
.receipt-sheet .item-table input { width: 100%; min-width: 0; min-height: 46px; border: 0; border-radius: 0; padding: 9px 7px; font-size: 15px; background: transparent; }
.receipt-sheet .item-table input:focus { background: #edf5e9; outline-offset: -3px; }
.receipt-sheet .item-table td:not(:first-child) input { text-align: right; font-variant-numeric: tabular-nums; }
.receipt-sheet .item-table .sheet-name-cell { position: relative; }
.sheet-item-summary { display: block; padding: 0 7px 7px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.sheet-uncertain { position: absolute; right: 4px; bottom: 3px; color: #935026; font-size: 11px; }
.receipt-sheet .price-cell { min-width: 0; white-space: normal; padding: 9px 6px !important; text-align: right; background: #f6f9f3; font-variant-numeric: tabular-nums; }
.sheet-unit-value { display: block; font-size: 14px; overflow-wrap: anywhere; }
.sheet-unit-basis { display: block; font-size: 10px; color: var(--muted); }
.sheet-row-actions button { min-width: 40px; width: 100%; border: 0; border-radius: 0; padding: 9px; }
.receipt-sheet .item-table .sheet-detail-row > td { position: static; padding: 14px; background: #f6f9f3; }
.receipt-sheet .item-table .sheet-item-details input, .receipt-sheet .item-table .sheet-item-details select { border: 1px solid #cad4c6; border-radius: 6px; text-align: left; margin-top: 5px; min-width: 0; }
.sheet-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.receipt-sheet .sheet-total { margin-top: 12px; padding: 10px 12px; font-size: 14px; background: #edf3eb; }
.receipt-sheet .sheet-total.warning { background: #f7f0df; color: #6e5725; }
.receipt-checks p { margin: 4px 0 10px; font-size: 13px; }
.receipt-sheet .warning-list { color: var(--muted); }
.receipt-camera { min-height: 58px; min-width: 130px; padding: 12px 18px; font-size: 16px; }
.receipt-camera .ui-icon { width: 30px; height: 30px; }
.primary.receipt-camera { background: var(--green); border-color: var(--green); color: #fff; }
.primary.receipt-camera:hover { background: #124e40; }
.workspace-options { position: relative; }
.workspace-options > summary { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--green); list-style: none; }
.workspace-options > summary::-webkit-details-marker { display: none; }
.workspace-options .actions { position: absolute; right: 0; top: 100%; z-index: 4; margin: 6px 0 0; padding: 8px; width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px #203d3320; }
.workspace-options .actions button { flex: 1 0 100%; width: 100%; justify-content: flex-start; gap: 10px; }
.receipt-upload-actions .receipt-camera { flex: 0 1 auto; }
@media(max-width:1000px) {
  header nav { flex: 1 0 100%; }
}
@media(max-width:650px) {
  .receipt-sheet { padding: 12px; }
  .inbox { padding: 12px; }
  .inbox h2 { font-size: 17px; }
  .receipt-primary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .receipt-primary > label:first-child { grid-column: 1 / -1; }
  .sheet-col-quantity { width: 44px; }
  .sheet-col-amount { width: 65px; }
  .sheet-col-each { width: 66px; }
  .sheet-col-more { width: 40px; }
  .receipt-sheet .item-table input { font-size: 16px; padding: 9px 4px; }
  .receipt-sheet .item-table th { font-size: 11px; padding: 9px 4px; }
  .receipt-sheet .price-cell { padding: 9px 4px !important; }
  .sheet-unit-value { font-size: 12px; }
  .receipt-camera { flex: 0 1 auto !important; }
}
