:root {
  /* Escala de grises grafito oscuro mate (sin negro puro ni blanco deslumbrante) */
  --color-bg: #1f2328;
  --color-surface: #282d33;
  --color-surface-2: #323840;
  --color-surface-hover: #3c434d;
  --color-input-bg: #1b1f23;
  --color-border: #3d444d;
  --color-border-strong: #525b66;

  --color-text: #e2e6eb;
  --color-text-2: #adb5bd;
  --color-text-3: #868e96;

  /* Un solo acento acero mate para la acción principal */
  --color-brand: #3b6998;
  --color-brand-hover: #2f567d;
  --color-brand-soft: #26384a;
  --color-brand-border: #476c8f;
  --color-brand-text: #f1f4f8;

  /* Semánticos atenuados para modo grafito */
  --color-ok-text: #8fd1a6;
  --color-ok-bg: #223328;
  --color-ok-border: #34543f;

  --color-warn-text: #e6b86a;
  --color-warn-bg: #352c1c;
  --color-warn-border: #59482a;

  --color-danger-text: #e68a85;
  --color-danger-bg: #382222;
  --color-danger-border: #5e3636;

  --radius: 6px;
  --radius-sm: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.45;
  min-height: 100vh;
}

/* Foco de teclado visible en todos los controles interactivos */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.num,
.tile-price-bs,
.tile-price-usd,
.total-big,
.total-ref,
.bcv-value,
.qty-input {
  font-variant-numeric: tabular-nums;
}

.text-right { text-align: right !important; }
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.icon-lg { width: 16px; height: 16px; flex-shrink: 0; }
.icon-xs { width: 14px; height: 14px; flex-shrink: 0; }
.hidden { display: none !important; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 12px; }
.ml-8 { margin-left: 8px; }
.muted-small { color: var(--color-text-2); font-size: 12px; }
.muted-mono { color: var(--color-text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.text-emerald { color: var(--color-ok-text); }
.text-cyan { color: var(--color-brand); }
.text-amber { color: var(--color-warn-text); }

/* Barra superior plana (48px) */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 48px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 16px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 40;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { display: flex; align-items: center; color: var(--color-brand); }
.brand-title { font-size: 14px; font-weight: 700; color: var(--color-text); }
.brand-sep { width: 1px; height: 14px; background: var(--color-border-strong); }
.brand-sub { font-size: 12px; color: var(--color-text-2); }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.bcv-pill, .status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-surface-2); border: 1px solid var(--color-border-strong);
  padding: 4px 10px; border-radius: var(--radius-sm); font-size: 12px;
}
.bcv-label { color: var(--color-text-2); font-weight: 600; }
.bcv-value {
  color: #f0c05a;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.btn-pill-edit {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--color-brand); color: #ffffff;
  border: 1px solid #4f81b5; border-radius: var(--radius-sm);
  padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.btn-pill-edit:hover { background: var(--color-brand-hover); }
.btn-pill-edit.btn-cash-close {
  background: #9e2a2b; color: #ffffff; border-color: #c23b3c;
}
.btn-pill-edit.btn-cash-close:hover { background: #822021; }
.btn-pill-edit.btn-cash-open {
  background: #1f6f47; color: #ffffff; border-color: #2e8c5c;
}
.btn-pill-edit.btn-cash-open:hover { background: #185838; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-ok-text); }

/* Sidebar lateral mercantil (168px) */
.sidebar {
  position: fixed; left: 0; top: 48px; bottom: 0; width: 168px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 10px 8px;
  display: flex; flex-direction: column; justify-content: space-between;
  z-index: 30;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-btn {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--color-text-2);
  font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
}
.nav-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.nav-btn.active {
  background: var(--color-brand-soft); color: var(--color-brand-text);
  border-color: var(--color-brand-border); font-weight: 600;
}
.nav-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-sm);
  background: var(--color-warn-bg); color: var(--color-warn-text);
  border: 1px solid var(--color-warn-border);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.sidebar-ver { padding: 4px 10px; font-size: 11px; color: var(--color-text-3); }

/* Contenido principal */
.main-wrap { margin-left: 168px; padding: 60px 16px 20px; }
.view { display: none; }
.view.active { display: block; }

@media (max-width: 820px) {
  .topbar { height: auto; min-height: 48px; flex-wrap: wrap; padding: 6px 12px; gap: 6px; }
  .sidebar {
    width: 100%; height: 54px; top: auto; bottom: 0;
    flex-direction: row; padding: 4px 6px; border-right: 0; border-top: 1px solid var(--color-border);
  }
  .sidebar-nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-btn { height: 44px; flex: 1; justify-content: center; flex-direction: column; gap: 2px; font-size: 11px; padding: 2px; }
  .nav-badge { position: absolute; top: 2px; right: 4px; margin-left: 0; }
  .sidebar-ver { display: none; }
  .main-wrap { margin-left: 0; padding: 94px 10px 66px; }
  .status-pill, .brand-sep { display: none; }
}

/* Paneles planos */
.glass-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.glass-card h2 { font-size: 14px; font-weight: 700; color: var(--color-text); }
.glass-card h3 { font-size: 13px; font-weight: 600; color: var(--color-text); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Banner de alerta tasa >24h */
.banner-warning {
  background: var(--color-warn-bg); color: var(--color-warn-text);
  border: 1px solid var(--color-warn-border);
  padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 500;
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface); color: var(--color-text);
  font-weight: 600; cursor: pointer; font-size: 12px;
  text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--color-surface-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 9px 16px; font-size: 13px; }

.btn-primary,
.btn-emerald {
  background: var(--color-brand); color: var(--color-brand-text); border-color: var(--color-brand);
}
.btn-primary:hover:not(:disabled),
.btn-emerald:hover:not(:disabled) { background: var(--color-brand-hover); border-color: var(--color-brand-hover); }

.btn-outline { background: var(--color-surface); color: var(--color-text-2); border-color: var(--color-border-strong); }
.btn-outline:hover:not(:disabled) { background: var(--color-surface-2); color: var(--color-text); }

.btn-warning { background: var(--color-surface); color: var(--color-warn-text); border-color: var(--color-warn-border); }
.btn-warning:hover:not(:disabled) { background: var(--color-warn-bg); }

.btn-danger,
.btn-danger-soft {
  background: var(--color-surface); color: var(--color-danger-text); border-color: var(--color-danger-border);
}
.btn-danger:hover:not(:disabled),
.btn-danger-soft:hover:not(:disabled) { background: var(--color-danger-bg); }

/* Inputs */
.input {
  width: 100%; padding: 7px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong); background: var(--color-input-bg);
  color: var(--color-text); font-size: 13px;
}
.input:focus { outline: none; border-color: var(--color-brand); }
.input-sm { width: auto; padding: 5px 8px; font-size: 12px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--color-text-2); }
.align-end { justify-content: flex-end; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; font-size: 13px; }

/* POS Layout 65% / 35% */
.pos-grid { display: grid; grid-template-columns: 1.85fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 1050px) { .pos-grid { grid-template-columns: 1fr; } }

.pos-left { display: flex; flex-direction: column; gap: 10px; }
.pos-sticky-head {
  position: sticky;
  top: 48px;
  z-index: 25;
  background: var(--color-bg);
  padding: 8px 0 6px;
  margin-top: -8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (max-width: 820px) {
  .pos-sticky-head { position: static; padding: 0; margin-top: 0; }
}
.pos-customer-panel {
  padding: 8px 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pos-customer-panel label {
  font-size: 12px; font-weight: 600; color: var(--color-text-2); white-space: nowrap;
}
.search-panel { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 10px; color: var(--color-text-3); pointer-events: none; }
.search-input {
  width: 100%; height: 42px; padding: 0 92px 0 34px;
  background: var(--color-input-bg); color: var(--color-text);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); font-size: 14px;
}
.search-input:focus { outline: none; border-color: var(--color-brand); }
.search-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 45;
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius); max-height: 300px; overflow-y: auto;
}
.search-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; border: 0; border-bottom: 1px solid var(--color-border);
  background: transparent; color: var(--color-text); text-align: left; cursor: pointer;
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover:not(:disabled),
.search-item.active-item { background: var(--color-brand-soft); }
.search-item:disabled { opacity: 0.5; cursor: not-allowed; }
.search-item-main { display: flex; flex-direction: column; gap: 2px; }
.search-item-price { text-align: right; white-space: nowrap; }
.search-empty { padding: 10px 12px; color: var(--color-text-2); font-size: 12px; }
.search-hl { background: var(--color-warn-bg); color: var(--color-warn-text); padding: 0 2px; border-radius: 2px; }
.kbd-badge {
  position: absolute; right: 8px;
  background: var(--color-surface-2); color: var(--color-text-2);
  border: 1px solid var(--color-border);
  font-family: ui-monospace, monospace; font-size: 11px;
  padding: 2px 6px; border-radius: var(--radius-sm);
}

.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 4px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-2); font-size: 12px; font-weight: 500; cursor: pointer;
}
.chip:hover { background: var(--color-surface-2); color: var(--color-text); }
.chip.active { background: var(--color-brand-soft); color: var(--color-brand-text); border-color: var(--color-brand-border); font-weight: 600; }

/* Catálogo compacto */
.pos-products {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
@media (max-width: 1200px) { .pos-products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pos-products { grid-template-columns: 1fr; } }

.product-tile {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
}
.product-tile:hover:not(.out-of-stock) { border-color: var(--color-border-strong); background: var(--color-surface-2); }
.product-tile.out-of-stock { opacity: 0.5; background: var(--color-surface-2); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.tile-name { font-weight: 600; font-size: 13px; color: var(--color-text); }
.tile-code { font-size: 11px; color: var(--color-text-3); font-variant-numeric: tabular-nums; }
.tile-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.tile-price-bs { font-size: 15px; font-weight: 700; color: var(--color-text); }
.tile-price-usd { font-size: 11px; color: var(--color-text-2); }
.tile-cart-badge {
  display: inline-block; margin-left: 6px;
  font-size: 11px; font-weight: 600; color: var(--color-brand-text);
  background: var(--color-brand-soft); border: 1px solid var(--color-brand-border);
  padding: 0 6px; border-radius: var(--radius-sm);
}
.btn-add-tile {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong); background: var(--color-surface-2); color: var(--color-text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.btn-add-tile:hover:not(:disabled) { background: var(--color-surface-hover); border-color: var(--color-brand); color: var(--color-brand); }
.btn-add-tile.flash-added { background: var(--color-brand) !important; border-color: var(--color-brand) !important; color: #fff !important; }

/* Panel de Venta Actual */
.cart-panel { padding: 0; overflow: hidden; position: sticky; top: 60px; }
.cart-header {
  padding: 10px 12px; background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center;
}
.cart-title-line { display: flex; align-items: baseline; gap: 6px; }
.cart-title-line h2 { font-size: 13px; font-weight: 700; }
.cart-count { font-size: 12px; color: var(--color-text-2); font-variant-numeric: tabular-nums; }
.held-orders-bar {
  padding: 4px 10px;
  background: var(--color-warn-bg);
  border-bottom: 1px solid var(--color-warn-border);
  display: flex; flex-direction: column; gap: 3px;
  max-height: 92px; overflow-y: auto;
}
.held-orders-title { font-size: 10px; font-weight: 700; color: var(--color-warn-text); line-height: 1.2; }
.held-order-row {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 2px 6px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-size: 11px; line-height: 1.2;
}
.held-order-row .btn-sm { padding: 2px 6px; font-size: 11px; }
.held-order-row .btn-close { font-size: 14px; padding: 0 4px; }
.cart-customer-bar { padding: 8px 12px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 8px; }
.cart-customer-bar label { font-size: 12px; font-weight: 600; color: var(--color-text-2); white-space: nowrap; }

.cart-items {
  padding: 8px 12px; max-height: 290px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.cart-row {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.cart-row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.cart-row-bottom { display: flex; justify-content: space-between; align-items: center; }
.qty-controls { display: inline-flex; align-items: center; gap: 4px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text);
  font-weight: 700; cursor: pointer;
}
.qty-btn:hover { background: var(--color-surface-hover); }
.qty-input {
  width: 52px; height: 26px; text-align: right; padding: 0 6px;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
}

.cart-footer { padding: 10px 12px; background: var(--color-surface-2); border-top: 1px solid var(--color-border); }
.total-well {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px;
}
.total-well-top { display: flex; justify-content: space-between; align-items: center; }
.total-label { font-size: 12px; font-weight: 600; color: var(--color-text-2); }
.bcv-tag {
  font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--color-text-2); background: var(--color-surface-2);
  border: 1px solid var(--color-border); padding: 1px 6px; border-radius: var(--radius-sm);
}
.total-big {
  display: block; text-align: right;
  font-size: 26px; font-weight: 700; color: var(--color-text); margin-top: 2px;
}
.total-ref { text-align: right; font-size: 12px; color: var(--color-text-2); }
.total-ref strong { color: var(--color-text); }

/* Acción principal única: Cobrar */
.btn-checkout {
  width: 100%; height: 42px; border: 1px solid var(--color-brand); border-radius: var(--radius-sm);
  background: var(--color-brand); color: var(--color-brand-text);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
}
.btn-checkout:hover:not(:disabled) { background: var(--color-brand-hover); border-color: var(--color-brand-hover); }
.btn-checkout:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-hold {
  width: 100%; height: 28px; border: 1px solid #c27816; border-radius: var(--radius-sm);
  background: #9a5b13; color: #ffffff;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
}
.btn-hold:hover:not(:disabled) { background: #7d490e; border-color: #d98a22; }
.btn-hold:disabled { opacity: 0.4; cursor: not-allowed; }
.kbd-inline { font-family: ui-monospace, monospace; font-size: 11px; opacity: 0.85; }

/* Tablas con encabezados en mayúscula de oración */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { padding: 8px 8px; border-bottom: 1px solid var(--color-border); text-align: left; }
.table th { color: var(--color-text-2); font-weight: 600; background: var(--color-surface-2); font-size: 12px; }
.table tbody tr:hover { background: var(--color-surface-2); }

.badge {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.badge-green { background: var(--color-ok-bg); color: var(--color-ok-text); border-color: var(--color-ok-border); }
.badge-yellow { background: var(--color-warn-bg); color: var(--color-warn-text); border-color: var(--color-warn-border); }
.badge-red { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: var(--color-danger-border); }
.badge-gray { background: var(--color-surface-2); color: var(--color-text-2); border-color: var(--color-border); }

/* Compras */
.purchase-add-bar { display: grid; grid-template-columns: 2fr 0.8fr 1fr auto; gap: 8px; margin-top: 8px; align-items: center; }
.purchase-price-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 8px 10px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.pur-eff-box, .pur-margin-group, .pur-sale-group {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
@media (max-width: 820px) { .purchase-add-bar { grid-template-columns: 1fr; } }
.purchase-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* Informes y Ajustes */
.report-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1100px) {
  .report-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .report-tabs { grid-template-columns: 1fr; }
}
.report-tab {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
}
.report-tab:hover { background: var(--color-surface-2); border-color: var(--color-border-strong); }
.report-tab.active {
  background: var(--color-brand-soft);
  border-color: var(--color-brand-border);
}
.report-tab-title { font-size: 12px; font-weight: 600; color: var(--color-text-2); }
.report-tab.active .report-tab-title { color: var(--color-brand-text); }
.report-tab-val { font-size: 18px; font-weight: 700; color: var(--color-text); }
.report-panel { display: none; }
.report-panel.active { display: block; }

.reports-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.report-stats { display: flex; flex-direction: column; gap: 6px; }
.stat-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font-variant-numeric: tabular-nums;
}
.divider { border: 0; border-top: 1px solid var(--color-border); margin: 12px 0; }
.backups-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.backups-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font-size: 12px;
}

/* Modales planos */
.modal {
  position: fixed; inset: 0; background: rgba(22, 25, 29, 0.52);
  display: flex; justify-content: center; align-items: center; padding: 12px; z-index: 60;
}
.modal-content {
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius); padding: 16px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
}
.modal-sm { max-width: 400px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--color-border);
}
.modal-header h2 { font-size: 14px; font-weight: 700; }
.btn-close {
  background: none; border: none; color: var(--color-text-2);
  font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm);
}
.btn-close:hover { background: var(--color-surface-2); color: var(--color-text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--color-border); }

.checkout-summary {
  background: var(--color-bg); border: 1px solid var(--color-border);
  padding: 10px 12px; border-radius: var(--radius-sm);
  display: flex; justify-content: space-between; align-items: center;
  font-variant-numeric: tabular-nums;
}
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.label-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.btn-exact {
  display: inline-flex; align-items: center; gap: 4px;
  background: #1f6f47; color: #ffffff;
  border: 1px solid #2e8c5c; border-radius: var(--radius-sm);
  padding: 4px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
  letter-spacing: 0.01em;
}
.btn-exact:hover { background: #195b3a; border-color: #3aa36d; }
.balance-box {
  padding: 10px; border-radius: var(--radius-sm); background: var(--color-bg);
  border: 1px solid var(--color-border); font-weight: 600; text-align: right;
  font-variant-numeric: tabular-nums;
}

.action-group { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-fav {
  background: transparent; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); width: 28px; height: 28px;
  color: var(--color-text-3); font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.btn-fav:hover { background: var(--color-surface-2); color: #f0c05a; }
.btn-fav.is-fav {
  background: var(--color-warn-bg); border-color: var(--color-warn-border); color: #f0c05a;
}
.margin-box {
  padding: 7px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  margin-bottom: 8px; border: 1px solid var(--color-border); font-variant-numeric: tabular-nums;
}
.margin-ok { background: var(--color-ok-bg); color: var(--color-ok-text); border-color: var(--color-ok-border); }
.margin-warn { background: var(--color-warn-bg); color: var(--color-warn-text); border-color: var(--color-warn-border); }
.margin-loss { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: var(--color-danger-border); }

/* Toast */
.toast {
  position: fixed; bottom: 16px; right: 16px; z-index: 100;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; border: 1px solid var(--color-border-strong);
}
.toast-ok { background: var(--color-surface); color: var(--color-text); border-left: 3px solid var(--color-brand); }
.toast-err { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: var(--color-danger-border); }

/* Comprobante e impresión térmica */
.receipt-box {
  font-family: "Courier New", Courier, monospace; font-size: 12px;
  background: #eceff2; color: #111; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 10px; white-space: pre-wrap;
}
.print-only { display: none; }
@media print {
  .no-print { display: none !important; }
  .print-only {
    display: block !important; font-family: "Courier New", Courier, monospace;
    font-size: 11px; line-height: 1.3; color: #000; margin: 0; padding: 4px;
  }
  body.print-58mm .print-only { width: 58mm; }
  body.print-80mm .print-only { width: 80mm; }
  @page { margin: 2mm; }
}

/* Aviso de tasa BCV sin variación (apertura de caja) */
.same-rate-warn {
  border: 1px solid #8a6d1f;
  background: #3a3222;
  color: #f0c05a;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}
#btn-open-cash-same-rate {
  width: 100%;
  white-space: normal;
}

.row-voided {
  opacity: 0.6;
}

/* Productos: cabecera fija (título + buscador + encabezados de columna no se mueven al hacer scroll) */
.products-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 84px);
}
.products-sticky-header {
  flex-shrink: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}
.products-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  max-height: calc(100vh - 165px);
}
.products-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface-2);
  box-shadow: 0 1px 0 var(--color-border-strong);
}

/* Destacado en Inicio de Caja para cuando la tasa BCV no varió */
.same-rate-callout {
  background: #2f2818;
  border: 1px solid #b58921;
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.same-rate-callout-title {
  font-size: 12px;
  font-weight: 700;
  color: #f0c05a;
}
.btn-same-rate {
  width: 100%;
  background: #9a6b13;
  border: 1px solid #d49b27;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  white-space: normal;
}
.btn-same-rate:hover:not(:disabled) {
  background: #b57e17;
  border-color: #f0c05a;
}
