:root {
  --azul: #1d4ed8;
  --azul-osc: #1e3a8a;
  --gris-fondo: #f4f6f9;
  --gris-borde: #dbe1e8;
  --texto: #1f2937;
  --rojo: #dc2626;
  --verde: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--gris-fondo);
  color: var(--texto);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  width: 320px;
  text-align: center;
}

.login-card h1 {
  font-size: 20px;
  margin-bottom: 4px;
  color: var(--azul-osc);
}

.login-card p.sub {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 24px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  font-size: 14px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}

.btn-primary {
  background: var(--azul);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: var(--azul-osc); }

.error-msg {
  color: var(--rojo);
  font-size: 13px;
  margin-top: 8px;
  min-height: 16px;
}

/* --- Dashboard --- */
.topbar {
  background: var(--azul-osc);
  color: white;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar h1 { font-size: 16px; margin: 0; }
.topbar button {
  background: rgba(255,255,255,0.15);
  color: white;
}
.topbar button:hover { background: rgba(255,255,255,0.3); }

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  background: white;
  border-bottom: 1px solid var(--gris-borde);
}
.tab-btn {
  background: transparent;
  color: #6b7280;
  padding: 10px 16px;
  border-radius: 8px 8px 0 0;
}
.tab-btn.active {
  background: var(--gris-fondo);
  color: var(--azul);
  border: 1px solid var(--gris-borde);
  border-bottom: 2px solid var(--gris-fondo);
  margin-bottom: -1px;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

.tab-content.narrow {
  max-width: 820px;
  margin: 0 auto;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 15px;
  margin-top: 0;
  color: var(--azul-osc);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gris-borde);
}
th { color: #6b7280; font-weight: 600; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #e0e7ff;
  color: var(--azul-osc);
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filters > * { flex: 1; min-width: 140px; margin-bottom: 0; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.link-btn {
  background: transparent;
  color: var(--azul);
  padding: 4px 8px;
  font-size: 12px;
  text-decoration: underline;
}

.small-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--azul-osc);
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none;
}
.toast.show { display: block; }
.toast.error { background: var(--rojo); }

code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

details summary { margin-bottom: 4px; }

tr.fila-eliminada {
  opacity: 0.55;
}
tr.fila-eliminada td {
  text-decoration: line-through;
}
tr.fila-eliminada td.col-acciones {
  text-decoration: none; /* los botones no quedan tachados */
}

.pill-eliminada {
  background: #fee2e2;
  color: var(--rojo);
}
.pill-activa {
  background: #dcfce7;
  color: var(--verde);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  min-width: 900px; /* solo entra en juego en pantallas realmente angostas */
}

.semaforo-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  min-width: 9px;
  border-radius: 50%;
}

.estado-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.estado-wrap select.select-estado {
  display: inline-block;
  width: auto;
  padding: 3px 6px;
  margin-bottom: 0;
  font-size: 12px;
}

.input-transporte {
  width: 100%;
  padding: 4px 6px;
  margin-bottom: 0;
  font-size: 12px;
}
