:root {
  --ink: #17283d;
  --muted: #586a7f;
  --brand: #b62937;
  --brand-hover: #94202c;
  --line: #dce3ec;
  --canvas: #f3f6fa;
  --surface: #fff;
  --success: #1b664f;
  --warning: #854b14;
  --shadow: 0 3px 10px #1a345309;
  color: var(--ink);
  background: var(--canvas);
  font: 15px/1.45 'Instrument Sans', 'Inter', 'Segoe UI', sans-serif;
  font-synthesis: none;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .59; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #3b69a8; outline-offset: 3px; }
h1, h2, p, fieldset { margin: 0; }
h1, h2 { letter-spacing: -.035em; line-height: 1.14; }
h1 { font-size: clamp(1.85rem, 3.8vw, 2.35rem); }
h2 { font-size: 1.27rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }

.topbar { position: sticky; z-index: 3; top: 0; min-height: 70px; display: flex; align-items: center; gap: clamp(14px, 3vw, 40px); padding: 10px clamp(16px, 3vw, 42px); color: #fff; background: #152438; }
.brand { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.brand small { color: #b6c5d5; font-size: .72rem; font-weight: 500; }
.brand img { display: block; width: auto; height: 40px; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.nav-button { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #d0dbe8; font-weight: 600; }
.nav-button:hover, .nav-button[aria-current='page'] { background: #263b53; color: #fff; }
.nav-button[aria-current='page'] { border-color: #3a516c; }
.nav-icon { position: relative; width: 14px; height: 12px; border: 1px solid currentColor; border-radius: 2px; }
.nav-icon::after { content: ''; position: absolute; }
.ico-register::after { inset: 3px 2px auto; border-top: 1px solid; }
.ico-stock { transform: rotate(45deg); border-radius: 1px; width: 10px; height: 10px; margin: 0 2px; }
.ico-customer { border-radius: 5px 5px 3px 3px; width: 13px; height: 7px; margin: 7px 0 0; }
.ico-customer::before { content: ''; position: absolute; width: 5px; height: 5px; left: 2px; bottom: 6px; border: 1.5px solid currentColor; border-radius: 50%; }
.ico-ticket { width: 11px; height: 14px; }
.ico-ticket::after { inset: 4px 2px auto; border-top: 1px solid; box-shadow: 0 2px; }
.ico-activity { border: 0; width: 14px; height: 13px; border-left: 1px solid; border-bottom: 1px solid; }
.ico-activity::after { inset: 1px 2px 2px; background: linear-gradient(to top,#afc1d4 45%,transparent 45%) left / 2px 100% no-repeat,linear-gradient(to top,#afc1d4 70%,transparent 70%) center / 2px 100% no-repeat,linear-gradient(to top,#afc1d4 100%,transparent 100%) right / 2px 100% no-repeat; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.store-control select { max-width: 210px; padding: 6px 23px 6px 10px; border: 1px solid #465870; border-radius: 8px; color: #f2f6fb; background: #20324a; font-size: .85rem; }
.store-control select:disabled { appearance: none; opacity: 1; padding-right: 10px; }
.connection { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 700; white-space: nowrap; color: #dce7f1; }
.connection::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #abb5c0; }
.connection[data-status='online']::before { background: #69d9a2; }
.connection[data-status='offline']::before { background: #ffc075; }
.profile { position: relative; }
.profile summary { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #54708e; border-radius: 50%; color: #e4f0ff; background: #2b4564; list-style: none; cursor: pointer; font-weight: 750; }
.profile summary::-webkit-details-marker { display: none; }
.profile-menu { position: absolute; top: 48px; right: 0; min-width: 176px; display: grid; gap: 6px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 26px #17283d25; }
.profile-menu small { margin-bottom: 6px; color: var(--muted); }

.login-screen { min-height: 100dvh; display: grid; align-items: center; justify-items: center; padding: 18px; background: radial-gradient(ellipse at top, #e1ebf6, var(--canvas) 60%); }
.login-card { display: grid; gap: 13px; width: min(100%, 440px); padding: clamp(26px, 5vw, 42px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 20px 55px #17325115; }
.login-brand { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-brand img { display: block; width: auto; height: 64px; }
.theme-toggle { min-width: 36px; min-height: 36px; padding: 0 8px; font-size: 1.1rem; line-height: 1; }
.login-card h1 { font-size: clamp(1.75rem, 5vw, 2.05rem); }
.login-form { display: grid; gap: 7px; margin-top: 11px; }
.login-form label { font-weight: 700; }
.login-form input { width: 100%; min-height: 45px; margin-bottom: 6px; padding: 7px 10px; border: 1px solid #bdc9d7; border-radius: 8px; color: var(--ink); background: #fff; }
.login-form .primary { margin-top: 8px; }

.workspace { max-width: 1710px; display: grid; grid-template-columns: minmax(0, 1fr) clamp(350px, 32vw, 455px); gap: clamp(18px, 2.3vw, 32px); align-items: start; margin: 0 auto; padding: clamp(18px, 2.6vw, 38px); }
.workspace.stock-view { grid-template-columns: minmax(0, 1fr); }
.catalog-panel { min-width: 0; }
.catalog-heading, .ticket-header, .catalog-footer, .dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.catalog-heading p, .ticket-header p, .dialog-head p { margin-top: 5px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 14px; border-radius: 8px; font-weight: 740; white-space: nowrap; }
.outline { border: 1px solid #d0dae6; background: var(--surface); color: var(--ink); }
.outline:hover:enabled { border-color: #889bb4; background: #f7faff; }
.primary { border: 1px solid transparent; background: var(--brand); color: white; }
.primary:hover:enabled { background: var(--brand-hover); }
.link-button { width: fit-content; align-self: center; padding: 4px 0; border: 0; background: transparent; color: var(--brand-hover); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.count { min-width: 20px; padding: 1px 5px; border-radius: 7px; background: #f9dfe3; color: var(--brand-hover); font-size: .75rem; text-align: center; }

#search-form { position: relative; display: flex; align-items: center; margin: 20px 0 13px; }
#search { width: 100%; min-height: 54px; padding: 8px 48px 8px 43px; color: var(--ink); border: 1px solid #b8c7d9; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
#search::placeholder { color: var(--muted); }
#search::-webkit-search-cancel-button { margin-right: 7px; }
.search-icon { position: absolute; left: 16px; width: 16px; height: 12px; color: #49637f; pointer-events: none; background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 3px, currentColor 3px 5px, transparent 5px 7px); }
.search-icon::after { position: absolute; content: ''; inset: -3px; border: 1px solid currentColor; border-radius: 3px; }
kbd { position: absolute; right: 12px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: #f0f4f9; color: var(--muted); pointer-events: none; }
.catalog-controls { display: grid; gap: 10px; margin-bottom: 17px; }
.category-line { display: flex; flex-wrap: wrap; gap: 6px; }
.category-chip { min-height: 35px; padding: 6px 10px; border: 1px solid #d7e0ea; border-radius: 7px; background: #fff; color: #334962; font-size: .82rem; font-weight: 650; }
.category-chip:hover { border-color: #8ea2bb; }
.category-chip[aria-pressed='true'] { color: #8f2331; border-color: #e4b3ba; background: #fdf1f2; }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.catalog-filters label { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink); font-size: .84rem; font-weight: 640; }
.catalog-filters select { min-height: 36px; min-width: 120px; max-width: min(250px, 57vw); padding: 5px 8px; color: var(--ink); background: var(--surface); border: 1px solid #cbd7e4; border-radius: 7px; font-weight: 500; }
.catalog-filters select:enabled:hover { border-color: #91a6bf; }
#filter-availability { min-width: 120px; min-height: 34px; padding: 4px 8px; color: var(--ink); border: 1px solid #becee0; border-radius: 7px; background: #eef4fb; font-size: .84rem; font-weight: 650; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.results-head .muted { font-size: .84rem; text-align: right; }
.results-tools { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 6px 10px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 14px; }
.pos-product-entry {
  --product-image-height: clamp(122px, 12vw, 168px);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  height: calc(var(--product-image-height) + 205px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.pos-product-entry:has(> .link-button) { grid-template-rows: minmax(0, 1fr) 36px; }
.pos-product-entry:hover, .pos-product-entry:focus-within { border-color: #8b9fb7; box-shadow: 0 3px 11px #1723371a; }
.pos-product-entry > .link-button { width: 100%; padding: 5px 12px; border-top: 1px solid var(--line); text-align: left; }
.pos-product-entry :is(.product, .link-button):focus-visible { outline-offset: -3px; }
.pos-product-photo { display: block; max-width: min(100%, 230px); max-height: 170px; object-fit: contain; margin: 0 auto 12px; }
.pos-product-photo[hidden] { display: none; }
.customer-history { border-block-start: 1px solid var(--line, #dde3ea); margin-block: 12px; }
.customer-history details { margin-block: 6px; padding-block: 4px; }
.customer-history summary { cursor: pointer; font-weight: 650; }
.customer-history .history-lines { padding-inline-start: 20px; color: var(--muted, #536075); }
.product { display: flex; min-width: 0; flex-direction: column; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.product-visual { width: 100%; flex: 0 0 var(--product-image-height); display: grid; place-items: center; overflow: hidden; background: #f7f9fc; border-bottom: 1px solid #edf0f5; color: #71849a; }
.product-visual img { display: block; width: 100%; height: 100%; min-height: 0; padding: 11px; object-fit: contain; mix-blend-mode: multiply; }
.no-photo-symbol { display: block; width: 33px; height: 28px; border: 1px solid #9cafc3; border-radius: 4px; background: linear-gradient(150deg, transparent 50%, #dfe7f0 50%) center/100% 100%; }
.product-info { display: grid; flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 4px; width: 100%; padding: 9px 12px; }
.product-code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #425d7a; font-size: .77rem; font-weight: 730; font-variant-numeric: tabular-nums; letter-spacing: .025em; }
.product-name { display: -webkit-box; align-self: start; max-height: 2.6em; overflow: hidden; font-size: .9rem; font-weight: 720; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.product-price { align-self: end; color: var(--ink); font-size: 1.05rem; font-weight: 790; font-variant-numeric: tabular-nums; }
.product-old-price { margin-left: .34rem; color: var(--muted); font-size: .74rem; font-weight: 400; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 42px; margin-top: 3px; padding-top: 6px; border-top: 1px solid #edf0f5; }
.product-bottom .stock-label { min-width: 0; white-space: normal; }
.product-add { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 29px; min-height: 29px; padding: 3px 7px; border: 1px solid #d4e0ed; border-radius: 6px; color: #264768; background: #edf4fc; font-size: .77rem; font-weight: 760; white-space: nowrap; }
.product:hover .product-add, .product:focus-visible .product-add { border-color: #264768; background: #264768; color: #fff; }
.product-add.product-source { border-color: #edced3; color: #8c2a38; background: #fff1f3; font-size: .73rem; }
.product:hover .product-source, .product:focus-visible .product-source { border-color: #8c2a38; color: #fff; background: #8c2a38; }
.stock-label { display: inline-flex; align-items: center; width: fit-content; gap: 4px; padding: 3px 6px; border-radius: 5px; color: #445b75; background: #eef3f8; font-size: .76rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-label[data-level='available'] { color: #19634b; background: #e8f5ee; }
.stock-label[data-level='low'] { color: #754a07; background: #fff2d9; }
.stock-label[data-level='empty'] { color: #902c3a; background: #fcecef; }
.no-results { grid-column: 1/-1; padding: 22px; border: 1px dashed #c4d0df; border-radius: 8px; background: var(--surface); color: var(--muted); }
.catalog-footer { align-items: center; margin-top: 15px; color: var(--muted); font-size: .85rem; }
.stock-list { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.stock-table, .manager-table { width: 100%; border-collapse: collapse; text-align: left; }
.stock-table th, .stock-table td, .manager-table th, .manager-table td { padding: 8px 13px; border-bottom: 1px solid var(--line); }
.stock-table th, .manager-table th { background: #edf2f8; color: #3d536e; font-size: .81rem; white-space: nowrap; }
.stock-table tr:last-child td, .manager-table tr:last-child td { border: 0; }
.stock-table .stock-label { font-size: .89rem; white-space: nowrap; }
.stock-position { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.stock-item { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.stock-item img { flex: none; width: 54px; height: 48px; padding: 4px; object-fit: contain; border-radius: 7px; background: #f3f6fa; }
.stock-item small { display: block; color: #425d7a; font-weight: 690; font-variant-numeric: tabular-nums; }

.ticket-panel { position: sticky; top: 90px; border: 1px solid #d5dfeb; border-radius: 13px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.ticket-header, .ticket-footer { padding: 17px 18px; }
.ticket-header { border-bottom: 1px solid var(--line); }
.customer-section { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #f4f8fc; font-size: .85rem; }
.customer-legacy, .ticket-customer { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.ticket-customer { justify-content: space-between; gap: 10px; }
.ticket-customer > div { min-width: 0; }
.ticket-customer strong, .ticket-customer small, .ticket-customer-label { display: block; }
.ticket-customer strong { margin-top: 2px; font-size: .98rem; overflow-wrap: anywhere; }
.ticket-customer small, .ticket-customer-label { color: var(--muted); }
.ticket-customer-label { font-size: .76rem; font-weight: 680; }
.ticket-customer .link-button { flex: none; min-height: 36px; padding: 5px 9px; border: 1px solid #cbd7e4; border-radius: 6px; color: #264768; text-decoration: none; }
.ticket-customer .link-button:hover { border-color: #91a6bf; background: #edf4fc; }
.ticket-customer-actions, .customer-result-actions { display: flex; flex: none; align-items: center; justify-content: end; flex-wrap: wrap; gap: 6px; }
.customer-section label { flex: none; font-weight: 700; }
.customer-section select { min-width: 0; width: 100%; padding: 7px 8px; color: var(--ink); background: #f6f8fb; border: 1px solid var(--line); border-radius: 7px; }
.cart { min-height: 178px; max-height: clamp(178px, calc(100dvh - 435px), 590px); overflow: auto; }
.empty-cart { min-height: 178px; display: grid; align-content: center; justify-items: center; gap: 4px; padding: 16px 22px; color: var(--muted); text-align: center; }
.empty-cart strong { color: var(--ink); }
.empty-cart-symbol { display: grid; place-items: center; width: 40px; height: 39px; margin-bottom: 4px; border-radius: 8px; color: #42627f; background: #eaf0f8; }
.empty-cart-symbol::after { content: ''; display: block; width: 14px; height: 17px; border: 1.5px solid; border-radius: 2px; background: repeating-linear-gradient(to bottom, transparent 0 3px, #42627f 3px 4px, transparent 4px 7px) center/8px 11px no-repeat; }
.cart-line { padding: 10px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: start; border-bottom: 1px solid #e9edf2; }
.cart-name { overflow-wrap: anywhere; font-size: .89rem; font-weight: 700; }
.cart-code { display: block; color: var(--muted); font-size: .75rem; margin-top: 1px; }
.cart-line-price { font-weight: 740; white-space: nowrap; }
.quantity { display: flex; align-items: center; gap: 6px; }
.quantity button { display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); color: var(--ink); font-size: 1.02rem; }
.quantity output { min-width: 22px; text-align: center; }
.remove-line { justify-self: end; align-self: center; font-size: .76rem; }
.ticket-footer { display: grid; gap: 9px; border-top: 1px solid var(--line); background: #f9fbfe; }
.total-row, .subtotal-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.total-row { font-size: .97rem; font-weight: 740; }
.total-row strong { font-size: 1.78rem; letter-spacing: -.045em; white-space: nowrap; }
.checkout { width: 100%; justify-content: space-between; min-height: 44px; }
.document-shortcuts, .payment-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.document-shortcuts .button { justify-content: center; width: 100%; min-height: 46px; padding-inline: 8px; font-size: .93rem; text-align: center; white-space: normal; }
.document-shortcuts .outline { border-color: #d4aeb3; color: #852b39; }
.document-shortcuts .outline:hover:enabled { border-color: #a04a58; background: #fff1f3; }
#checkout-note { flex-direction: column; gap: 2px; min-width: 0; line-height: 1.2; }
#checkout-note[data-credit='available'] { border-color: #9ac6ac; color: #145e41; background: #e9f6ee; }
#checkout-note[data-credit='available']:hover:enabled { border-color: #66a17b; color: #104d36; background: #dbf0e2; }
#checkout-note[data-credit='blocked'] { border-color: #ddaeb4; color: #8b2433; background: #fff0f1; }
#checkout-note[data-credit]:disabled { opacity: 1; }
#checkout-note[data-credit='unknown'] { color: #435a73; background: #eef3f8; border-color: #cbd7e4; }
.checkout-note-credit { max-width: 100%; font-size: .73rem; font-weight: 630; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.payment-shortcuts .button { min-height: 36px; padding-inline: 6px; font-size: .85rem; line-height: 1.2; text-align: center; white-space: normal; }
.ticket-help { font-size: .78rem; }

dialog { width: min(490px, calc(100vw - 24px)); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--surface); box-shadow: 0 20px 52px #15213228; }
dialog::backdrop { background: #15243894; }
.dialog-head { margin-bottom: 17px; }
.icon-button { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 7px; padding: 0; border: 1px solid var(--line); background: var(--canvas); color: var(--ink); font-size: 1.3rem; }
.payment-methods { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; border: 0; margin-bottom: 15px; }
.payment-methods legend { font-weight: 740; margin-bottom: 6px; padding: 0; }
.payment-methods label { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.payment-methods label:has(input:checked) { background: #fcf0f2; border-color: #e7b8be; }
.payment-methods input { accent-color: var(--brand); }
.cash-fields, .delivery-note-fields { display: grid; gap: 5px; margin-bottom: 14px; }
.cash-fields label, .delivery-note-fields label { font-weight: 710; }
.cash-fields input { max-width: 170px; border: 1px solid #bbc9da; border-radius: 7px; min-height: 40px; padding: 5px 8px; }
.delivery-note-fields select { min-height: 40px; width: 100%; padding: 5px 8px; color: var(--ink); background: var(--surface); border: 1px solid #bbc9da; border-radius: 7px; }
.delivery-note-fields p { margin-bottom: 5px; font-size: .87rem; }
.delivery-note-fields input { width: 100%; }
.message { padding: 9px 12px; border-radius: 7px; margin: 0 0 12px; }
.warning { color: var(--warning); background: #fff3e3; }
.ticket-filters { display: flex; flex-wrap: wrap; align-items: start; gap: 8px 12px; margin-bottom: 8px; }
.ticket-filters label { display: grid; gap: 4px; font-size: .85rem; font-weight: 670; }
.ticket-filters label:has(select) { flex: 1 1 190px; }
.ticket-filters :is(select, input) { min-height: 38px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; }
.ticket-filters .link-button { padding: 3px 0 0; font-size: .82rem; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sales-list { display: grid; padding: 0; list-style: none; max-height: 45vh; overflow: auto; margin: 0 0 17px; }
.sales-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.ticket-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ticket-summary > :last-child { text-align: right; }
.receipt-documents, .ticket-documents { display: grid; gap: 5px; margin-bottom: 8px; }
.pdf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; }
.pdf-actions strong { flex: 1 0 100%; }
.pdf-actions a { min-height: 32px; display: inline-flex; align-items: center; }
.sales-list li span { display: block; font-size: .85rem; }
.sales-status[data-status='synced'] { color: var(--success); }
.sales-status[data-status='pending'] { color: var(--warning); }
.sales-status[data-status='error'] { color: var(--brand-hover); }
.receipt { background: #f5f8fc; border: 1px dashed #a1b0c3; border-radius: 8px; padding: 13px; margin-bottom: 15px; }
.receipt-logo { display: block; width: auto; height: 50px; margin-bottom: 4px; }
.receipt dl { margin: 8px 0 0; }
.receipt dl div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 4px 0; }
.receipt dd { margin: 0; white-space: nowrap; }
.manager-dialog { width: min(740px, calc(100vw - 24px)); }
.lookup-dialog { width: min(620px, calc(100vw - 24px)); }
.customer-search-form { display: flex; gap: 8px; }
.customer-search-form input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f6f8fb; color: var(--ink); }
.lookup-status { margin: 11px 0; font-size: .88rem; }
.lookup-status:empty { display: none; }
.mobile-pickups { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.mobile-pickups summary { cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
.mobile-pickup-list:not(:empty) { display: grid; gap: 8px; margin-block: 10px; max-height: 42vh; overflow: auto; }
.mobile-pickup { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.mobile-pickup .button { margin-top: 8px; }
#mobile-pickups-refresh { margin-top: 8px; }
.lookup-list { max-height: 52vh; list-style: none; overflow: auto; padding: 0; margin: 0; }
.lookup-list li, .supplier-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lookup-list li:last-child, .supplier-row:last-child { border-bottom: 0; }
.lookup-list strong, .lookup-list small, .supplier-row strong, .supplier-row small { display: block; }
.lookup-list strong, .supplier-row strong { overflow-wrap: anywhere; }
.lookup-list small, .supplier-row small { color: var(--muted); }
.lookup-list .button, .supplier-row .button { flex: none; }
.lookup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.customer-details { display: grid; gap: 12px; }
.customer-details dl, dl.customer-details { display: grid; grid-template-columns: minmax(96px, 1fr) minmax(0, 2fr); gap: 6px 12px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f5f8fc; }
dl.customer-details:not(:has(dt)) { display: none; }
dl.customer-details > div { display: contents; }
.customer-details dt { color: var(--muted); font-size: .85rem; }
.customer-details dd { margin: 0; font-weight: 670; overflow-wrap: anywhere; }
.customer-notes { margin-top: 12px; }
.customer-notes > ul { max-height: min(245px, 34vh); overflow: auto; }
.customer-notes ul { margin: 0; padding: 0; list-style: none; }
.customer-notes li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.customer-notes li:last-child { border-bottom: 0; }
.customer-notes small { display: block; color: var(--muted); }
.customer-note-text { white-space: pre-wrap; }
.customer-note-form { display: grid; gap: 7px; margin-top: 12px; }
.customer-note-form label { font-weight: 690; }
.customer-note-form textarea { width: 100%; min-height: 82px; resize: vertical; padding: 8px 10px; border: 1px solid #bdc9d7; border-radius: 7px; background: #f9fbfe; color: var(--ink); }
.customer-note-form .button { justify-self: start; }
.supplier-results { max-height: 52vh; overflow: auto; }
.supplier-select-form { display: flex; flex-shrink: 0; align-items: stretch; gap: 5px; }
.supplier-select-form input { width: 60px; min-width: 0; padding: 5px 4px; border: 1px solid var(--line); border-radius: 7px; }
.supplier-choice { padding: 8px 10px; border-radius: 7px; background: #eef4fa; color: var(--ink); font-size: .88rem; font-weight: 700; }
#cart-backorders { margin: 8px 14px; }
#cart-backorders p { margin: 5px 0; }
.supplier-mode { display: inline-block; padding: 5px 8px; border-radius: 5px; background: #fff0d9; color: #754b07; font-size: .82rem; font-weight: 700; }
.manager-results { overflow-x: auto; margin-bottom: 12px; }
.manager-summary { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: #eef4fa; font-weight: 700; }
.manager-table { margin-bottom: 4px; font-size: .88rem; }
.toast { position: fixed; z-index: 4; bottom: 15px; left: 50%; width: max-content; max-width: calc(100% - 28px); transform: translateX(-50%); border-radius: 8px; background: var(--ink); color: white; padding: 10px 14px; box-shadow: 0 3px 12px #17233337; }
.mobile-ticket { display: none; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(305px, 38%); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
  .topbar { gap: 16px; }
  .topbar-tools { gap: 8px; }
  .nav-icon { display: none; }
  .nav-button { padding-inline: 9px; }
  .store-control select { max-width: 135px; }
}
@media (max-width: 900px) {
  .topbar { position: static; flex-wrap: wrap; gap: 7px 12px; }
  .brand img { height: 36px; }
  .brand small { display: none; }
  .main-nav { order: 3; flex: 1 0 100%; min-width: 0; flex-wrap: wrap; }
  .nav-button { min-height: 35px; }
}
@media (max-width: 750px) {
  .workspace { display: flex; flex-direction: column; gap: 17px; padding-bottom: 71px; }
  .catalog-panel, .ticket-panel { width: 100%; }
  .ticket-panel { position: static; }
  .cart { max-height: none; }
  .mobile-ticket { position: fixed; z-index: 2; right: 12px; left: 12px; bottom: 9px; display: flex; justify-content: space-between; gap: 12px; border-radius: 8px; padding: 11px 14px; background: var(--ink); color: #fff; font-weight: 740; text-decoration: none; }
  .toast { bottom: 62px; }
}
@media (max-width: 415px) {
  .store-control select { max-width: 105px; }
  .connection { font-size: .72rem; }
  .profile summary { width: 33px; height: 33px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .pos-product-entry { --product-image-height: 116px; }
  .product-info { padding-inline: 9px; }
  .product-bottom { gap: 4px; }
  .product-add, .stock-label { padding-inline: 5px; }
  .category-chip { padding-inline: 7px; }
  .catalog-heading { align-items: flex-start; }
  #install-button { font-size: .73rem; }
  .stock-table th, .stock-table td { padding-inline: 8px; }
}

:root[data-om-theme="day"] .topbar { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }
:root[data-om-theme="day"] .topbar :is(.brand small, .connection, .nav-button) { color: var(--muted); }
:root[data-om-theme="day"] .topbar .nav-button:hover,
:root[data-om-theme="day"] .topbar .nav-button[aria-current="page"] { background: #edf2f8; color: var(--ink); border-color: #d1dcea; }
:root[data-om-theme="day"] .topbar .store-control select { background: #f3f6fa; color: var(--ink); border-color: #c9d5e3; }
:root[data-om-theme="day"] .topbar .profile summary { background: #e9f0fa; color: #294465; border-color: #c9d5e3; }

:root[data-om-theme="night"] {
  color-scheme: dark;
  --ink: #ecf3fb;
  --muted: #afc0d2;
  --brand: #ae2836;
  --brand-hover: #f3939d;
  --line: #34465c;
  --canvas: #101b2b;
  --surface: #19283e;
  --success: #a5efd4;
  --warning: #ffcc9c;
  --shadow: 0 3px 10px #0003;
}
:root[data-om-theme="night"] .login-screen { background: radial-gradient(ellipse at top, #22344d, var(--canvas) 65%); }
:root[data-om-theme="night"] :is(.outline, .login-form input, #search, .catalog-filters select, #filter-availability, .pos-product-entry, .ticket-panel) { border-color: var(--line); background: var(--surface); }
:root[data-om-theme="night"] .primary:hover:enabled { background: #92202c; }
:root[data-om-theme="night"] :is(kbd, .customer-section, .customer-section select, .ticket-footer, .outline:hover:enabled, .supplier-choice, .manager-summary) { background: #24344c; color: var(--ink); }
:root[data-om-theme="night"] :is(.category-chip, .stock-table th, .manager-table th, .stock-item small, .product-code, .ticket-customer .link-button) { background: #24344c; color: var(--ink); border-color: var(--line); }
:root[data-om-theme="night"] .category-chip[aria-pressed="true"] { background: #553041; color: #ffc7cf; border-color: #975768; }
:root[data-om-theme="night"] :is(.product-bottom, .cart-line) { border-color: var(--line); }
:root[data-om-theme="night"] .document-shortcuts .outline { color: #f9bac4; }
:root[data-om-theme="night"] :is(.count, .warning, .payment-methods label:has(input:checked)) { background: #553041; border-color: #975768; color: #ffd8dc; }
:root[data-om-theme="night"] :is(.mobile-ticket, .toast) { background: #334d70; }

#receipt-share { width: 100%; margin-bottom: 8px; }
#invoice-share-form select { min-height: 38px; max-width: 100%; }
.invoice-share-page { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }

.pickup-actions, .pickup-cash { display: grid; gap: 8px; }
.pickup-actions { margin: 12px 0; }
.pickup-cash input { min-height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; }
.pickup-lines li > span { text-align: right; }
#pickup-documents:not(:empty) { margin-top: 12px; }

.product-details-dialog { width: min(765px, calc(100vw - 24px)); }
.product-details-section { margin: 14px 0; }
.product-details-section h3 { margin: 0 0 6px; font-size: 1rem; }
.product-details-section p { margin: 6px 0; font-size: .86rem; }
.product-details-table { overflow-x: auto; }
.position-table td:not(:first-child) { white-space: nowrap; }
.position-table .current-store-position td { font-weight: 700; background: var(--surface); }

#product-document-links a { display: inline-block; margin: 0 12px 5px 0; }
#product-details-fields dd { white-space: pre-wrap; }

.customer-more { margin: 8px 0; display: block; }

.returns-dialog { width: min(720px, calc(100vw - 24px)); }
.returns-dialog :is(input, textarea) { min-height: 39px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--canvas); }
.returns-receipt { display: grid; gap: 2px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); overflow-wrap: anywhere; }
.returns-wallet { color: var(--muted); }
.returns-form { margin-top: 13px; }
.returns-form fieldset { display: grid; gap: 8px; min-width: 0; padding: 0; border: 0; }
.returns-form legend { padding: 0; font-weight: 740; }
.returns-form > fieldset > button { justify-self: end; }
.returns-form textarea { resize: vertical; }
.returns-lines { max-height: 36vh; }
.returns-quantity { flex: 0 0 78px; display: grid; gap: 2px; font-size: .8rem; }
.returns-quantity input { width: 100%; }
.returns-history { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.returns-history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.returns-history-head h3 { margin: 0; font-size: 1rem; }
.returns-records { max-height: 38vh; }
.returns-records > li { flex-wrap: wrap; }
.returns-record-copy { flex: 1 1 150px; min-width: 0; }
.returns-record-copy [data-status="credited"] { color: var(--success); }
.returns-record-copy [data-status="pending"] { color: var(--warning); }
.returns-record-details { margin-top: 6px; font-size: .85rem; }
.returns-record-details summary { color: var(--muted); cursor: pointer; }
.returns-record-actions { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; }
.returns-record-actions .button, .returns-history-head .button { min-height: 35px; padding: 5px 8px; font-size: .86rem; }
@media (max-width: 440px) {
  .returns-dialog { padding: 15px; }
  .returns-dialog .customer-search-form { flex-wrap: wrap; }
  .returns-dialog .customer-search-form input { flex-basis: 100%; }
}

[data-procenter-brand],.login-brand img{background:#fff;border-radius:4px;object-fit:contain}
