/* ============================================
   Distribuidora Pine — tokens
============================================ */
:root{
  --pine-navy: #10305A;
  --pine-navy-deep: #0A2145;
  --pine-blue: #2E6FB0;
  --pine-blue-light: #5B93CC;
  --sky-tint: #E8F1FA;
  --paper-white: #FFFFFF;
  --ink: #16223A;
  --ink-soft: #4B5A72;

  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius-lg: 26px;
  --radius-md: 16px;

  --container: 720px;
}

*{ box-sizing: border-box; }

body{
  margin:0;
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sky-tint);
  -webkit-font-smoothing: antialiased;
}

a{ text-decoration: none; color: inherit; }

:focus-visible{
  outline: 3px solid var(--pine-blue-light);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}

/* ============================================
   Header
============================================ */
.site-header{
  background: var(--paper-white);
  border-bottom: 1px solid #DCE9F5;
}
.header-inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 20px;
  text-align: center;
}
.brand-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--pine-navy);
}
.brand-name strong{ font-weight: 800; }

/* ============================================
   Menú principal
============================================ */
.menu-main{
  max-width: var(--container);
  margin: 0 auto;
  padding: 48px 20px 60px;
}

.menu-title{
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--pine-navy);
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  text-align: center;
  margin: 0 0 32px;
}

.option-grid{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.option-card{
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--paper-white);
  border: 1.5px solid #DCE9F5;
  border-radius: var(--radius-lg);
  padding: 22px 22px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.option-card:hover{
  border-color: var(--pine-blue-light);
  box-shadow: 0 12px 28px -12px rgba(16,48,90,0.28);
  transform: translateY(-2px);
}

.option-icon{
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sky-tint);
  color: var(--pine-blue);
  border-radius: 50%;
}
.option-icon svg{ width: 28px; height: 28px; }

.option-text{
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.option-title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--pine-navy);
}
.option-sub{
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ============================================
   Desktop / tablet
============================================ */
@media (min-width: 640px){
  .option-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .option-card{
    flex-direction: column;
    text-align: center;
    padding: 32px 22px;
  }
  .option-text{ align-items: center; }
}

/* ============================================
   Páginas internas (fletes / fletesFrom)
============================================ */
.page-main{
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

.page-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.back-link{
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--pine-blue);
}
.back-link:hover{ text-decoration: underline; }

.page-title{
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--pine-navy);
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  margin: 0 0 4px;
}

.page-date{
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* --- Formulario de ingreso --- */
.flete-form{
  background: var(--paper-white);
  border: 1.5px solid #DCE9F5;
  border-radius: var(--radius-md);
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field.field-wide{ grid-column: 1 / -1; }

.field label{
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input{
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 12px;
  border: 1.5px solid #DCE9F5;
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper-white);
}
.field input:focus{
  border-color: var(--pine-blue-light);
  outline: none;
}

.btn-add{
  grid-column: 1 / -1;
  background: var(--sky-tint);
  color: var(--pine-navy);
  border: 1.5px solid var(--pine-blue-light);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
}
.btn-add:hover{ background: #dcecfa; }

/* --- Tabla estilo excel --- */
.table-wrap{
  background: var(--paper-white);
  border: 1.5px solid #DCE9F5;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 22px;
}

.flete-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 460px;
}
.flete-table th,
.flete-table td{
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #EEF4FA;
  white-space: nowrap;
}
.flete-table th{
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--pine-navy);
  background: var(--sky-tint);
}
.flete-table td.num,
.flete-table th.num{ text-align: right; }

.flete-table tbody tr:last-child td{ border-bottom: none; }

.row-total td{
  font-weight: 700;
  color: var(--pine-navy);
  border-top: 2px solid var(--sky-tint);
}

.row-remove{
  background: none;
  border: none;
  color: #B4C4D8;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
}
.row-remove:hover{ color: #C0392B; }

.empty-state{
  text-align: center;
  padding: 32px 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.btn-submit-block{
  width: 100%;
  background: var(--pine-blue);
  color: var(--paper-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  padding: 15px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(46,111,176,0.5);
}
.btn-submit-block:hover{ background: var(--pine-navy); }
.btn-submit-block:disabled{
  background: #C7D6E6;
  box-shadow: none;
  cursor: not-allowed;
}

/* --- Bloques por fecha (lista) --- */
.flete-block{
  margin-bottom: 26px;
}
.block-date{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--pine-navy);
  background: var(--sky-tint);
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  margin: 0 0 10px;
}

/* Ajustes para móviles */
@media (max-width: 600px) {
  /* Campos del formulario: uno debajo del otro */
  .flete-form {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  /* Agrandar áreas táctiles en inputs */
  .field input {
    padding: 14px 12px; /* Más altura */
    font-size: 16px; /* Evita el zoom automático de iOS */
  }

  /* Tabla: reducir un poco el padding en móviles */
  .flete-table th, 
  .flete-table td {
    padding: 10px 8px;
  }
}

/* Mejora general de accesibilidad */
.field input:focus {
  font-size: 16px; /* Evita que el navegador haga zoom al enfocar */
}