/* ═══════════════════════════════════════════════════════
   XERO L.I.A.M  —  Sistema de Pulpería
   Diseño: Minimalista · Oscuro · Elegante
═══════════════════════════════════════════════════════ */

:root {
  --bg:        #09090b;
  --surface:   #18181b;
  --surface2:  #27272a;
  --border:    #3f3f46;
  --text:      #fafafa;
  --muted:     #a1a1aa;
  --accent:    #22d3ee;
  --accent-dim:#164e63;
  --green:     #4ade80;
  --green-dim: #14532d;
  --red:       #f87171;
  --red-dim:   #7f1d1d;
  --yellow:    #fbbf24;
  --yellow-dim:#78350f;
  --radius:    14px;
  --radius-sm: 8px;
  --sidebar-w: 220px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ── TIPOGRAFÍA ────────────────────────────────────────── */
h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { line-height: 1.65; color: var(--muted); }

a { color: inherit; text-decoration: none; }

/* ── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo .brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--accent);
}

.sidebar-logo .brand-sub {
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1 1 0;
  min-height: 0;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s, color .18s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
  stroke-width: 1.75;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-footer .version {
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .05em;
}

.sidebar-footer .version span {
  color: var(--accent);
}

/* ── MAIN CONTENT ──────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.topbar-spacer { flex: 1; }

.topbar-date {
  font-size: .8rem;
  color: var(--muted);
}

.page-content {
  padding: 36px 32px;
  flex: 1;
}

/* ── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-sm { padding: 18px 20px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* ── STAT CARDS ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.stat-label {
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.03em;
}

.stat-value.accent  { color: var(--accent); }
.stat-value.green   { color: var(--green); }
.stat-value.yellow  { color: var(--yellow); }
.stat-value.red     { color: var(--red); }

/* ── BOTONES ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .18s, transform .12s, background .18s;
  border: none;
  outline: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: #001620;
}
.btn-primary:hover { opacity: .88; }

.btn-green {
  background: var(--green);
  color: #001f0d;
}
.btn-green:hover { opacity: .88; }

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
}
.btn-ghost:hover { background: var(--border); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
}
.btn-danger:hover { background: #991c1c; }

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: 10px;
}

.btn-sm {
  padding: 7px 13px;
  font-size: .82rem;
}

.btn svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
}

/* ── INPUTS ────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .02em;
}

.form-control {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,.12);
}

.form-control::placeholder { color: var(--muted); }

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* Anular el fondo blanco/amarillo de autocompletar en Chrome y Edge */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--surface2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── TABLA ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--surface2);
  transition: background .14s;
}

tbody tr:hover { background: var(--surface2); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 13px 16px;
  vertical-align: middle;
}

/* ── BADGES ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-muted  { background: var(--surface2);   color: var(--muted); }
.badge-accent { background: var(--accent-dim); color: var(--accent); }

/* ── CAJA (POS) ────────────────────────────────────────── */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.scanner-input-area {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.scanner-input-area .form-control {
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  letter-spacing: .04em;
}

.cart-list {
  max-height: 52vh;
  min-height: 220px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  margin-bottom: 8px;
  border: 1px solid transparent;
  transition: border-color .18s;
  animation: slideIn .18s ease;
}

.cart-item:hover { border-color: var(--border); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: .94rem; }
.cart-item-price { font-size: .8rem; color: var(--muted); margin-top: 2px; }

.cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  line-height: 1;
  padding: 0;
}

.qty-btn:hover { background: var(--border); }
.qty-val { font-weight: 700; font-size: .95rem; min-width: 22px; text-align: center; }

.cart-item-total {
  font-weight: 700;
  font-size: .95rem;
  min-width: 72px;
  text-align: right;
  color: var(--accent);
}

.remove-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
  padding: 0;
}

.remove-btn:hover { background: var(--red-dim); color: var(--red); }

/* ── PANEL DE COBRO ────────────────────────────────────── */
.checkout-panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 24px;
}

.checkout-panel .card {
  display: flex;
  flex-direction: column;
}

.total-breakdown { margin: 16px 0; }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface2);
  font-size: .9rem;
}

.total-row:last-child { border: none; }
.total-row.grand {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green);
  padding-top: 14px;
  letter-spacing: -.02em;
}

.total-row.grand .label { font-size: 1rem; font-weight: 600; color: var(--text); }

.payment-input-wrap {
  margin: 16px 0 12px;
}

.change-display {
  background: var(--green-dim);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.change-display .label { font-size: .88rem; color: var(--green); }
.change-display .value { font-size: 1.3rem; font-weight: 700; color: var(--green); }

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 48px; height: 48px;
  opacity: .35;
}

.empty-state p { font-size: .9rem; color: var(--muted); }

/* ── MODAL ─────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transform: translateY(16px) scale(.98);
  transition: transform .22s;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  justify-content: flex-end;
}

.close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}

.close-btn:hover { color: var(--text); background: var(--surface2); }
.close-btn svg { width: 20px; height: 20px; }

/* ── STOCK BAR ─────────────────────────────────────────── */
.stock-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-bar {
  flex: 1;
  height: 5px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.stock-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}

/* ── TOAST ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 340px;
  animation: toastIn .25s ease;
  pointer-events: all;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }

/* ── SCANNER RING ──────────────────────────────────────── */
.scan-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}

.scan-ring svg { width: 36px; height: 36px; color: var(--accent); }

/* ── SUCCESS OVERLAY ───────────────────────────────────── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9,9,11,.92);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.success-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.success-icon {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--green-dim);
  border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  animation: popIn .35s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-icon svg { width: 44px; height: 44px; color: var(--green); stroke-width: 2.5; }
.success-title { font-size: 1.5rem; font-weight: 700; }
.success-total { font-size: 3rem; font-weight: 800; color: var(--green); letter-spacing: -.04em; }
.success-change { font-size: 1.1rem; color: var(--muted); }

/* ── FORM GRID ─────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .full { grid-column: 1 / -1; }

/* ── BÚSQUEDA ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-220px); width: 220px; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.6); }
  .main { margin-left: 0 !important; }
  .page-content { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  #menuToggle { display: flex !important; min-width:40px; min-height:40px; }
  .topbar-date { display: none; }
  .user-info { display: none; }
  footer { margin-left: 0 !important; padding: 10px 16px; }
}

/* ── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── UTILIDADES ────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }

/* ── PAYMENT METHOD TOGGLE ─────────────────────────────── */
.payment-method-wrap {
  margin: 14px 0 4px;
}

.payment-method-toggle {
  display: flex;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px;
}

.payment-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s;
  font-family: inherit;
}

.payment-btn.efectivo.active {
  background: var(--green-dim);
  color: var(--green);
}

.payment-btn.tarjeta.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── CIERRE DE CAJA ────────────────────────────────────── */
.cierre-summary {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cierre-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}

.cierre-summary-row:last-child {
  border-bottom: none;
}

.cierre-summary-row span {
  color: var(--muted);
}

.cierre-summary-row strong {
  font-weight: 700;
}

/* ── LOGIN PAGE ─────────────────────────────────────────── */
.login-page {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--accent);
}

.login-brand-sub {
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: .83rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.login-error {
  background: var(--red-dim);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.login-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.login-hint {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .78rem;
}

.login-hint-title {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 8px;
}

.login-hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  color: var(--muted);
  font-size: .78rem;
}

.login-hint-row code {
  font-family: 'Courier New', monospace;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .75rem;
  color: var(--accent);
}

/* ── USER PILL (topbar) ─────────────────────────────────── */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  flex-shrink: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-avatar.av-admin { background: var(--accent-dim);           color: var(--accent); }
.user-avatar.av-super { background: rgba(251,191,36,.2);          color: var(--yellow); }

.user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.user-name {
  font-size: .82rem;
  font-weight: 600;
}

.user-role {
  font-size: .66rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.logout-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
  padding: 0;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red-dim);
}

.logout-btn svg { width: 14px; height: 14px; }

/* ── ROLE BADGES ────────────────────────────────────────── */
.badge-rol-empleado     { background: var(--surface2);          color: var(--muted); }
.badge-rol-administrador{ background: var(--accent-dim);        color: var(--accent); }
.badge-rol-superusuario { background: rgba(251,191,36,.15);     color: var(--yellow); }

/* ── NAV DIVIDER ────────────────────────────────────────── */
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 14px;
  opacity: .6;
}

.nav-section-label {
  padding: 6px 14px 4px;
  font-size: .65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* ── AUTOCOMPLETE SEARCH ────────────────────────────────── */
.search-wrapper {
  position: relative;
  flex: 1;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 150;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  display: none;
}

.search-dropdown.open { display: block; }

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--surface2);
  transition: background .14s;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface2); }

.search-result-name {
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 3px;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .76rem;
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* ── RECIBO / TICKET ────────────────────────────────────── */
.receipt-body-inner {
  font-size: .88rem;
}

.receipt-header {
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}

.receipt-store   { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.receipt-sub     { font-size: .72rem; color: var(--muted); margin-top: 2px; letter-spacing: .1em; text-transform: uppercase; }
.receipt-meta    { font-size: .78rem; color: var(--muted); margin-top: 3px; }

.receipt-table {
  width: 100%;
  font-size: .82rem;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.receipt-table th {
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  letter-spacing: .06em;
}

.receipt-table td {
  padding: 5px 0;
  vertical-align: middle;
}

.receipt-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 10px 0;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green);
  padding: 6px 0;
}

.receipt-pay-section { margin-top: 10px; }

.receipt-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--muted);
  padding: 3px 0;
}

.receipt-footer {
  text-align: center;
  color: var(--accent);
  font-size: .8rem;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  letter-spacing: .04em;
}

/* ── 403 PAGE ───────────────────────────────────────────── */
.forbidden-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 16px;
}

.forbidden-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -.04em;
  opacity: .25;
  line-height: 1;
}

/* ── AUDIT LOG ──────────────────────────────────────────── */
.audit-action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
}

/* ── SUPER MENU PLACEHOLDER ─────────────────────────────── */
.future-card {
  border: 1px dashed var(--border);
  background: transparent;
  opacity: .6;
  cursor: not-allowed;
}

.future-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  background: rgba(251,191,36,.1);
  color: var(--yellow);
  border: 1px dashed var(--yellow);
}
