:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18202a;
  --muted: #667180;
  --line: #d8dee6;
  --soft: #eef5f2;
  --brand: #0f6f66;
  --brand-dark: #0b524d;
  --accent: #b86d22;
  --danger: #b42318;
  --ok: #117a45;
  --warn: #a15c07;
  --shadow: 0 14px 36px rgba(21, 31, 44, .10);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Arial, Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; }
button { min-height: 42px; border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 800; cursor: pointer; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 800; color: #344050; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 34px); }
h2 { margin-bottom: 8px; font-size: 18px; }
h3 { margin-bottom: 8px; font-size: 15px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.span-2 { grid-column: span 2; }
.eyebrow { margin-bottom: 4px; color: var(--brand); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.app-shell.sidebar-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 16px 14px; background: #17212c; color: #fff; z-index: 20; overflow: auto; }
.sidebar.collapsed { width: 84px; }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .icon-btn { margin: 0 auto; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brand img { width: 148px; max-height: 70px; object-fit: contain; background: #fff; border-radius: 8px; padding: 8px; }
.sidebar.collapsed .brand img { display: none; }
.icon-btn { width: 42px; min-width: 42px; padding: 0; display: inline-grid; place-items: center; background: #fff; color: #17212c; border: 1px solid var(--line); font-size: 12px; }
.side-nav { display: grid; gap: 8px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: transparent; color: #dbe3ec; border: 1px solid rgba(255,255,255,.10); }
.nav-item:hover, .nav-item.active { color: #fff; background: var(--brand); }
.nav-item.sync { margin-top: 10px; background: rgba(184, 109, 34, .18); color: #ffd8b4; }
.nav-icon { flex: 0 0 30px; width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; line-height: 1; }
.nav-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.mobile-menu { display: none; }
.status-pill { min-width: 164px; text-align: center; border-radius: 999px; padding: 9px 12px; font-size: 12px; font-weight: 900; color: #fff; }
.status-online { background: var(--ok); }
.status-saving { background: #315b9a; }
.status-saved { background: var(--brand); }
.status-pending { background: var(--warn); }
.status-error { background: var(--danger); }

.view { display: none; padding: 18px; }
.active-view { display: block; }
.order-grid { display: grid; grid-template-columns: minmax(420px, 520px) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head.compact { align-items: center; }
.builder-head { margin: -16px -16px 14px; padding: 16px; background: #fff; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.builder-head h2 { margin-bottom: 2px; }
.always-visible-add { min-width: 150px; box-shadow: 0 8px 18px rgba(15, 111, 102, .20); }
.client-panel { grid-column: auto; }
.items-panel { grid-column: 2; min-height: calc(100vh - 126px); }
.left-order-column {
  grid-column: 1;
  display: grid;
  gap: 16px;
  align-content: start;
}
.operation-scroll { display: grid; gap: 16px; }
.client-panel {
  box-shadow: none;
  background: #fbfcfd;
}
.client-toggle-head {
  margin-bottom: 0;
  align-items: center;
}
.client-panel-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.operation-type-row {
  margin-top: 12px;
}
.sticky-builder, .totals-panel { grid-column: auto; }
.sticky-builder { position: static; }
.totals-panel { position: static; padding: 16px; border-color: #b9d8cf; box-shadow: var(--shadow); }
.form-grid, .quick-client, .item-form, .totals-grid, .admin-form, .purchase-form { display: grid; gap: 12px; }
.client-grid { grid-template-columns: minmax(0, 1fr) 220px; }
.quick-client { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 10px; border-top: 1px solid var(--line); }
.item-form { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.item-form .search-field, .item-form .details-field { grid-column: 1 / -1; }
.item-settings-panel { padding: 10px; border: 1px solid #cfe2dc; border-radius: 8px; background: #f6fbf8; }
.item-settings-panel label { max-width: 180px; }
.sticky-builder input,
.sticky-builder select,
.sticky-builder textarea { min-height: 40px; }
.check-row { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: 12px; line-height: 1.15; }
.check-row input { width: auto; }
.check-row span { white-space: nowrap; }
#reserveStock + span { white-space: nowrap; }
#specialWork + span, #reserveStock + span { min-width: max-content; }
label:has(#specialWork), label:has(#reserveStock) { grid-column: span 2; }
.item-bottom-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.item-bottom-actions #addItemBtn { min-width: 150px; }
.primary { color: #fff; background: var(--brand); }
.primary:hover { background: var(--brand-dark); }
.secondary { color: var(--brand-dark); background: #dff3ee; border: 1px solid #9bd4c8; }
.ghost { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.danger-text { color: var(--danger); }

.match-list { display: grid; gap: 6px; margin-top: 8px; }
.match-list:empty { display: none; }
.floating { position: absolute; z-index: 25; width: min(520px, calc(100vw - 48px)); max-height: 240px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; }
.search-field { position: relative; }
.match-btn { width: 100%; min-height: 38px; text-align: left; background: #fff; color: var(--ink); border: 1px solid #e4e9ef; font-weight: 700; }
.match-btn:hover { border-color: var(--brand); }

.items-list, .table-list, .stock-preview { display: grid; gap: 10px; }
.calc-preview { display: grid; gap: 8px; padding: 10px; border: 1px solid #d5e7e0; border-radius: 8px; background: #f6fbf8; }
.calc-preview:empty { display: none; }
.calc-preview-row { display: grid; grid-template-columns: minmax(90px, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.calc-preview-row strong { color: var(--brand-dark); }
.calc-preview-row.total { padding-top: 8px; border-top: 1px solid #d5e7e0; font-size: 15px; }
.calc-preview-detail { color: var(--muted); font-size: 12px; }
.visible-totals-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: -2px 0 12px; }
.total-chip { min-height: 58px; padding: 10px 12px; border: 1px solid #cfe2dc; border-radius: 8px; background: #f5fbf8; }
.total-chip span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.total-chip strong { display: block; color: var(--brand-dark); font-size: 20px; }
.empty { padding: 18px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); background: #fbfcfd; }
.item-card, .row-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.items-panel .item-card { grid-template-columns: minmax(0, 1fr) minmax(116px, auto); align-items: start; }
.items-panel .item-card > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.items-panel .item-card .item-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; margin-top: 8px; }
.items-panel .item-card .item-meta span { min-width: 0; padding: 6px 8px; border-radius: 6px; background: #f6f8fa; color: #3c4653; font-size: 12px; overflow-wrap: anywhere; }
.items-panel .item-card p { overflow-wrap: anywhere; }
.items-panel .item-card .row-actions { display: grid; grid-template-columns: 1fr; justify-items: stretch; align-content: start; min-width: 116px; }
.items-panel .item-card .row-actions strong { text-align: right; color: var(--brand-dark); font-size: 18px; white-space: nowrap; }
.item-card strong, .row-card strong { display: block; margin-bottom: 4px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mini { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.totals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.totals-panel .panel-head { margin-bottom: 5px; }
.totals-panel label { gap: 4px; font-size: 11px; }
.totals-panel input,
.totals-panel select { min-height: 30px; padding: 5px 8px; }
.order-extra-options { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: #fbfcfd; }
.order-extra-options summary { cursor: pointer; font-size: 13px; font-weight: 900; color: var(--brand-dark); }
.order-extra-options label { margin-top: 10px; }
.total-box { display: grid; grid-template-columns: minmax(120px, .85fr) minmax(0, 1.6fr); gap: 7px; margin: 8px 0; padding: 8px; border-radius: 8px; background: #f7faf9; border: 1px solid #d7e9e3; }
.total-box div { min-height: 34px; padding: 5px 7px; border-radius: 8px; background: #fff; border: 1px solid #e2eee9; }
.total-box span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 3px; }
.total-box strong { display: block; font-size: 15px; color: var(--ink); }
.total-box .pos-total-main { min-height: 74px; background: #eaf7f3; border-color: #b9d8cf; display: grid; align-content: center; }
.total-box .pos-total-main strong { color: var(--brand-dark); font-size: 30px; line-height: 1; }
.total-box .pos-total-minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0; border: 0; background: transparent; }
.total-box .pos-total-minis div { min-height: 34px; padding: 5px; }
.main-actions { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.main-actions #saveWorkBtn {
  font-size: 17px;
  min-height: 40px;
}
.main-actions .ghost { grid-column: auto; }
.save-message { min-height: 0; margin: 8px 0 0; font-weight: 800; }
.search { max-width: 360px; }

.admin-form { grid-template-columns: repeat(5, minmax(120px, 1fr)); margin-bottom: 14px; }
.molding-form { grid-template-columns: repeat(8, minmax(90px, 1fr)); }
.molding-form label {
  padding: 8px;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--brand-dark);
}
.molding-form label input {
  margin-top: 2px;
  background: #fff;
}
.molding-form button {
  align-self: end;
}
.material-form { grid-template-columns: 130px minmax(180px, 1fr) 140px 120px 160px; }
.material-form label {
  padding: 8px;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--brand-dark);
}
.material-form label input,
.material-form label select {
  margin-top: 2px;
  background: #fff;
}
.material-form button {
  align-self: end;
}
.settings-note { max-width: 760px; }
.subtabs, .table-toolbar, .print-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.import-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.hidden-file { display: none; }
.inventory-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #cfe2dc; border-radius: 8px; background: #f6fbf8; color: var(--brand-dark); font-weight: 800; }
.inventory-summary span { color: var(--muted); font-weight: 700; }
.subtab { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.subtab.active { color: #fff; background: var(--brand); }
.subview { display: none; }
.active-subview { display: grid; }
.purchase-form { grid-template-columns: repeat(4, minmax(140px, 1fr)); margin: 14px 0; }
.editable-table { display: grid; gap: 8px; overflow-x: auto; }
.edit-row { display: grid; grid-template-columns: 120px 1.2fr 90px 90px 90px 90px 90px 110px 40px; gap: 6px; align-items: center; min-width: 920px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.edit-row.order-row { grid-template-columns: 130px 1.2fr 90px 90px 90px 90px 1fr 1.1fr 40px; }
.edit-row.header { color: var(--muted); font-size: 12px; font-weight: 900; background: #f8fafb; }
.stock-ok { border-color: #b8dfca; background: #f5fbf7; }
.stock-warn { border-color: #f0c989; background: #fff9ed; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.badge.ok { color: #0d5f35; background: #dff4e7; }
.badge.warn { color: #7a4400; background: #fff0cf; }
.badge.bad { color: #8d1d14; background: #fde1de; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: start center; padding: 28px; background: rgba(15, 23, 42, .55); overflow: auto; }
.modal-card { width: min(720px, 100%); background: #fff; border-radius: 8px; padding: 16px; box-shadow: var(--shadow); }
.modal-card.wide { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.detail-box { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.version-list { display: grid; gap: 8px; margin-top: 10px; }

.print-area { display: none; }
.print-doc { color: #111; background: #fff; font-family: Arial, Helvetica, sans-serif; }
.print-doc h1 { margin: 0; }
.print-doc table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.print-doc th, .print-doc td { border: 1px solid #222; padding: 4px; text-align: left; vertical-align: top; }
.print-order-head { display: grid; grid-template-columns: 1.05fr 1.15fr .62fr; gap: 8mm; align-items: start; margin-bottom: 4mm; }
.print-company { display: grid; grid-template-columns: 18mm 1fr; gap: 4mm; align-items: center; }
.print-company img { width: 18mm; max-height: 18mm; object-fit: contain; }
.print-company h1 { font-size: 13pt; letter-spacing: .2pt; }
.print-company p, .print-client p, .print-folio p { margin: 1.5mm 0; font-size: 9pt; line-height: 1.25; }
.print-client { padding-top: 3mm; }
.print-client strong { display: inline-block; min-width: 24mm; }
.print-folio { text-align: center; }
.print-folio div { display: inline-block; min-width: 36mm; margin: 2mm 0 1mm; padding: 2mm 3mm; border: 1px solid #111; font-size: 9pt; font-weight: 900; line-height: 1.05; }
.print-folio strong { display: block; color: #b60000; font-size: 25pt; line-height: 1; letter-spacing: 1pt; }
.work-order-table { table-layout: fixed; font-size: 7.6pt; }
.work-order-table th { text-align: center; font-size: 7.2pt; line-height: 1.05; background: #f3f3f3; }
.work-order-table th, .work-order-table td { overflow-wrap: anywhere; word-break: normal; }
.work-order-table td { height: 7.3mm; border-color: #555; border-style: dotted; }
.work-order-table .num, .work-order-table .money { text-align: right; white-space: nowrap; }
.print-bottom { display: grid; grid-template-columns: 1fr 52mm; gap: 8mm; align-items: end; margin-top: 4mm; }
.print-terms { min-height: 34mm; padding: 3mm; border: 1px solid #222; font-size: 7.3pt; line-height: 1.2; }
.print-terms strong { display: block; margin-bottom: 1.5mm; }
.print-terms ul { margin: 0; padding-left: 4mm; }
.print-terms li { margin: 0 0 .8mm; }
.print-totals { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border: 1px solid #222; font-size: 9pt; }
.print-totals dt, .print-totals dd { margin: 0; padding: 2mm 2.5mm; border-bottom: 1px dotted #555; }
.print-totals dt { font-weight: 900; }
.print-totals dd { text-align: right; border-left: 1px solid #222; font-weight: 800; }
.print-totals .grand { font-size: 13pt; background: #f2f2f2; }
.print-totals .balance { font-size: 11pt; }
.print-vertical-double { display: grid; grid-template-rows: 1fr 1fr; gap: 5mm; }
.copy-box { min-height: 128mm; padding: 4mm; border: 1px solid #111; break-inside: avoid; page-break-inside: avoid; }
.copy-title, .copy-head, .copy-footer, .ticket-line { display: flex; justify-content: space-between; gap: 4mm; align-items: center; }
.copy-title { padding-bottom: 2mm; border-bottom: 1px solid #111; font-size: 9pt; }
.copy-head { margin: 2mm 0; }
.copy-head img { width: 14mm; max-height: 12mm; object-fit: contain; margin-right: 2mm; vertical-align: middle; }
.copy-head strong { display: inline-block; font-size: 10pt; }
.copy-head span { display: block; font-size: 8pt; }
.copy-head > div:last-child { text-align: center; }
.copy-head > div:last-child strong { color: #b60000; font-size: 18pt; }
.copy-client { margin: 2mm 0; padding: 2mm; border: 1px dotted #777; font-size: 8.5pt; }
.copy-table { font-size: 7.5pt; }
.copy-table th { background: #f3f3f3; }
.copy-table th, .copy-table td { overflow-wrap: anywhere; }
.copy-table td { height: 7mm; border-style: dotted; }
.copy-table .num, .copy-table .money { text-align: right; white-space: nowrap; }
.copy-footer { margin-top: 3mm; align-items: end; }
.copy-sign { width: 58mm; padding-top: 10mm; border-top: 1px solid #111; text-align: center; font-size: 8pt; }
.copy-footer .ticket-line { min-width: 48mm; padding: .8mm 0; border-bottom: 1px dotted #777; font-size: 8.5pt; }
.print-58mm { width: 58mm; padding: 0; font-size: 9pt; line-height: 1.25; }
.ticket-head { text-align: center; }
.ticket-head img { width: 20mm; max-height: 14mm; object-fit: contain; }
.ticket-head h1 { font-size: 10pt; }
.ticket-head p, .ticket-client, .ticket-message { margin: 1.5mm 0; }
.ticket-line { padding: 1mm 0; border-bottom: 1px dotted #555; }
.ticket-line.strong { font-size: 11pt; font-weight: 900; border-bottom: 1px solid #111; }
.ticket-client { padding: 1.5mm 0; }
.ticket-sep { margin: 2mm 0; border-top: 1px dashed #111; }
.ticket-item { display: grid; gap: .8mm; padding: 1.5mm 0; border-bottom: 1px dotted #777; }
.ticket-item b { text-align: right; }
.ticket-message { text-align: center; font-size: 8pt; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .order-grid { grid-template-columns: 1fr; }
  .left-order-column, .client-panel, .items-panel, .sticky-builder, .totals-panel { grid-column: 1; }
  .left-order-column { position: static; height: auto; overflow: visible; padding: 0; }
  .operation-scroll { height: auto; overflow: visible; padding: 0; }
  .totals-panel { position: static; box-shadow: var(--shadow); }
  .sticky-builder { top: auto; }
  .admin-form, .molding-form, .material-form, .purchase-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw); transform: translateX(-105%); transition: transform .18s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { width: min(310px, 86vw); }
  .sidebar.collapsed .brand img { display: block; }
  .sidebar.collapsed .nav-item { justify-content: initial; }
  .sidebar.collapsed .nav-label { display: inline; }
  .mobile-menu { display: inline-grid; }
  .topbar { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: flex-start; padding: 12px; }
  .status-pill { grid-column: 1 / -1; justify-self: start; min-width: 118px; max-width: 100%; padding: 8px; }
  .view { padding: 12px; }
  .order-grid { display: flex; flex-direction: column; }
  .left-order-column, .operation-scroll { display: contents; }
  .client-panel { order: 1; }
  .sticky-builder { order: 2; }
  .items-panel { order: 3; }
  .totals-panel { order: 4; }
  .panel { padding: 12px; }
  .panel-head, .client-grid, .quick-client, .item-form, .totals-grid, .admin-form, .molding-form, .material-form, .purchase-form, .detail-grid { grid-template-columns: 1fr; }
  .panel-head { display: grid; }
  .builder-head { position: static; margin: 0 0 14px; padding: 0 0 12px; border-radius: 0; }
  .always-visible-add { width: 100%; }
  .item-bottom-actions { display: grid; grid-template-columns: 1fr; }
  .item-bottom-actions #addItemBtn { min-width: 0; }
  .span-2, .item-form .search-field, .item-form .details-field, .main-actions .ghost { grid-column: 1; }
  .sticky-builder { position: static; }
  .item-card, .row-card { grid-template-columns: 1fr; }
  .items-panel .item-card { grid-template-columns: 1fr; }
  .items-panel .item-card .item-meta { grid-template-columns: 1fr; }
  .items-panel .item-card .row-actions { grid-template-columns: 1fr 1fr; min-width: 0; }
  .items-panel .item-card .row-actions strong { grid-column: 1 / -1; text-align: left; }
  .row-actions { display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .row-actions button { width: 100%; }
  .main-actions { grid-template-columns: 1fr; }
  .total-box { grid-template-columns: 1fr; }
  .total-box .pos-total-minis { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .visible-totals-strip { grid-template-columns: 1fr; }
  .modal { padding: 10px; }
}

@media print {
  body * { visibility: hidden !important; }
  #printArea, #printArea * { visibility: visible !important; }
  html, body { width: auto; min-width: 0; background: #fff !important; }
  #printArea { display: block; position: absolute; inset: 0; padding: 0; margin: 0; }
  .print-doc { display: block; box-shadow: none !important; color-adjust: exact; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-horizontal { page: printHorizontal; }
  .print-vertical-double { page: printVertical; }
  .print-58mm { page: print58; }
  table, tr, td, th, .copy-box, .print-bottom, .ticket-item { break-inside: avoid; page-break-inside: avoid; }
  .no-print { display: none !important; }
  @page { size: letter; margin: 8mm; }
  @page printHorizontal { size: letter landscape; margin: 7mm; }
  @page printVertical { size: letter portrait; margin: 7mm; }
  @page print58 { size: 58mm 210mm; margin: 2mm; }
}
