/* assets/css/style.css - Mobile First Responsive Design */
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap');

/* — Reset base — */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* — Tipografía y fondo — */
body, table {
  font-family: 'Inconsolata', Monaco, monospace;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  margin: 0;
}

/* — Contenedor principal - Mobile First — */
.container {
  max-width: 480px !important;
  width: 100% !important;
  margin: 20px auto !important;
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* — Encabezados — */
h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: #1a202c;
}

/* — Formularios Mobile First — */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
  color: #2d3748;
}

select,
input[type="text"] {
  width: 100%;
  padding: 16px !important;
  font-size: 1.1rem !important;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
  font-family: 'Inconsolata', Monaco, monospace;
}

select:focus,
input[type="text"]:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 2px rgba(49,130,206,0.2);
  outline: none;
}

/* — Botones Mobile First — */
button {
  width: 100% !important;
  padding: 18px 24px !important;
  font-size: 1.2rem !important;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .2s;
  font-weight: 500;
  box-sizing: border-box;
  margin-top: 1rem;
  font-family: 'Inconsolata', Monaco, monospace;
}

button:hover {
  background: #0056b3;
}

button:active {
  transform: translateY(1px);
}

/* Estado deshabilitado: grisado */
button:disabled {
  background: #cbd5e0;
  color: #4a5568;
  cursor: not-allowed;
  opacity: 0.8;
}

/* — Tablas Responsive — */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  border: 1px solid #cbd5e0;
  padding: 4px 8px;
  text-align: left;
}

thead th, .encabezados th {
  background: #2d3748;
  color: #fff;
  font-weight: bold;
  padding: 0.75rem 0.5rem;
}

/* — Estados de filas — */
.fila-vencida {
  background-color: #fed7d7 !important;
  font-weight: bold;
  color: #9b2c2c;
}

.fila-credito {
  background-color: #c6f6d5 !important;
  font-weight: bold;
  color: #22543d;
}

.titulo-cliente {
  background: #edf2f7;
  font-weight: bold;
  color: #2d3748;
}

.subtitulo-cliente {
  font-style: italic;
  font-size: 0.85rem;
  padding-bottom: 10px;
  color: #4a5568;
}

.etq-total {
  text-align: left;
  font-weight: bold;
  padding-left: 4px;
  background: #f7fafc;
}

.totales td {
  border-top: 2px solid #2d3748;
  font-weight: bold;
  background: #f7fafc;
}

.moneda {
  padding: 0 4px;
  position: relative;
  text-align: right;
}
.moneda .sign {
  float: left;
}
.moneda .value {
  float: right;
}

/* ========== Responsive Design - Tablet y Desktop ========== */

/* Tablet - 600px and up */
@media (min-width: 600px) {
  .container {
    max-width: 720px !important;
    margin: 2rem auto !important;
    padding: 2rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
  }
  
  label {
    margin-bottom: 0.25rem;
  }
  
  .form-group {
    flex: 1;
    min-width: 200px;
  }
  
  select,
  input[type="text"] {
    padding: 12px;
    font-size: 1rem;
  }
  
  button {
    width: auto !important;
    padding: 12px 24px !important;
    font-size: 1rem !important;
    margin-top: 0;
    flex-shrink: 0;
  }
  
  table {
    font-size: 1rem;
  }
  
  th, td {
    padding: 4px 8px;
  }
}

/* Desktop - 992px and up */
@media (min-width: 992px) {
  .container {
    max-width: 1200px !important;
    padding: 3rem;
  }
  
  h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
  }
  
  form {
    gap: 1.5rem;
  }
  
  .form-group {
    min-width: 250px;
  }
}

/* — Ajustes específicos para móvil — */
@media (max-width: 599px) {
  .container {
    margin: 10px !important;
    padding: 1rem;
    border-radius: 4px;
  }
  
  h1 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  select,
  input[type="text"] {
    padding: 18px !important;
    font-size: 1.2rem !important;
  }
  
  button {
    padding: 20px !important;
    font-size: 1.3rem !important;
  }
  
  table {
    font-size: 0.8rem;
  }
  
  th, td {
    padding: 0.4rem 0.2rem;
  }
  
  .table-responsive {
    margin: 0 -1rem;
    padding: 0 1rem;
  }
}
