/* ── PANEL DE CONTROL CSS ── */
:root {
  --bg-deep: #050505;
  --surface: rgba(18, 18, 22, 1);
  --border: rgba(255, 255, 255, 0.1);
  --orange: #FF8533;
  --violet: #B59BFF;
  --orange-dim: rgba(255, 133, 51, 0.28);
  --violet-dim: rgba(181, 155, 255, 0.28);
  --text: #ffffff;
  --muted: #a0a0a0;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
header {
  height: 64px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #000;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 24px; }

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.back-link:hover { color: var(--text); }

.title-group h1 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 2px;
}
.badge-status {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--orange);
}

.digital-clock {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── BENTO GRID ── */
main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto;
  gap: 20px;
}

.bento-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.widget-header h3 {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.icon-orange { color: var(--orange); }
.icon-violet { color: var(--violet); }

/* WIDGET A (Countdown & Calendar) */
.widget-a { grid-column: span 2; }
.widget-row {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}
.column-left { flex: 1.2; display: flex; flex-direction: column; gap: 12px; }
.column-right { flex: 1; }

.countdown-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px;
  background: #000;
  border-radius: 8px;
  height: 100%;
}
.countdown-item { display: flex; flex-direction: column; align-items: center; }
.countdown-item span { font-size: 2.2rem; font-weight: 900; line-height: 1; color: #fff; }
.countdown-item label { font-size: 0.55rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }
.countdown-separator { font-size: 1.2rem; font-weight: 300; opacity: 0.3; }

.training-summary {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.t-count { font-size: 1.8rem; font-weight: 900; color: var(--violet); }
.t-label { font-size: 0.6rem; font-weight: 800; color: var(--muted); letter-spacing: 0.05em; line-height: 1.2; }

/* MINI CALENDAR */
.mini-calendar {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  height: 100%;
}
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-title { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: #fff; letter-spacing: 0.05em; }
.cal-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; font-size: 0.8rem; display: flex; align-items: center; }
.cal-btn:hover { color: #fff; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day-header { font-size: 0.5rem; font-weight: 800; text-align: center; color: var(--muted); padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
  border: 1px solid transparent;
  line-height: 1;
}
.cal-day:hover:not(.day-official):not(.day-extra):not(.day-hito-concentracion):not(.day-hito-campeonato):not(.day-hito-competition) { background: rgba(255,255,255,0.07); color: #fff; }
.day-official {
  background: var(--orange-dim) !important;
  color: #fff !important;
  font-weight: 900;
  border: 2px solid rgba(255, 133, 51, 0.65) !important;
  border-radius: 6px !important;
  box-shadow: inset 0 0 0 1px rgba(255,133,51,0.15);
}
.day-official:hover { background: rgba(255,133,51,0.42) !important; }
.day-extra {
  background: var(--violet-dim) !important;
  color: #fff !important;
  font-weight: 900;
  border: 2px solid rgba(181, 155, 255, 0.65) !important;
  border-radius: 6px !important;
  box-shadow: inset 0 0 0 1px rgba(181,155,255,0.15);
}
.day-extra:hover { background: rgba(181,155,255,0.42) !important; }
.day-today { border-color: var(--orange) !important; color: #fff; }
.day-past { opacity: 0.2; pointer-events: none; }
.day-empty { pointer-events: none; }
/* Eventos del calendario — un color por tipo, sin mezcla */
.day-hito-concentracion {
  background: rgba(0, 198, 162, 0.18) !important;
  color: #00c6a2 !important;
  font-weight: 800;
  border: 2px solid rgba(0, 198, 162, 0.5) !important;
  border-radius: 6px !important;
}
.day-hito-campeonato {
  background: rgba(181, 155, 255, 0.22) !important;
  color: #d4bbff !important;
  font-weight: 900;
  border: 2px solid rgba(181, 155, 255, 0.6) !important;
  border-radius: 50% !important;
}
.day-hito-competition, .day-hito- {
  background: rgba(255, 107, 0, 0.15) !important;
  color: #ff6b00 !important;
  font-weight: 800;
  border: 2px solid rgba(255, 107, 0, 0.45) !important;
  border-radius: 50% !important;
}

/* Días con entreno (JU/SA) que TAMBIÉN tienen evento: mantiene color entreno + punto de evento abajo */
.has-event-campeonato::after,
.has-event-concentracion::after,
.has-event-competition::after,
.has-event-::after {
  content: '';
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  margin: 2px auto 0;
}
.has-event-campeonato::after    { background: #b57bee; }
.has-event-concentracion::after { background: #00c6a2; }
.has-event-competition::after   { background: #ff6b6b; }
.has-event-::after              { background: #f0b429; }
/* Asegurar que días con entreno + evento siguen siendo clicables */
.day-official.has-event-campeonato,
.day-official.has-event-concentracion,
.day-official.has-event-competition,
.day-extra.has-event-campeonato,
.day-extra.has-event-concentracion,
.day-extra.has-event-competition { cursor: pointer; }

table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
th { text-align: left; padding-bottom: 8px; color: var(--muted); text-transform: uppercase; font-size: 0.65rem; }
td { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }

/* ── FILAS DE EVENTO (nueva versión con color dinámico) ── */
.ev-row { background: var(--ev-bg); border-left: 3px solid var(--ev-borde); border-radius: 6px; transition: background 0.15s; }
.ev-row:hover { filter: brightness(1.15); }
.ev-row td { border-bottom: 1px solid rgba(255,255,255,0.03); vertical-align: middle; }
.ev-icono { width: 28px; font-size: 1rem; text-align: center; padding-left: 8px; }
.ev-info { padding: 9px 8px; }
.ev-nombre { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ev-color); line-height: 1.3; }
.ev-sede { display: block; font-size: 0.68rem; color: rgba(255,255,255,0.38); margin-top: 2px; }
.ev-fecha { text-align: right; padding-right: 10px; white-space: nowrap; }
.ev-fecha-txt { display: block; font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.8); }
.ev-dias { display: block; font-size: 0.62rem; color: var(--ev-color); margin-top: 1px; font-weight: 600; }

/* WIDGET B (Foco Trabajable - GRID) */
.widget-b { grid-column: span 2; grid-row: span 2; }
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.profile-card {
  background: #000;
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
  position: relative;
}
.btn-delete-card {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.2);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 4px;
  transition: color 0.2s;
}
.btn-delete-card:hover { color: #ff4444; }
.p-header { 
  font-size: 0.8rem; font-weight: 800; color: var(--orange); margin-bottom: 8px; letter-spacing: 0.05em; 
  display: flex; align-items: center; gap: 10px;
}
.status-indicator {
  width: 12px; height: 12px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  transition: all 0.3s;
}
.status-indicator.VERDE { background: #45ea8a; box-shadow: 0 0 10px rgba(69, 234, 138, 0.4); }
.status-indicator.AMARILLO { background: #facc15; box-shadow: 0 0 10px rgba(250, 204, 21, 0.4); }
.status-indicator.ROJO { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
.status-indicator:hover { transform: scale(1.2); }
.editable-focus {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  outline: none;
  min-height: 2.8rem;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}
.editable-focus:focus {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

/* WIDGET C (Infographic) */
.widget-c { grid-column: span 2; }
.infographic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.info-card {
  padding: 12px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.info-header { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; margin-bottom: 6px; }
.info-body { font-size: 0.7rem; color: var(--muted); }

.alert-red { border-top: 3px solid #cc3333; }
.alert-orange { border-top: 3px solid var(--orange); }
.alert-yellow { border-top: 3px solid #ffcc00; }
.alert-blue { border-top: 3px solid #3366cc; }
.alert-green { border-top: 3px solid #33cc66; }

/* WIDGET D (Doctrine) */
.widget-d { grid-column: span 2; }
.mantra {
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 0.05em;
  color: #fff;
}
.sequence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.seq-step { 
  display: flex; align-items: center; gap: 8px;
  font-size: 0.7rem; font-weight: 800; color: var(--muted);
}
.seq-step span {
  width: 22px; height: 22px;
  background: var(--violet);
  color: #000;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
.seq-arrow { font-size: 0.8rem; color: rgba(255,255,255,0.1); }

.crisis-management { display: flex; gap: 12px; }
.crisis-card {
  flex: 1;
  padding: 12px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.crisis-card h4 { font-size: 0.65rem; font-weight: 800; color: var(--violet); margin-bottom: 4px; text-transform: uppercase; }
.crisis-card p { font-size: 0.7rem; color: var(--muted); }

/* WIDGET E (Biblioteca Táctica - GRID DE FICHAS) */
.widget-e { grid-column: span 2; }
.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px;
}

.st-card {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.st-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.st-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.st-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.st-card:hover .st-thumb img {
  opacity: 1;
}

.st-thumb .file-icon {
  width: 40px;
  height: 40px;
  color: var(--muted);
  opacity: 0.5;
}

.st-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.st-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-st {
  flex: 1;
  padding: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
}

.btn-st:hover {
  background: var(--violet);
  color: #000;
  border-color: var(--violet);
}

.btn-st.danger:hover {
  background: #ff4444;
  color: #fff;
  border-color: #ff4444;
}

/* BOTONES Y MODAL */
.btn-mini-add {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--orange);
  font-size: 0.6rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-mini-add:hover { background: var(--orange); color: #000; border-color: var(--orange); }

.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  display: none;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
}
.modal-content h3 { font-size: 0.9rem; margin-bottom: 20px; color: var(--orange); letter-spacing: 0.1em; }

.custom-select-dark {
  width: 100%;
  background: #000;
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  outline: none;
}

/* Modal Gestión Focos */
.modal-gestion { max-width: 360px; width: 92%; }
.gestion-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}
.gestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.gestion-item.gestion-active {
  background: rgba(69,234,138,0.06);
  border-color: rgba(69,234,138,0.22);
}
.gestion-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.gestion-item.gestion-active .gestion-name { color: #45ea8a; }
.btn-gestion-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-gestion-add:hover { border-color: var(--orange); color: var(--orange); }
.btn-gestion-remove { border-color: rgba(69,234,138,0.35); color: #45ea8a; }
.btn-gestion-remove:hover { border-color: #ff4444; color: #ff4444; }

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.btn-cancel, .btn-confirm {
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--border);
}
.btn-cancel { background: transparent; color: var(--muted); }
.btn-confirm { background: var(--violet); color: #000; border-color: var(--violet); }

.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
}

/* WIDGET F (Tiradores Roster) */
.widget-f {
  grid-column: 5 / 6;
  grid-row: 1 / 4;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.tiradores-roster {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.roster-item:hover {
  background: rgba(255,255,255,0.05);
}
.roster-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-item:hover .roster-name { color: var(--orange); }
.roster-arrow {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.15);
  transition: color 0.2s;
}
.roster-item:hover .roster-arrow { color: var(--orange); }

/* Modo gestión */
.roster-item.manage-mode { cursor: default; }
.roster-item.manage-mode:hover { background: transparent; }
.btn-roster-hide {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-roster-hide:hover { border-color: #ff4444; color: #ff4444; }
.btn-roster-show {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-roster-show:hover { border-color: #45ea8a; color: #45ea8a; }

.roster-hidden-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.roster-hidden-title {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding: 0 12px;
}
.roster-item-hidden .roster-name {
  color: var(--muted);
  opacity: 0.5;
}

/* FOOTER BAR */
.action-bar-fixed {
  margin-top: 24px;
  padding: 24px 0 48px;
  display: flex;
  justify-content: center;
  gap: 32px;
  border-top: 1px solid var(--border);
}
.action-bar-fixed a {
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.action-bar-fixed a:hover { color: #fff; }
.bar-icon {
  font-size: 1.3rem;
  line-height: 1;
}
.bar-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  max-width: 72px;
  line-height: 1.2;
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  main { grid-template-columns: repeat(2, 1fr); }
  .widget-f { grid-column: span 2; grid-row: auto; max-height: none; }
  .tiradores-roster { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .roster-item { flex: 0 0 auto; }
}

@media (max-width: 768px) {
  main { grid-template-columns: 1fr; padding: 12px; padding-bottom: 80px; gap: 12px; }
  .bento-item { grid-column: span 1 !important; grid-row: auto !important; padding: 16px; border-radius: 10px; }

  /* Orden por prioridad en móvil */
  .widget-a { order: 1; }
  .widget-b { order: 2; }
  .widget-c { order: 3; }
  .widget-d { order: 4; }
  .widget-e { order: 5; }
  .widget-f { order: 6; display: none; } /* Oculto: acceso a fichas ya va desde foco */

  .widget-header { margin-bottom: 12px; padding-bottom: 8px; }
  .widget-header h3 { font-size: 0.65rem; }

  /* Widget-B entero colapsable en móvil */
  .widget-b .profiles-grid {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, margin 0.25s ease;
    margin-top: 0;
  }
  .widget-b.foco-widget-open .profiles-grid {
    max-height: 600px;
    overflow-y: auto;
    opacity: 1;
    margin-top: 8px;
  }
  .widget-b .widget-header {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    border-radius: 8px;
    transition: background 0.2s;
  }
  /* Cuando está colapsado: fondo naranja sutil para indicar que es interactivo */
  .widget-b:not(.foco-widget-open) .widget-header {
    background: rgba(255,107,0,0.07);
    border: 1px solid rgba(255,107,0,0.25);
    padding: 8px 10px;
    margin: -8px -10px 0;
  }
  .widget-b.foco-widget-open .widget-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .widget-b .widget-header::after {
    content: '';
    width: 8px; height: 8px;
    border-right: 2px solid var(--orange);
    border-bottom: 2px solid var(--orange);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: 8px;
  }
  .widget-b.foco-widget-open .widget-header::after {
    transform: rotate(-135deg);
  }
  /* Hint textual debajo del título cuando colapsado */
  .widget-b:not(.foco-widget-open) .widget-header h3::after {
    content: ' — toca para ver';
    font-weight: 400;
    font-size: 0.55rem;
    color: var(--orange);
    opacity: 0.7;
    letter-spacing: 0.03em;
    text-transform: none;
  }
  /* Contador de focos visible cuando colapsado */
  .widget-b .foco-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,107,0,0.15);
    color: var(--orange);
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 6px;
    margin-left: 8px;
  }
  .widget-b.foco-widget-open .foco-count-badge {
    display: none;
  }

  /* Foco cards — colapsable en móvil */
  .profiles-grid { grid-template-columns: 1fr; gap: 6px; }
  .profile-card {
    padding: 10px 12px;
    cursor: pointer;
    border-left: 3px solid var(--orange);
  }
  .profile-card .editable-focus {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 8px;
    margin: 0;
    font-size: 0.75rem;
    border: none;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease, margin 0.3s ease;
  }
  .profile-card.foco-open .editable-focus {
    max-height: 200px;
    overflow: visible;
    opacity: 1;
    padding: 8px;
    margin-top: 8px;
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 6px;
    min-height: 48px;
  }
  .profile-card.foco-open .editable-focus:focus {
    border-color: var(--orange);
    border-style: solid;
  }
  .p-header {
    font-size: 0.75rem;
    position: relative;
    padding-right: 30px; /* espacio para que el chevron no solape con el botón ✕ */
  }
  .p-header::after {
    content: '';
    width: 8px; height: 8px;
    border-right: 2px solid rgba(255,255,255,0.3);
    border-bottom: 2px solid rgba(255,255,255,0.3);
    transform: rotate(45deg);
    transition: transform 0.2s;
    margin-left: auto;
    flex-shrink: 0;
  }
  .profile-card.foco-open .p-header::after {
    transform: rotate(-135deg);
  }
  .status-indicator { width: 14px; height: 14px; min-width: 14px; }
  .btn-delete-card { padding: 6px; }

  /* Calendario */
  .widget-row { flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .countdown-container { gap: 12px; padding: 12px; }
  .countdown-item span { font-size: 1.6rem; }
  .cal-day { font-size: 0.55rem; }
  .training-summary { padding: 10px; gap: 10px; }
  .t-count { font-size: 1.4rem; }

  /* Conflictos */
  .infographic-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .info-card { padding: 10px; }
  .info-header { font-size: 0.6rem; }
  .info-body { font-size: 0.6rem; }

  /* Doctrina */
  .mantra { font-size: 1rem; margin-bottom: 16px; }
  .sequence { flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
  .seq-arrow { display: none; }
  .seq-step { font-size: 0.6rem; }
  .seq-step span { width: 18px; height: 18px; font-size: 0.6rem; }
  .crisis-management { flex-direction: column; gap: 8px; }
  .crisis-card h4 { font-size: 0.6rem; }
  .crisis-card p { font-size: 0.6rem; }

  /* Biblioteca */
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: 400px; overflow-y: auto; }
  .st-name { font-size: 0.65rem; }
  .btn-st { font-size: 0.6rem; padding: 8px 4px; min-height: 36px; }

  /* Header */
  .header-left { gap: 12px; }
  .title-group h1 { font-size: 0.8rem; letter-spacing: 0.08em; }
  .badge-status { font-size: 0.45rem; }
  header { padding: 0 12px; height: 52px; }
  .digital-clock { font-size: 0.75rem; }
  .back-link { font-size: 0.65rem; }

  /* Modal */
  .modal-content { padding: 20px; }
  .btn-cancel, .btn-confirm { padding: 10px 16px; min-height: 44px; }
  .btn-mini-add { min-height: 36px; padding: 6px 12px; }

  /* Footer fijo en móvil */
  .action-bar-fixed {
    position: fixed; bottom: 0; left: 0; right: 0;
    margin: 0; padding: 10px 16px env(safe-area-inset-bottom, 10px);
    background: rgba(0,0,0,0.95); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100; gap: 0; justify-content: space-around;
    border-top: 1px solid var(--border);
  }
  .action-bar-fixed a { padding: 6px 8px; min-height: 48px; flex-direction: column; align-items: center; justify-content: center; }
  .bar-icon { font-size: 1.2rem; }
  .bar-label { font-size: 0.52rem; max-width: 68px; }
}

/* ── MÓVIL PEQUEÑO ── */
@media (max-width: 480px) {
  .infographic-grid { grid-template-columns: 1fr; }
  .countdown-item span { font-size: 1.3rem; }
  .countdown-container { gap: 10px; padding: 10px; }
  .st-grid { grid-template-columns: 1fr 1fr; }
}

/* ── TOUCH DEVICES ── */
@media (hover: none) and (pointer: coarse) {
  .btn-mini-add, .btn-cancel, .btn-confirm, .btn-st, .btn-delete-card,
  .btn-gestion-toggle, .cal-btn { min-height: 44px; }
  .gestion-item { min-height: 44px; }
  .status-indicator { width: 18px; height: 18px; min-width: 18px; }
  .custom-select-dark { min-height: 44px; }
}

/* ── LINK A FICHA DESDE FOCO ── */
.shooter-ficha-link {
  color: var(--orange);
  text-decoration: none;
  font-weight: 800;
  font-size: inherit;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.shooter-ficha-link:hover { color: #fff; }
