:root {
  --verde: #7cb518;
  --verde-oscuro: #5c8c0f;
  --verde-claro: #eef7e2;
  --azul: #1f6feb;
  --gris-fondo: #eef0f2;
  --gris-campo: #f4f5f7;
  --texto: #1c2530;
  --texto-suave: #5b6572;
  --borde: #e2e5e9;
  --rojo: #e5484d;
  --radio: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--gris-fondo);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 12px 60px;
}

.card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(20, 30, 40, 0.08);
  padding: 28px 24px 32px;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.logo-wrap img { height: 56px; object-fit: contain; }

h1 {
  text-align: center;
  font-size: 1.4rem;
  margin: 4px 0 20px;
  color: var(--texto);
}

/* Selector Cargue / Descargue */
.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border: 2px solid var(--borde);
  border-radius: 14px;
  text-decoration: none;
  transition: all .15s ease;
  background: #fff;
}
.tab strong { display: block; font-size: 1.02rem; color: var(--texto); }
.tab span { display: block; font-size: .75rem; color: var(--texto-suave); margin-top: 2px; letter-spacing: .3px; }
.tab.activo { border-color: var(--azul); box-shadow: 0 0 0 1px var(--azul); }
.tab.activo strong { color: var(--azul); }
.tab:not(.activo):hover { border-color: #c9cdd3; }

label {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  margin: 18px 0 8px;
  color: var(--texto);
}

input[type=text], input[type=tel], input[type=number], input[type=date], input[type=password], select {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: var(--gris-campo);
  font-size: 1rem;
  color: var(--texto);
  outline: none;
  transition: box-shadow .15s ease;
}
input:focus, select:focus { box-shadow: 0 0 0 2px var(--azul); }

.hint-tiempo {
  margin-top: 8px;
  font-size: .85rem;
  color: var(--verde-oscuro);
  background: var(--verde-claro);
  border-radius: 10px;
  padding: 10px 12px;
  display: none;
}
.hint-tiempo.visible { display: block; }

.seccion {
  margin-top: 24px;
  padding: 18px;
  background: var(--gris-campo);
  border-radius: 16px;
}
.seccion-titulo {
  color: var(--azul);
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 10px;
}

.slots-estado {
  font-size: .85rem;
  color: var(--texto-suave);
  margin: 6px 0 4px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.slot-btn {
  padding: 10px 4px;
  font-size: .85rem;
  font-weight: 600;
  border: 1.5px solid var(--borde);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  color: var(--texto);
  transition: all .12s ease;
}
.slot-btn:hover:not(:disabled) { border-color: var(--verde); }
.slot-btn.seleccionado { background: var(--verde); border-color: var(--verde); color: #fff; }
.slot-btn:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

.btn-primario {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: var(--verde);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.btn-primario:hover:not(:disabled) { background: var(--verde-oscuro); }
.btn-primario:disabled { background: #c7cdd3; cursor: not-allowed; }
.btn-primario:active:not(:disabled) { transform: scale(.99); }

.btn-secundario {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border: 1.5px solid var(--borde);
  border-radius: 14px;
  background: #fff;
  color: var(--texto);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
}

.footer {
  text-align: center;
  margin-top: 26px;
  font-size: .78rem;
  color: #a6adb5;
}

.alerta {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: .88rem;
  margin: 14px 0;
}
.alerta.error { background: #fdeceb; color: var(--rojo); }
.alerta.exito { background: var(--verde-claro); color: var(--verde-oscuro); }

.confirmacion {
  text-align: center;
  padding: 10px 0 6px;
}
.confirmacion .check {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--verde-claro); color: var(--verde);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 16px;
}
.confirmacion table { width: 100%; border-collapse: collapse; margin-top: 18px; text-align: left; }
.confirmacion table td { padding: 8px 4px; font-size: .9rem; border-bottom: 1px solid var(--borde); }
.confirmacion table td:first-child { color: var(--texto-suave); width: 45%; }
.confirmacion table td:last-child { font-weight: 600; }

/* ---- Admin ---- */
.admin-wrap { width: 100%; max-width: 1080px; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 16px 22px; border-radius: 16px; margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(20,30,40,.06);
}
.admin-header img { height: 34px; }
.admin-header .salir { color: var(--rojo); text-decoration: none; font-weight: 600; font-size: .88rem; }

.filtros {
  display: flex; gap: 10px; flex-wrap: wrap; background: #fff; padding: 16px;
  border-radius: 16px; margin-bottom: 16px; box-shadow: 0 6px 18px rgba(20,30,40,.06);
  align-items: end;
}
.filtros label { margin: 0 0 6px; font-size: .8rem; }
.filtros input, .filtros select { padding: 10px 12px; }
.filtros .campo { display: flex; flex-direction: column; }
.filtros button { padding: 11px 18px; border: none; border-radius: 10px; background: var(--azul); color: #fff; font-weight: 600; cursor: pointer; }

.tabla-wrap { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 18px rgba(20,30,40,.06); }
table.reservas { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.reservas th {
  background: var(--gris-campo); text-align: left; padding: 12px 14px;
  font-size: .74rem; text-transform: uppercase; letter-spacing: .4px; color: var(--texto-suave);
}
table.reservas td { padding: 12px 14px; border-top: 1px solid var(--borde); vertical-align: middle; }
table.reservas tr:hover td { background: #fafbfc; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: .74rem; font-weight: 700; }
.badge.cargue { background: #e8f0fe; color: var(--azul); }
.badge.descargue { background: var(--verde-claro); color: var(--verde-oscuro); }
.badge.cancelado { background: #fdeceb; color: var(--rojo); }
.link-cancelar { color: var(--rojo); font-size: .8rem; text-decoration: none; font-weight: 600; }
.vacio { text-align: center; padding: 40px 20px; color: var(--texto-suave); }

.login-card { max-width: 380px; }

@media (max-width: 560px) {
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
  .filtros { flex-direction: column; align-items: stretch; }
  table.reservas { font-size: .78rem; }
  table.reservas th, table.reservas td { padding: 9px 8px; }
}
