* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === NUEVO: evitar scroll horizontal global y forzar buen wrap === */
html, body {
    width: 100%;
    max-width: 100%;
}

/* Tipografía general */
body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.4;
    overflow-x: hidden; /* importante para móvil */
}

/* Contenedores */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

/* Tarjetas */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 1rem 1.3rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

/* Títulos */
h1, h2, h3 {
    margin-bottom: .7rem;
    font-weight: 600;
    color: #222;
    word-wrap: break-word;         /* NUEVO */
    overflow-wrap: anywhere;       /* NUEVO */
}

/* Botones */
.btn {
    display: inline-block;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    border: none;
}

.btn-primary {
    background: #0077ff;
    color: #fff;
}
.btn-primary:hover {
    background: #005fd6;
}

.btn-danger {
    background: #e53935;
    color: #fff;
}
.btn-danger:hover {
    background: #c62828;
}

.btn-success {
    background: #43a047;
    color: #fff;
}
.btn-success:hover {
    background: #2e7d32;
}

/* Tabla base */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: .7rem;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

/* El texto “libre” solo en celdas de datos, no en los encabezados */
.table td {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Los TH mejor en una sola línea para que no hagan “F e c h a” */
.table th {
    white-space: nowrap;
}

.table tr:hover {
    background: #f0f0f0;
}

/* === NUEVO: wrapper genérico para tablas muy anchas en paneles admin === */
.admin-table-scroll {
    margin-top: 0.75rem;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-table-scroll table {
    width: 100%;
    border-collapse: collapse;
}

/* Estados (para asistencia, grupos, etc.) */
.state-ok { background: #e8f5e9; }
.state-pending { background: #fff8e1; }
.state-bad { background: #ffebee; }


/* ===========================================================
   ESTILOS ESPECÍFICOS PANEL ADMIN
   (scoped por clases .admin- para no molestar al resto)
   =========================================================== */

:root {
    --admin-bg: #f3f4f6;
    --admin-sidebar-bg: #111827;
    --admin-sidebar-bg-hover: #1f2937;
    --admin-sidebar-text: #e5e7eb;
    --admin-sidebar-text-active: #ffffff;
    --admin-accent: #2563eb;
    --admin-accent-soft: #dbeafe;
    --admin-border: #e5e7eb;
    --admin-card-bg: #ffffff;
    --admin-text-main: #111827;
    --admin-text-muted: #6b7280;
    --admin-danger: #dc2626;
    --admin-warning: #f59e0b;
    --admin-success: #16a34a;
    --admin-radius-lg: 16px;
    --admin-radius-xl: 20px;
    --admin-shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.12);
    --admin-shadow-subtle: 0 4px 12px rgba(15, 23, 42, 0.08);
    --admin-transition-fast: 150ms ease-out;
}

body.admin-body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e0f2fe, #eef2ff 35%, #f9fafb 70%);
    color: var(--admin-text-main);
    min-height: 100vh;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */

.admin-sidebar {
    width: 260px;
    background: radial-gradient(circle at top, #0f172a, #020617);
    color: var(--admin-sidebar-text);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;

    /* 🔧 Clave para el scroll del menú */
    max-height: 100vh;      /* no crece más que la ventana */
    overflow-y: auto;       /* scroll interno del menú */

    position: sticky;
    top: 0;
    align-self: flex-start;
    z-index: 10;
}


.admin-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.admin-logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0%, #38bdf8, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #eff6ff;
    box-shadow: var(--admin-shadow-soft);
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
}

.admin-brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e5e7eb;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    word-wrap: break-word;        /* NUEVO */
    overflow-wrap: anywhere;      /* NUEVO */
}

.admin-brand-sub {
    font-size: 0.75rem;
    color: #9ca3af;
}

.admin-nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin: 0.75rem 0 0.35rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 1.5rem;
}

.admin-nav a {
    text-decoration: none;
    color: var(--admin-sidebar-text);
    font-size: 0.9rem;
    padding: 0.55rem 0.7rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: background var(--admin-transition-fast), color var(--admin-transition-fast), transform 120ms ease-out;
    position: relative;
}

.admin-nav a:hover {
    background: rgba(148, 163, 184, 0.18);
    transform: translateX(2px);
}

.admin-nav a.active {
    background: linear-gradient(90deg, #2563eb, #22c55e);
    color: var(--admin-sidebar-text-active);
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(191, 219, 254, 0.3);
}

.admin-nav-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.65);
}

.admin-nav a.active .admin-nav-pill-dot {
    background: #eff6ff;
}

.admin-nav-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-nav-tag {
    font-size: 0.65rem;
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #9ca3af;
}

.admin-nav a.active .admin-nav-tag {
    border-color: rgba(248, 250, 252, 0.95);
    color: #eff6ff;
}

/* SIDEBAR FOOTER */

.admin-sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: #6b7280;
    border-top: 1px solid rgba(55, 65, 81, 0.8);
    padding-top: 0.85rem;
}

/* MAIN AREA */

.admin-main {
    flex: 1;
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-width: 0; /* NUEVO: evita desbordes por contenido */
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.admin-header-titles {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0; /* NUEVO */
}

.admin-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    word-wrap: break-word;         /* NUEVO */
    overflow-wrap: anywhere;       /* NUEVO */
}

.admin-page-subtitle {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap; /* NUEVO: que baje a varias líneas en móvil */
}

/* Selects del header (campamento, etc.) */
.admin-header-actions select,
.admin-select {
    max-width: 100%;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
}

/* Botones admin */

.btn-admin {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    background: #0f172a;
    color: #e5e7eb;
    box-shadow: var(--admin-shadow-subtle);
    transition: transform var(--admin-transition-fast), box-shadow var(--admin-transition-fast), filter 120ms ease-out;
    white-space: nowrap;
}

.btn-admin:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}

.btn-admin-secondary {
    display:inline-block;
    background:#e8ecff;
    border:1px solid #c7d2fe;
    color:#1e3a8a;
    padding:0.45rem 0.9rem;
    font-size:0.85rem;
    border-radius:10px;
    cursor:pointer;
    transition:0.15s ease-in-out;
    white-space: nowrap;
}

.btn-admin-secondary:hover {
    background:#dbe3ff;
    border-color:#b4c2ff;
}

.btn-admin-secondary:active {
    transform:scale(0.97);
}

/* CONTENT WRAPPER */

.admin-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* DASHBOARD GRID */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.dashboard-card {
    background: var(--admin-card-bg);
    border-radius: var(--admin-radius-xl);
    padding: 0.9rem 1rem;
    box-shadow: var(--admin-shadow-subtle);
    border: 1px solid rgba(209, 213, 219, 0.7);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 55%);
    pointer-events: none;
}

.dashboard-card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--admin-text-muted);
    margin-bottom: 0.25rem;
}

.dashboard-card-value {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.dashboard-card-footer {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--admin-text-muted);
}

/* RESPONSIVE GENERAL PANEL ADMIN */

/* Tablet / móvil: sidebar como menú lateral deslizable */
@media (max-width: 960px) {

    .admin-shell {
        position: relative;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform var(--admin-transition-fast);
        z-index: 50;
        align-self: stretch;
    }

    .admin-sidebar.is-open {
        transform: translateX(0);
    }

    .admin-main {
        padding: 1rem 0.85rem;
    }

    /* Botón hamburguesa (solo móvil) */
    .admin-mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        border-radius: 999px;
        border: 1px solid #d1d5db;
        background: #ffffff;
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(15,23,42,0.08);
    }

    .admin-mobile-menu-toggle span {
        font-weight: 600;
    }

    /* Icono hamburguesa sencillo */
    .admin-mobile-menu-toggle .burger {
        width: 14px;
        height: 2px;
        border-radius: 999px;
        background:#111827;
        position: relative;
    }
    .admin-mobile-menu-toggle .burger::before,
    .admin-mobile-menu-toggle .burger::after {
        content:"";
        position:absolute;
        left:0;
        width:100%;
        height:2px;
        border-radius:999px;
        background:#111827;
    }
    .admin-mobile-menu-toggle .burger::before { top:-4px; }
    .admin-mobile-menu-toggle .burger::after  { top: 4px; }

    /* Overlay oscuro detrás del menú */
    .admin-mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--admin-transition-fast);
        z-index: 40;
    }
    .admin-mobile-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }
}

/* En escritorio, el botón de menú no se muestra */
@media (min-width: 961px) {
    .admin-mobile-menu-toggle {
        display: none;
    }
    .admin-mobile-overlay {
        display: none;
    }
}


/* Móvil puro */
@media (max-width: 768px) {

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-header-actions > * {
        flex: 1 1 100%;
    }

    .admin-header-actions select,
    .admin-header-actions .btn-admin,
    .admin-header-actions .btn-admin-secondary {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* Dashboard: tarjetas en una sola columna si el ancho es muy pequeño */
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-card {
        padding: 0.8rem 0.9rem;
    }

    /* Tablas: un poco menos de padding en móvil */
    .table th,
    .table td {
        padding: 0.55rem 0.45rem;
        font-size: 0.82rem;
    }
}

/* Aún más pequeño (móviles muy estrechos) */
@media (max-width: 480px) {
    .dashboard-card-value {
        font-size: 1.25rem;
    }

    .admin-page-title {
        font-size: 1.1rem;
    }
}


/* ===========================================================
   FORMULARIOS PANEL ADMIN (inputs, labels, tarjetas)
   =========================================================== */

/* Sección centrada (como usamos en acceso_camp, identificar_familia...) */
.admin-section {
    max-width: 900px;
    margin: 1.5rem auto;
    padding: 0 0.25rem; /* un pelín de respiro en móvil */
}

/* Tarjeta de contenido principal */
.admin-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem 1.8rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(209, 213, 219, 0.8);
}

/* Etiquetas de formulario */
.admin-label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* Inputs de formulario */
.admin-input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    outline: none;
    background-color: #f9fafb;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.admin-input:focus {
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* Por si algún textarea usa admin-input */
textarea.admin-input {
    min-height: 80px;
    resize: vertical;
}

/* Grid simple de formulario (como usamos en identificar_familia) */
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .admin-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-form-grid > div {
        min-width: 0;
    }
}

/* =========================================
   INSCRIPCIÓN – Progreso de pasos en móvil
   ========================================= */
@media (max-width: 768px) {

  /* La card de pasos ocupa menos alto y se hace scroll horizontal */
  .steps-card {
    margin-bottom: 0.75rem;
  }

  .steps-progress {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    margin-left: -0.75rem;   /* que “llene” el ancho */
    margin-right: -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .steps-progress::-webkit-scrollbar {
    height: 4px;
  }

  .steps-progress::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
  }

  .steps-progress .step-pill {
    flex: 0 0 auto;
  }

  /* Texto más pequeño para que quepan mejor */
  .steps-progress .step-pill-label {
    font-size: 0.72rem;
    max-width: 140px;
    white-space: normal;
  }
}

/* =======================================
   BANNER SUPERIOR ESTILO "CARD AMARILLA"
======================================= */

.monitor-top-banner {
    width: 100%;
    
    border-bottom: 1px solid transparent;
    padding: 1rem 0;
    box-sizing: border-box;
}

/* Contenedor tipo card */
.monitor-top-banner-content {
    max-width: 1200px;
    margin: auto;
    padding: 1rem 1.25rem;

    background: #fff3bf;                /* un tono más cálido */
    border: 1px solid #facc15;          /* borde amarillo */
    border-radius: 14px;                /* igual que los paneles internos */
    box-shadow: 0 3px 8px rgba(0,0,0,0.08); /* misma sombra que tus tarjetas */

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.monitor-top-banner-text {
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.35;
}

/* Botones flex igual que en los paneles */
.monitor-top-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Vista móvil */
@media (max-width: 768px) {
    .monitor-top-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .monitor-top-banner-actions {
        width: 100%;
    }
    .monitor-top-banner-actions button {
        width: 100%;
        text-align: center;
    }
}

/* =======================================
   BOTÓN ADMIN – DANGER (rojo suave)
======================================= */
.btn-admin-danger {
    background: #fee2e2;            /* rojo claro */
    color: #b91c1c;                 /* rojo intenso */
    border: 1px solid #fca5a5;      /* borde rojo medio */
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--admin-radius, 6px);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-admin-danger:hover {
    background: #fecaca;            /* hover rojo un poco más fuerte */
    border-color: #f87171;
}

.btn-admin-danger:active {
    background: #fca5a5;
    border-color: #ef4444;
}    


/* Acordeones informativos */
.info-deadlines {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  margin: 0.55rem 0;
}

/* Cabecera */
.info-deadlines > summary {
  cursor: pointer;
  padding: 0.65rem 0.9rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #111827;
  list-style: none;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.info-deadlines > summary::-webkit-details-marker {
  display: none;
}

.info-deadlines > summary::after {
  content: "▾";
  opacity: 0.7;
  flex: 0 0 auto;
}

.info-deadlines[open] > summary::after {
  content: "▴";
}

/* Separador cuando está abierto */
.info-deadlines[open] > summary {
  border-bottom: 1px solid #eef2f7;
}

/* Cuerpo: AQUÍ estaba el fallo (faltaba padding) */
.info-deadlines-body {
  padding: 0.75rem 0.9rem 0.9rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #111827;
}

/* Título principal dentro del acordeón */
.info-deadlines-body .info-title {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 0.15rem;
}

/* Texto secundario (dirección, aclaraciones) */
.info-deadlines-body .info-sub {
  display: block;
  color: #374151;
}


