:root {
  --bg: #0f172a;
  --bg-soft: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --success: #16a34a;
  --success-2: #15803d;
  --danger: #dc2626;
  --danger-2: #b91c1c;
  --secondary: #475569;
  --secondary-2: #334155;
  --warning: #f59e0b;
  --warning-2: #d97706;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, #dbeafe 0%, transparent 24%),
    radial-gradient(circle at top right, #e0f2fe 0%, transparent 20%),
    linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
  color: var(--text);
}

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
a {
  touch-action: manipulation;
}

button {
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.8;
}

input,
select,
textarea {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid #d7e0ea;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.oculto,
.login-view.oculto,
.app-view.oculto,
.vista-seccion.oculto,
.mensaje.oculto,
.modal-overlay.oculto {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  width: 100%;
}

/* LOGIN */
.login-view {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.95) 0%, rgba(243,245,248,0.92) 44%, rgba(233,237,242,0.96) 100%),
    linear-gradient(180deg, #f7f8fa 0%, #edf1f5 100%);
  overflow: hidden;
}

.login-view::before,
.login-view::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(18px);
}

.login-view::before {
  width: 320px;
  height: 320px;
  top: -90px;
  left: -110px;
  background: rgba(255,255,255,0.8);
}

.login-view::after {
  width: 260px;
  height: 260px;
  right: -50px;
  bottom: -40px;
  background: rgba(191, 219, 254, 0.38);
}

.login-layout {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 430px);
  align-items: center;
  gap: 56px;
}

.login-brand-panel {
  padding: 8px;
}

.login-brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.86);
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(15,23,42,0.06);
}

.login-hero-title {
  max-width: 620px;
  margin: 18px 0 14px;
  color: #111827;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.login-hero-copy {
  max-width: 540px;
  margin: 0;
  color: #4b5563;
  font-size: 18px;
  line-height: 1.65;
}

.login-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.login-hero-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.86);
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15,23,42,0.05);
}

.login-card {
  width: 100%;
  max-width: 430px;
  margin-left: auto;
  background: rgba(255,255,255,0.76);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(15,23,42,0.12);
  padding: 34px 30px 26px;
  text-align: left;
}

.login-badge,
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #60a5fa 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 0 18px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  border: 1px solid rgba(209,213,219,0.85);
  color: #111827;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.96), 0 12px 34px rgba(15,23,42,0.08);
}

.login-eyebrow {
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: #111827;
}

.login-subtitle {
  color: #6b7280;
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field span {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.login-card input {
  margin-bottom: 0;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  color: #111827;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.login-card input::placeholder {
  color: #9ca3af;
}

.login-card input:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.10);
  transform: translateY(-1px);
}

.login-card .btn-primary {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
  box-shadow: 0 14px 30px rgba(15,23,42,0.16);
}

.login-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(15,23,42,0.18);
}

#mensajeLogin {
  margin-top: 14px;
  border-radius: 14px;
}

.login-footer-note {
  margin-top: 14px;
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

.login-footer-signature {
  display: inline-block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .login-view {
    align-items: start;
    padding: 22px 18px;
    overflow-y: auto;
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    max-width: 520px;
    margin: 0 auto;
  }

  .login-brand-panel {
    display: block;
    padding: 4px 2px 0;
    text-align: center;
  }

  .login-brand-chip {
    min-height: 32px;
    padding: 0 13px;
    font-size: 12px;
  }

  .login-hero-title {
    max-width: 100%;
    margin: 12px auto 8px;
    font-size: clamp(24px, 7.2vw, 40px);
    line-height: 1.04;
    letter-spacing: -0.045em;
  }

  .login-hero-copy {
    max-width: 100%;
    margin: 0 auto;
    font-size: clamp(13px, 3.2vw, 16px);
    line-height: 1.5;
  }

  .login-hero-badges {
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
  }

  .login-hero-badges span {
    min-height: 31px;
    padding: 0 11px;
    font-size: 12px;
  }

  .login-card {
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .login-view {
    min-height: 100dvh;
    padding: 16px 14px;
  }

  .login-layout {
    gap: 14px;
  }

  .login-hero-title {
    font-size: clamp(22px, 8.2vw, 32px);
    line-height: 1.06;
  }

  .login-hero-copy {
    font-size: 13px;
  }

  .login-hero-badges {
    gap: 7px;
    margin-top: 12px;
  }

  .login-hero-badges span {
    min-height: 29px;
    padding: 0 10px;
    font-size: 11px;
  }

  .login-card {
    padding: 24px 18px 20px;
    border-radius: 24px;
  }

  .login-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 21px;
    margin-bottom: 14px;
  }

  .login-card h1 {
    font-size: clamp(28px, 9vw, 32px);
  }
}

@media (max-width: 380px) {
  .login-view {
    padding: 12px;
  }

  .login-brand-panel {
    padding-top: 0;
  }

  .login-hero-title {
    font-size: clamp(20px, 8.4vw, 28px);
  }

  .login-hero-copy {
    font-size: 12px;
    line-height: 1.45;
  }

  .login-hero-badges span {
    min-height: 27px;
    padding: 0 9px;
    font-size: 10.5px;
  }

  .login-card {
    padding: 20px 16px 18px;
  }
}

@media (max-height: 720px) and (max-width: 920px) {
  .login-view {
    place-items: start center;
  }

  .login-hero-title {
    margin-top: 8px;
    margin-bottom: 6px;
    font-size: clamp(20px, 6.2vw, 30px);
  }

  .login-hero-copy {
    font-size: 12px;
    line-height: 1.4;
  }

  .login-hero-badges {
    margin-top: 10px;
  }

  .login-card {
    padding-top: 20px;
    padding-bottom: 18px;
  }
}

/* APP */
.app-view {
  width: 100%;
  padding: 20px;
}

.topbar {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
  overflow: hidden;
}

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.topbar-user-meta {
  display: grid;
  gap: 4px;
}

.topbar-subline {
  margin: 0;
}

.topbar-subline-secondary {
  font-size: 13px;
}

.dot {
  margin: 0 8px;
}

.topbar-actions {
  min-width: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ESTRUCTURA GENERAL */
.caja-layout,
.admin-layout,
.caja-sidebar,
.caja-main,
.panel,
.table-shell,
.lista-productos,
.admin-section,
.admin-dashboard-grid,
.admin-grid-2,
.admin-grid-4,
.admin-filtros,
.form-producto-extendido,
.modal-card {
  min-width: 0;
}

.caja-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.caja-sidebar,
.caja-main,
.admin-layout {
  display: grid;
  gap: 20px;
}

.caja-main {
  gap: 18px;
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel-accent {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title-row h2,
.panel-title-row h3 {
  margin: 0;
}

.panel-title-row h2 {
  font-size: 22px;
}

.panel-title-row h3 {
  font-size: 20px;
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* CAJA */
.caja-apertura {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.stat-card-highlight {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-color: #bbf7d0;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
}

/* PRODUCTOS */
.buscador {
  margin-bottom: 16px;
}

.lista-productos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.producto-item {
  min-width: 0;
  min-height: 190px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  align-content: space-between;
}

.producto-info {
  display: grid;
  gap: 8px;
}

.producto-nombre {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.producto-precio {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
}

.producto-stock {
  color: var(--muted);
  font-weight: 700;
}

.stock-bajo {
  color: #b45309;
  font-weight: 800;
}

.sin-stock {
  color: var(--danger);
  font-weight: 800;
}

.sin-resultados {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  background: #fafafa;
}

/* TABLAS */
.table-shell {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

td {
  font-size: 14px;
}

.compact-table th,
.compact-table td {
  padding: 10px 8px;
  font-size: 13px;
}

.input-cantidad,
.input-admin {
  min-height: 48px;
  width: 92px;
  text-align: center;
}

/* VENTA */
.venta-panel {
  display: grid;
  gap: 16px;
}

.venta-footer {
  display: grid;
  gap: 16px;
}

.metodo-pago-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.metodo-pago-box label {
  font-weight: 700;
  color: var(--muted);
}

.metodo-pago-box select {
  width: 230px;
}

.pago-efectivo-box {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.campo-cobro {
  display: flex;
  align-items: center;
  gap: 10px;
}

.campo-cobro label {
  font-weight: 700;
  color: var(--muted);
}

.campo-cobro input {
  width: 150px;
}

.cambio-valor {
  min-width: 120px;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--success-2);
}

.total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #93c5fd;
}

.total-label {
  font-size: 16px;
  font-weight: 800;
  color: #1e3a8a;
}

.total-amount {
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 900;
  color: #1d4ed8;
}

.acciones {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.acciones-grandes button {
  flex: 1;
  min-height: 70px;
  font-size: 20px;
  border-radius: 16px;
}

/* BOTONES */
.btn-primary,
.btn-success,
.btn-secondary,
.btn-danger,
.btn-ghost,
.btn-caja,
.btn-cerrar-caja,
.btn-agregar,
.btn-stock,
.btn-actualizar-precio,
.btn-eliminar,
.btn-eliminar-producto {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 800;
}

.btn-primary,
.btn-caja,
.btn-agregar,
.btn-stock {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-2) 100%);
  color: #fff;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-2) 100%);
  color: #fff;
}

.btn-danger,
.btn-cerrar-caja,
.btn-eliminar,
.btn-eliminar-producto {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-2) 100%);
  color: #fff;
}

.btn-ghost {
  background: #eef2f7;
  color: #0f172a;
}

.btn-actualizar-precio {
  background: linear-gradient(135deg, var(--warning) 0%, var(--warning-2) 100%);
  color: #fff;
}

.btn-agregar:disabled {
  background: #cbd5e1;
  color: #fff;
}

/* MENSAJES */
.mensaje {
  padding: 14px 16px;
  border-radius: 16px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-weight: 700;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 999;
}

.modal-card {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--line);
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
}

.modal-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* ADMIN */
.admin-layout {
  display: grid;
  gap: 20px;
}

.admin-section {
  display: grid;
  gap: 20px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-tabs button {
  min-width: 140px;
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-actions-bottom {
  display: flex;
  align-items: end;
}

.admin-actions-bottom button {
  width: 100%;
}

.admin-filtros {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 12px;
  margin-bottom: 16px;
}

.form-producto-extendido {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr 180px auto;
  gap: 12px;
  align-items: center;
}

.form-producto-extendido > * {
  min-width: 0;
}

.admin-lista-vacia {
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: #fafcff;
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.admin-lista {
  display: grid;
  gap: 12px;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.admin-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-item-title {
  font-weight: 800;
  color: var(--text);
}

.admin-item-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-badge-ok {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.admin-badge-warn {
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fdba74;
}

.admin-badge-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.admin-badge-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.admin-table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.admin-table-actions button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.admin-input-mini {
  min-height: 48px;
  width: 110px;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: center;
}

.admin-estado-activo {
  color: var(--success-2);
  font-weight: 800;
}

.admin-estado-inactivo {
  color: var(--danger-2);
  font-weight: 800;
}

.admin-resumen-metodos,
.admin-top-productos {
  display: grid;
  gap: 12px;
}

.admin-metodo-item,
.admin-top-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.admin-top-rank {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

.admin-top-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-top-name {
  font-weight: 800;
  color: var(--text);
}

.admin-top-meta {
  font-size: 14px;
  color: var(--muted);
}

.admin-total-strong {
  font-weight: 900;
  color: var(--primary);
}

label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.admin-section .table-shell {
  background: #fff;
}

.admin-section .stat-card {
  min-height: 120px;
}

.admin-section .panel-title-row {
  margin-bottom: 18px;
}

/* AJUSTES TABLAS */
#tablaAdminProductos td,
#tablaAdminPrecios td,
#tablaMovimientosInventario td,
#tablaReporteVentas td,
#historialVentas td,
#historialCortes td {
  white-space: normal;
}

#tablaAdminProductos td:first-child,
#tablaAdminPrecios td:first-child,
#tablaReporteVentas td:last-child {
  text-align: left;
}

#tablaAdminProductos td:last-child,
#tablaAdminPrecios td:last-child {
  min-width: 220px;
}

#tablaMovimientosInventario td:last-child {
  min-width: 120px;
}

/* TOUCH */
@media (hover: none) {
  button:hover {
    transform: none;
  }
}

/* RESPONSIVE */
@media (max-width: 1400px) {
  .admin-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-producto-extendido {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-producto-extendido button {
    grid-column: span 3;
  }
}

@media (max-width: 1280px) {
  .caja-layout {
    grid-template-columns: 1fr;
  }

  .caja-sidebar .panel {
    height: auto;
  }
}

@media (max-width: 1100px) {
  .admin-dashboard-grid,
  .admin-grid-2,
  .admin-grid-4,
  .admin-filtros {
    grid-template-columns: 1fr;
  }

  .admin-actions-bottom {
    align-items: stretch;
  }
}

@media (max-width: 1024px) {
  .app-view {
    padding: 14px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-producto-extendido {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-producto-extendido button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-left {
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .lista-productos {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .metodo-pago-box,
  .pago-efectivo-box,
  .campo-cobro,
  .acciones {
    flex-direction: column;
    align-items: stretch;
  }

  .metodo-pago-box select,
  .campo-cobro input {
    width: 100%;
  }

  .total-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .total-amount {
    width: 100%;
    text-align: left;
    font-size: 32px;
  }

  .admin-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .admin-tabs button {
    width: 100%;
    min-width: 0;
  }

  .form-producto-extendido {
    grid-template-columns: 1fr;
  }

  .form-producto-extendido button {
    grid-column: auto;
  }

  .admin-item,
  .admin-metodo-item,
  .admin-top-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-table-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-card {
    padding: 16px;
    border-radius: 18px;
  }
}

@media (max-width: 640px) {
  .admin-kpis {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-view {
    padding: 10px;
  }

  .panel {
    padding: 14px;
    border-radius: 18px;
  }

  .topbar {
    padding: 14px;
    border-radius: 18px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .lista-productos {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .producto-item {
    min-height: 170px;
    padding: 12px;
  }

  .producto-precio {
    font-size: 20px;
  }

  .btn-primary,
  .btn-success,
  .btn-secondary,
  .btn-danger,
  .btn-ghost,
  .btn-caja,
  .btn-cerrar-caja,
  .btn-agregar,
  .btn-stock,
  .btn-actualizar-precio,
  .btn-eliminar,
  .btn-eliminar-producto {
    min-height: 50px;
    padding: 12px 14px;
    font-size: 14px;
  }

  .table-shell {
    border-radius: 14px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}
.teclado-numerico {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.teclado-numerico button {
  min-height: 60px;
  font-size: 20px;
  border-radius: 14px;
  background: #eef2f7;
  font-weight: 800;
}

.teclado-rapido {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.teclado-rapido button {
  min-height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  font-weight: 800;
}
/* ========================= */
/* 🎨 MEJORA VISUAL SEGURA */
/* ========================= */

:root {
  --bg-soft: #f6f8fb;
  --panel-clean: #ffffff;
  --border-soft: #e5e7eb;

  --primary-clean: #2563eb;
  --primary-hover: #1d4ed8;

  --text-main: #0f172a;
  --text-muted: #64748b;
}

/* FONDO GENERAL */
body {
  background: var(--bg-soft) !important;
}

/* PANEL MÁS LIMPIO */
.panel {
  background: var(--panel-clean) !important;
  border: 1px solid var(--border-soft) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06) !important;
}

/* TOPBAR MÁS PRO */
.topbar {
  background: var(--panel-clean) !important;
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

/* BOTONES MÁS MODERNOS */
.btn-primary {
  background: var(--primary-clean) !important;
}

.btn-primary:hover {
  background: var(--primary-hover) !important;
}

.btn-secondary {
  background: #e2e8f0 !important;
  color: var(--text-main) !important;
}

.btn-danger {
  background: #dc2626 !important;
}

.btn-success {
  background: #16a34a !important;
}

/* INPUTS MÁS LIMPIOS */
input,
select {
  border-radius: 12px !important;
  border: 1px solid var(--border-soft) !important;
}

input:focus,
select:focus {
  border-color: var(--primary-clean) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* PRODUCTOS MÁS ELEGANTES */
.producto-item {
  background: #f9fafb !important;
  border: 1px solid var(--border-soft) !important;
  transition: all 0.2s ease;
}

.producto-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.producto-precio {
  color: var(--primary-clean) !important;
}

/* TABLAS MÁS PRO */
th {
  background: #f1f5f9 !important;
  color: var(--text-muted) !important;
}

td {
  background: #ffffff;
}

/* TOTAL MÁS LLAMATIVO */
.total-box {
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
}

.total-amount {
  color: var(--primary-clean) !important;
}

/* CARDS DE CAJA */
.stat-card {
  background: #f9fafb !important;
  border: 1px solid var(--border-soft) !important;
}

/* MENSAJES MÁS LIMPIOS */
.mensaje {
  border-radius: 12px !important;
  font-size: 14px;
}

/* TRANSICIONES GLOBALES */
button {
  transition: all 0.2s ease !important;
}
/* ========================= */
/* 🔐 LOGIN PRO (SaaS STYLE) */
/* ========================= */

.login-view {
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
}

.login-card {
  background: #ffffff !important;
  border-radius: 20px !important;
  padding: 40px 30px !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08) !important;
  border: 1px solid #e5e7eb !important;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

/* TÍTULO */
.login-card h1 {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

/* SUBTÍTULO (lo agregamos visualmente) */
.login-card::after {
  content: "Sistema de punto de venta";
  display: block;
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}

/* INPUTS */
.login-card input {
  margin-bottom: 12px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 0 12px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.login-card input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* BOTÓN */
.login-card .btn-primary {
  width: 100%;
  margin-top: 10px;
  height: 50px;
  font-size: 16px;
  border-radius: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.login-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

/* MENSAJE ERROR */
#mensajeLogin {
  margin-top: 12px;
  font-size: 14px;
  border-radius: 12px;
}

/* EFECTO FLOTANTE */
.login-card:hover {
  transform: translateY(-2px);
  transition: all 0.25s ease;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .login-card {
    padding: 30px 20px !important;
  }
}
.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;

  background: linear-gradient(135deg, #2563eb, #1d4ed8);

  color: white;
  font-size: 22px;
  font-weight: 900;

  display: flex;
  align-items: center;
  justify-content: center;

  letter-spacing: 1px;

  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s ease;
}

.login-logo:hover {
  transform: translateY(-2px);
}

.producto-meta {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.caja-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 12px;
  margin-bottom: 12px;
}

.buscador-principal,
.scanner-box {
  margin-bottom: 0;
}

.scanner-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.scanner-hint {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 600;
}

.venta-panel {
  position: sticky;
  top: 14px;
}

@media (max-width: 1280px) {
  .venta-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .caja-toolbar {
    grid-template-columns: 1fr;
  }

  .scanner-box {
    grid-template-columns: 1fr;
  }

  .scanner-box button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .table-shell table,
  .table-shell thead,
  .table-shell tbody,
  .table-shell th,
  .table-shell td,
  .table-shell tr {
    display: block;
  }

  .venta-panel .table-shell thead {
    display: none;
  }

  .venta-panel .table-shell table {
    min-width: 0;
  }

  .venta-panel .table-shell tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .venta-panel .table-shell tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: #fff;
  }

  .venta-panel .table-shell td {
    border: 0;
    padding: 6px 0;
    text-align: left;
  }

  .venta-panel .table-shell td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .venta-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: rgba(255,255,255,0.96);
    padding-top: 10px;
    backdrop-filter: blur(6px);
  }

  .lista-productos {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  .scanner-hint {
    font-size: 13px;
  }

  #codigoBarrasBusqueda,
  #buscadorProducto {
    min-height: 52px;
  }

  .lista-productos {
    grid-template-columns: 1fr;
  }
}

/* ===== Mejoras completas caja/admin ===== */
.sticky-panel { position: sticky; top: 14px; }
.caja-toolbar { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-bottom: 10px; }
.scanner-box { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.scanner-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.producto-meta, .producto-unidad, .total-subtext { color: var(--muted); font-size: 13px; }
.resumen-caja-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.campo-cobro-principal { flex: 1; align-items: stretch; }
.campo-cobro-principal input { width: 100%; }
.cambio-box { min-width: 180px; align-items: center; justify-content: center; }
.sticky-sale-footer { gap: 14px; }
.acciones-cobro button { min-height: 62px; }
.form-producto-mejorado { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-producto-acciones { display: flex; gap: 10px; flex-wrap: wrap; }
.form-producto-acciones button { flex: 1; }
.doble-accion-admin { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.proveedores-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#tablaAdminProductos td:last-child { min-width: 260px; }

@media (max-width: 1024px) {
  .caja-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .caja-toolbar, .proveedores-grid, .form-producto-mejorado { grid-template-columns: 1fr 1fr; }
  .sticky-sale-footer { position: sticky; bottom: 0; background: rgba(255,255,255,0.98); border-top: 1px solid var(--line); padding-top: 12px; z-index: 5; }
}
@media (max-width: 768px) {
  .caja-main { gap: 14px; }
  .caja-toolbar, .scanner-box, .form-producto-mejorado, .proveedores-grid, .doble-accion-admin { grid-template-columns: 1fr; }
  .teclado-rapido { grid-template-columns: repeat(3, 1fr); }
  .resumen-caja-grid, .admin-kpis, .admin-kpis-2 { grid-template-columns: 1fr 1fr; }
  .venta-panel .table-shell table, .venta-panel .table-shell thead, .venta-panel .table-shell tbody, .venta-panel .table-shell th, .venta-panel .table-shell td, .venta-panel .table-shell tr { display: block; width: 100%; }
  .venta-panel .table-shell thead { display: none; }
  .venta-panel .table-shell tr { margin: 0 0 12px; border-bottom: 1px solid var(--line); padding: 10px; background: #fff; }
  .venta-panel .table-shell td { text-align: left; border: none; padding: 8px 0; }
  .venta-panel .table-shell td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
  .input-cantidad { width: 100%; }
}
@media (max-width: 480px) {
  .resumen-caja-grid, .admin-kpis, .admin-kpis-2 { grid-template-columns: 1fr; }
  .teclado-rapido { grid-template-columns: repeat(2, 1fr); }
  .topbar-left, .topbar-actions { width: 100%; }
  .acciones-cobro button { min-height: 56px; font-size: 18px; }
  .scanner-box button, .acciones button, .form-producto-acciones button { width: 100%; }
}


.modal-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.modal-card-agranel {
  width: min(680px, calc(100vw - 24px));
  padding: 24px;
}

.agranel-producto-resumen {
  display: grid;
  gap: 10px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
  border: 1px solid #bfdbfe;
}

.agranel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.agranel-producto-nombre {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 900;
  color: var(--text);
}

.agranel-producto-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-weight: 700;
}

.agranel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr);
  gap: 18px;
  align-items: start;
}

.agranel-campo-principal,
.agranel-total-card {
  min-width: 0;
}

.agranel-campo-principal {
  display: grid;
  gap: 12px;
}

.agranel-campo-principal input {
  min-height: 72px;
  padding: 16px 18px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  text-align: center;
  border-radius: 20px !important;
}

.agranel-sugerencias {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.agranel-sugerencias button {
  min-height: 52px;
  border-radius: 14px;
  font-weight: 800;
  background: #eef2f7;
}

.agranel-total-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid #bbf7d0;
}

.agranel-total-label {
  color: #166534;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.agranel-total-monto {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 900;
  color: #15803d;
  word-break: break-word;
}

.agranel-total-ayuda {
  color: #166534;
  font-size: 14px;
}

.acciones-agranel {
  margin-top: 20px;
  justify-content: flex-end;
}

.acciones-agranel button {
  min-width: 180px;
}

.mensaje-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

@media (max-width: 768px) {
  .modal-card-agranel {
    width: calc(100vw - 16px);
    padding: 18px;
    border-radius: 20px;
  }

  .agranel-grid {
    grid-template-columns: 1fr;
  }

  .agranel-sugerencias {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .acciones-agranel {
    flex-direction: column-reverse;
  }

  .acciones-agranel button {
    width: 100%;
  }
}


.historial-ticket-actions { min-width: 170px; }
.modal-card-ticket { width: min(440px, calc(100vw - 24px)); }
.modal-card-ticket-decision { width: min(420px, calc(100vw - 24px)); text-align: center; }
.ticket-decision-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
  display: grid; place-items: center; font-weight: 900; font-size: 24px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff;
  box-shadow: 0 12px 24px rgba(37,99,235,.25);
}
.ticket-decision-texto { color: var(--muted); margin-bottom: 14px; }
.ticket-decision-resumen {
  margin: 0 auto 18px; padding: 14px 16px; border-radius: 18px; background: #f8fafc;
  border: 1px solid var(--line); display: grid; gap: 6px; text-align: left;
}
.acciones-ticket, .acciones-ticket-decision { justify-content: center; }
.ticket-preview-shell {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border-radius: 20px; padding: 18px; border: 1px solid var(--line);
}
.ticket-pos {
  width: 100%; max-width: 320px; margin: 0 auto; background: #fff; color: #0f172a;
  border-radius: 20px; border: 1px solid #e2e8f0; box-shadow: 0 16px 35px rgba(15,23,42,.08);
  padding: 22px 18px; font-size: 13px;
}
.ticket-pos-header { text-align: center; padding-bottom: 14px; border-bottom: 1px dashed #cbd5e1; margin-bottom: 14px; }
.ticket-pos-logo {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; font-weight: 900; letter-spacing: .04em;
}
.ticket-pos-title { font-size: 20px; font-weight: 900; margin: 0 0 4px; }
.ticket-pos-subtitle { color: #64748b; font-size: 12px; }
.ticket-pos-meta, .ticket-pos-totales { display: grid; gap: 8px; margin-bottom: 14px; }
.ticket-pos-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ticket-pos-row span:first-child { color: #64748b; }
.ticket-pos-items { margin-bottom: 14px; border-top: 1px dashed #cbd5e1; border-bottom: 1px dashed #cbd5e1; padding: 12px 0; display: grid; gap: 10px; }
.ticket-pos-item { display: grid; gap: 4px; }
.ticket-pos-item-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 800; }
.ticket-pos-item-meta { display: flex; justify-content: space-between; gap: 12px; color: #64748b; font-size: 12px; }
.ticket-pos-total-final {
  margin-top: 4px; padding-top: 10px; border-top: 1px solid #e2e8f0; font-size: 18px; font-weight: 900;
}
.ticket-pos-footer { margin-top: 14px; text-align: center; color: #64748b; font-size: 12px; }
@media print {
  body.printing-ticket > *:not(#printTicketStage) { display: none !important; }
  #printTicketStage { display: block !important; }
  #printTicketStage .ticket-pos { box-shadow: none; border: none; max-width: none; width: 80mm; border-radius: 0; }
}
#printTicketStage { display:none; }


.cobro-efectivo-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 12px;
  min-width: 0;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}
.cobro-efectivo-panel-principal { flex: 1.25; }
.cobro-encabezado {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cobro-encabezado label {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
}
.cobro-subtexto {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.cobro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.input-cobro-wrap {
  position: relative;
  width: 100%;
}
.input-cobro-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
  pointer-events: none;
}
.input-cobro-wrap input {
  width: 100%;
  min-height: 68px;
  padding-left: 42px !important;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.02em;
  border-radius: 18px !important;
  border: 1px solid #bfdbfe !important;
  background: #fff;
}
.teclado-rapido-cobro {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.teclado-rapido-cobro button {
  min-height: 52px;
  border-radius: 16px;
  font-size: 15px;
}
.cambio-box {
  min-width: 220px;
  align-content: center;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
}
.cambio-box label {
  margin: 0;
  color: var(--text);
}
.cambio-box .cambio-valor {
  min-height: 76px;
  border-radius: 18px;
  font-size: 28px;
  padding: 16px 18px;
}
#ticketVentaModal,
#ticketDecisionModal {
  z-index: 1200;
}
@media (max-width: 900px) {
  .pago-efectivo-box {
    width: 100%;
  }
  .cobro-encabezado {
    flex-direction: column;
    align-items: flex-start;
  }
  .teclado-rapido-cobro {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .input-cobro-wrap input {
    min-height: 62px;
    font-size: 24px;
  }
  .cambio-box .cambio-valor {
    min-height: 68px;
    font-size: 24px;
  }
}
@media (max-width: 480px) {
  .cobro-efectivo-panel {
    padding: 14px;
    border-radius: 18px;
  }
  .teclado-rapido-cobro {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .teclado-rapido-cobro button {
    min-height: 48px;
    font-size: 14px;
  }
  .input-cobro-wrap input {
    font-size: 22px;
  }
}


.cobro-efectivo-panel {
  width: 100%;
  align-items: stretch;
  justify-content: space-between;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 10px 24px rgba(37,99,235,0.08);
}
.campo-cobro-principal {
  display: grid;
  gap: 12px;
}
.cobro-efectivo-panel .campo-cobro {
  align-items: stretch;
}
.input-cobro-wrap input::-webkit-outer-spin-button,
.input-cobro-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-cobro-wrap input[type=number] {
  -moz-appearance: textfield;
}
#tablaAdminTickets td:last-child {
  min-width: 190px;
}
@media (max-width: 900px) {
  .cobro-efectivo-panel {
    padding: 16px;
  }
  .pago-efectivo-box {
    flex-direction: column;
  }
  .cambio-box {
    width: 100%;
    min-width: 0;
  }
}

.admin-filtros-precios { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(160px, 1fr)); }
.form-usuario-admin { grid-template-columns: 1.6fr 1.1fr 1fr 180px 160px auto auto; }
.usuario-rol-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.usuario-rol-admin { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.usuario-rol-cajero { background: #ecfeff; color: #0f766e; border-color: #99f6e4; }
.usuario-meta-fila { font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 1400px) { .form-usuario-admin { grid-template-columns: repeat(3, minmax(0, 1fr)); } .form-usuario-admin button { grid-column: span 3; } }
@media (max-width: 1100px) { .admin-filtros-precios { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .admin-filtros-precios, .form-usuario-admin { grid-template-columns: 1fr; } }


.modal-card-apertura-caja {
  width: min(460px, calc(100vw - 24px));
  text-align: center;
  padding: 28px 24px;
}
.apertura-caja-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 14px 30px rgba(22,163,74,.22);
}
.apertura-caja-texto {
  margin-bottom: 16px;
}
.apertura-caja-resumen {
  margin: 0 auto 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef2ff 100%);
  border: 1px solid #dbeafe;
  display: grid;
  gap: 8px;
  text-align: left;
}
.apertura-caja-campo {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  text-align: left;
}
.apertura-caja-campo label {
  margin: 0;
  color: var(--text);
}
.input-cobro-wrap-apertura input {
  text-align: right;
  padding-right: 18px;
}
.acciones-apertura-caja {
  justify-content: center;
}
.acciones-apertura-caja button {
  min-width: 180px;
}
#aperturaCajaError {
  margin-top: 2px;
}
.input-cobro-wrap input,
.input-cobro-wrap-apertura input,
#montoRecibido {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#montoRecibido {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
@media (max-width: 640px) {
  .modal-card-apertura-caja {
    width: calc(100vw - 16px);
    padding: 22px 16px;
    border-radius: 20px;
  }
  .acciones-apertura-caja {
    flex-direction: column-reverse;
  }
  .acciones-apertura-caja button {
    width: 100%;
    min-width: 0;
  }
}


body.requiere-apertura-caja #vistaCaja.caja-bloqueada-apertura {
  position: relative;
}
body.requiere-apertura-caja #vistaCaja.caja-bloqueada-apertura::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(246, 248, 251, 0.58);
  backdrop-filter: blur(2px);
  border-radius: 22px;
  z-index: 5;
}
#aperturaCajaModal {
  z-index: 1200;
}


.modal-card-delete-user {
  width: min(560px, calc(100vw - 24px));
  display: grid;
  gap: 18px;
}

.delete-user-hero {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff7ed 0%, #fff1f2 100%);
  border: 1px solid #fed7aa;
}

.delete-user-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-weight: 900;
  font-size: 28px;
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.24);
}

.delete-user-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}

.delete-user-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.acciones-delete-user {
  justify-content: flex-end;
}

body.dark-mode .delete-user-hero {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.35) 0%, rgba(69, 10, 10, 0.45) 100%);
  border-color: rgba(248, 113, 113, 0.28);
}

body.dark-mode .delete-user-title {
  color: #f8fafc;
}

body.dark-mode .delete-user-text {
  color: #cbd5e1;
}

@media (max-width: 640px) {
  .delete-user-hero {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .acciones-delete-user {
    flex-direction: column;
  }
}


.actions-ticket-print-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ticket-pos-logo-image-wrap {
  background: #fff;
  overflow: hidden;
  padding: 4px;
}
.ticket-pos-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ticket-format-58 { max-width: 240px; }
.ticket-format-80 { max-width: 320px; }
@media print {
  body.printing-ticket.ticket-print-58 #printTicketStage .ticket-pos { width: 58mm; }
  body.printing-ticket.ticket-print-80 #printTicketStage .ticket-pos { width: 80mm; }
}

.config-admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}
.config-admin-form,
.config-admin-preview {
  display: grid;
  gap: 16px;
}
.config-preview-card {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 22px;
  padding: 18px;
  display: grid;
  gap: 16px;
}
.config-preview-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.config-preview-logo {
  margin: 0;
  flex-shrink: 0;
}
.config-preview-name {
  font-size: 20px;
  font-weight: 900;
}
.config-preview-subtitle,
.config-theme-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.config-preview-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ticket-pos-preview-mini {
  margin: 0;
}
.config-theme-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.switch-tema {
  position: relative;
  width: 68px;
  height: 38px;
  display: inline-flex;
}
.switch-tema input {
  opacity: 0;
  width: 0;
  height: 0;
  min-height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .2s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15,23,42,.18);
  transition: transform .2s ease;
}
.switch-tema input:checked + .switch-slider {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.switch-tema input:checked + .switch-slider::before {
  transform: translateX(30px);
}

body.dark-pos-theme {
  background: linear-gradient(180deg, #0b1220 0%, #111827 100%) !important;
  color: #e5eefc;
}
body.dark-pos-theme .panel,
body.dark-pos-theme .topbar,
body.dark-pos-theme .login-card,
body.dark-pos-theme .modal-card,
body.dark-pos-theme .table-shell,
body.dark-pos-theme table,
body.dark-pos-theme .producto-item,
body.dark-pos-theme .stat-card,
body.dark-pos-theme .admin-item,
body.dark-pos-theme .admin-metodo-item,
body.dark-pos-theme .admin-top-item,
body.dark-pos-theme .ticket-preview-shell,
body.dark-pos-theme .config-preview-card,
body.dark-pos-theme .config-theme-card,
body.dark-pos-theme .admin-lista-vacia,
body.dark-pos-theme .sin-resultados,
body.dark-pos-theme .apertura-caja-resumen,
body.dark-pos-theme .ticket-decision-resumen {
  background: #0f172a !important;
  color: #e5eefc !important;
  border-color: #243244 !important;
  box-shadow: 0 16px 35px rgba(2,6,23,.38) !important;
}
body.dark-pos-theme th {
  background: #111c2f !important;
  color: #93c5fd !important;
}
body.dark-pos-theme td { background: #0f172a !important; color: #dce7f7; }
body.dark-pos-theme input,
body.dark-pos-theme select,
body.dark-pos-theme textarea {
  background: #0b1220 !important;
  color: #f8fbff !important;
  border-color: #334155 !important;
}
body.dark-pos-theme .btn-secondary {
  background: #1e293b !important;
  color: #e5eefc !important;
}
body.dark-pos-theme .panel-tag,
body.dark-pos-theme .usuario-rol-badge {
  background: #132238 !important;
  color: #93c5fd !important;
  border-color: #223654 !important;
}
body.dark-pos-theme .ticket-pos {
  background: #ffffff;
  color: #0f172a;
}
body.dark-pos-theme .topbar-subtitle,
body.dark-pos-theme .stat-label,
body.dark-pos-theme .ticket-decision-texto,
body.dark-pos-theme .config-preview-subtitle,
body.dark-pos-theme .config-theme-text,
body.dark-pos-theme label,
body.dark-pos-theme .ticket-pos-row span:first-child,
body.dark-pos-theme .ticket-pos-subtitle,
body.dark-pos-theme .ticket-pos-item-meta,
body.dark-pos-theme .ticket-pos-footer {
  color: #94a3b8 !important;
}
body.dark-pos-theme .producto-precio,
body.dark-pos-theme .admin-total-strong,
body.dark-pos-theme .total-amount,
body.dark-pos-theme .input-cobro-prefix,
body.dark-pos-theme .config-preview-name {
  color: #60a5fa !important;
}
body.dark-pos-theme .scanner-hint { color: #94a3b8; }
body.dark-pos-theme .cambio-valor {
  background: #082f49;
  border-color: #0ea5e9;
  color: #7dd3fc;
}
body.dark-pos-theme .login-view {
  background: linear-gradient(135deg, #0b1220 0%, #111827 100%);
}
body.dark-pos-theme .login-card::after { color: #94a3b8; }
body.dark-pos-theme .switch-slider { background: #334155; }

body.dark-pos-theme #vistaCaja .panel {
  background: linear-gradient(180deg, #0f172a 0%, #111c2f 100%) !important;
  border-color: #233149 !important;
}
body.dark-pos-theme #vistaCaja .panel-accent,
body.dark-pos-theme #vistaCaja .caja-sidebar .panel {
  background: linear-gradient(180deg, #111c2f 0%, #0f172a 100%) !important;
}
body.dark-pos-theme #vistaCaja .scanner-box input,
body.dark-pos-theme #vistaCaja #buscadorProducto,
body.dark-pos-theme #vistaCaja #metodoPago,
body.dark-pos-theme #vistaCaja .input-cantidad,
body.dark-pos-theme #vistaCaja #montoInicialCaja,
body.dark-pos-theme #vistaCaja #montoRecibido {
  background: #09111f !important;
  border-color: #31455f !important;
  color: #f8fbff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 0 1px rgba(15,23,42,.12) !important;
}
body.dark-pos-theme #vistaCaja .scanner-box input:focus,
body.dark-pos-theme #vistaCaja #buscadorProducto:focus,
body.dark-pos-theme #vistaCaja #metodoPago:focus,
body.dark-pos-theme #vistaCaja .input-cantidad:focus,
body.dark-pos-theme #vistaCaja #montoInicialCaja:focus,
body.dark-pos-theme #vistaCaja #montoRecibido:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 4px rgba(96,165,250,.15), inset 0 1px 0 rgba(255,255,255,.03) !important;
}
body.dark-pos-theme #vistaCaja .scanner-box button,
body.dark-pos-theme #vistaCaja .btn-ghost {
  background: linear-gradient(135deg, #162235 0%, #1e2f48 100%) !important;
  color: #dbeafe !important;
  border: 1px solid #304766 !important;
}
body.dark-pos-theme #vistaCaja .producto-item {
  background: linear-gradient(180deg, #101b2d 0%, #0c1525 100%) !important;
  border-color: #27354c !important;
}
body.dark-pos-theme #vistaCaja .producto-item:hover {
  box-shadow: 0 14px 28px rgba(2,6,23,.45), 0 0 0 1px rgba(96,165,250,.1) !important;
}
body.dark-pos-theme #vistaCaja .producto-nombre,
body.dark-pos-theme #vistaCaja .cobro-encabezado label,
body.dark-pos-theme #vistaCaja .cambio-box label,
body.dark-pos-theme #vistaCaja .total-label,
body.dark-pos-theme #vistaCaja .panel-title-row h2,
body.dark-pos-theme #vistaCaja .panel-title-row h3,
body.dark-pos-theme #vistaCaja .stat-value,
body.dark-pos-theme #vistaCaja .campo-cobro label {
  color: #f8fbff !important;
}
body.dark-pos-theme #vistaCaja .producto-stock,
body.dark-pos-theme #vistaCaja .cobro-subtexto,
body.dark-pos-theme #vistaCaja .stat-label,
body.dark-pos-theme #vistaCaja .panel-tag,
body.dark-pos-theme #vistaCaja .topbar-subtitle,
body.dark-pos-theme #vistaCaja .scanner-hint {
  color: #9fb2cc !important;
}
body.dark-pos-theme #vistaCaja .table-shell {
  background: #0a1220 !important;
  border-color: #223149 !important;
}
body.dark-pos-theme #vistaCaja th {
  background: #132033 !important;
  color: #8fc4ff !important;
}
body.dark-pos-theme #vistaCaja td {
  background: #0e1728 !important;
  color: #e6eefc !important;
  border-bottom-color: #1e2c40 !important;
}
body.dark-pos-theme #vistaCaja .total-box {
  background: linear-gradient(135deg, rgba(30,41,59,.96) 0%, rgba(18,52,86,.96) 100%) !important;
  border-color: #31567e !important;
  box-shadow: 0 18px 34px rgba(2,6,23,.42), inset 0 1px 0 rgba(255,255,255,.03) !important;
}
body.dark-pos-theme #vistaCaja .total-label {
  color: #c7dcff !important;
}
body.dark-pos-theme #vistaCaja .total-amount {
  color: #7dd3fc !important;
  text-shadow: 0 0 22px rgba(56,189,248,.12);
}
body.dark-pos-theme #vistaCaja .cobro-efectivo-panel {
  background: linear-gradient(180deg, #0f1c30 0%, #0b1526 100%) !important;
  border-color: #2f4d72 !important;
  box-shadow: 0 18px 34px rgba(2,6,23,.42), inset 0 1px 0 rgba(255,255,255,.03) !important;
}
body.dark-pos-theme #vistaCaja .cobro-badge {
  background: rgba(22,163,74,.15) !important;
  color: #86efac !important;
  border-color: rgba(34,197,94,.32) !important;
}
body.dark-pos-theme #vistaCaja .input-cobro-prefix {
  color: #7dd3fc !important;
}
body.dark-pos-theme #vistaCaja .input-cobro-wrap input {
  background: linear-gradient(180deg, #09111f 0%, #0c1727 100%) !important;
  border-color: #31567e !important;
  color: #f8fbff !important;
}
body.dark-pos-theme #vistaCaja .teclado-rapido-cobro button {
  background: linear-gradient(135deg, #18304c 0%, #1d4670 100%) !important;
  color: #eff6ff !important;
  border: 1px solid #31567e !important;
}
body.dark-pos-theme #vistaCaja .teclado-rapido-cobro button:hover {
  box-shadow: 0 10px 18px rgba(2,6,23,.34), 0 0 0 1px rgba(125,211,252,.16) !important;
}
body.dark-pos-theme #vistaCaja .cambio-box {
  background: linear-gradient(180deg, #0a2338 0%, #0c1a2f 100%) !important;
  border: 1px solid #2d557a !important;
}
body.dark-pos-theme #vistaCaja .cambio-box .cambio-valor {
  background: linear-gradient(180deg, #0b314d 0%, #0a2740 100%) !important;
  border-color: #38bdf8 !important;
  color: #b9f2ff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body.dark-pos-theme #vistaCaja .btn-success {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
}
body.dark-pos-theme #vistaCaja .btn-primary,
body.dark-pos-theme #vistaCaja .btn-caja,
body.dark-pos-theme #vistaCaja .btn-agregar,
body.dark-pos-theme #vistaCaja .btn-stock {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}
body.dark-pos-theme #vistaCaja .btn-danger,
body.dark-pos-theme #vistaCaja .btn-cerrar-caja,
body.dark-pos-theme #vistaCaja .btn-eliminar {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}
body.dark-pos-theme #vistaCaja .panel-tag {
  background: rgba(37,99,235,.14) !important;
  border-color: rgba(96,165,250,.2) !important;
}

@media (max-width: 1100px) {
  .config-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .actions-ticket-print-choices { grid-template-columns: 1fr; }
}


.cajero-identidad {
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
}
.cajero-identidad strong {
  font-size: 13px;
  color: var(--text);
  font-weight: 800;
}
.cajero-identidad span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
body.dark-mode .cajero-identidad strong {
  color: #e5eefb;
}
body.dark-mode .cajero-identidad span {
  color: #8ea3c7;
}
