/* =============================================
   Pato Santana POS — Diseño Profesional v2
   ============================================= */

:root {
  --sidebar-w: 220px;
  --header-h:  56px;
  --c-bg:      #f4f6f9;
  --c-surface: #ffffff;
  --c-sidebar: #1a2744;
  --c-sidebar-hover: #243460;
  --c-sidebar-active: #2e4080;
  --c-primary: #2563eb;
  --c-primary-d: #1d4ed8;
  --c-accent:  #f59e0b;
  --c-danger:  #dc2626;
  --c-success: #16a34a;
  --c-warning: #d97706;
  --c-info:    #0891b2;
  --c-text:    #111827;
  --c-text-2:  #374151;
  --c-muted:   #6b7280;
  --c-border:  #e5e7eb;
  --c-hover:   #f9fafb;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.14);
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size:16px; -webkit-font-smoothing:antialiased; }
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
}
button { cursor:pointer; font-family:inherit; }
input,select,textarea { font-family:inherit; }

/* ══════════════════════════════════════════════
   LAYOUT PRINCIPAL
══════════════════════════════════════════════ */
#app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--c-sidebar);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo .brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .3px;
}
.sidebar-logo .brand span { color: var(--c-accent); }
.sidebar-logo .version {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display:none; }

.nav-group-label {
  font-size: .68rem;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 18px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
  border-radius: 0;
  position: relative;
}
.nav-item:hover { background: var(--c-sidebar-hover); color: #fff; }
.nav-item.active {
  background: var(--c-sidebar-active);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--c-accent);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--c-accent);
  color: #1a2744;
  font-size: .68rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  background: var(--c-primary);
  border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  font-weight: 800; font-size: .85rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex:1; overflow:hidden; }
.sidebar-user-name {
  font-size: .82rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.4); }
#btnLogout {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  transition: background .15s;
}
#btnLogout:hover { background: rgba(220,38,38,.4); color:#fff; }

/* ── CONTENT AREA ───────────────────────────── */
#content-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOP BAR ────────────────────────────────── */
#topbar {
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
#topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
}
#topbar .spacer { flex:1; }
.topbar-time {
  font-size: .82rem;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}
#mob-menu-btn {
  display: none;
  background: none; border: none;
  font-size: 1.4rem; color: var(--c-text);
}

/* ── MAIN CONTENT ───────────────────────────── */
#main {
  flex: 1;
  padding: 24px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════
   SECCIONES
══════════════════════════════════════════════ */
.section { display:none; }
.section.active { display:block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--c-text);
}
.page-subtitle {
  font-size: .82rem;
  color: var(--c-muted);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════ */
.card {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items:center; justify-content:center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.green  { background: #dcfce7; }
.stat-icon.amber  { background: #fef3c7; }
.stat-icon.red    { background: #fee2e2; }
.stat-icon.purple { background: #f3e8ff; }
.stat-icon.teal   { background: #ccfbf1; }
.stat-info {}
.stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--c-text);
}
.stat-val.sm { font-size: 1.2rem; }
.stat-lbl {
  font-size: .75rem;
  color: var(--c-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════
   GRIDS
══════════════════════════════════════════════ */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }

/* ══════════════════════════════════════════════
   FORMULARIOS
══════════════════════════════════════════════ */
.form-row { display:flex; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.form-group { display:flex; flex-direction:column; gap:5px; flex:1; min-width:120px; }
.form-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--c-text-2);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .92rem;
  background: #fafbfc;
  color: var(--c-text);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-group input.err { border-color: var(--c-danger); }

/* ══════════════════════════════════════════════
   BOTONES
══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary   { background: var(--c-primary); color: #fff; }
.btn-primary:hover   { background: var(--c-primary-d); }
.btn-success   { background: var(--c-success); color: #fff; }
.btn-success:hover   { background: #15803d; }
.btn-danger    { background: var(--c-danger);  color: #fff; }
.btn-danger:hover    { background: #b91c1c; }
.btn-warning   { background: var(--c-warning); color: #fff; }
.btn-accent    { background: var(--c-accent);  color: #1a2744; font-weight: 700; }
.btn-accent:hover    { background: #d97706; }
.btn-info      { background: var(--c-info);    color: #fff; }
.btn-ghost     { background: transparent; border: 1.5px solid var(--c-border); color: var(--c-text-2); }
.btn-ghost:hover     { background: var(--c-hover); border-color: #d1d5db; }
.btn-dark      { background: var(--c-sidebar); color: #fff; }
.btn-sm  { padding: 6px 12px; font-size: .8rem; border-radius: 6px; }
.btn-lg  { padding: 13px 28px; font-size: 1rem; border-radius: 10px; }
.btn-xl  { padding: 16px 32px; font-size: 1.1rem; font-weight: 700; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ══════════════════════════════════════════════
   TABLA
══════════════════════════════════════════════ */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--c-border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: #f8fafc;
  color: var(--c-text-2);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1.5px solid var(--c-border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--c-text-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--c-hover); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2px;
}
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-gray   { background: #f3f4f6; color: #374151; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }

/* ══════════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════════ */
.search-wrap { position: relative; }
.search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  background: #fafbfc;
  transition: border-color .2s, box-shadow .2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  font-size: .9rem;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  cursor: pointer;
  gap: 12px;
  border-bottom: 1px solid #f3f4f6;
  transition: background .1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--c-hover); }
.sri-name { flex: 1; font-weight: 600; font-size: .88rem; }
.sri-cat  { font-size: .75rem; color: var(--c-muted); }
.sri-price { font-weight: 700; color: var(--c-primary); font-size: .9rem; }
.sri-stock { font-size: .75rem; color: var(--c-muted); }

/* ══════════════════════════════════════════════
   POS / VENDER
══════════════════════════════════════════════ */
#pos-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}
.pos-scanner {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.pos-scanner input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color .2s;
}
.pos-scanner input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

#cart-items {
  min-height: 160px;
  max-height: calc(100vh - 460px);
  overflow-y: auto;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-name { flex: 1; font-weight: 600; font-size: .88rem; line-height: 1.3; }
.cart-item-name small { display:block; color:var(--c-muted); font-weight:400; font-size:.74rem; }
.cart-qty-wrap { display:flex; align-items:center; gap:4px; }
.cart-qty-btn {
  width: 26px; height: 26px;
  border: 1.5px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-hover);
  font-size: 1rem; font-weight: 700;
  display: flex; align-items:center; justify-content:center;
  cursor: pointer;
  transition: background .1s;
}
.cart-qty-btn:hover { background: var(--c-border); }
.cart-qty-val {
  width: 40px; text-align: center;
  border: 1.5px solid var(--c-border);
  border-radius: 6px;
  padding: 3px;
  font-size: .88rem;
  font-weight: 600;
}
.cart-item-price { width: 80px; text-align: right; font-weight: 700; font-size: .9rem; color: var(--c-text); }
.cart-item-del {
  color: var(--c-muted);
  background: none; border: none;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}
.cart-item-del:hover { color: var(--c-danger); }

/* Panel cobro */
.cobro-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.cobro-header {
  background: var(--c-sidebar);
  padding: 14px 18px;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
}
.cobro-body { padding: 16px; }
.cobro-total-box {
  background: linear-gradient(135deg, var(--c-primary) 0%, #1d4ed8 100%);
  border-radius: 10px;
  padding: 16px;
  color: #fff;
  margin-bottom: 14px;
  text-align: center;
}
.cobro-total-lbl { font-size: .78rem; opacity: .8; margin-bottom: 4px; }
.cobro-total-val { font-size: 2.2rem; font-weight: 800; letter-spacing: -.5px; }
.cobro-total-items { font-size: .78rem; opacity: .7; margin-top: 2px; }

/* ══════════════════════════════════════════════
   CIERRE DE CAJA
══════════════════════════════════════════════ */
.cierre-resumen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cierre-box {
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.cierre-box.ventas   { background: #dbeafe; }
.cierre-box.retiros  { background: #fef3c7; }
.cierre-box.neto     { background: #dcfce7; }
.cierre-box-val { font-size: 1.3rem; font-weight: 800; }
.cierre-box-lbl { font-size: .72rem; color: var(--c-muted); margin-top: 3px; }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  padding: 16px;
}
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--c-surface);
  border-radius: var(--radius);
  width: min(98vw, 520px);
  box-shadow: var(--shadow-lg);
  transform: translateY(24px) scale(.97);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  max-height: 92vh;
  overflow-y: auto;
}
.modal-bg.open .modal { transform: translateY(0) scale(1); }
.modal.modal-lg { width: min(98vw, 740px); }
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items:center; justify-content:space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none; border: none;
  font-size: 1.3rem; color: var(--c-muted);
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items:center; justify-content:center;
}
.modal-close:hover { background: var(--c-hover); color: var(--c-text); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--c-border);
  display: flex; justify-content:flex-end; gap: 10px;
}

/* ══════════════════════════════════════════════
   OCR / FACTURAS
══════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--c-primary); background: #f0f6ff; }
.upload-zone-icon { font-size: 3rem; margin-bottom: 12px; }
.upload-zone p { color: var(--c-muted); font-size: .88rem; }
.upload-zone strong { color: var(--c-primary); }
.ocr-preview img { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--c-border); }
.ocr-result-item {
  display: flex; align-items:center; gap:10px;
  padding: 10px 12px;
  background: var(--c-hover);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--c-border);
}
.ocr-result-item.selected { background: #dbeafe; border-color: var(--c-primary); }
.ocr-item-check { accent-color: var(--c-primary); width:16px; height:16px; }
.ocr-item-name { flex:1; font-weight:600; font-size:.88rem; }
.ocr-item-price { font-weight:700; color:var(--c-primary); }
.ocr-item-qty input {
  width: 60px; text-align:center;
  border: 1px solid var(--c-border); border-radius:5px;
  padding: 4px; font-size:.85rem;
}

/* ══════════════════════════════════════════════
   CARGA INVENTARIO (inteligente)
══════════════════════════════════════════════ */
.carga-status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: .88rem;
  font-weight: 600;
  display: none;
}
.carga-status.nuevo   { background: #dcfce7; color: #166534; display:block; }
.carga-status.existe  { background: #dbeafe; color: #1e40af; display:block; }

/* ══════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════ */
#login-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1a2744 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.login-card {
  background: rgba(255,255,255,.97);
  border-radius: 20px;
  padding: 40px 36px;
  width: min(92vw, 400px);
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .brand-big {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--c-sidebar);
}
.login-logo .brand-big span { color: var(--c-accent); }
.login-logo .sub { color: var(--c-muted); font-size: .82rem; margin-top: 4px; }
.login-card .form-group { margin-bottom: 14px; }
.login-card .form-group input { width: 100%; font-size: .95rem; padding: 11px 14px; }
#loginError {
  color: var(--c-danger);
  font-size: .82rem;
  min-height: 18px;
  margin-bottom: 8px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--c-sidebar);
  color: #fff;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: .9rem; font-weight: 600;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.ok   { background: var(--c-success); }
#toast.err  { background: var(--c-danger); }
#toast.warn { background: var(--c-warning); }

/* ══════════════════════════════════════════════
   UTILIDADES
══════════════════════════════════════════════ */
.text-danger  { color: var(--c-danger) !important; }
.text-success { color: var(--c-success) !important; }
.text-muted   { color: var(--c-muted) !important; }
.text-primary { color: var(--c-primary) !important; }
.fw-bold { font-weight: 700; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 14px; }
.gap-2 { gap: 10px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.divider { border: none; border-top: 1px solid var(--c-border); margin: 14px 0; }

pre#ticket {
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  line-height: 1.6;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  white-space: pre-wrap;
  max-height: 55vh;
  overflow-y: auto;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 900px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.mob-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  #content-area { margin-left: 0; }
  #mob-menu-btn { display: flex; }
  #pos-wrap { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  #main { padding: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .cobro-total-val { font-size: 1.8rem; }
  .btn-xl { padding: 13px 22px; font-size: 1rem; }
}

/* Overlay para cerrar sidebar en mobile */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 299;
}
#sidebar-overlay.show { display: block; }

@media print {
  #sidebar, #topbar, .no-print { display: none !important; }
  #content-area { margin-left: 0; }
  body { background: #fff; }
}
