/* ------------------------------------------------------------------ */
/*  Panel Administrativo Jhojo Taxi — diseño                          */
/*  Identidad: amarillo taxi + negro, tipografía Inter, tarjetas      */
/*  con sombra suave, espaciado generoso. Sin dependencias nuevas.    */
/* ------------------------------------------------------------------ */

:root {
  /* Marca Jhojo Taxi */
  --taxi: #ffc800;
  --taxi-soft: #ffdf5e;
  --taxi-dark: #e0a800;
  --ink: #14161a;
  --ink-soft: #23262c;
  --bg: #f5f4f0;
  --card: #ffffff;
  --text: #1d2126;
  --muted: #6d7278;
  --line: #e6e3da;
  --line-strong: #d8d4c7;
  --green: #1d7a37;
  --green-bg: #ddf2e2;
  --green-ink: #145c24;
  --red: #b3261e;
  --red-bg: #fbe7e4;
  --amber: #8a6d00;
  --amber-bg: #fff3c4;
  --amber-line: #ffe08a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .06), 0 2px 8px -2px rgba(20, 22, 26, .06);
  --shadow-md: 0 1px 2px rgba(20, 22, 26, .06), 0 10px 28px -10px rgba(20, 22, 26, .18);
  --shadow-lg: 0 24px 60px -16px rgba(20, 22, 26, .35);
}

/* NUNCA QUITAR: sin esto el modal vacío tapa toda la página al cargar. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.35rem; margin: 0 0 .5rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; margin: .25rem 0 .8rem; font-weight: 800; letter-spacing: -.015em; }
h3 { font-size: 1rem; margin: 0 0 .5rem; font-weight: 700; }
p { margin: .35rem 0; }
.muted { color: var(--muted); font-size: .92rem; }
.hint { color: var(--muted); font-size: .85rem; margin: .25rem 0 .8rem; }
.error { color: var(--red); font-weight: 600; }

/* ---------------- Barra superior ---------------- */

.topbar {
  background: var(--ink);
  color: #fff;
  padding: .65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 6px 18px -8px rgba(20, 22, 26, .5);
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; min-width: 0; }
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
  background: var(--taxi);
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.brand span.brand-sub { font-weight: 500; color: #f5d76e; opacity: .95; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Pestañas ---------------- */

.tabs {
  display: flex;
  gap: .4rem;
  padding: .7rem .9rem;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 57px;
  background: rgba(245, 244, 240, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 0 auto;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: .55rem .95rem;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tabs button:hover { background: #eceae2; color: var(--text); }
.tabs button.active {
  background: var(--ink);
  color: var(--taxi);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ---------------- Layout ---------------- */

main { padding: .9rem .9rem 2rem; max-width: 1024px; margin: 0 auto; }
.tab-page { padding-top: .5rem; animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.screen { padding: 1rem; display: flex; flex-direction: column; align-items: center; min-height: calc(100dvh - 57px); }
.app-foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 1.6rem; }

/* ---------------- Tarjetas ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-bottom: .85rem;
  box-shadow: var(--shadow-sm);
}
.auth-card { max-width: 430px; width: 100%; margin-top: 2.2rem; padding: 1.6rem 1.5rem 1.4rem; box-shadow: var(--shadow-md); }
.auth-logo {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--taxi);
  border-radius: 20px;
  font-size: 2.1rem;
  line-height: 1;
  box-shadow: 0 8px 20px -6px rgba(224, 168, 0, .7), inset 0 -3px 0 rgba(0, 0, 0, .1);
}
.auth-card h1 { text-align: center; }
.auth-card > .muted { text-align: center; }
.auth-foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 1.4rem; }

/* ---------------- Estadísticas (Resumen) ---------------- */

.grid.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .7rem;
  margin-bottom: .85rem;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem .95rem .85rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--taxi), var(--taxi-soft));
}
.stat b { display: block; font-size: 1.65rem; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .86rem; line-height: 1.35; display: block; margin-top: .15rem; }
.stat .money { color: var(--green); }

/* ---------------- Listas ---------------- */

.list { display: flex; flex-direction: column; gap: .65rem; }
.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.item h3 { margin-bottom: .2rem; }
.item p { margin: .2rem 0; }
#drivers-list .item { cursor: pointer; }
#drivers-list .item:hover {
  border-color: var(--taxi-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------------- Píldoras de estado ---------------- */

.pill {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  padding: .18rem .6rem;
  border-radius: 999px;
  margin-right: .3rem;
  margin-bottom: .15rem;
}
.pill.vigente { background: var(--green-bg); color: var(--green-ink); }
.pill.por_vencer { background: var(--amber-bg); color: var(--amber); }
.pill.sin_pago { background: var(--red-bg); color: var(--red); }
.pill.en_servicio { background: var(--green-bg); color: var(--green-ink); }
.pill.fuera { background: #ededed; color: var(--muted); }

/* ---------------- Botones ---------------- */

.btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .6rem 1rem;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease, border-color .15s ease;
}
.btn:hover { background: #f8f7f3; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--taxi);
  border-color: var(--taxi-dark);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .08), 0 6px 14px -6px rgba(224, 168, 0, .6);
}
.btn-primary:hover { background: #ffd21f; }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .7); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: default; }
form .btn-primary[type="submit"] { width: 100%; padding: .7rem 1rem; margin-top: .2rem; }

/* ---------------- Formularios ---------------- */

label { display: block; margin-bottom: .75rem; font-weight: 600; font-size: .92rem; }
input, select {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: #a3a29a; }
input:focus, select:focus {
  outline: none;
  border-color: var(--taxi-dark);
  box-shadow: 0 0 0 3px rgba(255, 200, 0, .35);
}
input[type="checkbox"] { display: inline-block; width: auto; margin-right: .45rem; accent-color: var(--taxi-dark); }

/* ---------------- Banner de aviso ---------------- */

.banner {
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-left: 4px solid var(--taxi-dark);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin-bottom: .85rem;
  font-size: .95rem;
  box-shadow: var(--shadow-sm);
}

/* ---------------- Mapa ---------------- */

#map {
  height: 360px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: .85rem;
  z-index: 1;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.leaflet-container { font-family: inherit; border-radius: var(--radius); }

/* ---------------- Modal ---------------- */

.modal {
  position: fixed; inset: 0;
  background: rgba(20, 22, 26, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1rem; z-index: 50;
}
.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 1.3rem 1.25rem 1.2rem;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--taxi);
  animation: pop-in .16s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-x {
  position: absolute; top: .6rem; right: .6rem;
  width: 2.1rem; height: 2.1rem;
  display: flex; align-items: center; justify-content: center;
  border: none; background: #f1efe9; color: var(--text);
  border-radius: 999px;
  font-size: 1.35rem; cursor: pointer; line-height: 1;
  transition: background .15s ease;
}
.modal-x:hover { background: #e6e3da; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; font-size: .95rem; margin: .6rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------------- Escritorio ---------------- */

@media (min-width: 700px) {
  .grid.cards { grid-template-columns: repeat(4, 1fr); }
  #map { height: 460px; }
  main { padding: 1.1rem 1.2rem 2.5rem; }
  .tabs { justify-content: center; }
  .tabs button { flex: 0 1 auto; min-width: 7.5rem; }
  .auth-card { margin-top: 3rem; }
}
