/* Club de Caza "Piedra de Castillejo" — estilos de la app */
:root {
  --monte: #1f3a2b;
  --monte-2: #2d5240;
  --monte-claro: #e4ece4;
  --ocre: #b9822c;
  --ocre-claro: #f6ead2;
  --papel: #f4f1ea;
  --blanco: #fffdf8;
  --tinta: #1d211e;
  --gris: #6a706b;
  --linea: #dcd6c8;
  --rojo: #a63a2c;
  --rojo-claro: #f7e3df;
  --verde: #2f7a4a;
  --verde-claro: #e0f0e4;
  --ambar: #9a6a0b;
  --ambar-claro: #fbefd0;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(30, 40, 30, .06), 0 4px 14px rgba(30, 40, 30, .06);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.5;
  color: var(--tinta); background: var(--papel);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--monte-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--gris); }
.peq { font-size: .85rem; }
.ico { flex: none; }

/* ---------- Cabecera ---------- */
.cab {
  position: sticky; top: 0; z-index: 20;
  background: var(--monte); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  display: flex; align-items: center; gap: 12px;
}
.cab .marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.cab .marca img { width: 34px; height: 34px; border-radius: 9px; }
.cab .marca b { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab .marca small { display: block; font-size: .72rem; opacity: .7; font-weight: 400; font-family: var(--sans); }
.cab .der { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.cab .boton-ico { color: #fff; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; text-decoration: none; position: relative; }
.cab .boton-ico:hover { background: rgba(255,255,255,.1); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ocre); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; text-decoration: none; }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--blanco); border-top: 1px solid var(--linea);
  display: flex; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--gris); text-decoration: none; font-size: .7rem; font-weight: 500;
}
.nav a.activo { color: var(--monte); }
.nav a.activo .ico { stroke-width: 2.3; }
.nav .solo-escritorio { display: none; }

.contenedor { max-width: 980px; margin: 0 auto; padding: 16px; }

@media (min-width: 900px) {
  body { padding-bottom: 24px; padding-left: 232px; }
  .cab { padding-left: 24px; }
  .nav {
    top: 0; right: auto; width: 232px; height: auto; flex-direction: column; justify-content: flex-start;
    border-top: 0; border-right: 1px solid var(--linea); padding: 76px 12px 12px; gap: 2px; z-index: 15;
  }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: .92rem; }
  .nav a:hover { background: var(--papel); }
  .nav a.activo { background: var(--monte-claro); }
  .nav .solo-movil { display: none; }
  .nav .solo-escritorio { display: flex; }
  .nav .sep { height: 1px; background: var(--linea); margin: 8px 6px; }
  .contenedor { padding: 24px; }
}

/* ---------- Tarjetas ---------- */
.card { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-h h2, .card-h h3 { margin: 0; }
.card-h a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.titulo-pag { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.titulo-pag h1 { margin: 0; }
.titulo-pag p { margin: 2px 0 0; }

.hero {
  background: linear-gradient(135deg, var(--monte) 0%, var(--monte-2) 100%); color: #fff;
  border-radius: var(--radio); padding: 18px; margin-bottom: 14px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -30px; bottom: -40px; width: 180px; height: 120px; opacity: .12;
  background: radial-gradient(circle at 30% 70%, #fff 0 18%, transparent 19%), radial-gradient(circle at 70% 40%, #fff 0 25%, transparent 26%);
}
.hero h1 { color: #fff; font-size: 1.4rem; margin-bottom: 2px; }
.hero p { opacity: .8; margin: 0; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--blanco); border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; display: block; }
.kpi b { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.kpi span { font-size: .8rem; color: var(--gris); }
.kpi.alerta b { color: var(--rojo); }

/* ---------- Listas ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { border-top: 1px solid var(--linea); }
.lista > li:first-child { border-top: 0; }
.fila { display: flex; align-items: center; gap: 12px; padding: 12px 2px; color: inherit; text-decoration: none; }
a.fila:hover { background: var(--papel); }
.fila .cuerpo { flex: 1; min-width: 0; }
.fila .cuerpo b { display: block; font-weight: 600; }
.fila .cuerpo .muted { font-size: .84rem; }
.fila .fin { text-align: right; flex: none; }

.cal { flex: none; width: 50px; text-align: center; border-radius: 10px; background: var(--ocre-claro); color: var(--ambar); padding: 5px 0; line-height: 1.05; }
.cal b { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--tinta); }
.cal span { font-size: .66rem; font-weight: 700; letter-spacing: .06em; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--monte-claro); color: var(--monte); white-space: nowrap; }
.chip-ok, .chip-confirmada, .chip-pagada, .chip-abierta, .chip-resuelta { background: var(--verde-claro); color: var(--verde); }
.chip-pronto, .chip-espera, .chip-pendiente, .chip-cerrada, .chip-urgente { background: var(--ambar-claro); color: var(--ambar); }
.chip-caducado, .chip-cancelada, .chip-cierre { background: var(--rojo-claro); color: var(--rojo); }
.chip-falta, .chip-realizada, .chip-info { background: #ecebe6; color: var(--gris); }
.chip-admin { background: var(--monte); color: #fff; }
.chip-guarda { background: var(--ocre); color: #fff; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--monte); color: #fff; border: 0; border-radius: 11px;
  padding: 11px 18px; font: 600 .93rem var(--sans); cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn:hover { background: var(--monte-2); }
.btn-ocre { background: var(--ocre); }
.btn-ocre:hover { background: #a3711f; }
.btn-sec { background: transparent; color: var(--monte); border: 1.5px solid var(--linea); }
.btn-sec:hover { background: var(--papel); }
.btn-peligro { background: transparent; color: var(--rojo); border: 1.5px solid #e8c4bd; }
.btn-peligro:hover { background: var(--rojo-claro); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .82rem; border-radius: 9px; }
.btn-bloque { width: 100%; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 25;
  width: 56px; height: 56px; border-radius: 18px; background: var(--ocre); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.22); text-decoration: none;
}
@media (min-width: 900px) { .fab { bottom: 24px; right: 24px; } }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
.campo label, .etq { display: block; font-size: .8rem; font-weight: 600; color: var(--gris); margin-bottom: 5px; }
.campo input, .campo select, .campo textarea, .filtros select, .filtros input {
  width: 100%; font: 16px var(--sans); color: var(--tinta);
  background: #fff; border: 1.5px solid var(--linea); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
.campo textarea { min-height: 96px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--monte-2); box-shadow: 0 0 0 3px rgba(45, 82, 64, .15); }
.campo .ayuda { font-size: .78rem; color: var(--gris); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--monte); }
.seccion-form { font-family: var(--serif); font-size: 1rem; margin: 6px 0 -4px; padding-top: 10px; border-top: 1px solid var(--linea); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filtros > * { flex: 1 1 140px; }
.filtros .btn { flex: 0 0 auto; }

.selector-cant { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--linea); border-radius: 10px; overflow: hidden; background: #fff; width: max-content; }
.selector-cant button { width: 46px; height: 44px; border: 0; background: var(--papel); font-size: 1.3rem; cursor: pointer; color: var(--monte); }
.selector-cant input { width: 60px; text-align: center; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }

.especies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.especies-grid label { cursor: pointer; }
.especies-grid input { position: absolute; opacity: 0; pointer-events: none; }
.especies-grid span { display: block; text-align: center; padding: 11px 6px; border: 1.5px solid var(--linea); border-radius: 10px; background: #fff; font-weight: 600; font-size: .88rem; }
.especies-grid input:checked + span { border-color: var(--monte); background: var(--monte); color: #fff; }
.especies-grid input:focus-visible + span { box-shadow: 0 0 0 3px rgba(45, 82, 64, .3); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 4px; background: #e9e4d8; padding: 4px; border-radius: 12px; margin-bottom: 14px; overflow-x: auto; }
.tabs a { flex: 1; text-align: center; padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--gris); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.tabs a.activo { background: var(--blanco); color: var(--monte); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); padding: 8px; border-bottom: 1.5px solid var(--linea); white-space: nowrap; }
.tabla td { padding: 10px 8px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Barras de cupo ---------- */
.barra { height: 8px; background: #ebe6da; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.barra i { display: block; height: 100%; background: var(--monte-2); border-radius: 99px; }
.barra i.medio { background: var(--ocre); }
.barra i.lleno { background: var(--rojo); }

/* ---------- Avisos ---------- */
.aviso { border-left: 4px solid var(--monte-2); }
.aviso.urgente { border-left-color: var(--ocre); }
.aviso.cierre { border-left-color: var(--rojo); }
.aviso .cuerpo-aviso { white-space: pre-line; }

/* ---------- Mensajes ---------- */
.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.flash.ok { background: var(--verde-claro); color: #1e5533; }
.flash.error { background: var(--rojo-claro); color: #7d2a1f; }
.vacio { text-align: center; color: var(--gris); padding: 28px 12px; }
.vacio .ico { opacity: .4; margin-bottom: 6px; }

/* ---------- Mapa ---------- */
#mapa { height: calc(100vh - 220px); min-height: 380px; border-radius: var(--radio); border: 1px solid var(--linea); z-index: 1; }
#mapa-captura { height: 320px; border-radius: var(--radio); border: 1px solid var(--linea); z-index: 1; margin-top: 10px; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; margin-top: 10px; }
.leyenda i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.marcador { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* ---------- Modal (dialog) ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.3); background: var(--blanco); color: var(--tinta); }
dialog::backdrop { background: rgba(20, 28, 22, .5); }
dialog .dlg { padding: 20px; }
dialog .dlg-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
dialog .cerrar { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--gris); padding: 4px 8px; }

/* ---------- Menú "Más" ---------- */
.menu-mas a { display: flex; align-items: center; gap: 14px; padding: 14px 4px; text-decoration: none; color: var(--tinta); font-weight: 500; border-top: 1px solid var(--linea); }
.menu-mas a:first-child { border-top: 0; }
.menu-mas a .ico { color: var(--monte-2); }
.menu-mas a::after { content: "›"; margin-left: auto; color: var(--gris); font-size: 1.3rem; }

/* ---------- Login ---------- */
.login-pag { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--monte); padding-bottom: 24px; }
.login-pag .caja { width: 100%; max-width: 380px; }
.login-pag .logo { text-align: center; color: #fff; margin-bottom: 22px; }
.login-pag .logo img { width: 84px; height: 84px; border-radius: 22px; margin-bottom: 12px; }
.login-pag .logo h1 { color: #fff; font-size: 1.5rem; margin: 0; }
.login-pag .logo p { opacity: .7; margin: 4px 0 0; font-size: .9rem; }

.instalar { display: none; }
.instalar.visible { display: flex; }
.oculto { display: none !important; }
.separa { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.texto-dcha { text-align: right; }
.mt { margin-top: 14px; }
