/* ===== module-patterns.css =====
   Patrones estructurales compartidos por todos los módulos.
   Hero, KPI cards, encabezados de sección, shells y utilidades de texto.
   Los módulos solo deben definir columnas de tabla y overrides específicos.
   ========================================================= */

/* -----------------------------------------------------------------------
   SHELL DEL MÓDULO
   Contenedor raíz de cada página de módulo.
------------------------------------------------------------------------ */
.module-shell,
.theme-content {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

/* -----------------------------------------------------------------------
   HERO CARD
   Bloque de presentación de cada módulo: eyebrow, título, subtítulo y acciones.
------------------------------------------------------------------------ */
.hero-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 26px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(600px 200px at 0% 0%, rgba(91,170,224,.10), transparent 68%),
        linear-gradient(135deg, rgba(13,22,38,.52), rgba(10,16,28,.46));
    box-shadow: var(--shadow-1);
    overflow: hidden;
    position: relative;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,.22), transparent 60%);
    pointer-events: none;
}

/* Variante compacta: sin padding exagerado, más plana */
.hero-card-compact {
    padding: 22px 24px;
    background:
        linear-gradient(135deg, rgba(10,16,28,.60), rgba(7,9,14,.52));
}

.hero-card h1 {
    margin: 4px 0 8px;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -.03em;
    color: var(--text);
}

/* Eyebrow / kicker encima del título */
.eyebrow {
    display: block;
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: var(--cielo);
    opacity: .82;
}

/* Subtítulo del hero */
.hero-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-soft);
    max-width: 680px;
}

/* Acciones del hero (botones, badges) */
.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* -----------------------------------------------------------------------
   UI HERO  (variante usada por mi-agenda)
------------------------------------------------------------------------ */
.ui-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.ui-hero h1 {
    margin: 4px 0 6px;
    font-size: clamp(22px, 2.8vw, 32px);
    font-weight: 900;
    line-height: 1.06;
    letter-spacing: -.03em;
    color: var(--text);
}

.ui-hero p {
    margin: 0;
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.5;
}

.ui-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    padding-top: 4px;
}

/* Los KPIs oficiales viven en assets/css/kpi.css. */

/* -----------------------------------------------------------------------
   UI CARD BODY
   Área de contenido dentro de .ui-card.
------------------------------------------------------------------------ */
.ui-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* -----------------------------------------------------------------------
   EXPEDIENTE DETAIL (mis-casos)
   Grid de secciones del detalle de un caso.
------------------------------------------------------------------------ */
.exp-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.exp-detail-card {
    padding: 16px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.035);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exp-detail-card h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

/* -----------------------------------------------------------------------
   UTILIDADES DE TEXTO
------------------------------------------------------------------------ */
.text-soft  { color: var(--text-soft); }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; }
.d-block    { display: block; }

/* -----------------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------------------ */

@media (max-width: 900px) {
    .hero-card {
        flex-direction: column;
        gap: 14px;
    }

    .hero-actions,
    .ui-hero-actions {
        width: 100%;
    }

    .exp-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .hero-card,
    .hero-card-compact {
        padding: 18px 16px;
        border-radius: var(--radius-md);
    }
}

/* -----------------------------------------------------------------------
   LIGHT MODE
------------------------------------------------------------------------ */

body.light .hero-card {
    background:
        radial-gradient(500px 180px at 0% 0%, rgba(91,170,224,.12), transparent 68%),
        rgba(255,255,255,.82);
    border-color: var(--stroke);
    box-shadow: var(--shadow-1);
}

body.light .hero-card-compact {
    background: rgba(255,255,255,.82);
}

body.light .eyebrow {
    color: var(--azul);
    opacity: 1;
}

body.light .hero-subtitle,
body.light .ui-hero p {
    color: var(--text-soft);
}


body.light .ui-card-body {
    background: transparent;
}

body.light .exp-detail-card {
    background: rgba(255,255,255,.72);
    border-color: var(--stroke);
}

body.light .exp-detail-card h3 {
    border-bottom-color: rgba(13,72,130,.10);
}

/* Ajuste para secciones sin buscador: título + acciones */
.ui-module-head.ui-module-head-simple{
    grid-template-columns:minmax(220px,1fr) auto;
}
.ui-module-head.ui-module-head-simple > div:first-child{
    min-width:0;
}
@media (max-width:900px){
    .ui-module-head.ui-module-head-simple{
        grid-template-columns:1fr;
    }
}
