/* =========================================================
   Dreamfit · Contactos de Valor — Propuesta de diseño v3
   Brand Book Dreamfit:
   - Principal Pantone 2287 C #68D000 (logo blanco sobre verde / verde sobre blanco)
   - Secundarios 1785 C #FF4773 · 2151 C #0B78B6 · 7409 C #F6C000
   - Neutros blanco #FFFFFF y negro #1D1D1B
   - Primaria Druk (sustitutas web: Anton / Archivo expandida) · Secundaria Roboto
   - Recursos del manual: numerales gigantes en blanco sobre color,
     titulares condensados negros, fotografía con esquinas redondeadas
   ========================================================= */

:root {
  --green: #68D000;
  --green-press: #5BB800;
  --green-soft: #E9F8D6;
  --pink: #FF4773;
  --pink-soft: #FFE3EA;
  --blue: #0B78B6;
  --blue-soft: #DDEFF8;
  --yellow: #F6C000;
  --yellow-soft: #FFF3C7;
  --black: #1D1D1B;
  --white: #FFFFFF;

  --ink: var(--black);
  --muted: #676763;
  --line: #E6E6E2;
  --bg: #F1F1EE;
  --surface: #F6F6F4;

  --m-cumple: var(--yellow);
  --m-prueba: var(--blue);
  --m-riesgo: var(--pink);
  --m-nuevo: var(--green);
  --m-segmento: #DADAD5;

  --f-display: "Anton", "Druk Condensed Super", "Arial Narrow", Impact, sans-serif;
  --f-wide: "Archivo", "Druk Wide", system-ui, sans-serif;
  --f-body: "Roboto", system-ui, sans-serif;

  --r: 18px;
  --r-s: 12px;
  --shadow: 0 1px 2px rgba(29,29,27,.06), 0 10px 28px rgba(29,29,27,.08);
  --shadow-lift: 0 2px 4px rgba(29,29,27,.08), 0 18px 40px rgba(29,29,27,.14);

  --tap: 60px;
  --tap-l: 84px;
  --gap: 22px;
  --pad: 28px;

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 17px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- Botones ---------- */
.btn {
  appearance: none; border: 0; border-radius: var(--r-s);
  min-height: var(--tap); padding: 0 26px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--f-wide); font-weight: 800; font-stretch: 115%;
  font-size: 16px; letter-spacing: .01em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; user-select: none; transition: background-color .12s linear, transform .08s ease, box-shadow .12s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 24px; height: 24px; flex: none; }
.btn-primary { background: var(--green); color: var(--black); box-shadow: 0 6px 16px rgba(104,208,0,.35); }
.btn-primary:active { background: var(--green-press); }
.btn-primary:disabled { background: #E3E3DF; color: #9A9A95; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--white); color: var(--black); box-shadow: inset 0 0 0 2px var(--black); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-danger { background: var(--pink); color: var(--black); }
.btn-block { width: 100%; }
.btn-xl { min-height: var(--tap-l); font-size: 19px; border-radius: 16px; }
.icon-btn {
  appearance: none; border: 0; border-radius: var(--r-s); background: var(--surface); color: var(--black);
  width: var(--tap); height: var(--tap); flex: none; display: inline-grid; place-items: center; cursor: pointer; text-decoration: none;
}
.icon-btn:active { transform: scale(.96); }
.icon-btn svg { width: 26px; height: 26px; }

/* ---------- Barra superior (verde de marca, logo blanco) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px var(--pad); background: var(--green);
}
.back-btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 18px 0 12px;
  background: var(--white); color: var(--black); border-radius: 999px;
  font-family: var(--f-wide); font-weight: 800; font-stretch: 115%; font-size: 14px; text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(29,29,27,.12);
}
.back-btn svg { width: 24px; height: 24px; }
.topbar .brand { display: flex; flex-direction: column; align-items: flex-end; text-decoration: none; line-height: 1; }
.topbar .logo { height: 26px; width: auto; }
.topbar .brand span { font-family: var(--f-wide); font-weight: 800; font-size: 12px; color: var(--white); margin-top: 3px; }
.live {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  background: rgba(29,29,27,.1); border-radius: 999px; color: var(--black); font-weight: 500; font-size: 15px;
}
.live b { font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1; }
.live .dot { width: 9px; height: 9px; background: var(--white); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.topbar .spacer { flex: 1; }
.search-btn {
  flex: 0 1 380px; min-height: 56px; justify-content: flex-start; padding: 0 20px;
  background: var(--white); color: var(--muted); border-radius: 999px;
  font-family: var(--f-body); font-weight: 400; font-stretch: 100%; letter-spacing: 0; text-transform: none; font-size: 16px;
  box-shadow: 0 4px 12px rgba(29,29,27,.10);
}
.search-btn svg { color: var(--black); }
.user-chip {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px 0 6px;
  background: var(--white); border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 12px rgba(29,29,27,.10);
}
.user-chip .df {
  width: 44px; height: 44px; border-radius: 50%; background: var(--black); color: var(--green);
  display: grid; place-items: center; font-family: var(--f-display); font-size: 19px; font-style: normal;
}
.user-chip span { font-weight: 700; text-align: left; line-height: 1.15; font-size: 15px; }
.user-chip small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

/* ---------- Barra de filtros ---------- */
.toolbar { display: flex; align-items: center; gap: 16px; padding: 18px var(--pad) 6px; }
.filters { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 4px 2px 8px; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 8px 0 18px; border-radius: 999px;
  background: var(--white); border: 0; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 700; font-size: 16px; cursor: pointer;
}
.chip i { width: 12px; height: 12px; border-radius: 50%; }
.chip em {
  font-style: normal; font-family: var(--f-display); font-size: 18px; min-width: 36px; height: 36px; padding: 0 8px;
  display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface);
}
.chip[aria-pressed="true"] { background: var(--black); color: var(--white); }
.chip[aria-pressed="true"] em { background: var(--green); color: var(--black); }
.summary { flex: none; text-align: right; color: var(--muted); font-size: 14px; line-height: 1.3; }
.summary b { display: block; color: var(--ink); font-family: var(--f-display); font-weight: 400; font-size: 26px; }

/* ---------- Ranking: tarjetas ---------- */
.grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  padding: 10px var(--pad) 120px;
}
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--white); border-radius: var(--r); padding: 10px; box-shadow: var(--shadow);
  transition: transform .35s ease, opacity .35s ease, box-shadow .2s;
}
.card:active { box-shadow: var(--shadow-lift); }
.card.leaving { transform: translateY(-12px) scale(.94); opacity: 0; }

.card .top {
  position: relative; display: grid; grid-template-columns: 40% 60%; grid-template-rows: auto auto;
  background: var(--mc, var(--m-segmento)); border-radius: var(--r-s); overflow: hidden;
  border: 0; padding: 0; cursor: pointer; width: 100%; text-align: left; color: var(--mt, var(--black));
}
.card .num {
  grid-column: 1; grid-row: 1; display: flex; align-items: flex-start; justify-content: center; padding-top: 10px;
}
.card .num b {
  font-family: var(--f-display); font-weight: 400; color: var(--white);
  font-size: 104px; line-height: .9; letter-spacing: -.02em;
}
.card .top .pic { grid-column: 2; grid-row: 1; position: relative; aspect-ratio: 1; }
.card .top .pic img, .card .top .pic .ini { width: 100%; height: 100%; object-fit: cover; border-radius: 0 0 0 var(--r-s); }
.card .tag {
  grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  font-family: var(--f-wide); font-weight: 800; font-stretch: 115%; font-size: 13px; text-transform: uppercase;
  line-height: 1.1; white-space: nowrap;
}
.card .tag svg { width: 20px; height: 20px; flex: none; }
.card .top .seg {
  position: absolute; right: 8px; bottom: 8px; padding: 5px 10px; border-radius: 999px;
  background: var(--white); color: var(--black); font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(29,29,27,.2);
}
.card .body { padding: 0 6px 4px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card h2 { margin: 0; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: 32px; line-height: .98; }
.card h2 small { display: block; font-family: var(--f-body); text-transform: none; font-size: 17px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.meta-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.pill svg { width: 16px; height: 16px; color: var(--muted); }
.pill.warn { background: var(--pink-soft); color: #B0123D; }
.pill.warn svg { color: #B0123D; }
.pill.seg { background: var(--black); color: var(--white); font-weight: 700; }
.card .actions { display: grid; grid-template-columns: var(--tap) minmax(0, 1fr); gap: 8px; margin-top: auto; }
.card .actions .btn { padding: 0 18px; min-width: 0; gap: 8px; font-size: 15px; font-stretch: 105%; letter-spacing: 0; }
.card .actions .btn svg { width: 20px; height: 20px; }
.card.later { opacity: .55; }
.card.later .top { background: #DADAD5; }

.empty { grid-column: 1 / -1; padding: 64px 24px; text-align: center; color: var(--muted); background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); }
.empty h3 { font-family: var(--f-display); font-weight: 400; font-size: 36px; color: var(--ink); text-transform: uppercase; margin: 0 0 8px; }
.ini { display: grid; place-items: center; background: #DADAD5; color: var(--ink); font-family: var(--f-display); font-size: 64px; }

/* ---------- Hoja inferior (registro) ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(29,29,27,.45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 60; left: 50%; bottom: 0;
  width: min(840px, 100%); max-height: 94vh; overflow: auto;
  transform: translate(-50%, 104%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  background: var(--white); border-radius: 28px 28px 0 0;
  padding: 10px var(--pad) calc(24px + env(safe-area-inset-bottom));
}
.sheet::before { content: ""; display: block; width: 56px; height: 6px; border-radius: 3px; background: #D6D6D1; margin: 0 auto 14px; }
.sheet.open { transform: translate(-50%, 0); box-shadow: 0 -20px 60px rgba(29,29,27,.2); }
.sheet-head { display: flex; align-items: center; gap: 16px; padding: 12px; margin-bottom: 6px; border-radius: var(--r); background: var(--mc, var(--surface)); }
.sheet-head .who { width: 76px; height: 76px; flex: none; object-fit: cover; border-radius: 14px; border: 3px solid var(--white); }
.sheet-head .who.ini { font-size: 32px; }
.sheet-head h3 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 32px; text-transform: uppercase; line-height: 1; color: var(--mt, var(--black)); }
.sheet-head p { margin: 4px 0 0; color: var(--mt, var(--black)); opacity: .85; }
.sheet-head .icon-btn { margin-left: auto; background: var(--white); border-radius: 50%; }
.q { margin: 18px 0 10px; font-family: var(--f-wide); font-weight: 800; font-stretch: 120%; font-size: 15px; text-transform: uppercase; }
.q span { color: var(--muted); font-family: var(--f-body); font-weight: 400; font-stretch: 100%; text-transform: none; }
.big-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-choice .btn { min-height: 130px; flex-direction: column; font-size: 19px; gap: 12px; border-radius: var(--r); }
.big-choice .btn svg { width: 40px; height: 40px; }
.big-choice .btn-ghost { background: var(--surface); box-shadow: none; }

.tiles { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.tiles.four { grid-template-columns: repeat(4, 1fr); }
.tile {
  appearance: none; cursor: pointer; text-align: left; border: 0;
  min-height: 100px; padding: 14px 16px; border-radius: 16px; background: var(--surface);
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  transition: background-color .12s, transform .08s;
}
.tile:active { transform: scale(.98); }
.tile b { font-size: 18px; font-weight: 700; line-height: 1.15; }
.tile small { color: var(--muted); font-size: 14px; line-height: 1.3; }
.tile svg { width: 30px; height: 30px; color: var(--muted); }
.tile.center { align-items: center; justify-content: center; text-align: center; min-height: var(--tap-l); gap: 2px; }
.tile.center b { font-family: var(--f-display); font-weight: 400; font-size: 32px; }
.tile[aria-pressed="true"] { background: var(--green); }
.tile[aria-pressed="true"] small, .tile[aria-pressed="true"] svg { color: var(--black); }
.tile.danger[aria-pressed="true"] { background: var(--pink); }

textarea.notes { width: 100%; min-height: 84px; resize: vertical; border-radius: 16px; background: var(--surface); border: 2px solid transparent; padding: 14px 16px; }
textarea.notes:focus { border-color: var(--black); outline: none; background: var(--white); }
textarea.notes::placeholder { color: #8E8E89; }
.quick-notes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.quick-notes button { appearance: none; border: 2px solid var(--line); background: var(--white); cursor: pointer; height: 44px; padding: 0 16px; border-radius: 999px; font-weight: 500; font-size: 15px; }
.sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: 22px; }
.step[hidden] { display: none; }
.confirm-box { margin-top: 14px; padding: 16px; background: var(--pink-soft); border-radius: 16px; }
.confirm-box p { margin: 0 0 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translate(-50%, 160%);
  display: flex; align-items: center; gap: 16px; min-height: 64px;
  background: var(--black); color: var(--white); padding: 8px 8px 8px 12px; border-radius: 999px; font-weight: 700;
  transition: transform .25s ease; max-width: calc(100% - 32px); box-shadow: var(--shadow-lift);
}
.toast.show { transform: translate(-50%, 0); }
.toast .btn { min-height: 48px; padding: 0 18px; background: var(--white); color: var(--black); font-size: 13px; border-radius: 999px; }
.toast i { width: 40px; height: 40px; border-radius: 50%; background: var(--green); flex: none; display: grid; place-items: center; }
.toast i svg { width: 22px; height: 22px; color: var(--black); }

/* ---------- Buscador ---------- */
.search-panel { position: fixed; inset: 0; z-index: 55; background: var(--bg); display: flex; flex-direction: column; transform: translateY(-100%); transition: transform .25s ease; }
.search-panel.open { transform: translateY(0); }
.search-bar { display: flex; gap: 12px; padding: 14px var(--pad); background: var(--green); }
.search-bar input { flex: 1; min-height: 72px; border: 0; border-radius: 999px; background: var(--white); font-size: 24px; font-weight: 500; padding: 0 28px; box-shadow: 0 4px 12px rgba(29,29,27,.12); min-width: 0; }
.search-bar input:focus { outline: 3px solid var(--black); }
.search-bar input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-bar .icon-btn { width: 72px; height: 72px; border-radius: 50%; background: var(--white); }
.search-hint { padding: 14px var(--pad) 0; margin: 0; color: var(--muted); font-size: 15px; }
.results { overflow: auto; padding: 4px var(--pad) 40px; }
.results h4 { margin: 18px 0 10px; font-family: var(--f-wide); font-weight: 800; font-stretch: 120%; font-size: 13px; text-transform: uppercase; }
.result {
  display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 16px;
  padding: 10px; margin-bottom: 10px; background: var(--white); border-radius: var(--r); box-shadow: var(--shadow);
}
.result img, .result .ini { width: 76px; height: 76px; object-fit: cover; font-size: 30px; border-radius: 14px; }
.result b { font-family: var(--f-display); font-weight: 400; font-size: 26px; text-transform: uppercase; display: block; line-height: 1.05; }
.result .meta { color: var(--muted); font-size: 15px; }
.result .tag-in { color: #3E8A00; font-weight: 700; }
.result mark { background: var(--green-soft); color: inherit; padding: 1px 6px; border-radius: 6px; }
.result .acts { display: flex; gap: 8px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--white); }
.login-hero { position: relative; overflow: hidden; background: var(--green); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }

.login-hero .logo { width: 210px; position: relative; z-index: 1; }
.login-hero > div { position: relative; z-index: 1; }
.login-hero h1 { margin: 0; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; color: var(--black); font-size: clamp(64px, 8.5vw, 120px); line-height: .98; }
.login-hero h1 span { color: var(--white); }
.login-hero p { max-width: 32ch; font-size: 19px; margin: 22px 0 0; color: var(--black); }
.login-panel { padding: 48px; display: flex; flex-direction: column; justify-content: center; max-width: 560px; width: 100%; justify-self: center; }
.login-panel h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 46px; text-transform: uppercase; }
.login-panel .sub { color: var(--muted); margin: 8px 0 28px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label { font-family: var(--f-wide); font-weight: 800; font-stretch: 120%; font-size: 13px; text-transform: uppercase; }
.input-wrap { position: relative; display: flex; }
.input-wrap input { flex: 1; min-height: 68px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); font-size: 22px; padding: 0 20px; min-width: 0; }
.input-wrap input:focus { outline: none; border-color: var(--black); background: var(--white); }
.input-wrap .icon-btn { position: absolute; right: 6px; top: 6px; width: 56px; height: 56px; background: transparent; }
.input-wrap input[type="password"], .input-wrap input.has-btn { padding-right: 70px; }
.field.error input { border-color: var(--pink); background: var(--pink-soft); }
.check { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; margin: -4px 0 18px; }
.check input { width: 26px; height: 26px; accent-color: var(--black); }
.login-foot { margin-top: 20px; color: var(--muted); font-size: 15px; }
.login-alert { padding: 14px 16px; background: var(--pink-soft); border-radius: 14px; margin-bottom: 18px; font-weight: 500; }

/* ---------- Ficha ---------- */
.ficha { padding: 20px var(--pad) 140px; display: flex; flex-direction: column; gap: var(--gap); }
.hero {
  position: relative; overflow: hidden; border-radius: 24px; background: var(--mc, var(--m-segmento));
  display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 28px; padding: 22px; color: var(--mt, var(--black));
}
.hero .watermark {
  position: absolute; right: -10px; bottom: -40px; font-family: var(--f-display); font-size: 300px; line-height: .8;
  color: rgba(255,255,255,.28); pointer-events: none;
}
.hero .photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; border: 5px solid var(--white); box-shadow: 0 10px 30px rgba(29,29,27,.18); }
.hero .photo.ini { font-size: 110px; }
.hero .info { position: relative; display: flex; flex-direction: column; justify-content: center; }
.hero .kicker { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-wide); font-weight: 800; font-stretch: 120%; font-size: 14px; text-transform: uppercase; }
.hero .kicker svg { width: 22px; height: 22px; }
.hero h1 { margin: 8px 0 14px; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(48px, 6.6vw, 82px); line-height: .92; color: var(--black); }
.hero[data-motivo="prueba"] h1 { color: var(--white); }
.hero .pills { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .pill { background: var(--white); color: var(--black); height: 38px; font-weight: 700; }
.hero .pill.seg { background: var(--black); color: var(--white); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--white); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--sc, var(--surface)); }
.stat .ico svg { width: 26px; height: 26px; }
.stat b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.05; }
.stat span { color: var(--muted); font-size: 14px; }
.sections { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.panel { background: var(--white); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.panel.full { grid-column: 1 / -1; }
.panel h3 {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px;
  font-family: var(--f-display); font-weight: 400; font-size: 28px; text-transform: uppercase;
}
.panel h3 .src { font-family: var(--f-body); font-size: 13px; color: var(--muted); text-transform: none; font-weight: 400; }
.panel dl { display: grid; grid-template-columns: minmax(130px, auto) 1fr; margin: 0; }
.panel dt, .panel dd { padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
.panel dt { color: var(--muted); padding-right: 16px; }
.panel dd { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.reveal {
  appearance: none; border: 0; background: var(--black); color: var(--white); cursor: pointer;
  height: 44px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-wide); font-weight: 800; font-stretch: 115%; font-size: 12px; text-transform: uppercase; flex: none;
}
.reveal[aria-pressed="true"] { background: var(--surface); color: var(--black); }
.reveal svg { width: 18px; height: 18px; }
.ok { color: #3E8A00; }
.ko { color: #C21A47; }
.calendar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.calendar i { aspect-ratio: 1; background: var(--surface); border-radius: 8px; display: block; }
.calendar i.on { background: var(--green); }
.calendar i.today { box-shadow: inset 0 0 0 3px var(--black); }
.cal-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 10px; }
table.accesses { width: 100%; border-collapse: collapse; }
table.accesses th { text-align: left; font-family: var(--f-wide); font-weight: 800; font-stretch: 115%; font-size: 11px; text-transform: uppercase; padding: 6px 8px 8px 0; color: var(--muted); }
table.accesses td { padding: 11px 8px 11px 0; border-top: 1px solid var(--line); }
table.accesses td.big { font-family: var(--f-display); font-size: 22px; }
table.accesses tr.today td { background: var(--green-soft); }
table.accesses tr.today td:first-child { border-radius: 10px 0 0 10px; padding-left: 10px; }
table.accesses tr.today td:last-child { border-radius: 0 10px 10px 0; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.history li i { width: 44px; height: 44px; border-radius: 50%; background: var(--green); display: grid; place-items: center; }
.history li.no i { background: var(--surface); }
.history li i svg { width: 22px; height: 22px; }
.history b { display: block; }
.history span, .history time { color: var(--muted); font-size: 14px; }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px var(--pad) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(241,241,238,0), var(--bg) 35%);
}
.bottom-bar .btn { width: 100%; }

/* ---------- Resumen ---------- */
.dash { padding: 20px var(--pad) 60px; display: flex; flex-direction: column; gap: var(--gap); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.kpi { position: relative; overflow: hidden; border-radius: var(--r); padding: 20px 22px; background: var(--white); box-shadow: var(--shadow); }
.kpi b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 72px; line-height: 1; }
.kpi span { display: block; color: var(--muted); }
.kpi.accent { background: var(--green); }
.kpi.accent span { color: var(--black); }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 210px 1fr 48px; gap: 12px; align-items: center; }
.bar-row .track { height: 26px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--green); border-radius: 999px; }
.bar-row .fill.grey { background: #C9C9C4; }
.bar-row b { text-align: right; font-family: var(--f-display); font-weight: 400; font-size: 26px; }
table.team { width: 100%; border-collapse: collapse; }
table.team th { text-align: left; color: var(--muted); font-weight: 500; font-size: 14px; padding: 4px 0 8px; }
table.team td { padding: 12px 0; border-top: 1px solid var(--line); font-weight: 600; }
table.team td.n { font-family: var(--f-display); font-weight: 400; font-size: 26px; }

/* ---------- Menú usuario ---------- */
.menu { position: fixed; z-index: 45; top: 84px; right: var(--pad); width: 300px; background: var(--white); border-radius: var(--r); display: none; box-shadow: var(--shadow-lift); overflow: hidden; }
.menu.open { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 0 20px; background: none; border: 0; text-align: left; text-decoration: none; font-weight: 600; cursor: pointer; }
.menu > * + * { border-top: 1px solid var(--line) !important; }
.menu svg { width: 22px; height: 22px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .user-chip span { display: none; }
  .user-chip { padding: 0 6px; }
}
@media (max-width: 1024px) {
  .sections { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  :root { --pad: 20px; --gap: 16px; }
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 32px; gap: 24px; }
  .login-panel { padding: 32px; }
  .hero { grid-template-columns: 200px 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .live span:not(.dot) { display: none; }
  .search-btn .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .summary { display: none; }
}
@media (max-width: 600px) {
  :root { --pad: 14px; --gap: 12px; }
  body { font-size: 16px; }
  .topbar { gap: 8px; padding: 10px var(--pad); }
  .topbar .logo { height: 20px; }
  .topbar .brand span { font-size: 10px; }
  .live { display: none; }
  .back-btn { padding: 0 14px; font-size: 0; gap: 0; }
  .grid { grid-template-columns: 1fr; }
  .card { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .card .top { width: 132px; align-self: flex-start; grid-template-columns: 1fr auto; grid-template-rows: auto auto; }
  .card .top .pic { grid-column: 1 / -1; grid-row: 1; }
  .card .top .pic img, .card .top .pic .ini { border-radius: 0; }
  .card .top .seg { display: none; }
  .card .num { grid-column: 2; grid-row: 2; padding: 4px 10px 4px 0; align-items: center; }
  .card .num b { font-size: 40px; line-height: 1; }
  .card .tag { grid-column: 1; grid-row: 2; padding: 8px 10px; }
  .card .tag span { display: none; }
  .card .body { flex: 1; min-width: 0; padding: 4px 4px 0 0; gap: 8px; }
  .card h2 { font-size: 26px; }
  .card .actions { grid-template-columns: 52px minmax(0, 1fr); gap: 6px; }
  .card .actions .icon-btn { width: 52px; height: 52px; }
  .card .actions .btn { min-height: 52px; font-size: 14px; padding: 0 14px; }
  .card .actions .btn svg { display: none; }
  .search-btn { flex: 0 0 56px; width: 56px; padding: 0; justify-content: center; }
  .search-btn .lbl { display: none; }
  .topbar .spacer { display: block; }
  .tiles, .tiles.four { grid-template-columns: 1fr 1fr; }
  .tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .big-choice .btn { min-height: 110px; font-size: 16px; }
  .sheet-foot { grid-template-columns: 1fr; }
  .sheet-foot .btn-ghost { order: 2; }
  .hero { grid-template-columns: 1fr; padding: 16px; }
  .hero .photo { max-width: 180px; }
  .hero .watermark { font-size: 200px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
  .bar-row { grid-template-columns: 1fr 44px; }
  .bar-row .track { grid-column: 1 / -1; grid-row: 2; }
  .login-hero h1 { font-size: 56px; line-height: 1; }
  .login-hero .logo { width: 150px; }
  .login-panel { padding: 24px 16px; }
  .search-bar input { font-size: 19px; min-height: 60px; }
  .search-bar .icon-btn { width: 60px; height: 60px; }
  .result { grid-template-columns: 60px minmax(0, 1fr); }
  .result img, .result .ini { width: 60px; height: 60px; }
  .result .acts { grid-column: 1 / -1; }
  .result .acts .btn { flex: 1; }
  .result b { font-size: 22px; }
  .panel { padding: 16px; }
  .panel dl { grid-template-columns: 1fr; }
  .panel dt { padding-bottom: 0; font-size: 14px; }
  .panel dd { border-top: 0; padding-top: 2px; }
  table.accesses .hide-m { display: none; }
  .kpi b { font-size: 54px; }
}

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

/* =========================================================
   Añadidos para la aplicación (sobre la maqueta aprobada)
   ========================================================= */
[hidden] { display: none !important; }
.card .top { color: inherit; font: inherit; }
.result img { background: #DADAD5; }
.sheet-head .who { background: #DADAD5; }
.hero .photo { background: #DADAD5; }
.empty p { margin: 8px 0 0; }
.empty .btn { margin-top: 12px; }
.page-login .toast { bottom: 24px; }
.btn:disabled { cursor: not-allowed; }
.panel dd.ko, .panel dd.ok { font-weight: 700; }
.history li i svg { color: var(--black); }
.user-chip span small { white-space: nowrap; }

/* ---------- Selector de centro (cabecera + hoja) ---------- */
.club-switch {
  appearance: none; border: 0; cursor: pointer; flex: 0 0 auto; min-width: 0;
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px 0 12px;
  background: var(--black); color: var(--white); border-radius: 999px;
  font-family: var(--f-wide); font-weight: 800; font-stretch: 112%; font-size: 13px; text-transform: uppercase; letter-spacing: .01em;
  box-shadow: 0 4px 12px rgba(29,29,27,.16); transition: transform .08s;
}
.club-switch:active { transform: scale(.97); }
.club-switch i { display: inline-flex; font-style: normal; flex: none; }
.club-switch svg { width: 20px; height: 20px; }
.club-switch .pin svg { color: var(--green); }
.club-switch .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.live, .user-chip span { white-space: nowrap; }
.search-btn { min-width: 0; }
.club-switch .chev svg { width: 18px; height: 18px; opacity: .8; }
.club-switch.static { cursor: default; background: rgba(29,29,27,.1); color: var(--black); box-shadow: none; }
.club-switch.static .pin svg { color: var(--black); }
.club-switch.static:active { transform: none; }

.club-sheet .sheet-head { --mc: var(--green); padding: 18px 18px 18px 22px; }
.club-sheet .sheet-head p { opacity: 1; }
.club-filter {
  width: 100%; height: 60px; margin: 10px 0 4px; padding: 0 20px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--white); font-size: 18px;
}
.club-filter:focus { outline: none; border-color: var(--black); }
.club-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.club-option {
  appearance: none; border: 0; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px;
  border-radius: 16px; background: var(--surface); transition: background-color .12s, transform .08s;
}
.club-option:active { transform: scale(.98); }
.club-option .ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--white); }
.club-option .ico svg { width: 22px; height: 22px; color: var(--muted); }
.club-option b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1.05; text-transform: uppercase; }
.club-option small { display: block; margin-top: 3px; font-size: 14px; font-weight: 600; color: var(--muted); }
.club-option[aria-selected="true"] { background: var(--green); }
.club-option[aria-selected="true"] .ico { background: var(--black); }
.club-option[aria-selected="true"] .ico svg { color: var(--green); }
.club-option[aria-selected="true"] small { color: var(--black); }
.club-none { grid-column: 1 / -1; margin: 18px 0; color: var(--muted); text-align: center; }

@media (max-width: 860px) {
  .club-switch .name { max-width: 170px; }
}
@media (max-width: 600px) {
  .club-switch { height: 44px; padding: 0 10px; gap: 4px; font-size: 11px; }
  .club-switch { flex: 0 1 auto; }
  .club-switch .name { max-width: 120px; }
  .club-switch .pin { display: none; }
  .club-list { grid-template-columns: 1fr; }
}

/* ---------- Centros (ADMIN) ---------- */
.clubs-hint { color: var(--muted); margin: 0 0 14px; overflow-wrap: anywhere; }
.clubs-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.clubs-bar input { flex: 1; min-width: 200px; }
.clubs-bar input, .clubs-form input { min-height: var(--tap); border: 2px solid var(--line); border-radius: 14px; padding: 0 16px; background: var(--surface); }
.clubs-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 14px; }
.clubs-form[hidden] { display: none; }
.clubs-form label { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.clubs-form input { color: var(--ink); font-size: 17px; }
.clubs-list { display: flex; flex-direction: column; gap: 12px; }
.club-head { appearance: none; border: 0; background: none; width: 100%; min-height: 44px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; text-align: left; cursor: pointer; font-size: 19px; }
.club-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.club-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.club-badge.ok { background: var(--green-soft); color: #2F6B00; }
.club-badge.ko { background: var(--line); color: var(--muted); }
.club-scopes .club-badge.ko { background: var(--pink-soft); color: #B0123D; }
.club-body { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.club-scopes { margin-top: 14px; display: grid; gap: 8px; }
