/* =========================================================
   6b. TARJETAS DEL INICIO Y ESTADISTICAS
   ========================================================= */
/* home.php fija Inter en su <style>; el inicio usa la tipografia del sistema. */
#page-content .dash {
    font-family: var(--ds-font);
}

/* Stat cards (dashboard) */
.widget-content.widget-content-mini {
    padding: 22px 24px !important;
    display: flex;
    align-items: center;
    gap: 16px;
}

.widget [class*="widget-icon"][style*="56px"],
.widget [class*="widget-icon"] {
    flex: 0 0 44px;
    width: 44px !important;
    height: 44px !important;
    border-radius: var(--srx-radius-sm) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px;
}

.widget [class*="widget-icon"] i {
    font-size: 18px !important;
    color: #fff !important;
}

.widget h2.widget-heading {
    font-size: 28px !important;
    font-weight: 700;
    color: var(--srx-text);
    margin: 0 !important;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.widget h2.widget-heading.text-success { color: var(--srx-success) !important; }
.widget h2.widget-heading.text-warning { color: var(--srx-warning) !important; }
.widget h2.widget-heading.text-danger { color: var(--srx-primary) !important; }

.widget span.text-muted,
.widget .text-muted {
    color: var(--srx-text-muted) !important;
    font-size: 12.5px;
    font-weight: 500;
}

/* Profile card del dashboard */
.widget .widget-content[style*="background: var(--crh-red"],
.widget .widget-content[style*="background: rgb(237"],
.widget .widget-content.themed-background-passion,
.widget .widget-content.themed-background {
    background: linear-gradient(135deg, var(--srx-primary) 0%, var(--srx-primary-dark) 100%) !important;
    color: #fff;
}

.widget-content .img-thumbnail-avatar-2x {
    border: 3px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.widget .themed-background-muted {
    background: var(--srx-bg) !important;
    border-bottom: 1px solid var(--srx-border-soft);
}

/* Mini cards row con stats */
.dashboard-mini-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--srx-card);
    border: 1px solid var(--srx-border);
    border-radius: var(--srx-radius);
    text-decoration: none;
    color: var(--srx-text);
    transition: box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease;
    box-shadow: var(--srx-shadow-xs);
}

.dashboard-mini-card:hover {
    box-shadow: var(--srx-shadow-sm);
    border-color: var(--ds-ink-300);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--srx-text);
}

.dashboard-mini-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--srx-radius-sm);
    font-size: 16px;
}

.dashboard-mini-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;
}

.dashboard-mini-info strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--srx-text);
}

.dashboard-mini-info span {
    color: var(--srx-text-muted);
    font-size: 12.5px;
}

/* Stat cards SISTAH 3.0 */
.stat-card {
    background: var(--srx-card);
    border: 1px solid var(--srx-border);
    border-radius: var(--srx-radius);
    padding: 22px 24px;
    box-shadow: var(--srx-shadow-card);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.stat-card:hover {
    box-shadow: var(--srx-shadow-card-hover);
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: var(--srx-radius-sm);
    background: var(--srx-primary-50);
    /* El chip se tinta con el color propio del icono (currentColor):
       el acento vive solo aqui, nunca en el borde de la tarjeta */
    background: color-mix(in srgb, currentColor 14%, transparent);
    color: var(--srx-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-card .stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--srx-text);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.stat-card .stat-content p {
    margin: 3px 0 0;
    color: var(--srx-text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Preserva texto blanco cuando la tarjeta es un estado solido (text-white) */
.stat-card.text-white .stat-content h3,
.stat-card.text-white .stat-content p {
    color: #fff !important;
}

/* Left-borders de color eliminados (patron AdminLTE 2016): el acento vive
   solo en el icono. Hairline uniforme en las cuatro caras de la tarjeta. */
.stat-card.stat-primary,
.stat-card.stat-success,
.stat-card.stat-warning,
.stat-card.stat-danger,
.stat-card.stat-info {
    border: 1px solid var(--srx-border);
    box-shadow: var(--srx-shadow-card);
    border-left: 1px solid var(--srx-border) !important;
}

/* Vence los border-left de color escritos inline en el HTML legacy */
.stat-card[style*="border-left"],
.block[style*="border-left"],
.card[style*="border-left"] {
    border-left-width: 1px !important;
    border-left-color: var(--srx-border) !important;
}

/* =========================================================
   6c. PERFIL DEL INICIO: REDES SOCIALES
   ========================================================= */
.srx-profile-social-link {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--srx-radius-full);
    color: var(--srx-primary) !important;
    background: var(--srx-primary-50);
    border: 1px solid var(--srx-primary-100);
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms ease;
}

.srx-profile-social-link:hover,
.srx-profile-social-link:focus {
    color: #fff !important;
    background: var(--srx-primary);
    border-color: var(--srx-primary);
}

.srx-profile-social-link:active {
    transform: scale(0.96);
}

.srx-profile-social-link.is-disabled {
    color: var(--srx-text-soft) !important;
    background: var(--srx-bg);
    border-color: var(--srx-border);
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

/* =========================================================
   6d. CIFRAS Y ESTADOS VACIOS
   ========================================================= */
/* --- Numeros de stats en tabular-nums --- */
.widget h2.widget-heading,
.stat-card .stat-content h3,
.dashboard-mini-info strong,
.stat-number,
.stat-value {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* --- Empty states: icono en circulo tinted + jerarquia --- */
.srx-empty,
.text-center.text-muted.py-5:has(> i.fa-4x),
.text-center.text-muted.py-4:has(> i.fa-4x) {
    padding: 40px 24px !important;
}

.srx-empty > i,
.text-center.text-muted.py-5:has(> i.fa-4x) > i.fa-4x,
.text-center.text-muted.py-4:has(> i.fa-4x) > i.fa-4x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px !important;
    font-size: 26px !important;
    border-radius: var(--srx-radius-full);
    background: var(--srx-surface-muted);
    color: var(--srx-text-soft);
}

.text-center.text-muted.py-5:has(> i.fa-4x.text-success) > i.fa-4x,
.text-center.text-muted.py-4:has(> i.fa-4x.text-success) > i.fa-4x {
    background: var(--srx-success-soft);
}

.text-center.text-muted.py-5:has(> i.fa-4x.text-danger) > i.fa-4x,
.text-center.text-muted.py-4:has(> i.fa-4x.text-danger) > i.fa-4x {
    background: var(--srx-primary-50);
}

.text-center.text-muted.py-5:has(> i.fa-4x) > h4,
.text-center.text-muted.py-4:has(> i.fa-4x) > h4,
.srx-empty > h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--srx-text);
    margin: 0 0 4px;
}

.text-center.text-muted.py-5:has(> i.fa-4x) > p,
.text-center.text-muted.py-4:has(> i.fa-4x) > p,
.srx-empty > p {
    font-size: 13px;
    color: var(--srx-text-muted);
    margin: 0 0 4px;
}

/* Inicio (home.php): tarjetas y paneles del tablero, antes en la página. */
/* =====================================================================
   Dashboard premium SISTAH 3.0 - estilos scoped (prefijo .dash-*)
   Referencian tokens --srx-* con fallbacks para verse bien con o sin
   el design system global cargado. No dependen de CSS externo.
   ===================================================================== */
.dash {
    --d-primary:       var(--srx-primary, #ED1C24);
    --d-primary-dark:  var(--srx-primary-dark, #B8141B);
    --d-primary-soft:  var(--srx-primary-100, rgba(237,28,36,.12));
    --d-primary-tint:  var(--srx-primary-50, rgba(237,28,36,.06));
    --d-brand-grad:    var(--srx-brand-grad, linear-gradient(135deg, #ED1C24 0%, #C51820 100%));
    --d-card:          var(--srx-card, #ffffff);
    --d-bg:            var(--srx-bg, #faf9f7);
    --d-surface:       var(--srx-surface-muted, #f4f3f0);
    --d-border:        var(--srx-border, #e8e5e0);
    --d-border-soft:   var(--srx-border-soft, #f1efeb);
    --d-border-strong: #d9d5cf;
    --d-text:          var(--srx-text, #1c1917);
    --d-muted:         var(--srx-text-muted, #78716c);
    --d-soft:          var(--srx-text-soft, #a8a29e);
    --d-success:       var(--srx-success, #10b981);
    --d-warning:       var(--srx-warning, #f59e0b);
    --d-info:          var(--srx-info, #3b82f6);
    --d-shadow-xs:     var(--srx-shadow-xs, 0 1px 2px rgba(28,25,23,.05));
    --d-shadow-sm:     var(--srx-shadow-sm, 0 1px 3px rgba(28,25,23,.07), 0 1px 2px rgba(28,25,23,.04));
    --d-shadow-md:     var(--srx-shadow-md, 0 6px 16px -6px rgba(28,25,23,.12), 0 2px 6px -2px rgba(28,25,23,.06));
    --d-radius:        var(--srx-radius, 10px);
    --d-radius-lg:     var(--srx-radius-lg, 14px);
    --d-radius-sm:     var(--srx-radius-sm, 8px);
    --d-radius-full:   var(--srx-radius-full, 9999px);
    color: var(--d-text);
}

/* --- Encabezado --- */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.dash-header__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--d-text);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.dash-header__subtitle {
    font-size: 13px;
    color: var(--d-muted);
    margin: 5px 0 0;
}
.dash-header__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--d-card);
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius-full, 9999px);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--d-muted);
    box-shadow: var(--d-shadow-xs);
}
.dash-header__chip i { color: var(--d-primary); }

/* --- Tiles de estadistica (hero) --- */
.dash-tile {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    height: 100%;
    padding: 19px 20px;
    background: var(--d-card);
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius-lg);
    box-shadow: var(--d-shadow-xs);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.dash-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--d-shadow-md);
    border-color: var(--d-border-strong);
}
.dash-tile__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.dash-tile__body { min-width: 0; flex: 1; }
.dash-tile__value {
    font-size: 30px;
    line-height: 1.02;
    font-weight: 700;
    color: var(--d-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
}
.dash-tile__label {
    font-size: 12.5px;
    color: var(--d-muted);
    margin-top: 4px;
    font-weight: 500;
}
.dash-tile__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--d-soft);
    margin-top: 8px;
}
.dash-tile__meta strong { color: var(--d-muted); font-weight: 600; }
.dash-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }

/* Tintes de icono */
.dash-i-primary { background: var(--srx-primary-100, rgba(237,28,36,.12)); color: var(--d-primary); }
.dash-i-success { background: var(--srx-success-soft, rgba(16,185,129,.10)); color: var(--d-success); }
.dash-i-warning { background: var(--srx-warning-soft, rgba(245,158,11,.10)); color: var(--d-warning); }
.dash-i-info    { background: var(--srx-info-soft, rgba(59,130,246,.10)); color: var(--d-info); }
.dash-dot-success { background: var(--d-success); }
.dash-dot-info    { background: var(--d-info); }
.dash-dot-muted   { background: var(--d-soft); }

/* --- Card de perfil (blanca con acento rojo preciso) --- */
.dash-profile {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--d-card);
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius-lg);
    overflow: hidden;
    box-shadow: var(--d-shadow-xs);
}
.dash-profile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--d-brand-grad);
}
.dash-profile__body { padding: 22px 20px 18px; }
.dash-profile__head {
    display: flex;
    align-items: center;
    gap: 15px;
}
.dash-profile__avatar {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--d-card);
    border: 2px solid var(--d-card);
    box-shadow: 0 0 0 1px var(--d-border), 0 2px 6px rgba(28,25,23,.10);
}
.dash-profile__info { min-width: 0; }
.dash-profile__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--d-text);
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.dash-profile__role {
    font-size: 12.5px;
    color: var(--d-muted);
    margin: 3px 0 0;
    line-height: 1.35;
}
.dash-profile__carnet {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--d-primary-dark);
    background: var(--d-primary-soft);
    border: 1px solid var(--d-primary-soft);
    padding: 3px 10px;
    border-radius: var(--d-radius-full);
    margin-top: 10px;
}
.dash-profile__actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.dash-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: var(--d-radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.dash-btn:hover { text-decoration: none; }
.dash-btn--primary {
    background: var(--d-primary);
    color: #fff;
    border-color: var(--d-primary);
    box-shadow: 0 1px 2px rgba(237,28,36,.20);
}
.dash-btn--primary:hover {
    background: var(--d-primary-dark);
    border-color: var(--d-primary-dark);
    color: #fff;
    box-shadow: 0 2px 6px rgba(237,28,36,.24);
}
.dash-btn--ghost {
    background: var(--d-card);
    color: var(--d-text);
    border-color: var(--d-border);
}
.dash-btn--ghost:hover {
    background: var(--d-surface);
    border-color: var(--d-border-strong);
    color: var(--d-text);
}
.dash-profile__stats {
    display: flex;
    padding: 14px 8px;
    border-top: 1px solid var(--d-border-soft);
}
.dash-mini {
    position: relative;
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 2px 8px;
}
.dash-mini + .dash-mini::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12%;
    height: 76%;
    width: 1px;
    background: var(--d-border-soft);
}
.dash-mini__value {
    font-size: 19px;
    font-weight: 700;
    color: var(--d-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.dash-mini__label {
    display: block;
    font-size: 10.5px;
    color: var(--d-muted);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Stat row clickeable (usuarios activos) --- */
.dash-statrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 15px 16px;
    background: var(--d-card);
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius-lg);
    box-shadow: var(--d-shadow-xs);
    text-decoration: none;
    color: var(--d-text);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.dash-statrow:hover {
    transform: translateY(-2px);
    box-shadow: var(--d-shadow-sm);
    border-color: var(--d-border-strong);
    color: var(--d-text);
    text-decoration: none;
}
.dash-statrow__icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--srx-success-soft, rgba(16,185,129,.10));
    color: var(--d-success);
}
.dash-statrow__body { flex: 1; min-width: 0; }
.dash-statrow__value {
    font-size: 20px;
    font-weight: 700;
    color: var(--d-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.dash-statrow__label { font-size: 12.5px; color: var(--d-muted); margin-top: 2px; }
.dash-statrow__chevron { color: var(--d-soft); font-size: 13px; transition: transform 160ms ease; }
.dash-statrow:hover .dash-statrow__chevron { transform: translateX(3px); }

/* --- Chart cards --- */
.dash-chart {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--d-card);
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius-lg);
    overflow: hidden;
    box-shadow: var(--d-shadow-xs);
    transition: box-shadow 160ms ease, transform 160ms ease;
}
.dash-chart:hover { box-shadow: var(--d-shadow-sm); transform: translateY(-2px); }
.dash-chart::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--dash-accent, transparent);
}
.dash-accent-primary { --dash-accent: var(--d-primary); }
.dash-accent-info    { --dash-accent: var(--d-info); }
.dash-accent-success { --dash-accent: var(--d-success); }
.dash-chart__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 15px 16px 8px;
}
.dash-chart__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--d-text);
    margin: 0;
    line-height: 1.2;
}
.dash-chart__date { font-size: 12px; color: var(--d-soft); white-space: nowrap; flex: 0 0 auto; }
.dash-chart__summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 16px 4px;
}
.dash-chart__total {
    font-size: 23px;
    font-weight: 700;
    color: var(--d-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
}
.dash-chart__caption { font-size: 12px; color: var(--d-muted); }
.dash-chart__canvas {
    position: relative;
    height: 172px;
    margin-top: auto;
    padding: 4px 10px 12px;
}

@media (max-width: 575.98px) {
    .dash-header__title { font-size: 20px; }
    .dash-tile__value { font-size: 26px; }
}

