/* ============================================================
   CONCURSA · admin.css
   Componentes específicos del backend admin (Ubikua)
   Desktop-first. Superadmin solo >= 1280 px.
   ============================================================ */

/* ---------- Login con acceso rápido de demo ---------- */
.admin-login__quick {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--u-border);
}
.admin-login__quick-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--u-text-muted); font-weight: 700;
  text-align: center; margin-bottom: var(--sp-3);
}
.admin-login__quick-grid { display: grid; gap: var(--sp-2); grid-template-columns: 1fr 1fr; }
.admin-login__quick button {
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--u-border);
  border-radius: var(--r-md); background: var(--u-surface);
  font-size: 0.82rem; font-weight: 600; color: var(--u-text);
  transition: all var(--t-fast); font-family: inherit;
}
.admin-login__quick button:hover {
  border-color: var(--u-primary); color: var(--u-primary); background: var(--u-primary-light);
}

/* ---------- 2FA ---------- */
.twofa-grid { display: grid; gap: var(--sp-2); grid-template-columns: repeat(6, 1fr); margin-block: var(--sp-5); }
.twofa-grid input {
  aspect-ratio: 1 / 1.2; text-align: center;
  font-size: 1.4rem; font-weight: 700;
  border: 2px solid var(--u-border); border-radius: var(--r-md);
  background: var(--u-surface); width: 100%;
}
.twofa-grid input:focus { border-color: var(--u-primary); outline: none; }

/* ---------- Barra de herramientas de tabla ---------- */
.table-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-4); }
.table-toolbar__search {
  flex: 1; min-width: 200px; padding: var(--sp-2) var(--sp-3);
  border: 1.5px solid var(--u-border); border-radius: var(--r-md);
  background: var(--u-surface); font-size: 0.88rem;
}
.table-toolbar select {
  padding: var(--sp-2) var(--sp-3);
  border: 1.5px solid var(--u-border); border-radius: var(--r-md);
  background: var(--u-surface); font-size: 0.88rem;
}

.table-actions { display: flex; gap: var(--sp-1); justify-content: flex-end; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  color: var(--u-text-muted); transition: all var(--t-fast);
  font-size: 0.9rem; text-decoration: none;
}
.icon-btn:hover { background: var(--u-primary-light); color: var(--u-primary); }
.icon-btn--danger:hover { background: #fee2e2; color: var(--u-error); }
.icon-btn--ok:hover { background: #dcfce7; color: var(--u-success); }

/* ---------- Checklist (votación / resumen) ---------- */
.checklist { list-style: none; padding: 0; margin: var(--sp-4) 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) 0; border-bottom: 1px dashed var(--u-border);
  font-size: 0.9rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist__icon {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: #dcfce7; color: #14532d; font-weight: 800; font-size: 0.8rem;
}
.checklist__icon--warn { background: #fef3c7; color: #78350f; }
.checklist__icon--error { background: #fee2e2; color: #7f1d1d; }

/* ---------- Zona de aviso / peligro ---------- */
.danger-zone {
  border: 2px solid #fca5a5; background: #fef2f2;
  border-radius: var(--r-md); padding: var(--sp-4); margin-top: var(--sp-5);
}
.danger-zone h4 { color: #7f1d1d; margin-bottom: var(--sp-2); font-size: 0.95rem; }
.danger-zone p { font-size: 0.88rem; color: #7f1d1d; margin-bottom: var(--sp-3); }
.danger-zone--info { border-color: #a7f3d0; background: #ecfdf5; }
.danger-zone--info h4, .danger-zone--info p, .danger-zone--info ul { color: #065f46; }

.confirm-input {
  padding: var(--sp-3); border: 2px solid #fca5a5;
  border-radius: var(--r-md); background: #fff;
  font-weight: 700; letter-spacing: .1em; text-align: center;
  width: 100%; max-width: 220px; margin-bottom: var(--sp-3);
}

/* ---------- Timeline de auditoría ---------- */
.timeline { position: relative; padding-left: var(--sp-5); }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--u-border);
}
.timeline__item { position: relative; padding-bottom: var(--sp-4); }
.timeline__item::before {
  content: ""; position: absolute; left: calc(-1 * var(--sp-5) + 1px); top: 6px;
  width: 12px; height: 12px; border-radius: var(--r-full);
  background: var(--u-surface); border: 3px solid var(--u-primary);
}
.timeline__item--ok::before { border-color: var(--u-success); }
.timeline__item--warn::before { border-color: var(--u-warn); }
.timeline__item--error::before { border-color: var(--u-error); }
.timeline__time { font-size: 0.78rem; color: var(--u-text-muted); font-weight: 600; }
.timeline__text { font-size: 0.9rem; margin-top: 2px; }

/* ---------- Calendario semanal (fotógrafo) ---------- */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.week-day {
  background: var(--u-surface); border: 1px solid var(--u-border);
  border-radius: var(--r-md); padding: var(--sp-3);
  text-align: center; min-height: 88px;
}
.week-day--today { border-color: var(--u-primary); background: var(--u-primary-light); }
.week-day__name { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--u-text-muted); font-weight: 700; }
.week-day__num { font-size: 1.15rem; font-weight: 800; margin-block: 4px; }
.week-day__dots { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.week-day__dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--u-primary); }

/* ---------- Plantillas de foto (fotógrafo) ---------- */
.shot-template {
  border: 1px solid var(--u-border); border-radius: var(--r-md);
  padding: var(--sp-4); margin-bottom: var(--sp-3);
  display: grid; gap: var(--sp-4); grid-template-columns: 200px 1fr; align-items: start;
}
@media (max-width: 900px) { .shot-template { grid-template-columns: 1fr; } }
.shot-template__guide {
  aspect-ratio: 4 / 3; background: var(--u-primary-light);
  border: 2px dashed var(--u-primary); border-radius: var(--r-md);
  display: grid; place-items: center; position: relative;
  color: var(--u-primary); font-weight: 700; font-size: 0.8rem;
}
.shot-template__guide::before, .shot-template__guide::after {
  content: ""; position: absolute; background: var(--u-primary); opacity: .3;
}
.shot-template__guide::before { left: 33%; right: 33%; top: 0; bottom: 0; width: 1px; }
.shot-template__guide::after  { top: 33%; bottom: 33%; left: 0; right: 0; height: 1px; }
.shot-template__title { font-weight: 700; font-size: 0.95rem; margin-bottom: var(--sp-1); }
.shot-template__meta { font-size: 0.82rem; color: var(--u-text-muted); margin-bottom: var(--sp-3); }

/* ---------- Agenda del día ---------- */
.agenda-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.agenda-item {
  display: grid; grid-template-columns: 70px 1fr auto;
  gap: var(--sp-3); align-items: center;
  background: var(--u-surface); border: 1px solid var(--u-border);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
}
.agenda-item--done { opacity: .6; }
.agenda-item__time { font-weight: 800; font-size: 0.95rem; color: var(--u-primary); }
.agenda-item__name { font-weight: 600; font-size: 0.92rem; }
.agenda-item__addr { font-size: 0.8rem; color: var(--u-text-muted); }

/* ---------- Ranking resultados ---------- */
.ranking { display: flex; flex-direction: column; gap: var(--sp-2); }
.ranking__row {
  display: grid; grid-template-columns: 44px 1fr 100px 110px;
  gap: var(--sp-3); align-items: center;
  padding: var(--sp-3) var(--sp-4);
  background: var(--u-surface); border: 1px solid var(--u-border); border-radius: var(--r-md);
}
.ranking__row--gold   { border-color: #fbbf24; background: #fffbeb; }
.ranking__row--silver { border-color: #cbd5e1; background: #f8fafc; }
.ranking__row--bronze { border-color: #d97706; background: #fef3c7; }
.ranking__pos { font-weight: 900; font-size: 1.15rem; text-align: center; }
.ranking__name { font-weight: 600; font-size: 0.92rem; }
.ranking__score { text-align: right; font-weight: 800; color: var(--u-primary); }
.ranking__votes { text-align: right; font-size: 0.82rem; color: var(--u-text-muted); }

/* ---------- Comunicaciones ---------- */
.broadcast-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border: 1px solid var(--u-border);
  border-radius: var(--r-md); margin-bottom: var(--sp-2); background: var(--u-surface);
}
.broadcast-item__icon { color: var(--u-primary); flex-shrink: 0; }
.broadcast-item__body { flex: 1; }
.broadcast-item__title { font-weight: 700; font-size: 0.92rem; }
.broadcast-item__meta  { font-size: 0.78rem; color: var(--u-text-muted); }

/* ============================================================
   AMPLIACIÓN D2 — Jurado, Súper-Admin, Config de tenant
   ============================================================ */

/* ---------- Ficha de valoración del jurado ---------- */
.jury-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.jury-photos__item {
  aspect-ratio: 4 / 3; background: var(--u-primary-light);
  border-radius: var(--r-md); display: grid; place-items: center;
  font-size: 1.3rem; font-weight: 800; color: var(--u-primary);
  cursor: pointer; transition: transform var(--t-fast);
  position: relative; overflow: hidden; border: none; font-family: inherit;
}
.jury-photos__item:hover { transform: scale(1.02); }

.criteria-row {
  display: grid; grid-template-columns: 1fr 80px 460px;
  gap: var(--sp-4); align-items: center;
  padding: var(--sp-3) 0; border-bottom: 1px dashed var(--u-border);
}
.criteria-row:last-of-type { border-bottom: none; }
@media (max-width: 1200px) { .criteria-row { grid-template-columns: 1fr 80px; } }
.criteria-row__name { font-weight: 600; font-size: 0.92rem; }
.criteria-row__weight {
  font-size: 0.78rem; color: var(--u-text-muted); font-weight: 700;
  background: var(--u-primary-light); padding: 3px 8px;
  border-radius: var(--r-full); text-align: center;
}
.criteria-row__scale { display: flex; gap: 4px; flex-wrap: wrap; }
.criteria-row__scale input { position: absolute; opacity: 0; pointer-events: none; }
.criteria-row__scale label {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1.5px solid var(--u-border); border-radius: var(--r-sm);
  font-weight: 700; font-size: 0.82rem; cursor: pointer;
  transition: all var(--t-fast); background: var(--u-surface);
}
.criteria-row__scale label:hover { border-color: var(--u-primary); color: var(--u-primary); }
.criteria-row__scale input:checked + label { background: var(--u-primary); border-color: var(--u-primary); color: #fff; }
.criteria-row__scale input:focus-visible + label { outline: 3px solid var(--u-accent); outline-offset: 2px; }

/* ---------- Analítica global (superadmin) ---------- */
.chart-bars {
  display: flex; align-items: flex-end; gap: var(--sp-2);
  height: 160px; padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--u-border); margin-bottom: var(--sp-2);
}
.chart-bars__col {
  flex: 1; background: linear-gradient(180deg, var(--u-primary), #a78bfa);
  border-radius: 4px 4px 0 0; min-height: 4px; position: relative;
  transition: filter var(--t-fast);
}
.chart-bars__col:hover { filter: brightness(1.1); }
.chart-bars__label {
  position: absolute; bottom: -22px; left: 0; right: 0;
  text-align: center; font-size: 0.72rem; color: var(--u-text-muted); font-weight: 600;
}

/* ---------- Tenant row (superadmin) ---------- */
.tenant-row {
  display: grid;
  grid-template-columns: 44px 1fr 170px 110px 130px 190px;
  gap: var(--sp-4); align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--u-border); border-radius: var(--r-md);
  background: var(--u-surface); margin-bottom: var(--sp-2);
  transition: box-shadow var(--t-fast);
}
.tenant-row:hover { box-shadow: var(--sh-2); }
.tenant-row__logo {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--u-primary-light); display: grid; place-items: center;
  font-weight: 800; color: var(--u-primary); font-size: 0.85rem;
}
.tenant-row__name { font-weight: 700; font-size: 0.95rem; }
.tenant-row__slug { font-family: ui-monospace, monospace; font-size: 0.78rem; color: var(--u-text-muted); }
.tenant-row__metric-label {
  color: var(--u-text-muted); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 700;
}

/* ---------- Config sections (tenant-config) ---------- */
.config-layout {
  display: grid; gap: var(--sp-5);
  grid-template-columns: 220px 1fr 380px;
  align-items: start;
}
@media (max-width: 1400px) { .config-layout { grid-template-columns: 200px 1fr; } .config-preview { display: none; } }
@media (max-width: 900px) { .config-layout { grid-template-columns: 1fr; } .config-nav { display: none; } }

.config-nav {
  position: sticky; top: calc(var(--sp-5) + 60px);
  background: var(--u-surface); border: 1px solid var(--u-border);
  border-radius: var(--r-md); padding: var(--sp-3);
}
.config-nav__label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--u-text-muted); font-weight: 700;
  padding: var(--sp-2) var(--sp-3); margin-top: var(--sp-2);
}
.config-nav__label:first-child { margin-top: 0; }
.config-nav a {
  display: block; padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm); font-size: 0.85rem;
  color: var(--u-text); margin-bottom: 2px; transition: background var(--t-fast);
}
.config-nav a:hover { background: var(--u-primary-light); color: var(--u-primary); }

.config-section {
  background: var(--u-surface); border: 1px solid var(--u-border);
  border-radius: var(--r-lg); padding: var(--sp-5); margin-bottom: var(--sp-4);
  scroll-margin-top: 80px;
}
.config-section__head { margin-bottom: var(--sp-4); }
.config-section__title { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: var(--sp-2); }
.config-section__desc { font-size: 0.85rem; color: var(--u-text-muted); }
.config-subtitle {
  font-size: 0.8rem; margin-bottom: var(--sp-3); color: var(--u-text-muted);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}

/* ---------- Color picker de marca ---------- */
.brand-token {
  display: grid; grid-template-columns: 200px 1fr;
  gap: var(--sp-3); align-items: center;
  padding: var(--sp-3) 0; border-bottom: 1px dashed var(--u-border);
}
.brand-token:last-child { border-bottom: none; }
.brand-token__label { font-size: 0.88rem; font-weight: 600; }
.brand-token__hint { font-size: 0.75rem; color: var(--u-text-muted); }
.brand-token__inputs { display: grid; grid-template-columns: 48px 140px; gap: var(--sp-2); align-items: center; }
.brand-token input[type="color"] {
  width: 48px; height: 40px; border: 1.5px solid var(--u-border);
  border-radius: var(--r-md); cursor: pointer; background: var(--u-surface); padding: 2px;
}
.brand-token input[type="text"] {
  padding: var(--sp-2) var(--sp-3); border: 1.5px solid var(--u-border);
  border-radius: var(--r-md); background: var(--u-surface);
  font-family: ui-monospace, monospace; font-size: 0.85rem;
}

/* ---------- Preview de tenant ---------- */
.config-preview { position: sticky; top: calc(var(--sp-5) + 60px); }
.config-preview__frame {
  background: var(--u-surface); border: 1px solid var(--u-border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2);
}
.config-preview__bar {
  background: #f1f5f9; padding: var(--sp-2) var(--sp-3);
  font-size: 0.72rem; color: var(--u-text-muted);
  font-family: ui-monospace, monospace;
  border-bottom: 1px solid var(--u-border);
  display: flex; align-items: center; gap: 6px;
}
.config-preview__dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.config-preview__body { padding: var(--sp-4); font-size: 0.8rem; background: #fff; color: #1a1a1a; }
.config-preview__hero {
  aspect-ratio: 4 / 3; background: var(--preview-primary, #0b3d91);
  border-radius: var(--r-md); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.4rem; margin-bottom: var(--sp-3);
}
.config-preview__title { font-size: 1.05rem; font-weight: 800; margin-bottom: var(--sp-2); color: var(--preview-primary, #0b3d91); }
.config-preview__text { font-size: 0.78rem; color: #64748b; margin-bottom: var(--sp-3); }
.config-preview__cta {
  display: inline-block; background: var(--preview-accent, #e07a1f);
  color: #fff; padding: 8px 14px; border-radius: var(--r-md);
  font-size: 0.78rem; font-weight: 700;
}

/* ---------- Toggle switch ---------- */
.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; font-size: 0.9rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 42px; height: 24px; background: var(--u-border);
  border-radius: var(--r-full); position: relative;
  transition: background var(--t-fast); flex-shrink: 0;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  transition: transform var(--t-fast); box-shadow: var(--sh-1);
}
.switch input:checked + .switch__track { background: var(--u-primary); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--u-accent); outline-offset: 2px; }


/* ==========================================================================
   ESTADO VACIO
   --------------------------------------------------------------------------
   Cuando una tabla no tiene filas. Antes era un parrafo suelto que ademas
   hacia desaparecer la cabecera de la tabla, y el tecnico se quedaba sin saber
   si el problema era su filtro o que no habia datos.
   ========================================================================== */
.estado-vacio {
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  max-width: 46ch;
  margin-inline: auto;
}
.estado-vacio__icono {
  display: inline-grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--u-primary-light);
  color: var(--u-primary);
  margin-bottom: var(--sp-4);
}
.estado-vacio__titulo {
  font-size: 1.05rem; font-weight: 700;
  margin: 0 0 var(--sp-2);
}
.estado-vacio__texto {
  color: var(--u-text-muted);
  font-size: .92rem; line-height: 1.6;
  margin: 0 0 var(--sp-5);
}
.estado-vacio .btn { margin-top: var(--sp-1); }


/* ==========================================================================
   DIARIO DE DESARROLLO
   --------------------------------------------------------------------------
   Se lee como una cronologia, no como una tabla: casi nunca se busca un dato
   suelto, sino "que paso aquel dia" y "por que se decidio aquello".
   ========================================================================== */
.dev-entrada {
  border: 1px solid var(--u-border);
  border-radius: var(--r-md);
  background: var(--u-surface);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.dev-entrada[open] {
  border-color: var(--u-primary);
  box-shadow: 0 8px 24px -18px rgba(18, 41, 63, .5);
}

.dev-entrada__cabecera {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer; list-style: none;
}
.dev-entrada__cabecera::-webkit-details-marker { display: none; }
.dev-entrada__cabecera:focus-visible {
  outline: 3px solid var(--u-primary); outline-offset: -3px;
}

.dev-entrada__punto {
  flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
  margin-top: 6px;
}
.dev-entrada__titulo {
  flex: 1; font-weight: 600; font-size: .96rem; line-height: 1.45;
}
.dev-entrada__etiquetas {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
  flex-shrink: 0; max-width: 46%;
}

.dev-tag {
  display: inline-block;
  padding: 2px 9px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
  color: #fff; white-space: nowrap;
}
.dev-tag--suave { background: #e8eef5; color: #2c5f8a; }
.dev-tag--aviso { background: #8a6d1f; }
.dev-tag--ok    { background: #15803d; }

.dev-entrada__cuerpo {
  padding: 0 var(--sp-5) var(--sp-5) calc(var(--sp-5) + 22px);
  border-top: 1px solid var(--u-border);
  padding-top: var(--sp-4);
}

.dev-bloque { margin-bottom: var(--sp-4); }
.dev-bloque dt {
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--u-text-muted);
  margin-bottom: 3px;
}
.dev-bloque dd {
  margin: 0; font-size: .9rem; line-height: 1.65; max-width: 90ch;
}
.dev-bloque--leccion {
  border-left: 3px solid var(--u-primary);
  padding-left: var(--sp-4);
  font-style: italic;
  color: #1c3f66;
  background: #f4f7fb;
  padding-block: var(--sp-3);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.dev-ref {
  font-size: .76rem; color: var(--u-text-muted);
  margin: var(--sp-3) 0 0;
}

@media (max-width: 760px) {
  .dev-entrada__etiquetas { max-width: 100%; justify-content: flex-start; }
  .dev-entrada__cabecera { flex-wrap: wrap; }
  .dev-entrada__cuerpo { padding-left: var(--sp-5); }
}

/* ==========================================================================
   AYUDA DEL SISTEMA
   --------------------------------------------------------------------------
   Indice en rejilla con miniatura de cada pantalla, y ficha con las dos
   vistas: escritorio y movil.

   La miniatura se recorta por arriba y se muestra en 16:7 porque lo util de
   una captura esta en la parte alta; si se viera entera no se distinguiria
   nada a ese tamano.
   ========================================================================== */
.ayuda-grupo {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--u-text-muted); margin: var(--sp-5) 0 var(--sp-3);
}

.ayuda-rejilla {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.ayuda-tarjeta {
  display: flex; flex-direction: column;
  border: 1px solid var(--u-border); border-radius: var(--r-md);
  background: var(--u-surface); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.ayuda-tarjeta:hover {
  border-color: var(--u-primary);
  box-shadow: 0 12px 28px -18px rgba(18, 41, 63, .5);
  transform: translateY(-2px);
}
.ayuda-tarjeta__vista {
  display: block; aspect-ratio: 16 / 7;
  background: #eef1f5; overflow: hidden;
  border-bottom: 1px solid var(--u-border);
}
.ayuda-tarjeta__vista img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: top center; display: block;
}
.ayuda-tarjeta__sin {
  display: grid; place-items: center; height: 100%;
  font-size: .8rem; color: var(--u-text-muted);
}
.ayuda-tarjeta__cuerpo { padding: var(--sp-4); display: flex; flex-direction: column; gap: 3px; }
.ayuda-tarjeta__cuerpo strong { font-size: .95rem; }
.ayuda-tarjeta__ruta { font-family: ui-monospace, monospace; font-size: .76rem; color: var(--u-primary); }
.ayuda-tarjeta__para { font-size: .84rem; color: var(--u-text-muted); line-height: 1.5; }

.ayuda-entradilla {
  font-size: 1.05rem; line-height: 1.65; color: var(--u-text-muted);
  border-left: 3px solid var(--u-primary); padding-left: var(--sp-5);
  margin: var(--sp-4) 0 0; max-width: 78ch;
}
.ayuda-bloque { margin-bottom: var(--sp-7); }
.ayuda-bloque h2 {
  font-size: 1.1rem; font-weight: 800; margin: 0 0 var(--sp-3);
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--u-border);
}
.ayuda-bloque > div { font-size: .95rem; line-height: 1.75; max-width: 82ch; }
.ayuda-bloque--aviso {
  background: #fdf8ec; border-left: 4px solid #8a6d1f;
  padding: var(--sp-5); border-radius: 0 var(--r-md) var(--r-md) 0;
}
.ayuda-bloque--aviso h2 { border-bottom-color: #e6d9b8; }

.ayuda-pasos { margin: 0; padding-left: var(--sp-6); max-width: 82ch; }
.ayuda-pasos li { margin-bottom: var(--sp-3); line-height: 1.65; font-size: .95rem; }

.ayuda-vistas { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .ayuda-vistas { grid-template-columns: 2fr 1fr; align-items: start; }
}
.ayuda-vista { margin: 0; }
.ayuda-vista img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--u-border); border-radius: var(--r-md);
  box-shadow: 0 10px 30px -20px rgba(18, 41, 63, .55);
}
.ayuda-vista--movil img { max-width: 340px; margin-inline: auto; }
.ayuda-vista figcaption {
  font-size: .78rem; color: var(--u-text-muted);
  margin-top: var(--sp-3); text-align: center;
}
.ayuda-vista__falta {
  display: grid; place-items: center; min-height: 200px;
  border: 1px dashed var(--u-border); border-radius: var(--r-md);
  color: var(--u-text-muted); font-size: .86rem;
}

.ayuda-vecinos { margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid var(--u-border); }
.ayuda-vecinos h2 { font-size: .95rem; margin-bottom: var(--sp-3); }
.ayuda-vecinos ul { list-style: none; padding: 0; display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.ayuda-vecinos a { color: var(--u-primary); font-weight: 600; font-size: .9rem; }

/* ==========================================================================
   LISTA DE CONCURSOS
   --------------------------------------------------------------------------
   Cada concurso es una ficha con su estado, sus cifras y sus acciones. Se
   agrupan por ayuntamiento porque con varios clientes una lista plana no dice
   de quien es cada cosa.
   ========================================================================== */
.concurso-lista {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}
.concurso-ficha {
  border: 1px solid var(--u-border); border-radius: var(--r-md);
  background: var(--u-surface); padding: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.concurso-ficha__cabeza {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--sp-3); flex-wrap: wrap;
}
.concurso-ficha__titulo {
  font-size: 1rem; font-weight: 800; margin: 0; line-height: 1.35;
}
.concurso-ficha__meta {
  font-size: .8rem; color: var(--u-text-muted); margin: 4px 0 0;
}
.concurso-ficha__meta a { color: var(--u-primary); font-family: ui-monospace, monospace; }
.concurso-ficha__estado {
  font-size: .72rem; font-weight: 700; color: #fff;
  padding: 4px 10px; border-radius: var(--r-full); white-space: nowrap;
}
.concurso-ficha__desc {
  font-size: .88rem; color: var(--u-text-muted); line-height: 1.55; margin: 0;
}
.concurso-ficha__datos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: var(--sp-3); margin: 0;
}
.concurso-ficha__datos dt {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--u-text-muted); margin-bottom: 2px;
}
.concurso-ficha__datos dd { margin: 0; font-size: .88rem; font-weight: 700; }
.concurso-ficha__acciones {
  display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center;
  margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--u-border);
}

/* ==========================================================================
   GESTOR DE MARCA: SUBIDA DE IMAGENES
   --------------------------------------------------------------------------
   Cada imagen se sube desde aqui y se ve al momento. Antes habia que escribir
   la ruta a mano, que es como no tener gestor.
   ========================================================================== */
.marca-imagen {
  border: 1px solid var(--u-border); border-radius: var(--r-md);
  padding: var(--sp-4); background: var(--u-surface);
}
.marca-imagen__vista {
  display: grid; place-items: center;
  min-height: 96px; margin-block: var(--sp-3);
  background: repeating-conic-gradient(#eef1f5 0% 25%, #f7f9fb 0% 50%) 50% / 16px 16px;
  border-radius: var(--r-sm); overflow: hidden; padding: var(--sp-3);
}
.marca-imagen__vista img { max-width: 100%; max-height: 90px; object-fit: contain; display: block; }
.marca-imagen__vacia { font-size: .8rem; color: var(--u-text-muted); }
.marca-imagen input[type="file"] {
  width: 100%; font-size: .82rem; padding: var(--sp-2);
  border: 1px dashed var(--u-border); border-radius: var(--r-sm); background: #fff;
}
.marca-imagen input[type="file"]::file-selector-button {
  margin-right: var(--sp-3); padding: 6px 12px; border: 0; border-radius: 6px;
  background: var(--u-primary); color: #fff; font-weight: 600; cursor: pointer;
}
.marca-imagen__quitar {
  display: flex; gap: var(--sp-2); align-items: center;
  font-size: .8rem; color: var(--u-text-muted); margin-top: var(--sp-3); cursor: pointer;
}

/* ==========================================================================
   VER EL PANEL COMO OTRO PERFIL
   --------------------------------------------------------------------------
   Selector en la barra superior (solo superadministrador) y aviso permanente
   mientras se esta simulando. El aviso es importante: sin el, es facil creer
   que se han perdido permisos de verdad.
   ========================================================================== */
.ver-como { display: flex; align-items: center; gap: var(--sp-2); margin-right: var(--sp-3); }
.ver-como__etiq {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--u-text-muted); white-space: nowrap;
}
.ver-como select {
  font-size: .82rem; padding: 6px 10px;
  border: 1.5px solid var(--u-border); border-radius: var(--r-sm);
  background: #fff; cursor: pointer; max-width: 190px;
}

.ver-como-aviso {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
  background: #fdf8ec; border-bottom: 2px solid #d9a300;
  padding: var(--sp-3) var(--sp-6);
  font-size: .88rem; color: #6b4e00;
}
.ver-como-aviso form { margin: 0; }
@media (max-width: 760px) {
  .ver-como__etiq { display: none; }
  .ver-como select { max-width: 130px; }
}

/* ==========================================================================
   JURADO Y FOTOGRAFO
   --------------------------------------------------------------------------
   La escala de puntuacion son botones grandes, no un desplegable: se pulsa
   mejor en el movil y se ve de un golpe que nota has puesto.
   ========================================================================== */
.jurado-criterio {
  padding-block: var(--sp-4);
  border-top: 1px solid var(--u-border);
}
.jurado-criterio:first-of-type { border-top: 0; padding-top: 0; }
.jurado-criterio__cab { margin-bottom: var(--sp-3); }
.jurado-criterio__peso {
  font-size: .74rem; font-weight: 700; color: var(--u-text-muted);
  background: #eef1f5; padding: 2px 8px; border-radius: 999px; margin-left: 8px;
}
.jurado-escala { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.jurado-escala__op { position: relative; }
.jurado-escala__op input { position: absolute; opacity: 0; pointer-events: none; }
.jurado-escala__op span {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 2px solid var(--u-border); border-radius: var(--r-md);
  font-weight: 700; cursor: pointer; background: #fff;
  transition: border-color var(--t-base), background var(--t-base), color var(--t-base);
}
.jurado-escala__op:hover span { border-color: var(--u-primary); }
.jurado-escala__op input:checked + span {
  background: var(--u-primary); border-color: var(--u-primary); color: #fff;
}
.jurado-escala__op input:focus-visible + span { outline: 3px solid var(--u-primary); outline-offset: 2px; }

.foto-dropzone {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4); text-align: center;
  border: 2px dashed var(--u-border); border-radius: var(--r-lg);
  background: #fafbfc; cursor: pointer; color: var(--u-text-muted);
  transition: border-color var(--t-base), background var(--t-base);
}
.foto-dropzone:hover { border-color: var(--u-primary); background: #f4f7fb; }
.foto-dropzone strong { color: var(--u-text); font-size: .95rem; }
.foto-dropzone span { font-size: .84rem; }
.foto-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------------------------------------------------------------------------
   MEDALLAS DE LA CLASIFICACION (Font Awesome)
   Antes eran los emojis de copa y medalla: los dibuja la fuente del sistema, no
   se pueden pintar de un color concreto y cambian de forma entre Windows,
   Android y macOS. Ahora son iconos y el color lo pone la hoja.
   --------------------------------------------------------------------------- */
.medalla { margin-left: .15rem; font-size: .95em; vertical-align: -.05em; }
.medalla--oro    { color: #b45309; }   /* ambar oscuro: 4,6:1 sobre blanco */
.medalla--plata  { color: #64748b; }   /* pizarra: 4,8:1 sobre blanco */
.medalla--bronce { color: #92400e; }   /* cobre: 6,4:1 sobre blanco */


/* ---------- BARRA DE CONTEXTO DEL PANEL ------------------------------------ */
/* Dice SIEMPRE en que ayuntamiento y en que concurso se esta trabajando. Antes
   esa informacion estaba en letra pequeña en la barra superior y no se veia. */
.admin-contexto {
  background: var(--u-primary, #1c3f66);
  color: #fff;
  border-bottom: 3px solid var(--u-accent, #e07a1f);
}
.admin-contexto__in {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  padding: .55rem var(--sp-6); max-width: 1500px; margin: 0 auto;
  font-size: .9rem;
}
.admin-contexto__etiq {
  text-transform: uppercase; letter-spacing: .1em; font-size: .68rem;
  font-weight: 800; opacity: .85;
}
.admin-contexto__tenant { font-weight: 600; opacity: .95; }
.admin-contexto__sep { opacity: .6; margin-right: .3rem; }
.admin-contexto__concurso { font-weight: 800; font-size: 1rem; }
.admin-contexto .badge { background: rgba(255,255,255,.18) !important; color: #fff !important; }
.admin-contexto__cambiar {
  margin-left: auto; color: #fff; font-weight: 700; font-size: .82rem;
  text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.admin-contexto__cambiar + .admin-contexto__cambiar { margin-left: .2rem; }
.admin-contexto__cambiar:hover { opacity: .85; }
@media (max-width: 767px) {
  .admin-contexto__in { padding: .5rem var(--sp-4); font-size: .82rem; }
  .admin-contexto__cambiar { margin-left: 0; }
}

/* ---------- CUADRO DE MANDO ------------------------------------------------ */
.kpi--enlace { text-decoration: none; color: inherit; display: block; }
.kpi--enlace:hover { border-color: var(--u-primary, #1c3f66); }
.kpi--enlace:focus-visible { outline: 3px solid var(--u-primary, #1c3f66); outline-offset: 2px; }
.tabla-concursos td { vertical-align: middle; }
.mini-barra {
  display: inline-block; width: 74px; height: 8px; border-radius: 999px;
  background: #e5e7eb; overflow: hidden; vertical-align: middle;
}
.mini-barra span { display: block; height: 100%; background: var(--u-primary, #1c3f66); }
/* Las cifras que ademas son enlaces (negocios y votantes del cuadro). Sin esta
   marca el numero se ve igual que un dato muerto y nadie descubre que se puede
   pinchar. El color sale de la marca del ayuntamiento, no de aqui. */
.enlace-cifra {
  color: var(--u-primary, #1c3f66); font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px;
}
.enlace-cifra:hover { text-decoration-thickness: 2px; }
.enlace-cifra:focus-visible { outline: 3px solid var(--u-primary, #1c3f66); outline-offset: 2px; }

/* Selector de concurso dentro de las pantallas de trabajo (participantes,
   votantes, resultados). Va en la cabecera, a la derecha. */
.selector-concurso, .selector-concurso__unico {
  display: flex; align-items: center; gap: var(--sp-2);
  margin: 0; font-size: .85rem;
}
.selector-concurso__etiq {
  color: var(--u-text-muted); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; font-size: .72rem; white-space: nowrap;
}
.selector-concurso select {
  max-width: 320px; padding: .35rem .5rem; border-radius: var(--r-md, 8px);
  border: 1px solid var(--g-border-control, #6b7280); background: var(--u-surface);
  color: inherit; font-size: .85rem;
}
.selector-concurso select:focus-visible { outline: 3px solid var(--u-primary, #1c3f66); outline-offset: 2px; }
/* En el movil la etiqueta CONCURSO + un select de 320 px no caben en 390: se
   parte en dos lineas y el select ocupa el ancho que hay. */
@media (max-width: 767px) {
  .selector-concurso, .selector-concurso__unico { flex-wrap: wrap; width: 100%; }
  .selector-concurso select { max-width: 100%; width: 100%; flex: 1 1 100%; }
}

/* ---------- EL PANEL EN EL MOVIL ------------------------------------------- */
/* El panel se penso para el ordenador del ayuntamiento, pero el JURADO valora de
   pie en la calle con el movil. Por debajo de 900 px la barra lateral deja de
   ocupar la pantalla: se convierte en una tira horizontal que se desliza. Antes
   el contenido se quedaba con 90 px de ancho y la pagina desbordaba. */
@media (max-width: 900px) {
  .admin-shell { display: block; }
  .admin-sidebar {
    width: 100%; position: static; border-right: 0;
    border-bottom: 1px solid var(--u-border);
  }
  .admin-sidebar__brand { display: none; }
  .admin-sidebar__nav {
    display: flex; align-items: center; gap: var(--sp-2);
    overflow-x: auto; padding: var(--sp-2) var(--sp-3);
    -webkit-overflow-scrolling: touch;
  }
  .admin-sidebar__group { display: contents; }
  .admin-sidebar__label { display: none; }
  .admin-sidebar__link {
    white-space: nowrap; padding: .35rem .65rem; border-radius: 999px;
    border: 1px solid var(--u-border);
  }
  .admin-sidebar__link[aria-current="page"] { border-color: transparent; }
  .admin-sidebar__link svg { width: 14px; height: 14px; }
  .admin-content { padding: var(--sp-3); }
  .admin-topbar { flex-wrap: wrap; gap: var(--sp-2); }
  .admin-contexto__cambiar { white-space: nowrap; }
  .jbar { left: 0; }
  .cuenta-grid, .sexo-grid, .invitar-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- VALORACION DEL JURADO EN TARJETAS ------------------------------ */
/* Tarjetas, no tabla: el jurado las usa de pie en la calle o con el portatil
   sobre la mesa. Borde rojo = falta por valorar; verde = hecha. */
.jgrid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  margin-bottom: 90px;              /* hueco para la barra fija */
}
@media (max-width: 760px) { .jgrid { grid-template-columns: minmax(0, 1fr); } }

.jcard {
  background: var(--u-surface); border: 2px solid var(--u-border);
  border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column;
}
.jcard--falta { border-color: #b91c1c; }
.jcard--hecha { border-color: #15803d; }

.jcard__media { position: relative; background: #f3f4f6; }
.jcard__foto { display: block; width: 100%; height: 210px; object-fit: cover; }
.jcard__sinfoto {
  height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; color: var(--u-text-muted); font-size: .85rem; background: #eef2f7;
}
.jcard__sinfoto i { font-size: 1.6rem; }
.jcard__galeria { display: flex; gap: 4px; padding: 4px; background: #fff; }
.jcard__galeria img { width: 100%; height: 54px; object-fit: cover; border-radius: 4px; }
.jcard__galeria a { flex: 1; }
.jcard__estado {
  position: absolute; top: .5rem; left: .5rem; font-size: .75rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 999px; background: #fff; color: #7f1d1d;
  border: 1px solid #fecaca;
}
.jcard--hecha .jcard__estado { color: #14532d; border-color: #bbf7d0; }

.jcard__cuerpo { padding: var(--sp-4); display: flex; flex-direction: column; gap: .3rem; }
.jcard__nombre { margin: 0; font-size: 1.05rem; }
.jcard__lema { margin: 0; font-style: italic; color: var(--u-text-muted); font-size: .9rem; }
.jcard__cat { margin: 0; font-size: .78rem; color: var(--u-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.jcard__form { margin-top: var(--sp-3); }

/* Escala de botones: radios de verdad (accesibles con el teclado) pintados como
   botones. Nada de JavaScript para votar. */
.jvoto { border: 0; padding: 0; margin: 0 0 .55rem; }
.jvoto__nombre {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--u-text-muted); font-weight: 700; padding: 0;
}
.jvoto__botones { display: flex; flex-wrap: wrap; gap: 4px; }
.jvoto__btn { position: relative; }
.jvoto__btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jvoto__btn span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--g-border-control, #6b7280); font-size: .85rem; font-weight: 600;
  background: #fff; color: inherit;
}
.jvoto__btn span:hover { border-color: var(--u-primary, #1c3f66); }
.jvoto__btn input:checked + span {
  background: var(--u-primary, #1c3f66); color: #fff; border-color: transparent;
}
.jvoto__btn input:focus-visible + span { outline: 3px solid var(--u-primary, #1c3f66); outline-offset: 2px; }
.jcard__acciones { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }

/* Barra fija de progreso */
.jbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-5);
  background: var(--u-surface); border-top: 1px solid var(--u-border);
  box-shadow: 0 -2px 10px rgba(18,41,63,.08); font-size: .9rem;
}
@media (min-width: 900px) { .jbar { left: 256px; } }

/* Aviso de ACEPTO */
.acepto {
  /* margin:auto es lo que centra un <dialog> nativo: si la hoja del proyecto
     pone margin:0 a todo, se queda pegado a la esquina (pasaba). */
  margin: auto; border: 0; border-radius: var(--r-lg); padding: var(--sp-5);
  max-width: 460px; width: calc(100% - 2rem);
  box-shadow: 0 10px 40px rgba(18,41,63,.25);
}
.acepto::backdrop { background: rgba(18,41,63,.45); }
.acepto__titulo { margin: 0 0 var(--sp-3); font-size: 1.15rem; }
.acepto__texto { margin: 0 0 var(--sp-3); font-size: .92rem; line-height: 1.5; }
.acepto__etiq { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--u-text-muted); margin-bottom: .3rem; }
.acepto__acciones { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-4); }

/* ---------- COMUNICACIONES (lista y editor WYSIWYG) ---------------------- */
.com-grupo {
  font-size: 1.05rem; margin: var(--sp-6) 0 var(--sp-3);
  padding-bottom: .3rem; border-bottom: 1px solid var(--u-border);
}
.com-lista { display: grid; gap: var(--sp-3); }
.com-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap; padding: var(--sp-4);
  background: #fff; border: 1px solid var(--u-border); border-radius: var(--r-lg);
}
.com-item__cuerpo { min-width: 260px; flex: 1; }
.com-item__titulo {
  margin: 0 0 .25rem; font-size: 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.com-item__asunto {
  margin: 0; font-size: .85rem; color: var(--u-text-muted);
}
.com-item__acciones { display: flex; gap: var(--sp-2); }

.com-acciones { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; margin-top: var(--sp-4); }
.com-acciones--suaves {
  margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px dashed var(--u-border);
  justify-content: space-between;
}

/* Editor */
.wys { border: 1px solid var(--g-border-control, #6b7280); border-radius: var(--r-md); overflow: hidden; }
.wys__barra {
  display: flex; gap: 2px; flex-wrap: wrap; align-items: center;
  padding: .35rem .4rem; background: #f3f4f6; border-bottom: 1px solid var(--u-border);
}
.wys__barra button {
  border: 0; background: none; cursor: pointer; padding: .35rem .5rem; border-radius: 6px;
  font-size: .9rem; color: #374151; line-height: 1;
}
.wys__barra button:hover { background: #e5e7eb; }
.wys__barra button:focus-visible { outline: 2px solid var(--u-primary, #1c3f66); outline-offset: 1px; }
.wys__sep { width: 1px; height: 18px; background: var(--u-border); margin: 0 .25rem; }
.wys__area {
  min-height: 320px; max-height: 60vh; overflow: auto; padding: var(--sp-4);
  font-size: .95rem; line-height: 1.6; background: #fff;
}
.wys__area:focus { outline: 3px solid var(--u-primary, #1c3f66); outline-offset: -3px; }
.wys__area h2 { font-size: 1.15rem; margin: .2rem 0 .6rem; }
.wys__area p { margin: 0 0 .8rem; }
.wys__area ul, .wys__area ol { margin: 0 0 .8rem; padding-left: 1.3rem; }
.wys__area a { color: var(--u-primary, #1c3f66); text-decoration: underline; }

.com-variables { margin: var(--sp-3) 0 0; font-size: .85rem; }
.com-var {
  border: 1px solid var(--u-border); background: #f9fafb; cursor: pointer;
  border-radius: 999px; padding: .12rem .6rem; margin: .15rem .25rem .15rem 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; color: #374151;
}
.com-var:hover { background: #eef2ff; border-color: var(--u-primary, #1c3f66); }

/* ---------- ASISTENTE "COMO FUNCIONA" -------------------------------------- */
/* Puertas de entrada del manual: demo y recorrido guiado. */
.ayuda-empezar {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
@media (max-width: 900px) { .ayuda-empezar { grid-template-columns: minmax(0,1fr); } }
.ayuda-empezar__tarjeta {
  display: flex; flex-direction: column; gap: .35rem;
  padding: var(--sp-4); border-radius: var(--r-lg); text-decoration: none; color: inherit;
  border: 1px solid #86efac; background: #f0fdf4;
}
.ayuda-empezar__tarjeta:hover { border-color: var(--u-primary, #1c3f66); }
.ayuda-empezar__tarjeta i { font-size: 1.3rem; color: var(--u-primary, #1c3f66); }
.ayuda-empezar__tarjeta strong { font-size: 1rem; }
.ayuda-empezar__tarjeta span { font-size: .88rem; color: var(--u-text-muted); line-height: 1.5; }

.ayuda-flotante {
  position: fixed; right: var(--sp-5); bottom: var(--sp-5); z-index: 40;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--u-primary, #1c3f66); color: #fff; font-weight: 600; font-size: .88rem;
  box-shadow: 0 6px 20px rgba(18,41,63,.25); font-family: inherit;
}
.ayuda-flotante:hover { filter: brightness(1.08); }
.ayuda-flotante:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* En la app de jurado hay una barra fija abajo con "Revisar y enviar".
   El botón de ayuda tiene que quedar por encima, nunca tapando ese botón. */
.admin--jurado .ayuda-flotante { bottom: calc(var(--sp-5) + 64px); }

@media (max-width: 899px) {
  /* En móvil el botón pasa a ser un círculo con el interrogante: ocupa menos
     y deja libres los botones de acción. */
  .ayuda-flotante {
    width: 48px; height: 48px; padding: 0; border-radius: 50%;
    justify-content: center; right: var(--sp-4);
    bottom: calc(var(--sp-4) + 64px);
  }
  .ayuda-flotante span { display: none; }
  .ayuda-flotante i { margin: 0; font-size: 1.25rem; }
  .admin--jurado .ayuda-flotante { bottom: calc(var(--sp-4) + 64px); }
}

.ayuda-dialogo {
  margin: auto; border: 0; border-radius: var(--r-lg); padding: 0;
  width: min(560px, calc(100% - 2rem)); box-shadow: 0 12px 48px rgba(18,41,63,.3);
}
.ayuda-dialogo::backdrop { background: rgba(18,41,63,.45); }
.ayuda-dialogo__cabeza {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--u-border);
}
.ayuda-dialogo__cabeza h2 { margin: 0; font-size: 1.05rem; }
.ayuda-dialogo__cerrar { background: none; border: 0; cursor: pointer; font-size: 1.1rem; color: var(--u-text-muted); }
.ayuda-dialogo__cuerpo { padding: var(--sp-5); }
.ayuda-dialogo__texto { margin: 0 0 var(--sp-3); line-height: 1.6; font-size: .95rem; }
.ayuda-dialogo__origen { margin: 0 0 var(--sp-3); font-size: .78rem; color: var(--u-text-muted); }
.ayuda-dialogo__pregunta { margin: var(--sp-4) 0 0; }
.ayuda-dialogo__pregunta label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.ayuda-dialogo__pregunta input {
  flex: 1; padding: .45rem .6rem; border-radius: var(--r-md, 8px);
  border: 1px solid var(--g-border-control, #6b7280); font-family: inherit; font-size: .88rem;
}
.ayuda-dialogo__enlace { margin: var(--sp-4) 0 0; font-size: .9rem; }
.ayuda-dialogo__aviso { margin: var(--sp-3) 0 0; font-size: .76rem; color: var(--u-text-muted); }

/* ---------- FICHA DE FOTOS DEL FOTOGRAFO ----------------------------------- */
.foto-formatos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
.foto-formato { border: 1px solid var(--u-border); border-radius: var(--r-md); padding: var(--sp-3); }
.foto-formato--falta { border-color: #fca5a5; background: #fff7f7; }
.foto-formato__cabecera { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: var(--sp-2); font-size: .9rem; }
.foto-formato__fotos { display: flex; gap: 6px; flex-wrap: wrap; }
.foto-mini { margin: 0; }
.foto-mini img { width: 92px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid var(--u-border); }
.foto-mini figcaption { font-size: .7rem; color: var(--u-text-muted); margin-top: 2px; }

.foto-huecos { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--sp-4); }
@media (max-width: 900px) { .foto-huecos { grid-template-columns: minmax(0, 1fr); } }
.foto-hueco {
  border: 2px dashed var(--g-border-control, #6b7280); border-radius: var(--r-md);
  padding: var(--sp-3); display: flex; flex-direction: column; gap: .5rem;
}
.foto-hueco--hecho { border-style: solid; border-color: #86efac; background: #f0fdf4; }
.foto-hueco label { display: flex; flex-direction: column; gap: .2rem; font-size: .92rem; }
.foto-hueco__ayuda { font-weight: 400; font-size: .8rem; color: var(--u-text-muted); }

/* ---------- GESTOR DE JURADOS ---------------------------------------------- */
/* Atajo del jurado en el resumen: es su unica puerta al trabajo. */
.jurado-atajo {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap; padding: var(--sp-4); margin-bottom: var(--sp-5);
  border-radius: var(--r-lg); border: 1px solid #86efac; background: #f0fdf4;
}
.jurado-atajo strong { font-size: 1rem; }
.jurado-atajo p { margin: .25rem 0 0; font-size: .88rem; color: var(--u-text-muted); max-width: 60ch; }

.jurado-ficha { display: inline-flex; align-items: center; gap: .55rem; }
.jurado-foto {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--u-border); flex: 0 0 34px;
}
.jurado-foto--vacia {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--u-primary-light); color: var(--u-primary, #1c3f66);
  font-weight: 700; font-size: .95rem;
}
.jurado-form__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: var(--sp-3); margin-bottom: var(--sp-4);
}
@media (max-width: 1100px) { .jurado-form__grid { grid-template-columns: minmax(0,1fr); } }
.jurado-editar-fila td { background: #fafafa; border-bottom: 1px solid var(--u-border); }

/* Fila de edicion de la configuracion del concurso (premios, criterios...). */
.cfg-editar-fila td { background: #fafafa; border-bottom: 1px solid var(--u-border); }
.cfg-editar-fila summary { cursor: pointer; font-size: .85rem; color: var(--u-text-muted); }
.cfg-editar-fila summary:hover { color: var(--u-primary, #1c3f66); }
.cfg-editar-fila form { margin-top: var(--sp-3); }
.cfg-editar-fila .field > label[for] { display: block; margin-bottom: .25rem; }
.jurado-editar-fila summary { cursor: pointer; font-size: .85rem; color: var(--u-text-muted); }
.jurado-form { margin-top: var(--sp-3); }
/* Acciones de cada miembro del jurado, una debajo de otra: con los dos botones
   en la misma fila la columna ACCIONES se salia 60 px del panel a 1440. */
.jurado-acciones { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; }
.jurado-acciones form { margin: 0; }
.jurado-acciones .btn { white-space: nowrap; }

/* ---------- MI CUENTA ------------------------------------------------------ */
/* Dos columnas: los datos personales a la izquierda y la contrasena a la
   derecha. Y debajo, la casa (institucion, licencia, equipo...). */
.cuenta-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 1100px) { .cuenta-grid { grid-template-columns: minmax(0,1fr); } }

/* Tabla dentro de una columna estrecha (bases de datos propias). Si el
   contenido no cabe, se ajusta a la columna en vez de empujar la pagina:
   /admin/mi-cuenta desbordaba 35 px a la derecha en escritorio. */
.tabla--ajustada { width: 100%; table-layout: fixed; }
.tabla--ajustada th, .tabla--ajustada td { overflow-wrap: anywhere; }

.cuenta-dos { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--sp-3) var(--sp-4); }
.cuenta-tres { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--sp-3); }
@media (max-width: 900px) { .cuenta-dos, .cuenta-tres { grid-template-columns: minmax(0,1fr); } }

.cuenta-prefs { border: 1px solid var(--u-border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin: var(--sp-4) 0; }
.cuenta-prefs legend { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--u-text-muted); }
.cuenta-pref { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
.cuenta-pref input { width: 18px; height: 18px; margin-top: .15rem; }
.cuenta-pref__detalle { display: block; font-size: .8rem; color: var(--u-text-muted); font-weight: 400; }

.cuenta-marca { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4); }
.cuenta-color { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--u-border); display: inline-block; }
.cuenta-seguridad { margin: var(--sp-4) 0 0; font-size: .82rem; color: var(--u-text-muted); }
.cuenta-alta { margin-top: var(--sp-4); border-top: 1px solid var(--u-border); padding-top: var(--sp-3); }
.cuenta-alta summary { cursor: pointer; font-weight: 600; font-size: .9rem; }

/* ---------- NIVEL DE SEGURIDAD DEL VOTO ----------------------------------- */
/* El borde izquierdo y el color del nivel salen de aqui; el texto de cada nivel
   lo pone el modelo (Concurso::seguridadDelVoto), no esta escrito en la hoja. */
.seguridad-panel { border-left: 5px solid #9ca3af; }
.seguridad-panel.seguridad--alto  { border-left-color: #15803d; }
.seguridad-panel.seguridad--medio { border-left-color: #b45309; }
.seguridad-panel.seguridad--bajo  { border-left-color: #b41e2e; }

.seguridad-nivel { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.seguridad-nivel__etiqueta {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--u-text-muted); font-weight: 600;
}
.seguridad-nivel__badge { font-size: .95rem; padding: .2rem .8rem; }
.seguridad--alto  .seguridad-nivel__badge { background: #dcfce7; color: #14532d; }
.seguridad--medio .seguridad-nivel__badge { background: #fef3c7; color: #78350f; }
.seguridad--bajo  .seguridad-nivel__badge { background: #fee2e2; color: #7f1d1d; }
.seguridad-nivel__prueba { font-size: .8rem; color: var(--u-text-muted); }

.seguridad-porque { margin: 0 0 var(--sp-4); font-size: .95rem; }

.seguridad-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--sp-4); }
@media (max-width: 1100px) { .seguridad-grid { grid-template-columns: minmax(0,1fr); } }

.seguridad-bloque { border: 1px solid var(--u-border); border-radius: var(--r-lg); padding: var(--sp-4); }
.seguridad-bloque--si { background: #f0fdf4; border-color: #bbf7d0; }
.seguridad-bloque--no { background: #fff7ed; border-color: #fed7aa; }
.seguridad-bloque__titulo {
  margin: 0 0 var(--sp-3); font-size: .95rem; display: flex; align-items: center; gap: .5rem;
}
.seguridad-bloque--si .seguridad-bloque__titulo { color: #14532d; }
.seguridad-bloque--no .seguridad-bloque__titulo { color: #7c2d12; }
.seguridad-lista { margin: 0; padding-left: 1.1rem; font-size: .88rem; line-height: 1.55; }
.seguridad-lista li { margin-bottom: .4rem; }

/* ---------- INVITAR EMPRESAS ---------------------------------------------- */
/* Directorio a la izquierda y formulario a la derecha. En una sola columna por
   debajo de 1100 px, que es donde el panel se usa con la ventana partida. */
.invitar-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--sp-5); align-items: start;
}
@media (max-width: 1100px) { .invitar-grid { grid-template-columns: minmax(0, 1fr); } }

.invitar-fuentes { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.invitar-fuente {
  padding: .35rem .8rem; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--u-border); color: inherit; font-size: .85rem;
}
.invitar-fuente:hover { border-color: var(--u-primary, #1c3f66); }
.invitar-fuente.es-activa {
  background: var(--u-primary, #1c3f66); color: #fff; border-color: transparent; font-weight: 600;
}

.invitar-filtros {
  display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.invitar-filtros select, .invitar-filtros input[type=search] {
  padding: .35rem .5rem; border-radius: var(--r-md, 8px);
  border: 1px solid var(--g-border-control, #6b7280); background: var(--u-surface);
  color: inherit; font-size: .85rem; font-family: inherit;
}
.invitar-filtros input[type=search] { min-width: 180px; }

.invitar-categorias { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.invitar-categoria {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .8rem; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--u-border); color: inherit; font-size: .85rem;
}
.invitar-categoria:hover { border-color: var(--u-primary, #1c3f66); background: var(--u-primary-light); }
.invitar-categoria__n {
  font-size: .75rem; font-weight: 700; color: var(--u-text-muted);
  background: var(--u-surface); border-radius: 999px; padding: 0 .38rem;
}
/* El titulo del concurso es largo y el desplegable lo cortaba a media palabra. */
.selector-concurso select { max-width: 460px; }

.tabla-invitar td, .tabla-invitar th { vertical-align: middle; }
.tabla-invitar input[type=checkbox] { width: 18px; height: 18px; }
.tabla-invitar input[type=checkbox]:disabled { opacity: .45; }
@media (max-width: 767px) {
  .tabla-concursos { font-size: .85rem; }
  .tabla-concursos th, .tabla-concursos td { padding: .4rem .35rem; }
}
.cuenta-grid > * { min-width: 0; }
.cuenta-grid { padding-right: 4px; }
.cuenta-grid { padding-right: 8px; }
