/* Importar tipografía moderna de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Paleta de colores Premium */
  --bg-primary: #0f172a;      /* Slate 900 */
  --bg-secondary: #1e293b;    /* Slate 800 */
  --bg-tertiary: #334155;     /* Slate 700 */
  --accent: #0284c7;          /* Sky 600 */
  --accent-light: #38bdf8;    /* Sky 400 */
  --accent-glow: rgba(2, 132, 199, 0.15);
  --success: #10b981;         /* Emerald 500 */
  --warning: #f59e0b;         /* Amber 500 */
  --danger: #ef4444;          /* Red 500 */
  --text-main: #f8fafc;       /* Slate 50 */
  --text-muted: #94a3b8;      /* Slate 400 */
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px 0 rgba(2, 132, 199, 0.3);
}

/* Modo Claro (Opcional - Activado por clase) */
body.light-mode {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --accent: #0284c7;
  --accent-light: #0369a1;
  --accent-glow: rgba(2, 132, 199, 0.08);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(15, 23, 42, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(15, 23, 42, 0.05);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

/* --- LAYOUT DEL SISTEMA --- */

.sidebar {
  width: 230px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.logo-container {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, var(--text-main), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-list {
  list-style: none;
  padding: 16px 12px 32px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  max-height: calc(100vh - 145px);
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) rgba(0, 0, 0, 0.2);
}

/* Scrollbar elegante para la lista de menú */
.menu-list::-webkit-scrollbar {
  width: 8px;
}
.menu-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.menu-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.menu-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.menu-item button {
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.menu-item button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: var(--transition);
}

.menu-item.active button,
.menu-item button:hover {
  color: var(--text-main);
  background-color: var(--bg-tertiary);
}

.menu-item.active button {
  background: linear-gradient(to right, var(--accent-glow), rgba(2, 132, 199, 0.02));
  border-left: 4px solid var(--accent-light);
  border-radius: 0 8px 8px 0;
  padding-left: 10px;
  color: var(--accent-light);
}

.sidebar-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.theme-icon-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.theme-icon-btn:hover {
  background: var(--border-color);
  color: var(--accent-light);
  transform: scale(1.05);
}

.main-content {
  margin-left: 230px;
  flex-grow: 1;
  padding: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* --- CABECERA --- */

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.top-bar-user-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.75px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 20px;
}

.network-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  background-color: var(--bg-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  display: inline-block;
}

.dot.offline {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.dot.warning {
  background-color: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

/* --- CONTENEDORES Y TAB PANELS --- */

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- TARJETAS DASHBOARD --- */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(2, 132, 199, 0.3);
}

.metric-info h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-info .value {
  font-size: 28px;
  font-weight: 800;
}

.metric-icon {
  background: var(--bg-tertiary);
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
}

.metric-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* --- FORMATOS DE TABLA --- */

.card-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 30px;
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.card-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

th {
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: 600;
  color: var(--text-muted);
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.product-name-subtitle {
  display: none;
}

/* --- BOTONES Y COMPONENTES MODERNOS --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info { background-color: rgba(2, 132, 199, 0.15); color: var(--accent-light); }

/* --- SECCIÓN PUNTO DE VENTA (POS) --- */

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
}

.pos-main-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.scanner-box {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.scanner-box.scanning {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-glow);
}

#reader {
  width: 100%;
  max-width: 400px;
  background: black;
  border-radius: 12px;
  overflow: hidden;
}

/* Ajustes de diseño de html5-qrcode */
#reader__scan_region {
  background: #000;
}
#reader button {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 600;
  margin: 10px;
}

.search-bar {
  display: flex;
  gap: 12px;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-input-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
}

.search-input-wrapper input,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}

.search-input-wrapper input {
  padding-left: 48px;
}

.search-input-wrapper input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Resultados rápidos de búsqueda */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  z-index: 10;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  margin-top: 5px;
  display: none;
}

.search-results-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.search-results-item:hover {
  background-color: var(--bg-tertiary);
}

.search-results-item .code {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- CARRITO DE COMPRAS --- */

.pos-cart-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px; /* Reducido de 24px */
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  position: sticky;
  top: 40px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto; /* Permite scroll si la pantalla es muy pequeña */
}

.cart-header {
  font-size: 16px; /* Reducido de 18px */
  font-weight: 700;
  margin-bottom: 10px; /* Reducido de 16px */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px; /* Reducido de 12px */
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.cart-item-info {
  flex-grow: 1;
  margin-right: 12px;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-word;
}

.cart-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: var(--bg-tertiary);
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.cart-qty-btn:hover {
  background-color: var(--border-color);
}

.cart-item-qty {
  font-size: 14px;
  font-weight: 600;
  width: 20px;
  text-align: center;
}

.cart-item-price {
  font-weight: 700;
  font-size: 14px;
  margin-left: 8px;
  text-align: right;
  min-width: 60px;
}

.cart-totals {
  border-top: 1px solid var(--border-color);
  padding-top: 10px; /* Reducido de 16px */
  display: flex;
  flex-direction: column;
  gap: 4px; /* Reducido de 8px */
  margin-bottom: 10px; /* Reducido de 16px */
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px; /* Reducido de 14px */
  color: var(--text-muted);
}

.cart-total-row.grand-total {
  font-size: 17px; /* Reducido de 20px */
  font-weight: 800;
  color: var(--text-main);
  border-top: 1px dashed var(--border-color);
  padding-top: 6px; /* Reducido de 8px */
  margin-top: 2px; /* Reducido de 4px */
}

.client-select-wrapper {
  margin-bottom: 10px; /* Reducido de 16px */
}

.client-select-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- MODALES --- */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

@keyframes modalSlideIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

/* Premium iOS-style Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background-color: var(--accent) !important;
  border-color: var(--accent-light) !important;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group.full-width {
  grid-column: span 2;
}

/* --- FORMATO RECIBO / RIDE TÉRMICO (PARA IMPRIMIR) --- */

.invoice-preview-container {
  max-width: 400px;
  margin: 0 auto;
  background: white;
  color: black;
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
}

.invoice-preview-header {
  text-align: center;
  margin-bottom: 15px;
}

.invoice-preview-header h4 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
}

.invoice-divider {
  border-top: 1px dashed black;
  margin: 10px 0;
}

.invoice-row {
  display: flex;
  justify-content: space-between;
}

.invoice-row-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.invoice-items-list {
  margin: 10px 0;
}

.invoice-item-row {
  margin-bottom: 6px;
}

.barcode-simulated {
  text-align: center;
  margin: 15px 0 5px;
  font-size: 28px;
  letter-spacing: 2px;
  font-family: 'Libre Barcode 39', 'Courier New', Courier, monospace;
}

.clave-acceso-text {
  font-size: 9px;
  text-align: center;
  word-break: break-all;
  display: block;
}

/* --- RESPONSIVIDAD GENERAL --- */

@media screen and (max-width: 768px) {
  .btn-text-responsive {
    display: none;
  }
  body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }
  
  .logo-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 10px !important;
    height: 70px !important;
    justify-content: space-between !important;
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .logo-container .top-bar-user-section {
    width: auto !important;
    margin-top: 0 !important;
    justify-content: flex-end !important;
  }

  .logo-container img {
    max-height: 50px !important;
    margin: 0 !important;
  }
  
  .menu-list {
    width: 100% !important;
    max-width: 100% !important;
    flex-direction: row;
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    height: auto;
    gap: 8px;
    display: flex !important;
    box-sizing: border-box !important;
  }
  
  .menu-item button {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
  
  .menu-item.active button {
    border-left: none;
    border-bottom: 3px solid var(--accent-light);
    border-radius: 0;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    padding: 10px !important;
  }

  .pos-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
  }

  .pos-main-panel, .pos-cart-panel {
    min-width: 0 !important;
  }

  .top-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  .top-bar-user-section {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 5px !important;
  }

  .search-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .search-bar #toggle-camera-btn {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
  }

  .search-bar #toggle-camera-btn span {
    display: none !important;
  }

  .table-responsive:not(.table-fit) table {
    min-width: 650px !important;
  }
  
  .table-responsive.table-fit table {
    min-width: 0 !important;
    width: 100% !important;
  }

  .card-header {
    padding: 12px 14px !important;
  }

  th, td {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }
  
  .pos-cart-panel {
    height: auto;
    position: relative;
    top: 0;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }

  /* --- DASHBOARD METRICS SQUARES IN A SINGLE ROW ON MOBILE --- */
  .metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 24px !important;
  }

  .metric-card {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 4px !important;
    text-align: center !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 12px !important;
    background-color: var(--bg-secondary) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .metric-card .metric-icon {
    order: -1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    width: 100% !important;
    height: auto !important;
    margin-bottom: 4px !important;
    box-shadow: none !important;
  }

  .metric-card .metric-icon svg {
    width: 16px !important;
    height: 16px !important;
  }

  .metric-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    gap: 2px !important;
  }

  .metric-info h3 {
    font-size: 7.5px !important;
    color: var(--text-muted) !important;
    margin: 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.2px !important;
    line-height: 1.1 !important;
    font-weight: 600 !important;
    text-align: center !important;
    width: 100% !important;
    word-break: break-word !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .metric-info .value {
    font-size: 11px !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
    line-height: 1.2 !important;
    text-align: center !important;
    width: 100% !important;
    word-break: break-all !important;
    margin: 0 !important;
  }

  /* --- RESPONSIVE COLUMNS MERGING --- */
  .col-barcode {
    display: none !important;
  }

  .product-name-cell {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }

  .product-name-subtitle {
    display: block !important;
    font-size: 10px !important;
    color: var(--text-muted) !important;
    margin-top: 1px !important;
    font-weight: 500 !important;
  }
}

/* --- ESTILOS DE IMPRESIÓN (OCULTA LA APP Y DEJA SOLO LA FACTURA RIDE) --- */

@media print {
  .sidebar, .main-content, .top-bar, .modal-backdrop, .btn, .status-indicator {
    display: none !important;
  }
  
  body {
    display: block !important;
    background-color: white !important;
    color: black !important;
  }
  
  .invoice-print-container {
    display: block !important;
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    width: 80mm;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    background: white;
    color: black;
  }
  
  @page {
    size: auto;
    margin: 0;
  }
}

.invoice-print-container {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
}

/* --- GESTIÓN DE CATEGORÍAS EN INTERFAZ --- */
.category-node {
  margin: 10px 0;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.category-node:hover {
  border-color: var(--accent-light);
  transform: translateX(2px);
}

.category-children {
  margin-left: 32px;
  border-left: 2px dashed var(--border-color);
  padding-left: 16px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.category-node.subcategory {
  background: rgba(255, 255, 255, 0.01);
  border-color: transparent;
  padding: 8px 12px;
  font-size: 14px;
}

.category-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-actions {
  display: flex;
  gap: 8px;
}

/* --- ESTILOS DE ETIQUETA ADHESIVA --- */
.label-print-container {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
}

@media print {
  /* Si se está imprimiendo una etiqueta */
  body.printing-label {
    background-color: white !important;
    color: black !important;
  }
  
  body.printing-label .sidebar,
  body.printing-label .main-content,
  body.printing-label .modal-backdrop,
  body.printing-label .invoice-print-container,
  body.printing-label #print-area {
    display: none !important;
  }
  
  body.printing-label .label-print-container {
    display: block !important;
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    box-sizing: border-box !important;
  }
  
  body.printing-label .label-print-page {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: repeat(8, 1fr) !important;
    gap: 4mm !important;
    width: 210mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    padding: 10mm 15mm !important;
    box-sizing: border-box !important;
    page-break-after: always !important;
    break-after: page !important;
    background: white !important;
    overflow: hidden !important;
  }
  
  body.printing-label .label-print-page:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
  
  .printable-label-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px dashed #cbd5e1 !important;
    padding: 2mm !important;
    background: white !important;
    color: black !important;
    box-sizing: border-box !important;
    width: 50mm !important;
    height: 30mm !important;
    margin: 0 auto !important;
    overflow: hidden !important;
  }
  
  body.printing-label .printable-label-card h4 {
    font-size: 8pt;
    font-family: Arial, sans-serif;
    margin: 0 0 0.5mm 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-weight: bold;
  }
  
  body.printing-label .printable-label-card .price {
    font-size: 10pt;
    font-weight: bold;
    font-family: Arial, sans-serif;
    margin: 0 0 1mm 0;
    color: black !important;
  }
  
  body.printing-label .printable-label-card svg,
  body.printing-label .printable-label-card canvas,
  body.printing-label .printable-label-card img {
    max-height: 10mm;
    max-width: 44mm;
    display: block;
    margin: 0 auto;
  }
  
  body.printing-label .printable-label-card .code-text {
    font-size: 6pt;
    font-family: monospace;
    letter-spacing: 0.5px;
    margin-top: 0.5mm;
    font-weight: bold;
    color: black !important;
  }
}

/* --- ESTILOS COMPRAS --- */
.purchase-prod-select {
  width: 100%;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  outline: none;
}
.purchase-qty-input, .purchase-cost-input, .purchase-unit-cost-input {
  width: 100%;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  outline: none;
}
.purchase-qty-input:focus, .purchase-cost-input:focus, .purchase-unit-cost-input:focus, .purchase-prod-select:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.purchase-row-total {
  font-weight: 700;
  color: var(--text-main);
}

/* --- ESTILOS CARTERA --- */
.cartera-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}
.cartera-summary-card {
  background-color: var(--bg-primary);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  text-align: center;
}
.cartera-summary-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cartera-summary-value {
  font-size: 24px;
  font-weight: 800;
}

/* --- ESTILOS NOTAS DE CRÉDITO Y DEVOLUCIONES --- */
.credit-note-qty-input {
  width: 80px;
  padding: 6px;
  border-radius: 6px;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-align: center;
  outline: none;
  font-family: var(--font-family);
  transition: var(--transition);
}
.credit-note-qty-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.btn-danger:active {
  transform: translateY(0);
}

/* --- ESTILOS MÓDULO DE REPORTES --- */
.reports-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 992px) {
  .reports-detail-layout {
    grid-template-columns: 1fr;
  }
}

#btn-export-csv {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
}

#btn-export-csv:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#rep-kpi-vat-balance.text-danger {
  color: #ef4444 !important;
}

#rep-kpi-vat-balance.text-success {
  color: #10b981 !important;
}




/* --- ESTILOS CAJA CHICA Y TURNOS --- */
#caja-panel input#caja-monto-apertura {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: white;
  border-radius: 8px;
  outline: none;
}
#caja-panel input#caja-monto-apertura:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
#caja-movimiento-form select, 
#caja-movimiento-form input {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  outline: none;
}
#caja-movimiento-form select:focus, 
#caja-movimiento-form input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.caja-kpi-esperado {
  color: var(--accent-light);
}

/* Modales e inputs adicionales de cierre */
#cierre-caja-form input {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  outline: none;
}
#cierre-caja-form input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

#pago-proveedor-form input,
#pago-proveedor-form select {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  outline: none;
}
#pago-proveedor-form input:focus,
#pago-proveedor-form select:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

#purchase-forma-pago,
#purchase-metodo-pago {
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  outline: none;
  width: 100%;
}
#purchase-forma-pago:focus,
#purchase-metodo-pago:focus {
  border-color: var(--accent-light);
}

/* --- FORMATO FACTURA A4 RIDE (PARA IMPRIMIR Y PREVISUALIZAR) --- */

.a4-invoice-layout {
  width: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  color: black;
  font-size: 11px;
  line-height: 1.4;
}

.a4-header-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 15px;
  margin-bottom: 15px;
}

.a4-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.a4-card p {
  margin: 4px 0;
  color: #334155;
  font-size: 10.5px;
}

.a4-card strong {
  color: black;
}

.a4-logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.a4-logo-text {
  font-size: 16px;
  font-weight: 800;
  color: #0284c7;
  letter-spacing: -0.5px;
}

.a4-title {
  font-size: 18px;
  font-weight: 800;
  color: black;
  margin-bottom: 8px;
}

.a4-emisor-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.a4-info-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.a4-customer-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.a4-customer-card p {
  margin: 3px 0;
  font-size: 11px;
}

/* Tablas A4 */
.a4-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
  font-size: 10px;
}

.a4-table th,
.a4-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  text-align: left;
}

.a4-table th {
  background-color: #f1f5f9;
  font-weight: bold;
  color: black;
}

.a4-table tr:nth-child(even) td {
  background-color: #f8fafc;
}

.a4-totals-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin-bottom: 15px;
}

.a4-additional-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.a4-additional-card h5 {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.a4-payment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
}

.a4-payment-table th,
.a4-payment-table td {
  border: 1px solid #cbd5e1;
  padding: 4px 6px;
}

.a4-payment-table th {
  background-color: #f1f5f9;
}

.a4-totals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.a4-totals-table td {
  border: 1px solid #cbd5e1;
  padding: 5px 8px;
}

.a4-totals-table td:first-child {
  background-color: #f8fafc;
  font-weight: 500;
}

.a4-totals-table td:last-child {
  text-align: right;
  font-weight: 600;
}

.a4-totals-table tr.total-row td {
  background-color: #f1f5f9;
  font-weight: bold;
  font-size: 12px;
}

.a4-barcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 4px;
}

.a4-barcode-container svg,
.a4-barcode-container canvas {
  max-width: 100%;
  height: auto;
}

.a4-footer-terms {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  font-size: 9px;
  color: #475569;
  line-height: 1.3;
  background-color: #f8fafc;
}

.a4-footer-terms strong {
  color: black;
}

/* COMPATIBILIDAD CON IMPRESIÓN EN TAMAÑO A5 (148mm de ancho) - Desactivado para evitar conflictos en vistas previas móviles de A4
@media print and (max-width: 150mm) {
  @page {
    margin: 4mm !important;
  }
  
  body.printing-a4 .invoice-print-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 8.5px !important;
  }
  
  .a4-header-grid {
    grid-template-columns: 1.15fr 0.85fr !important;
    gap: 8px !important;
    margin-bottom: 6px !important;
  }
  
  .a4-card {
    padding: 6px !important;
  }
  
  .a4-card p {
    font-size: 8px !important;
    margin: 1px 0 !important;
  }
  
  .a4-title {
    font-size: 11px !important;
    margin-bottom: 2px !important;
  }
  
  .a4-customer-card {
    grid-template-columns: 1.2fr 0.8fr !important;
    gap: 8px !important;
    padding: 6px !important;
    margin-bottom: 6px !important;
  }
  
  .a4-customer-card p {
    font-size: 8px !important;
    margin: 1px 0 !important;
  }
  
  .a4-table {
    margin-bottom: 6px !important;
    font-size: 7.5px !important;
  }
  
  .a4-table th,
  .a4-table td {
    padding: 3px 4px !important;
  }
  
  .a4-totals-grid {
    grid-template-columns: 1.15fr 0.85fr !important;
    gap: 10px !important;
    margin-bottom: 6px !important;
  }
  
  .a4-additional-card {
    padding: 5px !important;
    margin-bottom: 5px !important;
  }
  
  .a4-payment-table {
    font-size: 7.5px !important;
  }
  
  .a4-payment-table th,
  .a4-payment-table td {
    padding: 2px 3px !important;
  }
  
  .a4-totals-table {
    font-size: 8px !important;
  }
  
  .a4-totals-table td {
    padding: 2.5px 4px !important;
  }
  
  .a4-totals-table tr.total-row td {
    font-size: 9.5px !important;
  }
  
  .a4-barcode-container {
    margin-top: 2px !important;
  }
  
  .a4-barcode-container canvas {
    max-height: 25px !important;
  }
  
  .a4-footer-terms {
    padding: 5px !important;
    font-size: 7.5px !important;
  }
}
*/

/* OVERRIDES DE IMPRESIÓN PARA FORMATO A4 */
@media print {
  body.printing-a4 {
    display: block !important;
    background-color: white !important;
    color: black !important;
  }
  
  body.printing-a4 .sidebar,
  body.printing-a4 .main-content,
  body.printing-a4 .top-bar,
  body.printing-a4 .modal-backdrop,
  body.printing-a4 .btn,
  body.printing-a4 .status-indicator,
  body.printing-a4 .label-print-container,
  body.printing-a4 #label-print-area {
    display: none !important;
  }
  
  body.printing-a4 .invoice-print-container {
    display: block !important;
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    width: 190mm !important; /* Force exact 190mm width to avoid mobile viewport shriveling */
    max-width: 190mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-size: 11px !important;
    background: white !important;
    color: black !important;
  }
  
  body.printing-a4.print-a4-half .invoice-print-container {
    display: block !important;
    position: absolute !important;
    top: 5mm !important;
    right: 5mm !important; /* Position it on the right side of landscape A4 (297mm width) */
    left: auto !important;
    width: 138mm !important; /* Fits perfectly on right half */
    height: auto !important; /* Let height flow naturally to prevent page overflow */
    max-height: 200mm !important;
    box-sizing: border-box !important;
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  
  body.printing-a4.print-a4-half .a4-invoice-layout {
    width: 100% !important;
    font-size: 8.2px !important;
  }
  
  body.printing-a4.print-a4-half .a4-header-grid {
    grid-template-columns: 1.15fr 0.85fr !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
  }
  
  body.printing-a4.print-a4-half .a4-card {
    padding: 5px !important;
    border-radius: 4px !important;
  }
  
  body.printing-a4.print-a4-half .a4-card p {
    font-size: 8px !important;
    margin: 1px 0 !important;
  }
  
  body.printing-a4.print-a4-half .a4-title {
    font-size: 10.5px !important;
    margin-bottom: 2px !important;
  }
  
  body.printing-a4.print-a4-half .a4-customer-card {
    grid-template-columns: 1.2fr 0.8fr !important;
    gap: 6px !important;
    padding: 5px !important;
    margin-bottom: 6px !important;
    border-radius: 4px !important;
  }
  
  body.printing-a4.print-a4-half .a4-customer-card p {
    font-size: 8px !important;
    margin: 1px 0 !important;
  }
  
  body.printing-a4.print-a4-half .a4-logo-container img {
    max-height: 28px !important;
  }
  
  body.printing-a4.print-a4-half .a4-logo-text {
    font-size: 11.5px !important;
  }
  
  body.printing-a4.print-a4-half .a4-table {
    table-layout: fixed !important;
    width: 100% !important;
    margin-bottom: 6px !important;
    font-size: 7.5px !important;
  }
  
  body.printing-a4.print-a4-half .a4-table th,
  body.printing-a4.print-a4-half .a4-table td {
    padding: 2.5px 3px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  body.printing-a4.print-a4-half .a4-table th:nth-child(1),
  body.printing-a4.print-a4-half .a4-table td:nth-child(1) { width: 16% !important; word-break: break-all !important; }
  body.printing-a4.print-a4-half .a4-table th:nth-child(2),
  body.printing-a4.print-a4-half .a4-table td:nth-child(2) { width: 10% !important; text-align: center !important; }
  body.printing-a4.print-a4-half .a4-table th:nth-child(3),
  body.printing-a4.print-a4-half .a4-table td:nth-child(3) { width: 34% !important; word-wrap: break-word !important; }
  body.printing-a4.print-a4-half .a4-table th:nth-child(4),
  body.printing-a4.print-a4-half .a4-table td:nth-child(4) { width: 10% !important; }
  body.printing-a4.print-a4-half .a4-table th:nth-child(5),
  body.printing-a4.print-a4-half .a4-table td:nth-child(5) { width: 10% !important; text-align: right !important; }
  body.printing-a4.print-a4-half .a4-table th:nth-child(6),
  body.printing-a4.print-a4-half .a4-table td:nth-child(6) { width: 10% !important; text-align: right !important; }
  body.printing-a4.print-a4-half .a4-table th:nth-child(7),
  body.printing-a4.print-a4-half .a4-table td:nth-child(7) { width: 10% !important; text-align: right !important; }
  
  body.printing-a4.print-a4-half .a4-totals-grid {
    grid-template-columns: 1.15fr 0.85fr !important;
    gap: 8px !important;
    margin-bottom: 6px !important;
  }
  
  body.printing-a4.print-a4-half .a4-additional-card {
    padding: 4px !important;
    margin-bottom: 5px !important;
    border-radius: 4px !important;
  }
  
  body.printing-a4.print-a4-half .a4-payment-table {
    font-size: 7.2px !important;
  }
  
  body.printing-a4.print-a4-half .a4-payment-table th,
  body.printing-a4.print-a4-half .a4-payment-table td {
    padding: 1.5px 2.5px !important;
  }
  
  body.printing-a4.print-a4-half .a4-totals-table {
    font-size: 7.5px !important;
  }
  
  body.printing-a4.print-a4-half .a4-totals-table td {
    padding: 1.5px 2.5px !important;
  }
  
  body.printing-a4.print-a4-half .a4-totals-table tr.total-row td {
    font-size: 8.5px !important;
  }
  
  body.printing-a4.print-a4-half .a4-barcode-container {
    margin-top: 2px !important;
  }
  
  body.printing-a4.print-a4-half .a4-barcode-container canvas {
    max-height: 20px !important;
  }
  
  body.printing-a4.print-a4-half .a4-footer-terms {
    padding: 4px !important;
    font-size: 6.8px !important;
    margin-top: 4px !important;
    line-height: 1.2 !important;
  }
  
  body.printing-a4.print-a4-half img {
    max-height: 28px !important;
  }
}

body.test-preview-a4.print-a4-half .invoice-print-container {
  width: 138mm !important;
  height: 200mm !important;
  max-height: 200mm !important;
  overflow-y: auto !important;
  font-size: 8.2px !important;
}

body.test-preview-a4.print-a4-half .a4-invoice-layout {
  width: 100% !important;
  font-size: 8.2px !important;
}

body.test-preview-a4.print-a4-half .a4-header-grid { grid-template-columns: 1.15fr 0.85fr !important; gap: 6px !important; margin-bottom: 6px !important; }
body.test-preview-a4.print-a4-half .a4-card { padding: 5px !important; }
body.test-preview-a4.print-a4-half .a4-card p { font-size: 8px !important; margin: 1px 0 !important; }
body.test-preview-a4.print-a4-half .a4-title { font-size: 10.5px !important; margin-bottom: 2px !important; }
body.test-preview-a4.print-a4-half .a4-customer-card { grid-template-columns: 1.2fr 0.8fr !important; gap: 6px !important; padding: 5px !important; margin-bottom: 6px !important; }
body.test-preview-a4.print-a4-half .a4-customer-card p { font-size: 8px !important; margin: 1px 0 !important; }
body.test-preview-a4.print-a4-half .a4-table { table-layout: fixed !important; width: 100% !important; margin-bottom: 6px !important; font-size: 7.5px !important; }
body.test-preview-a4.print-a4-half .a4-table th, body.test-preview-a4.print-a4-half .a4-table td { padding: 2.5px 3px !important; }
body.test-preview-a4.print-a4-half .a4-table th:nth-child(1), body.test-preview-a4.print-a4-half .a4-table td:nth-child(1) { width: 16% !important; word-break: break-all !important; }
body.test-preview-a4.print-a4-half .a4-table th:nth-child(2), body.test-preview-a4.print-a4-half .a4-table td:nth-child(2) { width: 10% !important; text-align: center !important; }
body.test-preview-a4.print-a4-half .a4-table th:nth-child(3), body.test-preview-a4.print-a4-half .a4-table td:nth-child(3) { width: 34% !important; word-wrap: break-word !important; }
body.test-preview-a4.print-a4-half .a4-table th:nth-child(4), body.test-preview-a4.print-a4-half .a4-table td:nth-child(4) { width: 10% !important; }
body.test-preview-a4.print-a4-half .a4-table th:nth-child(5), body.test-preview-a4.print-a4-half .a4-table td:nth-child(5) { width: 10% !important; text-align: right !important; }
body.test-preview-a4.print-a4-half .a4-table th:nth-child(6), body.test-preview-a4.print-a4-half .a4-table td:nth-child(6) { width: 10% !important; text-align: right !important; }
body.test-preview-a4.print-a4-half .a4-table th:nth-child(7), body.test-preview-a4.print-a4-half .a4-table td:nth-child(7) { width: 10% !important; text-align: right !important; }
body.test-preview-a4.print-a4-half .a4-totals-grid { grid-template-columns: 1.15fr 0.85fr !important; gap: 8px !important; margin-bottom: 6px !important; }
body.test-preview-a4.print-a4-half .a4-additional-card { padding: 4px !important; margin-bottom: 5px !important; }
body.test-preview-a4.print-a4-half .a4-payment-table { font-size: 7.2px !important; }
body.test-preview-a4.print-a4-half .a4-payment-table th, body.test-preview-a4.print-a4-half .a4-payment-table td { padding: 1.5px 2.5px !important; }
body.test-preview-a4.print-a4-half .a4-totals-table { font-size: 7.5px !important; }
body.test-preview-a4.print-a4-half .a4-totals-table td { padding: 1.5px 2.5px !important; }
body.test-preview-a4.print-a4-half .a4-totals-table tr.total-row td { font-size: 8.5px !important; }
body.test-preview-a4.print-a4-half .a4-barcode-container { margin-top: 2px !important; }
body.test-preview-a4.print-a4-half .a4-barcode-container canvas { max-height: 20px !important; }
body.test-preview-a4.print-a4-half .a4-footer-terms { padding: 4px !important; font-size: 6.8px !important; margin-top: 4px !important; line-height: 1.2 !important; }
body.test-preview-a4.print-a4-half img { max-height: 28px !important; }

/* --- ESTILOS DE PREVISUALIZACIÓN DE PRUEBA (TEST ONLY) --- */
body.test-preview-ticket .invoice-print-container {
  display: block !important;
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 80mm !important;
  max-width: 90vw !important;
  height: 80vh !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
  background: white !important;
  color: black !important;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6) !important;
  z-index: 1000000 !important;
  padding: 15px !important;
  border-radius: 8px !important;
  border: 3px solid #0284c7 !important;
  font-family: 'Courier New', Courier, monospace !important;
  font-size: 12px !important;
}

body.test-preview-a4 .invoice-print-container {
  display: block !important;
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 190mm !important;
  max-width: 90vw !important;
  height: 90vh !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  background: white !important;
  color: black !important;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6) !important;
  z-index: 1000000 !important;
  padding: 25px !important;
  border-radius: 8px !important;
  border: 3px solid #0284c7 !important;
}

/* --- AUTOCOMPLETE CLIENT SEARCH STYLING --- */
.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: #f8fafc;
  background: #1e293b;
  transition: background 0.15s ease, color 0.15s ease;
}

.autocomplete-item:hover {
  background: #0284c7 !important;
  color: white !important;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-no-results {
  padding: 12px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  background: #1e293b;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  min-width: 300px;
  max-width: 450px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: var(--shadow-lg), 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s, border-color 0.3s;
  opacity: 0;
}

.toast-message.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-message.success {
  border-left: 4px solid var(--success);
}

.toast-message.error {
  border-left: 4px solid var(--danger);
}

.toast-message.warning {
  border-left: 4px solid var(--warning);
}

.toast-message.info {
  border-left: 4px solid var(--accent);
}

.toast-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-content {
  flex-grow: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.toast-close:hover {
  color: var(--text-main);
}

/* --- ESTILOS DE SERVICIO TÉCNICO --- */
.badge-service-recibido {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.badge-service-reparacion {
  background-color: rgba(249, 115, 22, 0.15) !important;
  color: #f97316 !important;
  border: 1px solid rgba(249, 115, 22, 0.25) !important;
}

.badge-service-listo {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.badge-service-entregado {
  background-color: rgba(2, 132, 199, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
}

.badge-service-anulado {
  background-color: rgba(148, 163, 184, 0.15) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

/* Detalles en modal */
.service-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.service-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.service-detail-item label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.service-detail-item span {
  font-size: 14px;
  font-weight: 600;
}

/* Estilos específicos de impresión de Órdenes de Trabajo */
@media print {
  body.printing-service-order .modal-backdrop,
  body.printing-service-order .btn,
  body.printing-service-order .status-indicator,
  body.printing-service-order .main-content,
  body.printing-service-order .sidebar,
  body.printing-service-order .top-bar {
    display: none !important;
  }
  
  body.printing-service-order {
    background: white !important;
    color: black !important;
    display: block !important;
  }

  body.printing-service-order .invoice-print-container {
    display: block !important;
    width: 80mm !important;
    margin: 0 !important;
    padding: 2mm !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 12px !important;
    color: black !important;
    background: white !important;
    line-height: 1.4 !important;
  }
}

/* ==========================================
   ESTILOS DE AUTENTICACIÓN Y SAAS (PAYWALL)
   ========================================== */

#auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgb(15, 23, 42) 0%, rgb(9, 13, 26) 90%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 20px;
  box-sizing: border-box;
  z-index: 999999;
}

.auth-card {
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
  margin: auto;
}

.auth-card.register-active {
  max-width: 760px;
}

.auth-logo-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-logo-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.auth-logo-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  border-bottom: 2px solid transparent;
}

.auth-tab.active {
  color: white;
  border-bottom: 2px solid #8b5cf6;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.auth-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.4);
  color: white;
  font-size: 13.5px;
  outline: none;
  transition: all 0.3s ease;
}

.auth-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.auth-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.auth-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.auth-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* --- ESTILOS DE PAGO / PAYWALL CONTENEDOR --- */

#paywall-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 20px;
  box-sizing: border-box;
  z-index: 9999999;
}

.paywall-card {
  background: #1e293b;
  border: 1px solid rgba(239, 68, 68, 0.3);
  margin: auto;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  padding: 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.paywall-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.paywall-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  width: 60px;
  height: 60px;
  border-radius: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
}

.paywall-title {
  font-size: 22px;
  font-weight: bold;
  color: white;
}

.paywall-description {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

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

.subscription-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.05);
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.user-email-text {
  font-size: 12.5px;
  font-weight: 500;
  color: white;
}

.logout-btn-nav {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn-nav:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* --- ESTILOS VISUALIZACIÓN CONTRASEÑA --- */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-input-wrapper input {
  padding-right: 40px !important;
  width: 100% !important;
}
.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: none !important;
  border: none !important;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 !important;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  box-shadow: none !important;
  transform: none !important;
}
.password-toggle-btn:hover {
  color: white !important;
  background: none !important;
}

/* --- ADAPTACIÓN ADICIONAL PARA CELULARES (LOGIN / PAYWALL) --- */
@media (max-width: 480px) {
  #auth-container, #paywall-container {
    padding: 16px;
    box-sizing: border-box;
  }
  
  .auth-card, .paywall-card {
    padding: 24px 18px !important;
    gap: 16px !important;
  }
  
  .auth-logo-title {
    font-size: 19px !important;
  }
  
  .paywall-title {
    font-size: 18px !important;
  }
  
  .paywall-description {
    font-size: 12px !important;
  }
}

/* --- TOGGLE SWITCHES ELEGANTES --- */
.switch-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 8px;
  transition: var(--transition);
}

.switch-group:hover {
  background: rgba(255, 255, 255, 0.05);
}

.switch-label-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.switch-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.switch-desc {
  font-size: 10.5px;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .slider-round {
  background-color: var(--accent-light);
}

.toggle-switch input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* --- ESTILOS DE GRÁFICO --- */
.chart-filter-btn.active {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent) !important;
}

/* --- CUSTOM ALERT DIALOG MODAL --- */
.custom-alert-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 12, 21, 0.6); /* Fondo ultra oscuro y transparente */
  backdrop-filter: blur(16px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  animation: premiumBackdropFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-alert-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  width: 90%;
  max-width: 440px;
  padding: 36px 32px 32px 32px;
  text-align: center;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 
              0 0 50px -10px rgba(56, 189, 248, 0.1);
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  animation: premiumCardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  overflow: hidden;
}

.custom-alert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

@keyframes premiumBackdropFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(16px) saturate(140%); }
}

@keyframes premiumCardSlideIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom-alert-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
}

/* Tipos de iconos */
.custom-alert-icon.success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.custom-alert-icon.error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}

.custom-alert-icon.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.custom-alert-card h3 {
  font-size: 19px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
  margin-top: 0;
  letter-spacing: -0.02em;
}

.custom-alert-card p {
  font-size: 14.5px;
  color: #94a3b8; /* Slate 400 */
  line-height: 1.6;
  margin-bottom: 28px;
  word-break: break-word;
}

.custom-alert-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.custom-alert-actions button {
  flex: 1;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.custom-alert-actions button.btn-accept {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.custom-alert-actions button.btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

.custom-alert-actions button.btn-accept:active {
  transform: translateY(0);
}

.custom-alert-actions button.btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-alert-actions button.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateY(-2px);
}

.custom-alert-actions button.btn-cancel:active {
  transform: translateY(0);
}

/* --- ONBOARDING WIZARD --- */
.onboarding-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  width: 95%;
  max-width: 600px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 
              0 0 50px -10px rgba(56, 189, 248, 0.05);
  transform: translateY(30px) scale(0.96);
  opacity: 0;
  animation: premiumCardSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
  position: relative;
}

.onboarding-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

.onboarding-header {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.onboarding-header h2 {
  font-size: 19px;
  font-weight: 700;
  color: white;
  margin: 0;
  letter-spacing: -0.02em;
}

.onboarding-skip-btn {
  font-size: 13px;
  color: #94a3b8;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.onboarding-skip-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.onboarding-steps-indicator {
  display: flex;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 16px;
}

.onboarding-step-indicator-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  position: relative;
  flex: 1;
}

.onboarding-step-indicator-item.active {
  color: #38bdf8;
}

.onboarding-step-indicator-item.completed {
  color: #34d399;
}

.onboarding-step-indicator-item .step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  color: #94a3b8;
}

.onboarding-step-indicator-item.active .step-num {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.onboarding-step-indicator-item.completed .step-num {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.onboarding-body {
  padding: 32px 28px;
  overflow-y: auto;
  flex: 1;
}

.onboarding-step-content {
  display: none;
}

.onboarding-step-content.active {
  display: block;
  animation: premiumStepTransition 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes premiumStepTransition {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.onboarding-welcome-icon {
  font-size: 64px;
  text-align: center;
  margin-bottom: 20px;
  animation: onboardingBounce 2.5s infinite;
}

@keyframes onboardingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.onboarding-welcome-text {
  text-align: center;
  margin-bottom: 20px;
}

.onboarding-welcome-text h3 {
  font-size: 22px;
  font-weight: 800;
  color: white;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.onboarding-welcome-text p {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.7;
}

.onboarding-footer {
  padding: 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.10);
}

/* --- ESTILOS DEL CONSTRUCTOR WEB (ESTILO ELEMENTOR) --- */

.webbuilder-container {
  display: flex;
  gap: 20px;
  height: calc(100vh - 140px);
  min-height: 500px;
  overflow: hidden;
}

.webbuilder-sidebar {
  width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.webbuilder-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.01);
}

.webbuilder-sidebar-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.webbuilder-sidebar-content {
  padding: 16px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.webbuilder-preview-container {
  flex-grow: 1;
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.webbuilder-preview-header {
  height: 55px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--card-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.device-selectors {
  display: flex;
  gap: 6px;
}

.device-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.device-btn:hover {
  background: rgba(255,255,255,0.08);
}

.device-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.preview-url-bar {
  flex-grow: 1;
  max-width: 400px;
  margin-left: 20px;
  background: rgba(0,0,0,0.30);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.webbuilder-preview-body {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  overflow: auto;
  position: relative;
  background: radial-gradient(circle at center, #111827 0%, #030712 100%);
}

#preview-device-frame {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: #0f172a;
  overflow: hidden;
}

#preview-device-frame.device-desktop {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

#preview-device-frame.device-mobile {
  width: 375px;
  height: 700px;
  border-radius: 40px;
  border: 14px solid #1f2937;
  box-shadow: 0 25px 60px rgba(0,0,0,0.7);
  position: relative;
}

#preview-device-frame.device-mobile::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 16px;
  background: #1f2937;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 10;
}

#webbuilder-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0f172a;
}

/* Acordeón del Editor */
.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.accordion-header {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border: none;
  color: var(--text-color);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
  font-family: inherit;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: rgba(255,255,255,0.05);
}

.accordion-icon {
  font-size: 0.75rem;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.accordion-body {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(0,0,0,0.1);
  display: none;
}

.accordion-item.active .accordion-body {
  display: block;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

/* Sub-acordeones internos */
.sub-accordion-body {
  padding: 8px 4px 0 4px;
  display: none;
}

.sub-accordion.open .sub-accordion-body {
  display: block;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

/* Botones de Efectivo Rápido - POS */
#quick-cash-buttons button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#quick-cash-buttons button:hover {
  background: var(--accent);
  border-color: var(--accent-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

#quick-cash-buttons button:active {
  transform: translateY(0);
}

#btn-cash-exact {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#btn-cash-exact:hover {
  background: var(--success) !important;
  border-color: #34d399 !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

#btn-cash-exact:active {
  transform: translateY(0);
}

/* --- ESTILOS ADICIONALES PARA PLANES DE REGISTRO --- */
.pricing-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.pricing-card.active {
  border-color: var(--accent) !important;
  background: rgba(2, 132, 199, 0.08) !important;
  box-shadow: 0 8px 32px rgba(2, 132, 199, 0.2) !important;
}

.pricing-card#pricing-card-accounting.active {
  border-color: #eab308 !important;
  background: rgba(234, 179, 8, 0.08) !important;
  box-shadow: 0 8px 32px rgba(234, 179, 8, 0.2) !important;
}

.plan-select-btn {
  transition: all 0.2s ease;
}

.plan-select-btn:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

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

/* --- ESTILOS DE LA PÁGINA DE INICIO (LANDING PAGE) --- */
#landing-page-container {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #0b0f19;
  color: #f1f5f9;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  flex: 1;
  box-sizing: border-box;
}

.landing-header {
  position: sticky;
  top: 0;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;
  padding: 16px 24px;
}

.landing-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-logo img {
  max-height: 64px;
  width: auto;
  display: block;
}

.landing-logo span {
  font-size: 20px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.5px;
}

.landing-nav {
  display: flex;
  gap: 32px;
}

.landing-nav a {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  transition: color 0.2s;
}

.landing-nav a:hover {
  color: white;
}

.landing-auth-buttons {
  display: flex;
  gap: 12px;
}

.btn-landing-secondary {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-landing-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-landing-primary {
  background: var(--accent);
  border: none;
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-landing-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* HERO SECTION */
.landing-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.badge-ecuador {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-light);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.hero-left h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  color: white;
  margin: 0;
  background: linear-gradient(to right, #ffffff 40%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-left p {
  font-size: 16px;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.btn-hero-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(59, 130, 246, 0.6);
}

.btn-hero-secondary {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  transition: color 0.2s;
}

.btn-hero-secondary:hover {
  color: white;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 30px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-item strong {
  font-size: 24px;
  font-weight: 800;
  color: white;
}

.stat-item span {
  font-size: 12px;
  color: #64748b;
}

/* MOCKUP */
.dashboard-mockup {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mockup-header {
  background: #1f2937;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.mockup-title {
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
  font-family: monospace;
}

.mockup-body {
  display: flex;
  height: 220px;
}

.mockup-sidebar {
  width: 50px;
  background: #111827;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.m-item {
  width: 20px;
  height: 20px;
  background: #374151;
  border-radius: 4px;
}

.m-item.active {
  background: var(--accent);
}

.mockup-main {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mockup-row {
  display: flex;
  gap: 15px;
}

.mockup-card {
  flex: 1;
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mockup-card span {
  font-size: 10px;
  color: #94a3b8;
}

.mockup-card strong {
  font-size: 16px;
  color: white;
}

.mockup-card.blue strong { color: var(--accent-light); }
.mockup-card.green strong { color: #34d399; }

.mockup-chart-placeholder {
  flex: 1;
  background: #1f2937;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
}

.bar {
  width: 25px;
  background: #374151;
  border-radius: 4px 4px 0 0;
  transition: all 0.3s;
}

.bar.active {
  background: linear-gradient(to top, var(--accent) 0%, #60a5fa 100%);
}

/* CARACTERISTICAS */
.landing-features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-title {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 50px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin: 0;
}

.section-title p {
  font-size: 15px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.feature-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 30px;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(30, 41, 59, 0.6);
}

.feature-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.feature-card p {
  font-size: 13.5px;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0;
}

/* PLANES */
.landing-pricing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pricing-wrapper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 480px));
  justify-content: center;
  gap: 40px;
  margin-top: 20px;
}

.pricing-card-landing {
  background: rgba(30, 41, 59, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: all 0.3s;
}

.pricing-card-landing.featured {
  border-color: rgba(234, 179, 8, 0.3);
  background: rgba(30, 41, 59, 0.65);
  box-shadow: 0 10px 40px -15px rgba(234, 179, 8, 0.15);
}

.badge-featured {
  position: absolute;
  top: -12px;
  right: 30px;
  background: #eab308;
  color: black;
  font-size: 9.5px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.pricing-card-landing h4 {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.price-old {
  font-size: 13px;
  color: #64748b;
  text-decoration: line-through;
  margin-bottom: -10px;
}

.price-discount {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
}

.pricing-card-landing.featured .price-discount {
  background: rgba(234, 179, 8, 0.15);
  color: #f59e0b;
}

.price-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-light);
  margin: 5px 0;
}

.pricing-card-landing.featured .price-value {
  color: #eab308;
}

.price-value span {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
}

.price-sub {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.btn-card-landing {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-card-landing:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-card-landing-featured {
  background: #eab308;
  border: none;
  color: black;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3);
}

.btn-card-landing-featured:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.pricing-card-landing ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  color: #cbd5e1;
  text-align: left;
}

.pricing-card-landing ul li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* FOOTER */
/* --- FOOTER MULTICOLUMNA PREMIUM --- */
.landing-footer-sec {
  background: #090d16;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 80px 24px 40px;
  color: #94a3b8;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.footer-grid-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
  max-width: 320px;
}

.footer-menu-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer-menu-col h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: white;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-menu-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-menu-col ul li a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.2s ease;
}

.footer-menu-col ul li a:hover {
  color: white;
}

.footer-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 1200px;
  margin: 0 auto 30px auto;
}

.footer-bottom-row {
  max-width: 1200px;
  margin: 0 auto 30px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-addresses {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.5;
  flex-wrap: wrap;
}

.footer-addresses strong {
  color: #94a3b8;
}

.addr-sep {
  color: rgba(255, 255, 255, 0.1);
}

.footer-copyright {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 25px;
  text-align: center;
}

.footer-copyright p {
  font-size: 11.5px;
  color: #475569;
  margin: 0;
}

/* MEDIA RESPONSIVE */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-left h1 {
    font-size: 34px;
  }
  .hero-ctas {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .pricing-wrapper {
    grid-template-columns: 1fr;
  }

  /* RESPONSIVE FOOTER */
  .footer-grid-container {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .footer-socials {
    align-self: flex-start;
  }
}

@media (max-width: 500px) {
  .footer-grid-container {
    grid-template-columns: 1fr;
    gap: 25px;
  }
}

/* FAQ ACCORDION SECTION */
.landing-faq {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item.active {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(30, 41, 59, 0.65);
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
}

.faq-question {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 15px;
  color: white;
  gap: 20px;
}

.faq-toggle {
  font-size: 20px;
  font-weight: 500;
  color: var(--accent-light);
  transition: transform 0.3s ease, color 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.faq-item.active .faq-toggle {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.2);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer p {
  padding: 0 24px 20px 24px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #94a3b8;
}

/* REVIEWS / TESTIMONIALS SECTION */
.landing-reviews {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 20px;
}

.review-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  transition: all 0.3s ease;
}

.review-card:hover {
  transform: translateY(-5px);
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(30, 41, 59, 0.6);
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5);
}

.review-rating {
  font-size: 15px;
  color: #fbbf24;
  letter-spacing: 2px;
}

.review-text {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
  font-style: italic;
  margin: 0;
}

.review-user {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.review-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.review-info strong {
  font-size: 14.5px;
  color: white;
}

.review-info span {
  font-size: 12px;
  color: #94a3b8;
}

/* SOCIAL MEDIA LINKS */
.footer-socials {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 16px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.footer-socials a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.footer-socials a#footer-link-tiktok:hover {
  background: #010101;
  border-color: #ff0050;
  box-shadow: 0 4px 12px rgba(255, 0, 80, 0.3);
}

.footer-socials a#footer-link-instagram:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
}

.footer-socials a#footer-link-youtube:hover {
  background: #ff0000;
  border-color: #ff0000;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

/* --- USER PROFILE DROPDOWN --- */
.profile-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-trigger-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  padding: 0;
  box-shadow: var(--shadow-sm);
}

.profile-trigger-btn:hover {
  border-color: var(--accent-light);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.profile-avatar-initials {
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-light);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.profile-dropdown-menu {
  position: absolute;
  top: 48px;
  right: 0;
  width: 240px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg), 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.profile-dropdown-menu.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-menu-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.profile-menu-avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 4px;
}

.profile-menu-initials {
  font-family: var(--font-family);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-light);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.profile-menu-store-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-email {
  font-size: 12.5px;
  color: var(--text-muted);
  word-break: break-all;
  font-weight: 400;
}

.profile-trigger-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  box-sizing: border-box;
}

.profile-menu-avatar-circle img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  box-sizing: border-box;
}

.profile-menu-body {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-menu-info-item {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-menu-footer {
  padding: 8px;
}

.logout-btn-dropdown {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--danger);
  font-family: var(--font-family);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.logout-btn-dropdown:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* --- ESTADOS EN EL DROPDOWN DEL PERFIL --- */
.profile-menu-status-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 20px;
  transition: var(--transition);
}

.profile-menu-status-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  transition: var(--transition);
}

.profile-menu-status-dot.offline {
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.profile-menu-status-text {
  font-size: 9px;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
  transition: var(--transition);
}

.profile-menu-status-badge.offline {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
}

.profile-menu-status-badge.offline .profile-menu-status-text {
  color: #ef4444;
}

/* --- RESPONSIVIDAD NAVBAR DE LANDING PAGE --- */
@media screen and (max-width: 768px) {
  .landing-header {
    padding: 12px 16px;
  }
  .landing-nav-container {
    display: grid !important;
    grid-template-areas: 
      "logo auth"
      "nav nav" !important;
    grid-template-columns: auto auto !important;
    row-gap: 12px !important;
    align-items: center !important;
  }
  .landing-logo {
    grid-area: logo !important;
    justify-self: start !important;
  }
  .landing-auth-buttons {
    grid-area: auth !important;
    justify-self: end !important;
    gap: 8px !important;
  }
  .landing-nav {
    grid-area: nav !important;
    display: flex !important;
    justify-content: center !important;
    gap: 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding-top: 10px !important;
    margin-top: 4px !important;
    width: 100% !important;
  }
  .landing-nav a {
    font-size: 13.5px !important;
  }
  .btn-landing-secondary, .btn-landing-primary {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }
  .landing-logo img {
    max-height: 40px !important;
  }
}

/* PWA / Mobile Only Utility Classes */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: inline-flex !important;
  }
  #btn-header-show-scanner-qr {
    padding: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    justify-content: center !important;
    align-items: center !important;
    display: inline-flex !important;
  }
  #btn-header-show-scanner-qr span {
    display: none !important;
  }
  #btn-header-show-scanner-qr svg {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
  }
}

/* Centro de Notificaciones */
.notification-dropdown-container {
  position: relative;
  display: inline-block;
  margin-right: 12px;
}

.notification-trigger-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.notification-trigger-btn:hover {
  background: var(--border-color);
  color: var(--accent-light);
  transform: translateY(-1px);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent-red);
  color: white;
  border-radius: 50%;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: bold;
  border: 1.5px solid var(--bg-main);
  min-width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
}

.notification-dropdown-menu {
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg), 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.notification-dropdown-menu.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.notification-header h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.notification-body {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.2s ease;
  align-items: flex-start;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.notification-item.unread {
  background: rgba(2, 132, 199, 0.08);
}

.notification-item.unread:hover {
  background: rgba(2, 132, 199, 0.12);
}

.notification-icon-wrapper {
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}

.notification-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
}

.notification-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.notification-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.notification-time {
  font-size: 9.5px;
  color: var(--text-muted);
  opacity: 0.7;
}

.notification-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* Menú Dropdown Theme Toggle */
.theme-icon-btn-menu {
  display: none !important;
}

@media (max-width: 768px) {
  #theme-toggle {
    display: none !important;
  }
  .theme-icon-btn-menu {
    display: inline-flex !important;
  }
  .profile-menu-status-badge {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    display: flex !important;
    justify-content: space-between !important;
  }
  .profile-menu-header {
    padding-top: 52px !important;
  }
}



/* ==========================================================================
   ESTILOS DEL BANNER DE SINCRONIZACIÓN OFFLINE
   ========================================================================== */
.offline-sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f59e0b, #d97706); /* Ámbar/Naranja cálido */
  border-bottom: 2px solid #b45309;
  padding: 10px 24px;
  color: #ffffff;
  font-weight: 500;
  font-size: 13.5px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 5;
  position: relative;
  animation: slideDown 0.3s ease-out;
}

.offline-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.offline-banner-icon {
  font-size: 16px;
  animation: pulse-warn 1.5s infinite;
}

.offline-banner-text {
  letter-spacing: 0.2px;
}

.offline-sync-btn {
  background: #ffffff !important;
  color: #b45309 !important;
  border: 1px solid #d97706 !important;
  padding: 6px 14px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  margin: 0 !important;
}

.offline-sync-btn:hover {
  background: #fef3c7 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@keyframes pulse-warn {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Estilo para botón secundario activo (ej. selectores de método de desbloqueo) */
.btn-secondary.active {
  background-color: var(--accent-light) !important;
  color: white !important;
  border-color: var(--accent-light) !important;
}

/* ==========================================
   ESTILOS DEL MÓDULO DE RESTAURANTE (MESAS)
   ========================================== */

.pos-mode-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 15px;
}

.pos-mode-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted) !important;
  font-weight: 700;
  font-size: 13.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pos-mode-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: white !important;
}

.pos-mode-tab.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.mesa-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mesa-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(255, 255, 255, 0.05);
}

.mesa-card:active {
  transform: translateY(-1px);
}

.mesa-card.ocupada:hover {
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.2), 0 0 15px rgba(239, 68, 68, 0.1);
}

.mesa-card.libre:hover {
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2), 0 0 15px rgba(16, 185, 129, 0.1);
}

/* --- ORDEN DE SUPERPOSICIÓN DE MODALES --- */
#product-modal {
  z-index: 300;
}
#category-modal,
#subcategory-modal {
  z-index: 400;
}


/* --- ANIMACIÓN Y COLOR DE CAMPANA DE NOTIFICACIONES --- */
@keyframes bell-ring {
  0% { transform: rotate(0); }
  2% { transform: rotate(18deg); }
  4% { transform: rotate(-16deg); }
  6% { transform: rotate(14deg); }
  8% { transform: rotate(-12deg); }
  10% { transform: rotate(10deg); }
  12% { transform: rotate(-8deg); }
  14% { transform: rotate(6deg); }
  16% { transform: rotate(-4deg); }
  18% { transform: rotate(2deg); }
  20% { transform: rotate(0); }
  100% { transform: rotate(0); }
}

.notification-trigger-btn.has-unread i {
  color: #f59e0b !important; /* Ámbar/Amarillo advertencia */
  animation: bell-ring 3.5s ease infinite;
  transform-origin: top center;
  filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.4));
}

.notification-trigger-btn.has-unread.has-urgent i {
  color: #ef4444 !important; /* Rojo urgente */
  filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.6));
}

.notification-trigger-btn.has-unread {
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2) !important;
}

.notification-trigger-btn.has-unread.has-urgent {
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3) !important;
}

/* Forzar tamaño de lienzo SOLO en dispositivos móviles (celulares/tabletas) para evitar encogimiento del viewport */
@media print and (max-width: 1024px) {
  html.printing-a4,
  body.printing-a4 {
    width: 800px !important;
    min-width: 800px !important;
    max-width: 800px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }

  html.printing-a4.print-a4-half,
  body.printing-a4.print-a4-half {
    width: 1122px !important;
    min-width: 1122px !important;
    max-width: 1122px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }

  body.printing-a4 .invoice-print-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 25px !important;
    box-sizing: border-box !important;
  }

  /* Restablecer alineación original para mitad de hoja en landscape */
  body.printing-a4.print-a4-half .invoice-print-container {
    width: 521px !important;
    max-width: 521px !important;
    position: absolute !important;
    top: 19px !important;
    right: 19px !important;
    left: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  html.printing-ticket,
  body.printing-ticket,
  html.printing-service-order,
  body.printing-service-order {
    width: 360px !important;
    min-width: 360px !important;
    max-width: 360px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* ==========================================================================
   CHATBOT FLOTANTE STORVEXI (ESQUINA INFERIOR DERECHA)
   ========================================================================== */

#storvexi-chatbot-container {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.chatbot-trigger-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 12px rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.chatbot-trigger-btn:hover {
  transform: scale(1.08) translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 18px rgba(56, 189, 248, 0.4);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
}

.chatbot-trigger-btn:active {
  transform: scale(0.95);
}

.chatbot-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
}

.chatbot-pulse-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border: 2px solid #0f172a;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
  animation: chatbot-pulse 2s infinite;
}

@keyframes chatbot-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Ventana del Chat */
.chatbot-window {
  position: fixed;
  bottom: 72px;
  right: 20px;
  width: 410px; max-width: calc(100vw - 32px);
  height: 570px;
  max-height: calc(100vh - 100px);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.15);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatbot-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

@keyframes chatbot-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.chatbot-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.chatbot-status {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
}

.chatbot-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.chatbot-close-btn:hover {
  color: #ffffff;
}

.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.chatbot-msg {
  display: flex;
  flex-direction: column;
  max-width: 92%;
  animation: msg-fade 0.25s ease-out;
}

@keyframes msg-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.bot-msg {
  align-self: flex-start;
}

.user-msg {
  align-self: flex-end;
}

.bot-msg .msg-content {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.user-msg .msg-content {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.chatbot-quick-options {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 6px !important;
  margin-top: 8px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding-right: 4px !important;
  box-sizing: border-box !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(56, 189, 248, 0.35) transparent !important;
}

.chatbot-quick-options::-webkit-scrollbar {
  width: 4px !important;
  height: 0px !important;
}

.chatbot-quick-options::-webkit-scrollbar-track {
  background: transparent !important;
}

.chatbot-quick-options::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35) !important;
  border-radius: 10px !important;
}

.chatbot-quick-options::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.7) !important;
}

.chatbot-module-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.chatbot-module-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f1f5f9;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.chatbot-module-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateX(4px);
}

.quick-chip {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-chip:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateX(4px);
}

.chatbot-footer {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chatbot-footer input {
  flex: 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 10px 16px;
  color: #ffffff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}

.chatbot-footer input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.chatbot-footer input::placeholder {
  color: #64748b;
}

.chatbot-footer button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-footer button:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #38bdf8, #0284c7);
}

.chatbot-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: white !important;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 8px;
  font-size: 12.5px;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
  transition: transform 0.2s;
}

.chatbot-btn-whatsapp:hover {
  transform: scale(1.03);
  background: #22c55e;
}

/* Adaptación para móviles */
@media (max-width: 480px) {
  .chatbot-trigger-btn {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }

  .chatbot-window {
    right: 12px;
    bottom: 78px;
    width: calc(100vw - 24px);
    height: 72vh;
  }

  .tour-card {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}







/* ESTILOS DE FORMATO BONITO Y LEGIBLE PARA RESPUESTAS DE CHATBOT */
.bot-msg .msg-content {
  background: rgba(30, 41, 59, 0.95) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 16px 16px 16px 4px !important;
  padding: 15px 18px !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
}

.bot-msg .msg-content strong {
  color: #38bdf8 !important;
  font-weight: 600 !important;
}

.chat-step-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  background: linear-gradient(135deg, #0284c7, #3b82f6) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  border-radius: 50% !important;
  margin-right: 6px !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4) !important;
}

.chat-key-tag {
  display: inline-block !important;
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
  padding: 1px 7px !important;
  border-radius: 5px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

.chat-bullet-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  margin-top: 4px !important;
  color: #e2e8f0 !important;
}

.chat-bullet-dot {
  color: #38bdf8 !important;
  font-size: 14px !important;
}
