/* GAINVO commerce, document and device layer — v2.1 */

body.portal-theme-ocean{--brand-soft:#e8f0fa;--brand-shadow:rgba(21,62,117,.24)}
body.portal-theme-emerald{--brand-soft:#e4f4ef;--brand-shadow:rgba(15,107,91,.24)}
body.portal-theme-plum{--brand-soft:#f0e9f4;--brand-shadow:rgba(86,54,109,.24)}
body.portal-theme-graphite{--brand-soft:#e8eef1;--brand-shadow:rgba(40,55,68,.24)}
body.portal-theme-cocoa{--brand-soft:#f5ece7;--brand-shadow:rgba(103,63,46,.24)}
.app-body .sidebar-nav .nav-link.active{background:var(--brand-soft);color:var(--brand)}
.app-body .mobile-nav a.active{color:var(--brand)}
.app-body .mobile-create{background:var(--brand);box-shadow:0 8px 18px var(--brand-shadow)}
.app-body .welcome-panel,.app-body .sales-summary,.app-body .team-hero,.app-body .billing-current,.app-body .report-hero{background-color:var(--brand)}

.portal-theme-picker{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.portal-theme-option{position:relative;display:grid;gap:5px;padding:10px;border:1px solid var(--line);border-radius:14px;cursor:pointer;background:#fff;transition:.18s ease}
.portal-theme-option:hover,.portal-theme-option.selected,.portal-theme-option:has(input:checked){border-color:var(--brand);box-shadow:0 8px 24px rgba(18,32,51,.08);transform:translateY(-1px)}
.portal-theme-option input{position:absolute;opacity:0;pointer-events:none}
.portal-theme-option strong{font-size:11px}.portal-theme-option small{font-size:8px;color:var(--muted)}
.theme-swatch{height:55px;border-radius:10px;display:flex;align-items:end;padding:8px;gap:5px;overflow:hidden}
.theme-swatch i,.theme-swatch b{display:block;background:#fff;border-radius:5px;box-shadow:0 4px 12px rgba(0,0,0,.12)}
.theme-swatch i{width:60%;height:26px}.theme-swatch b{width:24%;height:17px}
.theme-swatch-ocean{background:linear-gradient(135deg,#153e75,#d69e2e)}
.theme-swatch-emerald{background:linear-gradient(135deg,#0f6b5b,#d4a72c)}
.theme-swatch-plum{background:linear-gradient(135deg,#56366d,#d18464)}
.theme-swatch-graphite{background:linear-gradient(135deg,#283744,#20a39e)}
.theme-swatch-cocoa{background:linear-gradient(135deg,#673f2e,#d9973d)}
.print-preference{border:0;border-top:1px solid var(--line);padding:20px 0 0;margin:22px 0 0}
.print-preference legend{font-size:12px;font-weight:850;padding:0}.print-preference>p{color:var(--muted);font-size:9px;margin:5px 0 12px}
.print-preference>div{display:grid;grid-template-columns:1fr 1fr;gap:10px}.print-preference label{position:relative}
.print-preference label>input{position:absolute;opacity:0}.print-preference label>span{display:grid;padding:13px;border:1px solid var(--line);border-radius:12px;cursor:pointer}
.print-preference input:checked+span{border-color:var(--brand);background:var(--brand-soft)}.print-preference small{font-size:8px;color:var(--muted)}
.document-palette-presets{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:12px}.document-palette-presets>span{width:100%;font-size:9px;color:var(--muted)}
.document-palette-presets button{display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:30px;padding:6px 10px 6px 6px;background:#fff;cursor:pointer;color:var(--ink)}.document-palette-presets button:hover,.document-palette-presets button.selected{border-color:var(--brand);background:var(--brand-soft)}
.document-palette-presets i{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,var(--palette-primary) 0 58%,var(--palette-accent) 58%)}.document-palette-presets strong{font-size:8px}

.pos-heading-actions{display:flex;gap:8px}.pos-search-row{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;margin-bottom:16px}
.pos-search-row .pos-search{margin:0}.scanner-ready{display:inline-flex;align-items:center;gap:6px;font-size:8px;color:#087f5b;font-weight:800;white-space:nowrap}
.scanner-ready .icon{width:15px}.barcode-value{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em}
.scanner-modal .modal-card{max-width:540px}.scanner-viewport{position:relative;aspect-ratio:4/3;border-radius:18px;overflow:hidden;background:#0b1522;color:#fff}
.scanner-viewport video{width:100%;height:100%;object-fit:cover}.scanner-frame{position:absolute;inset:20%;border:2px solid #64e6d2;border-radius:14px;box-shadow:0 0 0 999px rgba(3,12,23,.35)}
.scanner-frame:after{content:"";position:absolute;left:7%;right:7%;top:50%;height:2px;background:#64e6d2;box-shadow:0 0 12px #64e6d2;animation:yentumi-scan-line 1.7s ease-in-out infinite}
@keyframes yentumi-scan-line{0%,100%{transform:translateY(-55px);opacity:.45}50%{transform:translateY(55px);opacity:1}}
.scanner-state{position:absolute;left:12px;right:12px;bottom:12px;padding:9px 12px;border-radius:10px;background:rgba(3,12,23,.72);backdrop-filter:blur(8px);font-size:9px;text-align:center}
.scanner-manual{display:grid;grid-template-columns:1fr auto;gap:9px;align-items:end;margin-top:13px}.scanner-manual label{margin:0}
.scanner-privacy{display:flex;align-items:center;gap:7px;font-size:8px;color:var(--muted);margin:12px 0 0}.scanner-privacy .icon{width:16px;color:var(--brand)}

.print-format-grid{display:grid;gap:9px}.print-format-grid>button{position:relative;display:grid;grid-template-columns:44px 1fr;column-gap:11px;text-align:left;align-items:center;padding:12px;border:1px solid var(--line);border-radius:13px;background:#fff;color:var(--ink);cursor:pointer}
.print-format-grid>button:hover{border-color:var(--brand);background:var(--brand-soft)}.print-format-grid>button>span{grid-row:1/3;width:44px;height:44px;display:grid;place-items:center;border-radius:11px;background:var(--brand-soft);color:var(--brand)}
.print-format-grid strong{font-size:11px}.print-format-grid small{font-size:8px;color:var(--muted)}.print-format-grid .preferred:after{content:"DEFAULT";position:absolute;right:10px;top:9px;color:#087f5b;font-size:7px;font-weight:900;letter-spacing:.08em}
.print-device-note{display:flex;gap:10px;margin-top:14px;padding:11px;border-radius:12px;background:#f0f5fb}.print-device-note>.icon{width:20px;color:var(--brand)}.print-device-note>span{display:grid}.print-device-note strong{font-size:9px}.print-device-note small{font-size:8px;color:var(--muted)}

/* Export always uses this fixed A4 canvas, regardless of phone or desktop viewport. */
.document-export-host{position:fixed;left:-10000px;top:0;width:794px;background:#fff;z-index:2147483000;pointer-events:none}
.receipt-paper.document-export-mode{box-sizing:border-box!important;width:794px!important;min-height:1123px!important;height:auto!important;margin:0!important;padding:64px 68px!important;border:0!important;box-shadow:none!important;overflow:hidden!important}
.document-export-mode .receipt-head{display:flex!important;justify-content:space-between!important;gap:25px!important}.document-export-mode .receipt-business{display:flex!important;gap:13px!important;align-items:center!important}
.document-export-mode .receipt-business img,.document-export-mode .receipt-logo-placeholder{width:63px!important;height:63px!important}.document-export-mode .receipt-business h2{font-size:20px!important}.document-export-mode .receipt-business p{font-size:10px!important}
.document-export-mode .receipt-title{text-align:right!important}.document-export-mode .receipt-title span{font-size:27px!important}.document-export-mode .receipt-title strong{font-size:10px!important}.document-export-mode .receipt-rule{margin:27px 0!important}
.document-export-mode .receipt-meta{display:flex!important;justify-content:space-between!important;margin-bottom:27px!important}.document-export-mode .receipt-meta>div:last-child{min-width:220px!important}.document-export-mode .receipt-meta strong{font-size:11px!important}.document-export-mode .receipt-meta>div:first-child>strong{font-size:15px!important}
.document-export-mode .receipt-items{display:table!important;width:100%!important}.document-export-mode .receipt-items th,.document-export-mode .receipt-items td{padding:10px!important;font-size:10px!important}.document-export-mode .receipt-items td small{font-size:8px!important}
.document-export-mode .receipt-totals{display:grid!important;grid-template-columns:1fr 270px!important;gap:35px!important;margin-top:28px!important}.document-export-mode .receipt-totals .receipt-note{order:initial!important}
.document-export-mode .receipt-foot{display:flex!important;justify-content:space-between!important;align-items:end!important;margin-top:60px!important}.document-export-mode .verification-box{display:flex!important}.document-export-mode .receipt-thanks{margin:30px 0 10px!important}

@media(max-width:900px){.portal-theme-picker{grid-template-columns:repeat(3,1fr)}}
@media(max-width:680px){
  .portal-theme-picker{grid-template-columns:1fr 1fr}.theme-swatch{height:46px}.print-preference>div{grid-template-columns:1fr}
  .pos-heading{align-items:flex-start}.pos-heading-actions{display:grid}.pos-heading-actions .btn{min-height:42px}.pos-search-row{display:block}.scanner-ready{margin:8px 4px 0}.scanner-manual{grid-template-columns:1fr}.scanner-manual .btn{width:100%}
  .scanner-modal .modal-card,.print-options-modal .modal-card{margin:auto 8px 8px;width:calc(100% - 16px);max-height:calc(100dvh - 16px);border-radius:20px}.scanner-viewport{aspect-ratio:3/4;max-height:58dvh}
}

@media(prefers-reduced-motion:reduce){.scanner-frame:after{animation:none}}

@page yentumi-a4{size:A4 portrait;margin:0}
@page yentumi-80{size:80mm auto;margin:0}
@page yentumi-58{size:58mm auto;margin:0}
@media print{
  html,body{width:210mm!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important}
  .app-shell,.app-main,.content,.document-view-grid,.public-document-main{display:block!important;width:auto!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important}
  .receipt-paper{page:yentumi-a4;box-sizing:border-box!important;width:209.5mm!important;min-height:296mm!important;height:auto!important;margin:0!important;padding:18mm!important;border:0!important;box-shadow:none!important;overflow:hidden!important;break-after:avoid-page!important;page-break-after:avoid!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .receipt-head{display:flex!important}.receipt-meta{display:flex!important}.receipt-totals{grid-template-columns:1fr 70mm!important}.receipt-foot{display:flex!important}.verification-box{display:flex!important}
  body[data-print-format="thermal80"],body[data-print-format="thermal58"]{width:auto!important}body[data-print-format="thermal80"] .receipt-paper,body[data-print-format="thermal58"] .receipt-paper{min-height:0!important;height:auto!important;border:0!important;box-shadow:none!important;margin:0!important;color:#000!important;overflow:visible!important}
  body[data-print-format="thermal80"] .receipt-paper{page:yentumi-80;width:80mm!important;padding:4mm!important}
  body[data-print-format="thermal58"] .receipt-paper{page:yentumi-58;width:58mm!important;padding:3mm!important}
  body[data-print-format^="thermal"] .receipt-head{display:block!important;text-align:center!important}
  body[data-print-format^="thermal"] .receipt-business{display:grid!important;justify-items:center!important;gap:2mm!important}
  body[data-print-format^="thermal"] .receipt-business img,body[data-print-format^="thermal"] .receipt-logo-placeholder{width:14mm!important;height:14mm!important;border-radius:2mm!important}
  body[data-print-format^="thermal"] .receipt-business h2{font-size:12pt!important;color:#000!important}body[data-print-format^="thermal"] .receipt-business p{font-size:7pt!important;color:#222!important}
  body[data-print-format^="thermal"] .receipt-title{text-align:center!important;margin-top:4mm!important}body[data-print-format^="thermal"] .receipt-title span{font-size:15pt!important;color:#000!important;font-weight:800!important}body[data-print-format^="thermal"] .receipt-title strong{font-size:7pt!important}
  body[data-print-format^="thermal"] .receipt-rule{height:1px!important;background:#000!important;margin:4mm 0!important}
  body[data-print-format^="thermal"] .receipt-meta{display:grid!important;gap:3mm!important;margin-bottom:4mm!important}body[data-print-format^="thermal"] .receipt-meta>div:last-child{min-width:0!important}body[data-print-format^="thermal"] .receipt-meta>div:last-child p{font-size:7pt!important}
  body[data-print-format^="thermal"] .receipt-items{table-layout:fixed!important;width:100%!important}body[data-print-format^="thermal"] .receipt-items th{background:#000!important;color:#fff!important;font-size:6.5pt!important;padding:2mm 1mm!important}body[data-print-format^="thermal"] .receipt-items td{font-size:7pt!important;padding:2mm 1mm!important;vertical-align:top!important;overflow-wrap:anywhere!important}body[data-print-format^="thermal"] .receipt-items td small{font-size:6pt!important;color:#333!important}
  body[data-print-format^="thermal"] .receipt-items th:first-child{width:43%}body[data-print-format^="thermal"] .receipt-items th:nth-child(2){width:12%}body[data-print-format^="thermal"] .receipt-items th:nth-child(3){width:20%}body[data-print-format^="thermal"] .receipt-items th:nth-child(4){width:25%}
  body[data-print-format^="thermal"] .receipt-totals{display:grid!important;grid-template-columns:1fr!important;gap:2mm!important;margin-top:4mm!important}body[data-print-format^="thermal"] .receipt-note{order:2!important}body[data-print-format^="thermal"] .receipt-totals>div:last-child p{font-size:7pt!important;padding:1.5mm!important}body[data-print-format^="thermal"] .receipt-totals .grand{background:#000!important;color:#fff!important}body[data-print-format^="thermal"] .receipt-totals .grand strong{font-size:11pt!important}
  body[data-print-format^="thermal"] .receipt-foot{display:grid!important;justify-items:center!important;text-align:center!important;gap:3mm!important;margin-top:5mm!important;padding-top:4mm!important;border-top:1px dashed #000!important}body[data-print-format^="thermal"] .receipt-foot>div:first-child{display:grid;justify-items:center}body[data-print-format^="thermal"] .verification-box{display:flex!important;align-items:center!important}
  body[data-print-format^="thermal"] .receipt-thanks{margin:4mm 0 2mm!important;color:#000!important;font-size:8pt!important}body[data-print-format^="thermal"] .tax-disclaimer{font-size:5.5pt!important;color:#333!important;padding-top:2mm!important}
  body[data-print-format="thermal58"] .receipt-paper{font-size:7pt!important}body[data-print-format="thermal58"] .receipt-items th,body[data-print-format="thermal58"] .receipt-items td{font-size:5.7pt!important;padding:1.5mm .5mm!important}body[data-print-format="thermal58"] .receipt-title span{font-size:13pt!important}body[data-print-format="thermal58"] .verification-box{transform:scale(.86);transform-origin:center}
}
