/* src/ui/styles/main.css */
/* Estilos principales - Diseño profesional y responsive */

/* ============================================
   RESET Y BASE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f5f7fa;
  color: #1a2332;
  overflow-x: hidden;
}

#app {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 0 80px 0;
  min-height: 100vh;
  background: #f5f7fa;
}

#app-content {
  padding: 12px 12px 80px 12px;
  min-height: calc(100vh - 80px);
  background: #f5f7fa;
  color: #1a2332;
  overflow-x: hidden;
  max-width: 100%;
}

/* ============================================
   TARJETAS
   ============================================ */

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  max-width: 100%;
  overflow: hidden;
}

/* ============================================
   INPUTS Y CAMPOS DE DATOS (MÁS GRANDES)
   ============================================ */

.input-field {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  font-size: 18px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  background: #ffffff;
  color: #1a2332;
  min-height: 60px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.input-field:focus {
  border-color: #1a237e;
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(26, 35, 126, 0.08);
}

.input-field::placeholder {
  color: #a0aec0;
  font-size: 16px;
}

input,
select,
textarea {
  max-width: 100%;
  box-sizing: border-box;
  font-size: 16px;
}

/* ============================================
   BOTONES DE ACCIÓN (MÁS PEQUEÑOS)
   ============================================ */

button {
  font-family: inherit;
  touch-action: manipulation;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.97);
}

.btn-action {
  padding: 6px 4px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 10px;
  cursor: pointer;
  min-height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  line-height: 1.1;
  width: 100%;
  color: white;
  letter-spacing: 0.3px;
}

.btn-action .icon {
  font-size: 14px;
  line-height: 1;
}

.btn-action .label {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 1px;
}

.btn-action .sub {
  font-size: 7px;
  font-weight: 400;
  opacity: 0.8;
  line-height: 1;
  margin-top: 0px;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-action:active {
  transform: scale(0.96);
}

/* Colores profesionales */
.btn-cerrar {
  background: #c62828;
}

.btn-cerrar:hover {
  background: #b71c1c;
}

.btn-nuevo {
  background: #e65100;
}

.btn-nuevo:hover {
  background: #bf360c;
}

.btn-pdf {
  background: #1565c0;
}

.btn-pdf:hover {
  background: #0d47a1;
}

.btn-whatsapp {
  background: #25D366;
}

.btn-whatsapp:hover {
  background: #128C7E;
}

.btn-dev {
  background: #1a237e;
}

.btn-dev:hover {
  background: #0d47a1;
}

/* ============================================
   BOTÓN PRINCIPAL (AGREGAR PRODUCTO)
   ============================================ */

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1a237e, #0d47a1);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  min-height: 52px;
  box-shadow: 0 4px 12px rgba(26, 35, 126, 0.2);
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.97);
}

/* ============================================
   PRODUCTOS
   ============================================ */

.producto-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e8ecf1;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 6px;
}

.producto-row .campo {
  flex: 1;
  min-width: 50px;
}

.producto-row .campo label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding-left: 2px;
  margin-bottom: 3px;
}

.producto-row .campo input {
  width: 100%;
  padding: 8px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: #1a2332;
  min-height: 40px;
  transition: all 0.2s ease;
}

.producto-row .campo input:focus {
  border-color: #1a237e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.06);
}

.btn-eliminar {
  background: none;
  border: none;
  color: #c62828;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-eliminar:hover {
  background: #fef2f2;
}

/* ============================================
   BILLETES (2 COLUMNAS RESPONSIVE)
   ============================================ */

.billetes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
}

.billete-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e8ecf1;
  min-width: 0;
}

.billete-row .denom {
  font-weight: 700;
  font-size: 13px;
  min-width: 38px;
  color: #1a237e;
  flex-shrink: 0;
}

.billete-row input {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  background: white;
  color: #1a2332;
  min-height: 34px;
  min-width: 32px;
  max-width: 70px;
  transition: all 0.2s ease;
}

.billete-row input:focus {
  border-color: #1a237e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.06);
}

.billete-row .subtotal {
  font-weight: 600;
  font-size: 12px;
  min-width: 38px;
  text-align: right;
  color: #2e7d32;
  flex-shrink: 0;
}

/* ============================================
   TRANSFERENCIA
   ============================================ */

.transferencia-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #e8f0fe;
  border-radius: 8px;
  border: 1px solid #c5cae9;
  margin-top: 6px;
  flex-wrap: wrap;
}

.transferencia-row .denom {
  font-weight: 700;
  font-size: 15px;
  min-width: 60px;
  color: #1a237e;
}

.transferencia-row input {
  flex: 1;
  padding: 10px 10px;
  border: 1px solid #c5cae9;
  border-radius: 6px;
  text-align: center;
  font-size: 15px;
  background: white;
  color: #1a2332;
  min-height: 42px;
  min-width: 60px;
  transition: all 0.2s ease;
}

.transferencia-row input:focus {
  border-color: #1a237e;
  outline: none;
}

.transferencia-row .subtotal {
  font-weight: 600;
  font-size: 15px;
  min-width: 60px;
  text-align: right;
  color: #0d47a1;
}

/* ============================================
   TOTALES
   ============================================ */

.totales {
  margin-top: 8px;
  padding: 10px 14px;
  background: #e8eaf6;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  color: #1a237e;
}

.totales .monto {
  font-size: 17px;
  color: #2e7d32;
}

.total-general {
  margin-top: 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #1a237e, #0d47a1);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  color: white;
  box-shadow: 0 4px 12px rgba(26, 35, 126, 0.2);
}

.total-general .monto {
  font-size: 20px;
  color: #90caf9;
}

/* ============================================
   TOTAL PRINCIPAL
   ============================================ */

.total {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  margin: 10px 0;
  border: 2px solid #a5d6a7;
  background: #e8f5e9;
  color: #1b5e20;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.06);
  transition: 0.3s;
}

.total.sobra {
  background: #fff3e0;
  color: #e65100;
  border-color: #ffcc80;
}

.total.falta {
  background: #fef2f2;
  color: #c62828;
  border-color: #fecaca;
}

/* ============================================
   COMPARADOR
   ============================================ */

.comparador {
  padding: 14px;
  background: #f8fafc;
  border-radius: 12px;
  border: 2px solid #e8ecf1;
  display: block;
  margin: 8px 0;
  font-size: 14px;
}

.comparador .fila {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #e8ecf1;
}

.comparador .fila:last-child {
  border-bottom: none;
}

.comparador .fila .label {
  color: #555;
  font-weight: 500;
}

.comparador .fila .valor {
  font-weight: 700;
  color: #1a2332;
}

.comparador .resultado {
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid transparent;
}

.comparador .resultado.sobra {
  background: #fff3e0;
  color: #e65100;
  border-color: #ffcc80;
}

.comparador .resultado.falta {
  background: #fef2f2;
  color: #c62828;
  border-color: #fecaca;
}

.comparador .resultado.exacto {
  background: #e8f5e9;
  color: #1b5e20;
  border-color: #a5d6a7;
}

/* ============================================
   NAVEGACIÓN
   ============================================ */

.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  display: flex;
  justify-content: space-around;
  padding: 6px 0 12px;
  border-top: 1px solid #e8ecf1;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
  z-index: 100;
  max-width: 500px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: #8892a0;
  cursor: pointer;
  padding: 4px 8px;
  border: none;
  background: none;
  transition: color 0.2s;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  border-radius: 8px;
}

.nav-item .icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.nav-item.active {
  color: #1a237e;
  font-weight: 600;
}

/* ============================================
   SELECTOR DE TURNO
   ============================================ */

.turno-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.turno-selector button {
  flex: 1;
  padding: 10px;
  border: 2px solid #e8ecf1;
  border-radius: 10px;
  background: #ffffff;
  font-weight: 600;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.turno-selector button.active {
  border-color: #1a237e;
  background: #e8eaf6;
  color: #1a237e;
  box-shadow: 0 2px 8px rgba(26, 35, 126, 0.06);
}

/* ============================================
   PESTAÑAS
   ============================================ */

.tabs-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #e8ecf1;
  background: white;
  touch-action: pan-y;
  margin-bottom: 12px;
}

.tabs-header {
  display: flex;
  background: #f5f7fa;
  border-bottom: 1px solid #e8ecf1;
}

.tabs-header button {
  flex: 1;
  padding: 12px 0;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 14px;
  color: #8892a0;
  cursor: pointer;
  transition: 0.2s;
  border-bottom: 3px solid transparent;
  min-height: 44px;
}

.tabs-header button.active {
  color: #1a237e;
  border-bottom-color: #1a237e;
  background: white;
}

.tabs-track {
  display: flex;
  transition: transform 0.3s ease;
}

.tab-pane {
  min-width: 100%;
  padding: 0;
  background: white;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  #app-content {
    padding: 8px 8px 70px 8px;
  }

  .card {
    padding: 12px;
    border-radius: 14px;
  }

  .input-field {
    padding: 16px 16px;
    font-size: 17px;
    min-height: 54px;
  }

  .producto-row {
    padding: 8px 8px;
    gap: 4px;
  }

  .producto-row .campo {
    min-width: 44px;
  }

  .producto-row .campo input {
    font-size: 13px;
    padding: 6px 4px;
    min-height: 36px;
  }

  .btn-eliminar {
    font-size: 16px;
    min-width: 32px;
    min-height: 32px;
  }

  .btn-action {
    padding: 5px 3px;
    font-size: 9px;
    min-height: 28px;
  }

  .btn-action .icon {
    font-size: 12px;
  }

  .btn-action .label {
    font-size: 8px;
  }

  .btn-action .sub {
    font-size: 6px;
  }

  .btn-primary {
    font-size: 14px;
    padding: 12px;
    min-height: 46px;
  }

  .billetes-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3px;
  }

  .billete-row {
    padding: 4px 6px;
    gap: 3px;
  }

  .billete-row .denom {
    font-size: 12px;
    min-width: 34px;
  }

  .billete-row input {
    font-size: 13px;
    padding: 4px 2px;
    min-height: 30px;
    min-width: 28px;
    max-width: 60px;
  }

  .billete-row .subtotal {
    font-size: 11px;
    min-width: 32px;
  }

  .transferencia-row {
    padding: 8px 10px;
    gap: 6px;
  }

  .transferencia-row .denom {
    font-size: 14px;
    min-width: 55px;
  }

  .transferencia-row input {
    font-size: 14px;
    padding: 8px;
    min-height: 38px;
    min-width: 55px;
  }

  .total {
    font-size: 18px;
    padding: 12px;
  }

  .tabs-header button {
    font-size: 13px;
    padding: 10px 0;
    min-height: 38px;
  }

  .turno-selector button {
    font-size: 13px;
    padding: 8px;
    min-height: 38px;
  }

  .comparador .resultado {
    font-size: 15px;
    padding: 8px;
  }

  .nav-item {
    font-size: 9px;
    padding: 2px 4px;
    min-width: 38px;
    min-height: 38px;
  }

  .nav-item .icon {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .billetes-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }

  .billete-row .denom {
    font-size: 10px;
    min-width: 28px;
  }

  .billete-row input {
    font-size: 11px;
    min-height: 26px;
    min-width: 24px;
    max-width: 50px;
  }

  .billete-row .subtotal {
    font-size: 9px;
    min-width: 28px;
  }

  .producto-row .campo {
    min-width: 36px;
  }

  .producto-row .campo input {
    font-size: 12px;
    padding: 4px 2px;
    min-height: 30px;
  }

  .btn-eliminar {
    font-size: 14px;
    min-width: 28px;
    min-height: 28px;
  }

  .btn-action {
    font-size: 8px;
    padding: 4px 2px;
    min-height: 24px;
  }

  .btn-action .icon {
    font-size: 11px;
  }

  .btn-action .label {
    font-size: 7px;
  }

  .btn-action .sub {
    font-size: 5px;
  }

  .total {
    font-size: 16px;
    padding: 10px;
  }
}
