:root {
  --green: #163f34;
  --deep: #10362e;
  --mint: #eaf3ee;
  --lime: #d6e9b7;
  --paper: #f7f8f4;
  --white: #fff;
  --ink: #202a25;
  --body: #415146;
  --muted: #647267;
  --line: #e1e7df;
  --border: #d6dfd4;
  --red: #9c382e;
  --amber: #79551e;
  --side: 228px;
  font: 14px/1.5 Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; touch-action: manipulation; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid #b78a35; outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #6f9e86; outline-offset: 1px; }
input, select, textarea {
  min-width: 0; max-width: 100%; min-height: 40px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--white);
}
input[type="checkbox"] { accent-color: var(--green); width: 18px; height: 18px; min-height: 0; margin: 0; }
textarea { min-height: 75px; resize: vertical; }
input::placeholder { color: #6b786d; opacity: 1; }
label { display: grid; gap: 6px; color: #44564a; font-size: 12px; font-weight: 650; min-width: 0; }
label small, .hint { color: var(--muted); font-size: 11px; font-weight: 400; }
h1, h2, h3, p { margin-top: 0; }
h2 { font-size: 17px; line-height: 1.35; }
h3 { font-size: 14px; }
svg { flex: none; vertical-align: middle; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-180%); padding: 8px 12px; background: white; border-radius: 7px; }
.skip:focus { transform: none; }
.shell { display: flex; min-height: 100dvh; }
#sidebar {
  position: sticky; top: 0; width: var(--side); height: 100dvh; padding: 26px 16px 20px;
  background: var(--green); color: #d9e5dd; flex: 0 0 var(--side); display: flex; flex-direction: column;
  overflow: auto; scrollbar-width: thin; scrollbar-color: #6e9180 var(--green);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 1px 10px 29px; font-size: 17px; letter-spacing: 1px; font-weight: 750; color: white; }
.brandmark {
  display: grid; grid-auto-flow: column; place-content: center; gap: 0; flex: 0 0 40px; width: 40px; height: 42px;
  border-radius: 11px; background: var(--lime); color: var(--green); font: 800 35px/1 Inter, "Segoe UI", sans-serif;
  letter-spacing: -5px; padding: 0 5px 4px 0;
}
.brandmark span { color: #8b6927; }
.brand small { display: block; margin-top: 3px; color: #bcd1c1; font-size: 9px; letter-spacing: 3.5px; font-weight: 550; }
.store-name { margin: 0 12px 14px; color: #bcd1c1; font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }
nav { display: grid; gap: 5px; flex: 0 0 auto; }
.navitem { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px; font-size: 13px; color: #d1e1d8; background: transparent; text-align: left; min-height: 42px; }
.navitem:hover { background: #265344; }
.navitem.active { color: var(--deep); background: var(--lime); font-weight: 750; }
.navitem svg { width: 18px; height: 18px; }
.side-bottom { margin-top: auto; padding-top: 25px; }
.side-mode { display: flex; align-items: center; gap: 8px; border: 1px solid #497565; background: #204e40; padding: 9px 11px; border-radius: 9px; color: #e0ebe3; font-size: 11px; margin-bottom: 14px; }
.userbox { width: 100%; display: flex; gap: 9px; align-items: center; text-align: left; background: transparent; color: #e9f1eb; border-top: 1px solid #436a59; padding: 13px 4px 0; }
.avatar { flex: 0 0 33px; height: 33px; border-radius: 50%; display: grid; place-content: center; background: #577b65; color: white; font-weight: 700; }
.user-details { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; font-size: 12px; }
.user-details small { color: #c4d6c9; font-size: 10px; }
.scrim { display: none; }
.workspace { min-width: 0; width: 100%; flex: 1; display: flex; flex-direction: column; }
.topbar { min-height: 73px; padding: 0 30px; background: white; border-bottom: 1px solid var(--line); display: flex; gap: 14px; justify-content: space-between; align-items: center; }
.breadcrumb { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 10px; letter-spacing: 1px; font-weight: 700; }
.slash { color: #a4b0a2; }
.breadcrumb strong { color: #3b4d40; font-size: 13px; letter-spacing: 0; }
.header-right { display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; color: #2c6549; background: #edf4ed; border: 1px solid transparent; border-radius: 20px; white-space: nowrap; font-size: 11px; font-weight: 700; }
.pill.off { color: var(--amber); background: #fff1dc; }
.pill.shift { background: #fff; border-color: var(--border); color: #56665b; }
.pill.open { color: #286047; border-color: #cfe3d4; }
.indicator { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.date-label { color: var(--muted); font-size: 11px; }
.mobilebrand { display: none; }
main { flex: 1; padding: 28px 30px 16px; outline: 0; }
footer { display: flex; justify-content: space-between; gap: 10px; padding: 13px 30px 20px; color: var(--muted); font-size: 10px; }
.dot { color: #60884d; padding: 0 6px; font-size: 8px; }
#banner:empty { display: none; }
#banner { background: #fff3db; color: #6a4d1e; border-bottom: 1px solid #ecdcb9; padding: 9px 30px; font-size: 12px; }
#banner .btn { margin-left: 7px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.pagehead h1 { font-size: clamp(24px, 2.25vw, 31px); font-weight: 700; letter-spacing: -.85px; margin: 0 0 4px; line-height: 1.2; }
.pagehead p { font-size: 13px; color: var(--muted); margin: 0; }
.actions, .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar { margin: 0 0 15px; align-items: end; }
.toolbar .searchbar { flex: 1; min-width: 160px; margin: 0; }
.toolbar select { min-height: 42px; }
.toolbar .btn { min-height: 42px; }
.product-activation-panel { padding: 0; border: 0; margin: 0; min-width: 0; }
.product-activation-panel .toolbar label { flex: 1; min-width: min(190px, 100%); }
.product-activation-panel .check { cursor: pointer; }
.align-end { justify-content: flex-end; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wide, .span2 { grid-column: 1 / -1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 13px; border-radius: 8px;
  border: 1px solid var(--border); color: #374c3d; background: white; font-weight: 650; font-size: 12px; line-height: 1.3;
}
.btn:hover { background: #f0f4ec; }
.btn.primary { border-color: var(--green); background: var(--green); color: white; }
.btn.primary:hover { background: #255540; }
.btn.light { color: var(--green); background: #eef4e5; border-color: #d8e5ca; }
.btn.danger { color: var(--red); background: #fff2ef; border-color: #edcfc9; }
.btn.sm { min-height: 33px; padding: 6px 10px; font-size: 11px; }
.btn.block { width: 100%; min-height: 44px; }
.icon-btn { display: inline-grid; place-content: center; min-width: 34px; min-height: 34px; background: #f4f7f1; border: 1px solid var(--line); border-radius: 7px; color: #556959; }
.icon-btn:hover { background: #e9f0e4; }
.text-btn { padding: 2px 0; background: none; color: #275e46; text-decoration: underline; text-underline-offset: 2px; font-size: 12px; font-weight: 650; }
.muted { color: var(--muted); font-size: 12px; }
.no-margin { margin: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-value, .money { font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 0 0 21px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; min-width: 0; background: white; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 7px; font-size: 11px; color: #5b6a5f; font-weight: 650; }
.stat-label svg { color: #5b8067; }
.stat-value { display: block; font-size: clamp(17px, 1.8vw, 25px); line-height: 1.2; letter-spacing: -.55px; font-weight: 730; overflow-wrap: anywhere; }
.stat small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.panel { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 17px; min-width: 0; }
.panel h2 { margin: 0 0 8px; }
.panel p:last-child { margin-bottom: 0; }
.notice { padding: 11px 13px; border: 1px solid #dbe8cf; border-radius: 9px; background: #f1f6ea; color: #40533b; font-size: 12px; margin: 0 0 13px; }
.notice.warn { background: #fff5e4; color: var(--amber); border-color: #eee0bf; }
.notice.bad { background: #fff1ed; color: var(--red); border-color: #efd1c7; }
.badge { display: inline-flex; padding: 3px 7px; border-radius: 6px; background: #edf4e8; color: #3e6442; font-weight: 700; font-size: 10px; align-items: center; }
.badge.warn { background: #fff2db; color: #79571d; }
.badge.bad { background: #ffece8; color: #943d31; }
.badge.neutral { background: #f0f3ef; color: #53655a; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) clamp(298px, 27vw, 370px); gap: 20px; align-items: start; }
.catalog { min-width: 0; }
.searchbar { position: relative; margin-bottom: 12px; min-width: 0; }
.searchbar input { width: 100%; height: 47px; padding-left: 42px; padding-right: 40px; font-size: 14px; }
.searchbar > svg { position: absolute; z-index: 1; left: 13px; top: 14px; color: #688071; }
.searchbar kbd { position: absolute; top: 13px; right: 12px; }
kbd { display: inline-flex; align-items: center; padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: #f8faf7; color: #647268; font: 650 10px/1.5 Inter, "Segoe UI", sans-serif; }
.categories { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 5px; margin: 0 -2px 12px; scrollbar-width: thin; }
.cat { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; white-space: nowrap; color: #4e6353; background: transparent; font-size: 12px; min-height: 35px; }
.cat.active { background: #e3eddb; border-color: #cfdfc3; color: #335839; font-weight: 700; }
.productgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 11px; }
.product { text-align: left; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; min-width: 0; transition: transform .12s, border-color .12s; }
.product:hover { transform: translateY(-2px); border-color: #9eb799; }
.product-art { color: #4b735e; background: #eef3e7; border-radius: 8px; height: 76px; display: grid; place-items: center; margin-bottom: 9px; width: 100%; }
.product-art svg { opacity: .9; stroke-width: 1.25; }
.product:nth-child(4n + 2) .product-art { background: #f4efdf; color: #8a7444; }
.product:nth-child(4n + 3) .product-art { background: #e8f1eb; color: #4a7967; }
.product:nth-child(4n) .product-art { background: #f3ebe4; color: #8c6b53; }
.product h3 { margin: 0 0 4px; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.product .unit { margin: 0 0 8px; font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.product-bottom { width: 100%; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 3px; }
.price { font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.price-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 600; }
.add-circle { display: grid; place-content: center; border-radius: 6px; width: 25px; height: 25px; background: #eaf1e4; color: #315f43; flex-shrink: 0; }
.stock-label { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.stock-label.low, .low { color: var(--amber); }
.cart { position: sticky; top: 15px; background: white; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.carthead { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px dashed var(--line); gap: 8px; }
.carthead h2 { font-size: 16px; margin: 0 0 2px; }
.carthead small { color: var(--muted); font-size: 11px; }
.carthead > svg { color: #5a7f64; }
.cartbody { padding: 14px 18px 17px; }
.cartbody > label { margin-bottom: 10px; }
.cart-drafts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.customerpicker { background: #f4f7ef; border: 1px solid #edf2e9; border-radius: 9px; width: 100%; margin-bottom: 8px; justify-content: space-between; text-align: left; }
.customerpicker span { min-width: 0; overflow-wrap: anywhere; }
/* Cliente de la factura dentro de Venta actual, antes de las partidas. */
.pos-buyer { display: grid; gap: 5px; margin-bottom: 12px; }
.pos-buyer > label { font-size: 12px; font-weight: 650; }
.pos-buyer-row { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.pos-buyer-row input { min-width: 0; flex: 1 1 auto; }
.pos-buyer-row .btn { flex: 0 0 auto; white-space: nowrap; }
.pos-buyer > small { color: var(--muted); font-size: 10px; line-height: 1.4; }

.cartlines { max-height: 340px; overflow: auto; }
.cartline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; border-bottom: 1px solid #edf1eb; padding: 9px 0; }
.cartline strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.cartline small { display: block; font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.cartline .num { font-weight: 700; font-size: 12px; }
.qtybar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.qtybar .icon-btn { min-width: 29px; min-height: 28px; }
.qtybar .btn { min-height: 28px; padding: 3px 7px; }
.qtybar output { min-width: 15px; text-align: center; font-size: 11px; font-weight: 650; }
.cart-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 23px 0; }
.cart-empty svg { display: block; margin: 0 auto 8px; color: #70907a; }
.totals { margin-top: 12px; display: grid; gap: 7px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: #53675a; }
.totals strong { color: #28513a; }
.totals .grand { padding-top: 11px; margin-top: 3px; border-top: 1px dashed var(--border); font-size: 14px; font-weight: 650; }
.grand strong { font-size: 23px; letter-spacing: -.65px; }
.checkout { width: 100%; padding: 10px 13px; margin-top: 13px; justify-content: space-between; min-height: 45px; }
.checkout kbd { background: #3a6955; color: white; border-color: #547e68; }
.mobile-cart { display: none; }
.empty { grid-column: 1 / -1; text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 26px 17px; background: #fff; min-width: 0; }
.empty-icon { display: inline-grid; width: 43px; height: 43px; place-content: center; border-radius: 11px; background: #eef4e9; color: #567b60; margin-bottom: 8px; }
.empty h3 { margin: 0 0 5px; }
.empty p { margin: 0 auto 10px; max-width: 400px; color: var(--muted); font-size: 12px; }
.empty .actions { justify-content: center; }
.tablebox { width: 100%; background: white; border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.tablebox:focus-visible { outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th { text-align: left; white-space: nowrap; background: #fbfcf8; color: #55655a; font-size: 11px; font-weight: 700; }
td, th { padding: 11px 12px; vertical-align: middle; }
td { border-top: 1px solid #edf1eb; }
td strong, td small { overflow-wrap: anywhere; }
td small { display: block; color: var(--muted); font-size: 11px; }
tbody tr:hover { background: #fafbf8; }
td .actions { flex-wrap: nowrap; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.pager .actions { margin-left: auto; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-items: start; }
.check { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.formactions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.error { color: var(--red); font-size: 12px; line-height: 1.5; margin: 9px 0; white-space: pre-wrap; }
.error:empty { display: none; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 13px 0; }
dialog { padding: 0; border: 1px solid #dbe6d9; border-radius: 16px; color: var(--ink); background: white; width: min(590px, calc(100% - 26px)); max-height: calc(100dvh - 30px); box-shadow: 0 24px 85px #0d2e2850; }
dialog.wide-modal { width: min(850px, calc(100% - 26px)); }
dialog::backdrop { background: #102f27a3; backdrop-filter: blur(2px); }
#modal { padding: 21px 23px; }
.modalhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0 0 15px; }
.modalhead h2 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.4px; }
.modalhead p { color: var(--muted); margin: 0; font-size: 12px; }
.bigamount { font-size: 32px; margin: 0 0 10px; color: var(--green); font-weight: 750; letter-spacing: -.7px; }
.lookup { position: relative; min-width: 0; }
.lookup input { width: 100%; }
.lookup-results { display: grid; margin-top: 3px; background: white; border: 1px solid var(--border); border-radius: 8px; max-height: 177px; overflow-y: auto; }
.lookup-results button { background: white; text-align: left; padding: 8px 10px; color: var(--body); border-bottom: 1px solid var(--line); font-size: 12px; }
.lookup-results button:hover, .lookup-results button:focus-visible { background: #edf4e7; }
.lookup-results small { display: block; color: var(--muted); }
.lookup-results .muted { padding: 8px 10px; }
.line-card { padding: 10px; background: #f9faf7; border: 1px solid var(--line); border-radius: 9px; margin: 10px 0; }
.line-card .formgrid { margin-top: 8px; }
.line-card .row { align-items: flex-start; }
.units { display: grid; gap: 8px; margin-top: 9px; }
.unit-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding-top: 6px; }
.unit-btn { justify-content: space-between; text-align: left; overflow-wrap: anywhere; }
.receipt { color: #171e18; background: white; font: 12px/1.55 "Courier New", monospace; max-width: 380px; margin: 0 auto; overflow-wrap: anywhere; }
.receipt.a4 { max-width: 730px; }
.receipt.letter { max-width: 765px; }
.receipt h2 { text-align: center; margin: 0; font-size: 19px; }
.receipt strong { font-size: 13px; }
.receipt p { margin: 2px 0 5px; }
.receipt .center { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #9a9a9a; margin: 10px 0; }
.receipt td, .receipt th { padding: 4px 2px; font-size: 11px; background: transparent; }
.receipt .amount { font-size: 16px; font-weight: 700; }
.sale-ticket { color: #000; font: 13px/1.22 Arial, Helvetica, sans-serif; }
.sale-ticket p { margin: 0; }
.sale-ticket strong { font-size: inherit; }
.sale-ticket-header { text-align: center; padding-bottom: .4em; border-bottom: 1px solid #000; }
.sale-ticket-header h2 { font-size: 1.3em; line-height: 1.1; margin: 0 0 .2em; }
.sale-ticket-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .1em .55em; margin-top: .25em; }
.sale-ticket-meta > * { white-space: nowrap; }
.sale-ticket .sale-ticket-customer { margin: .4em 0; }
.sale-ticket-items { font-size: inherit; }
.sale-ticket-items :is(th, td) { padding: .12em 0; border: 0; font-size: inherit; color: inherit; }
.sale-ticket-items thead { border-block: 1px solid #000; }
.sale-ticket-items tbody + tbody { border-top: 1px dotted #000; }
.sale-ticket-items td.num { padding-left: .35em; vertical-align: bottom; }
.sale-ticket-detail { font-size: .95em; }
.sale-ticket-totals { margin-top: .3em; }
.sale-ticket-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: .4em; }
.sale-ticket-totals strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sale-ticket-total { border-top: 1px solid #000; padding-top: .2em; font-size: 1.19em; font-weight: 700; }
.sale-ticket-balance { font-weight: 700; }
.sale-ticket-footer { margin-top: .35em; padding-top: .3em; border-top: 1px solid #000; }
.sale-ticket-notes { white-space: pre-line; }
#printview { display: none; }
#printview.measuring-ticket {
  display: block; position: fixed; inset: 0 auto auto 0; visibility: hidden; pointer-events: none;
  height: auto; min-height: 0;
}
#printview .roll-ticket {
  box-sizing: border-box; margin: 0; max-width: none; padding: 1.3mm 3mm 1.3mm; overflow-wrap: anywhere;
  font: 9.5pt/1.16 Arial, Helvetica, sans-serif;
}
#printview .roll-ticket table { width: 100%; }
.ticket-format { margin: 10px 0 0 auto; max-width: 170px; }
.ticket-code { width: 100%; max-width: 56mm; margin: 1mm auto 0; }
.print-barcode { display: block; width: 100%; height: 8mm; }
.shipping-form { max-width: 760px; }
.shipping-form .lookup { margin-bottom: 14px; }
.print-label {
  box-sizing: border-box; color: #000; background: #fff; overflow: hidden;
  overflow-wrap: anywhere; font-family: Arial, Helvetica, sans-serif; break-inside: avoid;
}
.shipping-label {
  width: 4in; height: 2in; padding: 2.5mm 3mm; display: flex; flex-direction: column;
  gap: .5mm; font-size: 9pt; line-height: 1.1;
}
.shipping-recipient {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4mm 2mm;
}
.shipping-label header { font-size: 8pt; border-bottom: 1px solid #000; padding-bottom: .8mm; }
.shipping-address { white-space: pre-line; }
.shipping-note { font-size: 8pt; }
.shipping-label .label-code { margin: auto 0 0; width: 72mm; align-self: center; text-align: center; font-size: 7pt; }
.product-label {
  width: 2in; height: 1in; padding: 1.15mm 1.6mm; display: flex; flex-direction: column;
  gap: .35mm; font-size: 8pt; line-height: 1.06; text-align: center;
}
.label-title { font-size: 9pt; max-height: 2.12em; overflow: hidden; }
.label-detail { font-size: 7pt; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-label .label-code { margin-top: auto; font-size: 6.5pt; line-height: 1; }
.product-label .print-barcode { height: 6.8mm; }
#toast { position: fixed; z-index: 110; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: 90vw; display: none; border-radius: 10px; color: white; background: #1b4937; padding: 11px 17px; box-shadow: 0 5px 20px #10362e40; font-size: 13px; }
#toast.show { display: block; }
#toast.fail { background: #7a3229; }
.loading { color: var(--muted); text-align: center; padding: 28px 12px; }
.loading::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #67916d; display: inline-block; margin: 0 7px 1px 0; }
.access { min-height: 100dvh; display: grid; grid-template-columns: minmax(285px, .83fr) minmax(475px, 1.17fr); }
.access-brand { background: var(--green); color: white; display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 8vw, 120px); }
.access-brand .brand { padding: 0; margin-bottom: 35px; }
.access-brand h1 { margin: 0 0 12px; font-size: clamp(29px, 4vw, 53px); line-height: 1.06; letter-spacing: -1.5px; }
.access-brand p { font-size: 14px; color: #cfe1d5; max-width: 31ch; margin: 0; }
.access-main { display: grid; align-content: center; padding: 30px clamp(24px, 8vw, 118px); }
.access-panel { max-width: 560px; width: 100%; margin: auto; background: white; border: 1px solid var(--line); border-radius: 15px; padding: clamp(18px, 4vw, 31px); }
.access-panel h2 { font-size: 24px; letter-spacing: -.5px; margin: 0 0 4px; }
.access-panel .formgrid { margin-top: 15px; }
.access-panel .btn.block { margin: 6px 0 0; }
.access-panel .text-btn { margin-top: 12px; }
.meter { accent-color: #6a8f62; width: 100%; height: 10px; margin: 7px 0 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.camera-preview { display: block; width: 100%; max-height: 55vh; background: #12372e; border-radius: 12px; }
.timeline li { padding: 9px 0 9px 12px; border-left: 2px solid #dfebd9; margin-left: 3px; }
.timeline li p { margin: 2px 0 0; }
@media (max-width: 1190px) {
  :root { --side: 201px; }
  #sidebar { padding: 23px 12px 17px; }
  main, .topbar, #banner, footer { padding-left: 22px; padding-right: 22px; }
  .topbar { min-height: 65px; }
  .date-label { display: none; }
  .pos { gap: 15px; }
  .stats { gap: 9px; }
  .stat { padding: 12px; }
}
@media (max-width: 950px) {
  :root { --side: 179px; }
  .navitem { font-size: 12px; gap: 8px; padding: 9px; }
  .pos { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cartlines { max-height: 260px; }
  .grid-2.responsive { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .access { grid-template-columns: minmax(0, 1fr); }
  .access-brand { padding: 18px clamp(17px, 6vw, 55px); }
  .access-brand .brand { margin: 0; }
  .access-brand h1, .access-brand p { display: none; }
  .access-main { align-content: start; padding: 23px 15px; }
}
@media (max-width: 660px) {
  #sidebar { position: fixed; z-index: 90; width: 228px; transform: translateX(-100%); transition: transform .18s ease; }
  #sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 85; background: #0f2e2580; }
  .topbar { padding: 0 12px; min-height: 59px; gap: 5px; }
  .breadcrumb { display: none; }
  .mobilebrand { display: inline-flex; align-items: center; gap: 6px; color: var(--green); background: none; padding: 6px 1px; min-height: 42px; font-size: 12px; }
  .header-right { gap: 4px; }
  .pill { font-size: 10px; padding: 5px 7px; }
  main, #banner, footer { padding-left: 13px; padding-right: 13px; }
  main { padding-top: 19px; }
  .pagehead { align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
  .pagehead p { font-size: 12px; }
  .pagehead .actions { width: 100%; }
  .stat small { font-size: 10px; }
  .productgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-art { height: 68px; }
  .cartbody, .carthead { padding-left: 13px; padding-right: 13px; }
  .pos-active footer { padding-bottom: 68px; }
  .mobile-cart {
    position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; display: flex; width: 100%;
    justify-content: space-between; align-items: center; padding: 9px 13px calc(9px + env(safe-area-inset-bottom));
    background: var(--green); color: white; border-top: 1px solid #5c826e;
  }
  .mobile-cart svg { margin-right: 5px; }
  #key-hints, kbd { display: none; }
  #toast { bottom: 61px; }
  #modal { padding: 17px 15px; }
  .btn { min-height: 43px; }
  input, select, textarea { font-size: 16px; }
  .formgrid, .grid-3, .unit-row { grid-template-columns: 1fr; gap: 9px; }
  .grid-2:not(.keep-grid) { grid-template-columns: 1fr; }
  .unit-row { padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
  td, th { padding: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@media print {
  html, body {
    display: block !important; height: auto !important; min-height: 0 !important;
    width: auto !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important;
    overflow: visible !important; background: #fff !important;
  }
  body > :not(#printview) { display: none !important; }
  #printview {
    display: flow-root !important; position: static !important; visibility: visible !important;
    height: auto; min-height: 0; width: auto; margin: 0; padding: 0; overflow: visible;
  }
  #printview > :first-child { break-before: auto; }
  #printview > :last-child { break-after: auto; }
  .receipt { width: 72mm; max-width: 100%; margin: 0 auto; }
  .receipt.a4 { width: 190mm; max-width: 100%; }
  .receipt.letter { width: 201mm; max-width: 100%; }
  .receipt.matricial { width: 100%; font: 9pt/1.2 "Courier New", Courier, monospace; }
  .receipt tr { break-inside: avoid; }
  .receipt table { width: 100%; }
  .sale-ticket { color: #000; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .sale-ticket-items tbody, .sale-ticket-totals, .sale-ticket-footer { break-inside: avoid; }
}

.payment-grid { margin: 10px 0; }
[data-credit-summary] { margin-top: 10px; }
[data-credit-summary] .btn { margin-top: 8px; }
[data-tender] { margin: 8px 0; }

.mapping { margin: 12px 0; border: 1px solid var(--line); background: #f8faf5; padding: 9px 11px; border-radius: 8px; }
.mapping summary { cursor: pointer; font-weight: 700; margin-bottom: 6px; }
.migrate-assign, .migrate-preview { margin-top: 13px; }
.import-issues { max-height: 190px; overflow: auto; margin: 6px 0 0; padding-left: 20px; font-size: 12px; }
.import-issues li { margin: 3px 0; }

.offline-tools { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.offline-tools p { margin-bottom: 6px; }
.offline-tools .hint { margin-top: 6px; }
.alerts-button { position: relative; flex: none; }
.alert-counter { position: absolute; top: -6px; right: -6px; border-radius: 10px; padding: 1px 5px;
  background: var(--green); color: white; border: 1px solid white; font-size: 10px; line-height: 14px; }
.alerts-grid .panel { margin: 0; }
.alerts-grid ul { list-style: none; margin: 0 0 12px; padding: 0; }
.alerts-grid li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 7px 0; border-top: 1px solid var(--line); }

.after-setup { margin: 11px 0 8px; gap: 7px; }

/* Cupón en una sola fila sin alterar el resto del diseño del POS. */
.checkout-coupon{display:flex;align-items:flex-end;gap:8px}.checkout-coupon>label{flex:1 1 auto;min-width:0}.checkout-coupon>.btn{flex:0 0 auto;min-height:42px;white-space:nowrap}
@media(max-width:480px){.checkout-coupon{flex-wrap:nowrap}.checkout-coupon>.btn{font-size:11px;padding-inline:8px}.checkout-coupon input{min-width:0}}

/* Confirmaciones reales de sincronización; se muestra solo durante el envío. */
.sync-confirmed{display:grid;gap:4px;min-width:180px;margin:4px 0 9px;width:min(100%,460px);font-size:12px}
.sync-confirmed progress{display:block;width:100%;height:11px;accent-color:var(--green)}
.sync-confirmed small{font-size:11px;color:var(--muted)}

/* Asesor ASSANPOS: no animaciones, nunca reemplaza la vista principal. */
.ai-context { margin: .7rem 0 1rem; padding: .8rem 1rem; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface, #fff); }
.ai-context-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.ai-context-head strong { font-size: .93rem; }
.ai-context-head .btn { flex-shrink:0; }
.ai-context-list { margin:.55rem 0 0; padding-left:1.15rem; }
.ai-context-list li { margin: .28rem 0; font-size:.87rem; }
.ai-context small { display:block; color:var(--muted,#5e6d63); font-size:.74rem; margin-top:.35rem; }
.ai-context [data-ai-status] { font-size:.85rem; color:var(--muted,#5e6d63); }
@media(max-width:600px){.ai-context-head {flex-wrap:wrap;} }

/* 1.0.29: un consejo corto, desplegable y sin animaciones. */
.ai-micro{margin:4px 0 10px;max-width:100%;}
.ai-micro[hidden]{display:none!important}
.ai-micro-details{border:1px solid var(--line);border-radius:9px;background:var(--surface,#fff);}
.ai-micro-details summary{display:flex;align-items:center;gap:10px;padding:8px 11px;cursor:pointer;list-style:none;min-height:38px;font-size:12px;}
.ai-micro-details summary::-webkit-details-marker{display:none}
.ai-micro-tag{background:#eaf4e8;color:#23523e;border-radius:7px;padding:3px 7px;font-weight:700;white-space:nowrap;}
.ai-micro-details summary strong{font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:38%;}
.ai-micro-hint{color:var(--muted,#5e6d63);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;}
.ai-micro-caret{color:#245440;font-weight:600;white-space:nowrap;font-size:11px;}
.ai-micro-info{padding:4px 13px 12px;border-top:1px solid var(--line);font-size:12px;}
.ai-micro-info p{margin:6px 0;}
.ai-micro-info small{display:block;margin:5px 0;color:var(--muted,#5e6d63);font-size:11px;}
.ai-micro-info button{margin-top:5px;}
@media(max-width:720px){.ai-micro-hint{display:none}.ai-micro-details summary strong{max-width:none;flex:1}}
@media print{.ai-micro{display:none!important}}

/* Asistente contextual visible en todo momento: sin desplegables ni parpadeos. */
.ai-micro.ai-visible{display:flex;align-items:flex-start;gap:9px;margin:4px 0 10px;padding:9px 11px;max-width:100%;border:1px solid var(--line);border-radius:9px;background:var(--surface,#fff);font-size:12px;line-height:1.35;}
.ai-visible .ai-micro-tag{display:inline-flex;align-items:center;white-space:nowrap;background:#eaf4e8;color:#23523e;font-size:11px;font-weight:700;padding:3px 7px;border-radius:7px;flex:none;}
.ai-visible-copy{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 6px;min-width:0;flex:1;}
.ai-visible-copy strong{font-size:12px;font-weight:700;}
.ai-visible-copy [data-ai-suggestion]{font-size:12px;color:var(--text,#213329);min-width:0;overflow-wrap:anywhere;}
.ai-visible-copy [data-ai-caution]{flex-basis:100%;font-size:11px;color:var(--muted,#68766b);}
@media(max-width:600px){.ai-micro.ai-visible{gap:6px;flex-wrap:wrap}.ai-visible-copy{flex-basis:100%;}}
@media print{.ai-micro.ai-visible{display:none!important}}
