:root {
  --fg: #12151c;
  --muted: #4a5568;
  --border: #c5cdd8;
  --bg: #eef1f5;
  --surface: #ffffff;
  --danger: #b42318;
  --navy: #162033;
  --blue: #1e4d8c;
  --coffee: #6b3e1a;
  --price: #8a3d0f;
  --price-bg: #fff3d6;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 16px; }
.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.35rem;
}
.muted { color: var(--muted); }
.btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-outline { background: var(--surface); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
[hidden] { display: none !important; }
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
label input, label select { margin-top: 4px; }
.card-form {
  border: 1px solid var(--border);
  padding: 1rem;
  background: var(--surface);
}
.alert {
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
}
.alert--err { border-color: #fecaca; color: var(--danger); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 3px solid #c17a3a;
  position: sticky;
  top: 0;
  background: var(--navy);
  color: #f4f6f8;
  z-index: 10;
  max-width: 100%;
  overflow: visible;
}
.topbar .muted { color: #b8c2d0; }
.topbar > div:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar strong { letter-spacing: -0.02em; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 16px 0;
}
.stat {
  background: var(--surface);
  padding: 14px 16px;
}
.stat .n {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.table-foot td {
  border-top: 1px solid var(--border);
  border-bottom: none;
  padding-top: 12px;
  font-weight: 700;
  font-size: 14px;
}
.table tfoot { border-top: 1px solid var(--border); }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 2px;
}
.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 6px;
  background: #16a34a;
}
.online-dot.off { background: #a3a3a3; }

/* POS — viewport fijo; scroll solo en grid / carrito */
body.pos-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
body.pos-page .topbar,
body.pos-page .shift-warn { flex-shrink: 0; }
body.pos-fullscreen .topbar,
body.pos-kiosk .topbar { display: none; }
body.pos-fullscreen .shift-warn { display: none !important; }
.pos-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 10px;
}
.pos-catalog-head { flex-shrink: 0; }
.catalog-dlg {
  width: min(1100px, 98vw);
  max-width: none;
  height: min(92vh, 900px);
}
.catalog-dlg__body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-width: none;
}
.catalog-dlg .prod-grid {
  flex: 1;
  min-height: 240px;
}
.pos-search {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.25;
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid var(--navy);
  letter-spacing: 0.01em;
}
.pos-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 72px;
  overflow-y: auto;
}
.cat-chips button {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
}
.cat-chips button.is-on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}
.prod-card {
  background: var(--bg);
  padding: 8px 10px;
  cursor: pointer;
  border: none;
  text-align: left;
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
}
.prod-card:active { background: var(--surface); }
.prod-card .price {
  display: inline-block;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--price);
  background: var(--price-bg);
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.pos-cart {
  padding: 2px 0 0;
  background: #fff;
  border-left: none;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.pos-cart-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: 0 0 6px;
}
.pos-cart-bar .ticket-tabs { margin: 0; flex: 1; min-width: 0; }
.pos-cart-bar #customer {
  margin: 0;
  width: min(220px, 32vw);
  flex-shrink: 0;
}
.pos-cart-bar #priceMode { margin: 0; flex-shrink: 0; }
.cart-lines {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff8ef;
  border: 1px solid #e0c9a8;
  border-radius: 4px;
  padding: 4px 10px;
}
.cart-totals {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.cart-tot-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}
.pos-keys {
  font-size: 11px;
  margin: 0 0 10px;
  line-height: 1.35;
}
.ticket-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  flex-shrink: 0;
}
.ticket-tab {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ticket-tab__x {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
}
.ticket-tab__x:hover { background: rgba(0,0,0,0.08); }
.ticket-tab.is-on .ticket-tab__x:hover { background: rgba(255,255,255,0.18); }
.ticket-tab.is-on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.ticket-tab--new {
  min-width: 32px;
  font-weight: 700;
  color: var(--fg);
}
.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem auto 5.75rem;
  grid-template-areas: "name meta qty total";
  column-gap: 10px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cart-line__name {
  grid-area: name;
  font-weight: 600;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-line__meta {
  grid-area: meta;
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--price);
  text-align: right;
  white-space: nowrap;
}
.cart-line .qty-btns {
  grid-area: qty;
}
.cart-line__qty {
  min-width: 2.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cart-line__total {
  grid-area: total;
  font-weight: 800;
  color: var(--price);
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 5.5rem;
  font-size: 1.25rem;
}
.cart-totals { display: none; }
.pos-pay {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-top: 6px;
}
.pos-pay .cart-total {
  margin: 0;
  flex: 0 0 auto;
}
@media (max-width: 860px) {
  .pos-pay { flex-wrap: wrap; }
  .pos-pay .cart-total { width: 100%; text-align: right; }
  .pos-pay .pay-grid { min-width: 0; }
  .pos-cart-bar { flex-wrap: wrap; }
  .pos-cart-bar #customer { width: 100%; }
}
.cart-total {
  font-size: clamp(1.7rem, 3.2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--price);
  line-height: 1;
  text-align: right;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
}
.pay-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pay-btn:active:not(:disabled) { background: var(--bg); }
.pay-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pay-btn--primary {
  grid-column: auto;
  min-height: 36px;
  font-size: 13px;
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.pay-btn--primary:active:not(:disabled) { opacity: 0.9; background: var(--navy); }
.cash-dlg { max-width: 360px; }
.cash-due {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--price);
}
.cash-change {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.cash-change.is-short { color: var(--danger); }
.cash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.cash-chips button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  cursor: pointer;
}
.cash-chips button:active { background: var(--surface); }
.inv-hits {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
}
.inv-hits:empty { display: none; }
@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow: visible;
    max-width: 100%;
    row-gap: 8px;
    column-gap: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-links::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .nav-links a,
  .nav-drop__btn { white-space: nowrap; }
}
.dlg-scroll {
  max-height: min(85dvh, 640px);
  overflow-y: auto;
}
.inv-hit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: var(--bg);
  font: inherit;
  cursor: pointer;
}
.inv-hit:active { background: var(--surface); }
.shift-warn {
  background: var(--price-bg);
  border-bottom: 2px solid var(--coffee);
  padding: 8px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.shift-warn a,
.shift-warn button { font-weight: 600; }
body.pos-no-shift .prod-grid,
body.pos-no-shift .pos-cart,
body.pos-no-shift .cat-chips,
body.pos-no-shift .pos-search {
  pointer-events: none;
  opacity: 0.4;
}
body.pos-no-shift #clear,
body.pos-no-shift #btnPrice {
  pointer-events: auto;
  opacity: 1;
}
.toast {
  position: fixed;
  inset: auto auto 24px 50%;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  margin: 0;
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  z-index: 2147483647;
  max-width: calc(100% - 32px);
  width: max-content;
  cursor: default;
  box-shadow: none;
}
.toast:popover-open { display: block; }
.toast--err {
  background: #fff;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.toast[hidden] { display: none !important; }
.week-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 88px;
  margin: 8px 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.week-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  position: relative;
}
.week-bar-fill {
  width: 100%;
  background: var(--fg);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
}
.week-bar span {
  font-size: 10px;
  color: var(--muted);
  position: absolute;
  bottom: -16px;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  justify-content: flex-end;
}
.nav-links a {
  font-size: 13px;
  text-decoration: none;
  color: #d4dce8;
}
.nav-links a:hover,
.nav-links a.is-active { text-decoration: underline; color: #fff; }
.nav-links .nav-disabled {
  font-size: 13px;
  color: #6b7688;
  cursor: not-allowed;
  user-select: none;
}
.nav-drop.is-disabled .nav-drop__btn,
.nav-drop__btn:disabled {
  color: #6b7688;
  cursor: not-allowed;
}
.nav-drop.is-disabled .nav-drop__btn::after {
  opacity: 0.35;
}
.nav-drop {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-drop__btn {
  font: inherit;
  font-size: 13px;
  color: #d4dce8;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-drop__btn::after {
  content: ' ▾';
  font-size: 10px;
  opacity: 0.7;
}
.nav-drop.is-active .nav-drop__btn,
.nav-drop__btn[aria-expanded="true"],
.nav-drop__btn:hover {
  color: #fff;
  text-decoration: underline;
}
.nav-drop__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 10rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.nav-drop__menu[hidden] { display: none !important; }
.nav-drop__menu a {
  display: block;
  padding: 8px 12px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--fg);
  font-size: 13px;
}
.nav-drop__menu a:hover,
.nav-drop__menu a.is-active {
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
}
.page-title {
  margin: 0;
  letter-spacing: -0.02em;
  font-size: 1.5rem;
}
.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 16px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.filters label { margin: 0; min-width: 140px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger {
  background: var(--bg);
  color: var(--danger);
  border-color: #fecaca;
}
.row-muted { opacity: 0.55; }
.check-inline {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.check-inline input { width: auto; margin: 0; }
.dlg {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  max-width: 420px;
  width: calc(100% - 32px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dlg::backdrop { background: rgba(0,0,0,0.35); }
.dlg.is-saving {
  pointer-events: none;
  opacity: 0.92;
}
.save-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
}
.save-flash[hidden] { display: none !important; }
.save-flash__card {
  border: 1px solid var(--border);
  background: var(--bg, #fff);
  padding: 20px 28px;
  border-radius: 4px;
  text-align: center;
  min-width: 200px;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.save-flash.is-on .save-flash__card {
  transform: none;
  opacity: 1;
}
.save-flash__ok {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.save-flash__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.dlg-body { min-width: min(100%, 280px); }
.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  min-height: 40px;
}
.dlg-head .label {
  margin: 0;
  padding: 0;
  line-height: 1.2;
}
.dlg-x {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface, #fafafa);
  color: var(--fg);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dlg-x:hover { background: var(--fg); color: #fff; border-color: var(--fg); }
.dlg-x:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.table-wrap { overflow-x: auto; }
.qty-btns { display: flex; gap: 4px; align-items: center; }
.qty-btns button {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.wrap-cel { max-width: 28rem; }
.qty-big {
  font-size: 1.75rem;
  font-weight: 700;
  min-height: 56px;
  letter-spacing: -0.02em;
}
body.inv-cel .card-form label { font-size: 13px; }
.price-result {
  background: var(--price-bg);
  border: 1px solid #e0c9a8;
  border-radius: 4px;
  padding: 12px;
  margin: 0 0 14px;
  min-height: 7rem;
}
.price-result__name {
  font-weight: 700;
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.price-result__amt {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--price);
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  font-variant-numeric: tabular-nums;
}
.price-result__stock {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.opening-show {
  background: #e8eef7;
  border: 1px solid #b7c6dc;
  border-radius: 4px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.opening-show .cash-due { margin: 0; color: var(--navy); }
.leave-hint {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--navy);
}
.login-wrap {
  max-width: 24rem;
  padding-top: 4rem;
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}
.pin-pad button {
  min-height: 56px;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  border-radius: 4px;
  cursor: pointer;
}
.pin-pad button:active { background: var(--bg); }
.pin-pad__go { font-size: 0.95rem !important; }
.pos-help-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0 0 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  border-radius: 50%;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pos-help-btn:hover { color: var(--fg); }
.hoy-tops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 1.5rem;
}
@media (max-width: 720px) {
  .hoy-tops { grid-template-columns: 1fr; }
}
.corte-tree { margin: 12px 0 24px; }
.corte-day, .corte-shift {
  border: 1px solid var(--border);
  margin: 0 0 8px;
  background: var(--surface);
}
.corte-day > summary,
.corte-shift > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.corte-shift { margin: 0 12px 8px; border-color: #d8dee8; }
.corte-ticket {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.corte-ticket.is-void { opacity: 0.55; }
.corte-ticket__act {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

/* —— Movimiento sobrio —— */
@keyframes dt-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes dt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dt-toast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes dt-line { from { background: var(--price-bg); } to { background: transparent; } }
@keyframes dt-dots { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
dialog[open].dlg { animation: dt-in 0.16s ease-out; }
dialog[open].dlg::backdrop { animation: dt-fade 0.16s ease-out; }
.toast:popover-open { animation: dt-toast 0.18s ease-out; }
.cart-line:last-child { animation: dt-line 0.6s ease-out; }
.btn, .pay-btn, .prod-card, .cash-chips button, .qty-steps button {
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:active, .pay-btn:active, .prod-card:active, .cash-chips button:active, .qty-steps button:active { transform: scale(0.97); }
.stat, .card-form, .corte-day { animation: dt-fade 0.25s ease-out; }
details[open] > *:not(summary) { animation: dt-fade 0.18s ease-out; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* —— Ventas de hoy (POS) —— */
.sales-sum { border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; margin: 0 0 12px; }
.sales-sum:empty { display: none; }
.sales-sum__total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.sales-sum__total strong { font-size: 1.35rem; }
.sales-sum__row { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
#ticketsBody { max-height: 55vh; overflow: auto; }

/* —— WhatsApp —— */
.wa-preview {
  white-space: pre-wrap; font: 13px/1.4 system-ui, sans-serif; background: var(--bg);
  border: 1px solid var(--border); border-radius: 4px; padding: 10px; margin: 8px 0 0; max-height: 32vh; overflow: auto;
}
.btn.is-disabled { opacity: 0.45; }

/* —— Inventario celular —— */
.stock-now { display: flex; justify-content: space-between; align-items: baseline; border: 1px solid var(--border);
  border-radius: 4px; padding: 10px 12px; margin: 0 0 12px; background: var(--bg); }
.stock-now strong { font-size: 1.6rem; }
.qty-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0 4px; }
.qty-steps button { min-height: 48px; font-size: 16px; font-weight: 700; border: 1px solid var(--border);
  border-radius: 4px; background: var(--surface); color: var(--fg); }
@media (max-width: 380px) { .qty-steps { grid-template-columns: repeat(3, 1fr); } }

/* —— Crédito: desglose —— */
.ledger__row { border-bottom: 1px solid var(--border); padding: 8px 0; }
.ledger__row > summary, .ledger__row:not(details) { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: baseline; }
.ledger__row > summary { cursor: pointer; list-style: none; }
.ledger__row > summary::-webkit-details-marker { display: none; }
.ledger__row:not(details) > .ledger__note { grid-column: 1 / -1; font-size: 12px; }
.ledger__type { font-weight: 700; }
.ledger__folio { font-size: 12px; color: var(--muted); }
.ledger__amt { text-align: right; font-weight: 700; }
.ledger__date, .ledger__bal { font-size: 12px; }
.ledger__date { grid-column: 1 / 3; }
.ledger__bal { text-align: right; }
details.ledger__row > summary .ledger__type::after { content: ' ▸'; color: var(--muted); font-weight: 400; }
details.ledger__row[open] > summary .ledger__type::after { content: ' ▾'; }
.ledger__items { margin: 8px 0 0; padding: 8px 10px; background: var(--bg); border-radius: 4px; font-size: 13px; }
.ledger__items > div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.ledger__items .btn { margin-top: 6px; }

/* —— Reportes por día —— */
.row-click { cursor: pointer; }
.row-click:hover td, .row-click.is-open td { background: var(--bg); }
.day-sales > td { background: var(--bg); padding: 6px 10px 10px; }
.day-sale { display: grid; grid-template-columns: 3.2rem 6rem 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.day-sale.is-void { opacity: 0.5; text-decoration: line-through; }
.day-sale__amt { text-align: right; font-weight: 700; }
@media (max-width: 560px) { .day-sale { grid-template-columns: 3rem 1fr auto; } .day-sale > .muted, .day-sale > .btn { display: none; } }

/* —— Código maestro —— */
.master-code { font: 700 1.8rem/1.2 ui-monospace, monospace; letter-spacing: 0.12em; text-align: center;
  border: 1px dashed var(--fg); border-radius: 4px; padding: 10px; margin: 0 0 10px; }
.badge--warn { background: var(--price-bg); color: var(--price); border-color: var(--price-bg); }

/* —— Asistente —— */
.assist { max-width: 460px; }
.assist__log { height: min(46vh, 360px); overflow: auto; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border); border-radius: 4px; padding: 10px; background: var(--bg); }
.assist__msg { margin: 0; padding: 8px 10px; border-radius: 4px; max-width: 88%; white-space: pre-wrap; animation: dt-in 0.16s ease-out; }
.assist__msg--bot { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; }
.assist__msg--me { background: var(--navy); color: #fff; align-self: flex-end; }
.assist__msg.is-wait { animation: dt-dots 1s ease-in-out infinite; }
.assist__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.assist__chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; color: var(--fg); }
.assist__form { display: flex; gap: 8px; }
.assist__form input { flex: 1; margin: 0; }

/* Farmacia en operación: mismos colores que la portada, letra del sistema.
   Atkinson solo vive en la portada. Aquí se lee todo el día. */
html[data-theme="farmacia"] {
  --fg: #14211C;
  --muted: #3D5248;
  --border: #C5D5CE;
  --bg: #F4F7F5;
  --surface: #ffffff;
  --navy: #146B45;
  --blue: #146B45;
  --coffee: #0C2E26;
  --price: #14211C;
  --price-bg: #E7F2EC;
  --danger: #8C2F2F;
}
html[data-theme="farmacia"] body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  color: var(--fg);
}
html[data-theme="farmacia"] ::selection { background: #C9E6D6; color: #14211C; }
html[data-theme="farmacia"] .topbar {
  background: #0C2E26;
  color: #E7F2EC;
  border-bottom: 1px solid #1A5244;
}
html[data-theme="farmacia"] .topbar .muted { color: #B7D0C6; }
html[data-theme="farmacia"] .nav-links a { color: #B7D0C6; }
html[data-theme="farmacia"] .nav-links a:hover,
html[data-theme="farmacia"] .nav-links a.is-active { color: #F4FBF7; }
html[data-theme="farmacia"] .btn,
html[data-theme="farmacia"] input,
html[data-theme="farmacia"] select,
html[data-theme="farmacia"] textarea,
html[data-theme="farmacia"] .pin-pad button { border-radius: 0; }
html[data-theme="farmacia"] .btn-primary {
  background: #146B45;
  border-color: #146B45;
  color: #F4FBF7;
}
html[data-theme="farmacia"] .btn-primary:hover { background: #0F5A39; border-color: #0F5A39; }
html[data-theme="farmacia"] .rx-mark { display: block; width: 22px; height: 22px; flex-shrink: 0; }
html[data-theme="farmacia"]:has(.login-wrap),
html[data-theme="farmacia"] body:has(.login-wrap) {
  background: #0C2E26;
  color: #E7F2EC;
  min-height: 100dvh;
}
html[data-theme="farmacia"] .login-wrap {
  background: #F4F7F5;
  color: #14211C;
  margin-top: 8vh;
  padding: 32px 28px 28px;
  box-shadow: 0 22px 40px -18px rgb(0 0 0 / 0.45);
}
html[data-theme="farmacia"] .pin-pad__go {
  background: #146B45;
  color: #F4FBF7;
  border-color: #146B45;
}
html[data-theme="farmacia"] .chk-machine__face {
  background: #0C2E26;
  border-color: #0C2E26;
  color: #E7F2EC;
}
html[data-theme="farmacia"] .chk-mini { border-color: #C5D5CE; }
html[data-theme="farmacia"] .chk-mini.is-mine { box-shadow: none; background: #E7F2EC; }
