﻿/* ═══════════════════════════════════════════════════════════════════════════
   TodosLosModulos.css  —  v4 · Rediseño editorial
   -----------------------------------------------------------------------
   Paleta principal:
     --ink-900   #0F1923   Texto primario / fondo oscuro
     --ink-600   #374151   Texto secundario
     --ink-300   #9CA3AF   Texto terciario / etiquetas
     --ink-100   #F3F4F6   Fondo neutro
     --ink-50    #F9FAFB   Fondo de página
     --paper     #FFFFFF   Fondo de tarjeta

   Acentos por estado:
     Activo      --green-600 #4D7C0F  /  --green-50 #F0FDF4
     No empezado --blue-600  #2563EB  /  --blue-50  #EFF6FF
     Finalizado  --slate-500 #64748B  /  --slate-50 #F8FAFC
     Cancelado   --red-600   #DC2626  /  --red-50   #FFF5F5

   Tipografía:
     Display  — "Sora" (Google Fonts), geométrica y moderna
     Cuerpo   — "DM Sans", extremadamente legible y elegante

   Importar en <head> del master page:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,400&family=Sora:wght@600;700;800&display=swap" rel="stylesheet">
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Variables globales ─────────────────────────────────────────────────── */

:root {
    /* Neutros */
    --ink-900: #0F1923;
    --ink-700: #1F2937;
    --ink-600: #374151;
    --ink-400: #6B7280;
    --ink-300: #9CA3AF;
    --ink-200: #E5E7EB;
    --ink-100: #F3F4F6;
    --ink-50: #F9FAFB;
    --paper: #FFFFFF;
    /* Marca / primario */
    --brand-700: #0C447C;
    --brand-600: #1A5FA8;
    --brand-500: #2979D0;
    --brand-100: #DBEAFE;
    --brand-50: #EFF6FF;
    /* Estados */
    --activo-bg: #F0FDF4;
    --activo-text: #14532D;
    --activo-dot: #4D7C0F;
    --activo-band: #65A30D;
    --noempezado-bg: #EFF6FF;
    --noempezado-text: #1E3A8A;
    --noempezado-dot: #2563EB;
    --noempezado-band: #3B82F6;
    --finalizado-bg: #F8FAFC;
    --finalizado-text: #334155;
    --finalizado-dot: #64748B;
    --finalizado-band: #94A3B8;
    --cancelado-bg: #FFF5F5;
    --cancelado-text: #7F1D1D;
    --cancelado-dot: #DC2626;
    --cancelado-band: #EF4444;
    /* Espaciado */
    --sp-xs: 0.375rem; /*  6px */
    --sp-sm: 0.75rem; /* 12px */
    --sp-md: 1.25rem; /* 20px */
    --sp-lg: 2rem; /* 32px */
    --sp-xl: 3rem; /* 48px */
    /* Radios */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-pill: 999px;
    /* Tipografía */
    --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    /* Sombras */
    --shadow-card: 0 2px 8px rgba(15,25,35,.06), 0 1px 2px rgba(15,25,35,.04);
    --shadow-hover: 0 16px 40px rgba(15,25,35,.12), 0 4px 12px rgba(15,25,35,.06);
    --shadow-focus: 0 0 0 3px rgba(41,121,208,.25);
    /* Transiciones */
    --ease-card: cubic-bezier(0.22, 1, 0.36, 1);
}


/* ─── Tipografía base ────────────────────────────────────────────────────── */

.modulos-section,
.filtros-bar,
.paginacion-wrapper {
    font-family: var(--font-body);
    color: var(--ink-700);
    -webkit-font-smoothing: antialiased;
}


/* ═══════════════════════════════════════════════════════════════════════════
   BARRA DE FILTROS
   ═══════════════════════════════════════════════════════════════════════════ */

.filtros-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1.5rem 0 0.75rem;
    max-width: 780px; /* ampliado para dar cabida al select */
    flex-wrap: wrap; /* en pantallas estrechas los controles se apilan */
}


/* ─── Select de área ─────────────────────────────────────────────────────── */

/*
   Envolvemos el <select> en un <div class="filtro-select-wrapper"> para poder
   pintar el icono chevron personalizado encima, ya que el select nativo no
   permite estilar la flecha de forma cruzada entre navegadores.
*/
.filtro-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.filtro-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}
.filtro-select-wrapper {
    position: relative;
    flex: 1;
}

    .filtro-select-wrapper .filtro-select {
        width: 100%;
        appearance: none;
        -webkit-appearance: none;
        padding-right: 36px; /* espacio para la flecha */
    }

    .filtro-select-wrapper .select-chevron {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        color: #555;
    }
/* El <select> propiamente dicho */
.filtro-select,
select[id$="ddlCentro"] {
    height: 46px;
    padding: 0 2.75rem 0 1rem; /* derecha: espacio para el chevron */
    border: 1.5px solid var(--ink-200);
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-700);
    background: var(--paper);
    outline: none;
    cursor: pointer;
    /* Ocultar la flecha nativa del navegador */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Limitar anchura: suficiente para los nombres de área habituales */
    min-width: 180px;
    max-width: 260px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .filtro-select:hover,
    select[id$="ddlCentro"]:hover {
        border-color: var(--ink-300);
    }

    .filtro-select:focus,
    select[id$="ddlCentro"]:focus {
        border-color: var(--brand-500);
        box-shadow: var(--shadow-focus);
    }

/* Chevron SVG superpuesto (no interactivo) */
.select-chevron {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* deja pasar los clics al select */
    color: var(--ink-400);
    flex-shrink: 0;
    transition: color .2s ease;
}

/* Al hacer focus/hover el chevron toma el color de marca */
.filtro-select-wrapper:focus-within .select-chevron,
.filtro-select-wrapper:hover .select-chevron {
    color: var(--brand-500);
}

/* Input de búsqueda */
input[id$="txtFiltro"],
.filtros-bar input[type="text"] {
    flex: 1;
    height: 46px;
    padding: 0 1rem;
    border: 1.5px solid var(--ink-200);
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--ink-900);
    background: var(--paper);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    input[id$="txtFiltro"]::placeholder,
    .filtros-bar input[type="text"]::placeholder {
        color: var(--ink-300);
    }

    input[id$="txtFiltro"]:focus,
    .filtros-bar input[type="text"]:focus {
        border-color: var(--brand-500);
        box-shadow: var(--shadow-focus);
    }

/* Botón Filtrar */
input[id$="btnFiltrar"],
.filtros-bar input[type="submit"] {
    height: 46px;
    padding: 0 22px;
    background: var(--brand-600);
    color: var(--paper);
    border: none;
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background .2s ease, transform .15s var(--ease-card), box-shadow .2s ease;
    white-space: nowrap;
}

    input[id$="btnFiltrar"]:hover,
    .filtros-bar input[type="submit"]:hover {
        background: var(--brand-700);
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(26,95,168,.28);
    }

    input[id$="btnFiltrar"]:active,
    .filtros-bar input[type="submit"]:active {
        transform: translateY(0);
        box-shadow: none;
    }

    input[id$="btnFiltrar"]:focus-visible,
    .filtros-bar input[type="submit"]:focus-visible {
        outline: none;
        box-shadow: var(--shadow-focus);
    }


/* ═══════════════════════════════════════════════════════════════════════════
   SECCIÓN PRINCIPAL
   ═══════════════════════════════════════════════════════════════════════════ */

.modulos-section {
    padding: 1.5rem 0 5rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MENSAJES DE ERROR Y VACÍO
   ═══════════════════════════════════════════════════════════════════════════ */

/* Error de carga */
.modulos-error {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #FFF5F5;
    border: 1.5px solid #FECACA;
    border-radius: var(--r-md);
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.75rem;
    color: var(--cancelado-text);
    animation: fadeSlideDown .3s var(--ease-card);
}

    /* Icono de alerta (decorativo SVG inline via background) */
    .modulos-error::before {
        content: '';
        flex-shrink: 0;
        width: 22px;
        height: 22px;
        margin-top: 1px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
    }

    .modulos-error strong {
        display: block;
        font-size: 0.92rem;
        font-weight: 700;
        margin-bottom: 2px;
    }

    .modulos-error small {
        font-size: 0.82rem;
        opacity: 0.75;
        line-height: 1.5;
    }

/* Estado vacío — úsalo con un asp:Panel adicional cuando rptModulos no tenga items */
.modulos-vacio {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--ink-400);
    animation: fadeSlideDown .3s var(--ease-card);
}

.modulos-vacio-icono {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    background: var(--ink-100);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modulos-vacio-titulo {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink-700);
    margin-bottom: 0.5rem;
}

.modulos-vacio-desc {
    font-size: 0.9rem;
    color: var(--ink-400);
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.6;
}


/* ═══════════════════════════════════════════════════════════════════════════
   GRID DE TARJETAS
   ═══════════════════════════════════════════════════════════════════════════ */

.modulos-grid {
    display: grid;
    /* 
      Mínimo 300px; se ajusta automáticamente entre 1 y 3 columnas según el 
      espacio disponible: 1 col en móvil, 2 en tablet, 3 en escritorio.
    */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.375rem;
    margin-top: 1.75rem;
    /* Animación de aparición escalonada para los hijos */
    --stagger: 40ms;
}

/* Efecto de entrada escalonado para cada tarjeta */
.modulo-card-wrapper {
    width: 350px; /* ANCHO ESTÁTICO */
    flex: 0 0 350px; /* Evita que crezcan o encojan */
    margin-bottom: 20px;
}

    /* Cada elemento retrasa la animación en función de su posición (nth-child) */
    .modulo-card-wrapper:nth-child(1) {
        animation-delay: calc(1 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(2) {
        animation-delay: calc(2 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(3) {
        animation-delay: calc(3 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(4) {
        animation-delay: calc(4 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(5) {
        animation-delay: calc(5 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(6) {
        animation-delay: calc(6 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(7) {
        animation-delay: calc(7 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(8) {
        animation-delay: calc(8 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(9) {
        animation-delay: calc(9 * var(--stagger));
    }

    .modulo-card-wrapper:nth-child(n+10) {
        animation-delay: calc(10 * var(--stagger));
    }


/* ═══════════════════════════════════════════════════════════════════════════
   TARJETA (card container)
   ═══════════════════════════════════════════════════════════════════════════ */

.modulo-card-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--paper);
    border: 1.5px solid var(--ink-200);
    border-radius: var(--r-lg);
    overflow: hidden;
    position: relative;
    cursor: default;
    transition: transform .35s var(--ease-card), box-shadow .35s var(--ease-card), border-color .2s ease;
    box-shadow: var(--shadow-card);
}

    /* Hover: sube y amplía sombra */
    .modulo-card-container:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-hover);
        border-color: transparent;
    }

        /* Reveal de fechas en hover */
        .modulo-card-container:hover .mc-extra {
            max-height: 140px;
            opacity: 1;
            padding-top: 0.75rem;
            padding-bottom: 0.9rem;
        }

    /* Accesibilidad: focus en tarjetas que son enlaces o tienen tabindex */
    .modulo-card-container:focus-within {
        outline: none;
        box-shadow: var(--shadow-focus), var(--shadow-card);
    }


/* ─── Banda de color (indicador de estado) ───────────────────────────────── */
/*
   La banda superior es el primer elemento visual que comunica el estado.
   Usa un degradado sutil para añadir profundidad a un solo trazo.
*/

.mc-band {
    height: 4px;
    width: 100%;
    flex-shrink: 0;
    background: var(--ink-200); /* fallback */
}

/* Activo */
.mc-band-activo {
    background: linear-gradient(90deg, var(--activo-band) 0%, #86EFAC 100%);
}

/* No empezado */
.mc-band-noempezado,
.mc-band-noempezado {
    background: linear-gradient(90deg, var(--noempezado-band) 0%, #93C5FD 100%);
}

/* Finalizado */
.mc-band-finalizado {
    background: linear-gradient(90deg, var(--finalizado-band) 0%, #CBD5E1 100%);
}

/* Cancelado */
.mc-band-cancelado {
    background: linear-gradient(90deg, var(--cancelado-band) 0%, #FCA5A5 100%);
}


/* ─── Cabecera: número de módulo + badge ─────────────────────────────────── */

.modulo-card-header {
    padding: 1rem var(--sp-md) 0.75rem;
    display: flex;
    align-items: flex-start; /* alinea arriba si hay wrap */
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap; /* si el área es muy larga, el badge baja a nueva línea */
    min-width: 0; /* permite que el flex container se comprima */
}

/* Pill "Área" */
.modulo-num-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-700);
    background: var(--brand-50);
    padding: 4px 11px;
    border-radius: var(--r-pill);
    border: 1px solid var(--brand-100);
    /* ── Clave: limita el ancho y trunca si el texto es muy largo ── */
    min-width: 0; /* permite que flex lo comprima */
    max-width: 100%; /* nunca supera el contenedor */
    overflow: hidden; /* oculta lo que sobra */
}

    /* El <strong> interior trunca con puntos suspensivos */
    .modulo-num-pill strong {
        font-weight: 800;
        font-family: var(--font-display);
        letter-spacing: 0;
        font-size: 0.8rem;
        white-space: nowrap; /* no parte la línea */
        overflow: hidden;
        text-overflow: ellipsis; /* "Administración de..." */
        display: block; /* necesario para text-overflow */
        min-width: 0;
    }


/* ─── Badges de estado ───────────────────────────────────────────────────── */

.modulo-estado {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 11px;
    border-radius: var(--r-pill);
    white-space: nowrap; /* el texto del estado nunca se parte */
    flex-shrink: 0; /* el badge NUNCA cede espacio al área */
    flex-grow: 0; /* tampoco crece */
    align-self: flex-start; /* se alinea arriba cuando el header hace wrap */
    transition: opacity .2s ease;
}

/* Punto de estado (indicador circular animado en activo) */
.estado-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Estado Activo — punto con pulso verde */
.modulo-estado--activo {
    background: var(--activo-bg);
    color: var(--activo-text);
    border: 1px solid #BBF7D0;
}

    .modulo-estado--activo .estado-dot {
        background: var(--activo-dot);
        box-shadow: 0 0 0 0 rgba(77,124,15,.4);
        animation: pulsoActivo 2.2s ease infinite;
    }

/* Estado No Empezado */
.modulo-estado--noempezado,
.modulo-estado--no-empezado,
.modulo-estado--no\ empezado {
    background: var(--noempezado-bg);
    color: var(--noempezado-text);
    border: 1px solid #BFDBFE;
}

    .modulo-estado--noempezado .estado-dot,
    .modulo-estado--no-empezado .estado-dot {
        background: var(--noempezado-dot);
    }

/* Estado Finalizado */
.modulo-estado--finalizado {
    background: var(--finalizado-bg);
    color: var(--finalizado-text);
    border: 1px solid #E2E8F0;
}

/* Estado Cancelado */
.modulo-estado--cancelado {
    background: var(--cancelado-bg);
    color: var(--cancelado-text);
    border: 1px solid #FECACA;
}


/* ─── Cuerpo: nombre y descripción ──────────────────────────────────────── */

.modulo-card-body {
    padding: 0.5rem var(--sp-md) 0.6rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Nombre del módulo — jerarquía más alta */
.mc-nombre {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink-900);
    line-height: 1.35;
    margin: 0;
    /* Corta en 2 líneas para mantener la card compacta */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Descripción / título secundario */
.mc-titulo {
    font-size: 0.84rem;
    font-weight: 400;
    color: var(--ink-400);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ─── Fechas (reveladas en hover) ────────────────────────────────────────── */

.mc-extra {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 var(--sp-md);
    /* La transición de max-height permite el reveal suave */
    transition: max-height .4s var(--ease-card), opacity .3s ease, padding .3s ease;
}

.mc-fecha-row {
    display: flex;
    gap: 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ink-100);
}

.mc-fecha {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mc-fecha-label {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-300);
}

.mc-fecha-val {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-700);
    letter-spacing: 0.01em;
}


/* ─── Pie: código de curso ───────────────────────────────────────────────── */

.modulo-card-footer {
    padding: 0.75rem var(--sp-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--ink-100);
    flex-shrink: 0;
    margin-top: auto;
    /* Fondo ligeramente diferenciado para separar el pie visualmente */
    background: var(--ink-50);
}

.modulo-cod-label {
    font-size: 0.67rem;
    font-weight: 600;
    color: var(--ink-300);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modulo-cod-value {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-700);
    letter-spacing: 0.05em;
    /* Borde sutil que hace el código más legible */
    background: var(--brand-50);
    padding: 2px 9px;
    border-radius: var(--r-sm);
    border: 1px solid var(--brand-100);
}


/* ═══════════════════════════════════════════════════════════════════════════
   PAGINACIÓN
   ═══════════════════════════════════════════════════════════════════════════ */

.paginacion-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0 3rem;
    font-family: var(--font-body);
}

/* Botones Anterior / Siguiente */
.btn-nav,
input.btn-nav {
    height: 44px;
    padding: 0 22px;
    background: var(--paper);
    color: var(--brand-600);
    border: 1.5px solid var(--ink-200);
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s var(--ease-card), box-shadow .2s ease;
}

    .btn-nav:hover,
    input.btn-nav:hover {
        background: var(--brand-600);
        color: var(--paper);
        border-color: var(--brand-600);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(26,95,168,.25);
    }

    .btn-nav:active,
    input.btn-nav:active {
        transform: translateY(0);
        box-shadow: none;
    }

    .btn-nav:disabled,
    input.btn-nav:disabled {
        opacity: 0.35;
        pointer-events: none;
        cursor: not-allowed;
    }

    .btn-nav:focus-visible,
    input.btn-nav:focus-visible {
        outline: none;
        box-shadow: var(--shadow-focus);
    }

/* Indicador de página */
.info-pag {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-400);
    letter-spacing: 0.02em;
    min-width: 90px;
    text-align: center;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ANIMACIONES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Entrada de tarjetas: sube desde abajo */
@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide down para paneles de error / vacío */
@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulso suave para el punto de estado "Activo" */
@keyframes pulsoActivo {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(77, 124, 15, 0.4);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(77, 124, 15, 0);
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVIDAD
   ═══════════════════════════════════════════════════════════════════════════ */

/* --- Tablet: ≤ 768px ─────────────────────────────────────── */
@media (max-width: 768px) {

    .modulos-grid {
        /* En tablet forzamos 2 columnas si el espacio lo permite */
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1rem;
    }

    .mc-nombre {
        font-size: 0.97rem;
    }

    .filtros-bar {
        max-width: 100%;
    }
}

/* --- Móvil: ≤ 480px ──────────────────────────────────────── */
@media (max-width: 480px) {

    .modulos-grid {
        /* Una sola columna en móvil */
        grid-template-columns: 1fr;
        gap: 0.875rem;
        margin-top: 1.25rem;
    }

    .filtros-bar {
        flex-direction: column;
        align-items: stretch;
    }

        input[id$="txtFiltro"],
        .filtros-bar input[type="text"],
        input[id$="btnFiltrar"],
        .filtros-bar input[type="submit"] {
            width: 100%;
        }

    .modulo-card-header {
        padding: 0.875rem 1rem 0.65rem;
    }

    .modulo-card-body {
        padding: 0.4rem 1rem 0.5rem;
    }

    .modulo-card-footer {
        padding: 0.65rem 1rem;
    }

    /* En móvil las fechas se muestran siempre (no se ocultan) */
    .mc-extra {
        max-height: 140px !important;
        opacity: 1 !important;
        padding: 0 1rem 0.9rem !important;
    }

    /* La paginación se apila si no cabe */
    .paginacion-wrapper {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   REDUCCIÓN DE MOVIMIENTO (accesibilidad)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

    .modulo-card-wrapper {
        animation: none;
        opacity: 1;
    }

    .modulo-card-container {
        transition: box-shadow .2s ease;
    }

        .modulo-card-container:hover {
            transform: none;
        }

    .estado-dot {
        animation: none !important;
    }

    .btn-nav,
    input.btn-nav {
        transition: background .2s ease, color .2s ease;
    }

        .btn-nav:hover,
        input.btn-nav:hover {
            transform: none;
        }

    input[id$="btnFiltrar"]:hover,
    .filtros-bar input[type="submit"]:hover {
        transform: none;
    }
}

/* Contenedor principal */
.modulo-card-wrapper {
    height: 100%;
    padding: 10px;
}

.modulo-card-static {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 100%;
    border: 1px solid #e0e0e0;
    position: relative; 
}

.modulo-header-flat {
    background: linear-gradient(180deg, #e9effd 0%, #cbd8f9 100%);
    padding: 25px 20px;
    height: 160px; /* ALTURA FIJA para el área gris/azulada */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modulo-title-box {
    background: #fff;
    padding: 12px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Badge de Estado Ovalado */
.modulo-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    background-color: #f0f0f0; /* Fondo por defecto */
    color: #444;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #888;
}

/* Variaciones de color según el estado */
/* ACTIVO (Verde) */
.status-activo {
    background-color: #e6f4ea;
    color: #1e7e34;
}

    .status-activo .status-dot {
        background-color: #28a745;
    }

/* NO EMPEZADO (Azul) */
.status-noempezado {
    background-color: #e8f0fe;
    color: #1a73e8;
}

    .status-noempezado .status-dot {
        background-color: #1a73e8;
    }

/* Títulos */
.m-title {
    color: #2b6df5;
    font-size: 0.95rem; /* Un pelín más pequeño para que quepa bien */
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    /* Truncar texto si es muy largo para no romper el diseño */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.m-area {
    color: #8a94a6;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Cuerpo y Lista */
.modulo-body-static {
    padding: 20px;
    flex: 1;
}

.modulo-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .modulo-info-list li {
        background: #fdfdfd;
        padding: 8px 12px;
        border-radius: 10px;
        transition: background 0.3s;
    }
        .modulo-info-list li:hover {
            background: #f0f7ff; /* Un toque de color al pasar el ratón */
        }
.icon-m {
    color: #0d6ffd;
    font-size: 0.9rem;
    width: 18px;
}

/* Footer */
.modulo-footer-static {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
}

.modulo-cod {
    font-size: 0.75rem;
    color: #999;
}
/* ... (mantenemos los estilos anteriores de card y header) ... */

.modulo-card-static {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 100%;
    border: 1px solid #e0e0e0;
}

.modulo-header-flat {
    background-color: #1e1e1e;
    padding: 30px 15px; /* Un poco más de aire */
}

/* Footer con distribución espacial */
.modulo-footer-static {
    padding: 12px 18px;
    background: #fdfdfd;
    border-top: 1px solid #eee;
}

.footer-flex {
    display: flex;
    justify-content: space-between; /* Código a la izquierda, Estado a la derecha */
    align-items: center;
}

.modulo-cod {
    font-size: 0.7rem;
    color: #999;
    font-weight: 500;
}

/* Badge de Estado Ovalado (Ajustado para el footer) */
.modulo-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

/* Colores de los estados */
.status-activo {
    background-color: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
}

    .status-activo .status-dot {
        background-color: #28a745;
    }

.status-noempezado {
    background-color: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #d2e3fc;
}

    .status-noempezado .status-dot {
        background-color: #1a73e8;
    }

/* Estado por defecto o pendiente */
.status-pendiente {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

    .status-pendiente .status-dot {
        background-color: #ffc107;
    }

.contenedor-modulos {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center; /* Centra las cards si sobran espacios */
}

.m-footer-reserva {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px; /* Esto le da aire al texto */
    background: #dc3545; /* Rojo sólido más limpio */
    color: white !important; /* Forzamos el blanco */
    text-decoration: none !important;
    border-radius: 8px; /* Bordes un poco más rectos para que sea elegante */
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    transition: all 0.3s ease;
}

    .m-footer-reserva:hover {
        background: #c82333; /* Un rojo un poco más oscuro pero sin degradado sucio */
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
        transform: translateY(-2px); /* Un pequeño salto hacia arriba */
    }

    /* Si quieres que el icono SVG también se vea bien dentro */
    .m-footer-reserva svg {
        margin-left: 8px;
        width: 16px;
        height: 16px;
        stroke: white;
    }