/* SALES HISTORY ACTIONS */
.sale-history-row {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
  background: rgba(15, 23, 42, 0.35);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.sale-history-row:last-child {
  border-bottom: 1px solid var(--border-color);
}

.sale-history-info {
  width: 100%;
}

.sale-history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.15);
}

.sale-history-actions button {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.btn-delete-sale {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-delete-sale:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

.btn-reopen-ticket {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-reopen-ticket:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #fff;
}

/* PRINTER CONFIGURATION IN ADMIN */
.printer-settings-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.printer-badge {
  background: var(--accent-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.printer-select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 6px;
  font-weight: 600;
}

.printer-select:focus {
  outline: none;
  border-color: var(--accent-orange);
}

.printer-spec-card {
  background: var(--bg-surface);
  border: 1px dashed rgba(249, 115, 22, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
}

.printer-spec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.printer-spec-header strong {
  color: var(--accent-orange);
  font-size: 13px;
}

.spec-tag {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.printer-spec-details {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: #cbd5e1;
}

.printer-spec-details li b {
  color: #fff;
}

.btn-test-print {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-test-print:hover {
  background: rgba(34, 197, 94, 0.25);
  color: #fff;
}

/* SURCHARGE STEPPER IN CHARGE MODAL */
.charge-surcharge-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.surcharge-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.surcharge-label {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}
.surcharge-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-orange);
}
.surcharge-stepper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 75px), 1fr));
  gap: 6px;
}
@media (max-width: 440px) {
  .surcharge-stepper-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
.surcharge-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #f1f5f9;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.surcharge-btn:active, .surcharge-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-orange);
}
.surcharge-btn.add {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.3);
  color: #fb923c;
}
.surcharge-btn.reset {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}


/* =========================================================================
   REORGANIZACIÓN ELEGANTE DE CONFIGURACIÓN Y ESTACIÓN DE IMPRESIÓN (PRINT RELAY)
   ========================================================================= */
.admin-settings-section {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.admin-settings-section:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

.admin-settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.admin-settings-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.admin-settings-section-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin: 2px 0 0 0;
  font-weight: normal;
  line-height: 1.3;
}

.relay-role-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.relay-role-card > div {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  word-break: break-word;
}

.relay-role-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(30, 41, 59, 0.9);
}

.relay-role-card.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.relay-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.relay-counter-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}


/* -------------------------------------------------------------
 * BLINDAJE RESPONSIVE ANTI-OVERFLOW (CERO DESPLAZAMIENTO LATERAL)
 * ------------------------------------------------------------- */
html, body, #app, .app-content, .view-section {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

.table-card {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.table-number {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: block !important;
}

.admin-item-row {
  max-width: 100% !important;
  min-width: 0 !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}

.admin-item-row > div:first-child {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.admin-item-row div > div:first-child {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
}

.cart-item-row {
  max-width: 100% !important;
  min-width: 0 !important;
  gap: 8px !important;
  box-sizing: border-box !important;
}

.cart-item-info {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.cart-item-name {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  display: block !important;
}

.product-order-card {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.product-name {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  word-break: break-word !important;
  line-height: 1.25 !important;
}


/* ==========================================================================
   HEADER PRINTER BADGE & QUICK WIZARD STYLES (v3.4.95)
   ========================================================================== */
#header-printer-status,
.header-printer-badge,
#profile-badge,
.profile-badge {
  display: none !important;
}

.header-printer-badge {
  display: none !important;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #f8fafc;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.header-printer-badge:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.header-printer-badge:active {
  transform: scale(0.97);
}

.header-printer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green {
  background: #10b981;
  box-shadow: 0 0 7px rgba(16, 185, 129, 0.85);
}

.dot-blue {
  background: #3b82f6;
  box-shadow: 0 0 7px rgba(59, 130, 246, 0.85);
}

.dot-orange {
  background: #f59e0b;
  box-shadow: 0 0 7px rgba(245, 158, 11, 0.85);
}

.dot-inactive {
  background: #ef4444;
  box-shadow: 0 0 7px rgba(239, 68, 68, 0.85);
  animation: pulseRed 2s infinite ease-in-out;
}

@keyframes pulseRed {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

.wizard-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.wizard-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(15, 23, 42, 0.9);
}

.wizard-card.active-mode {
  border: 2px solid #2563eb !important;
  background: rgba(37, 99, 235, 0.1) !important;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.2);
}

.wizard-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.wizard-badge-blue {
  background: rgba(37, 99, 235, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.wizard-badge-purple {
  background: rgba(147, 51, 234, 0.25);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.4);
}

.wizard-badge-green {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.wizard-printer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
