/* super.css — tema premium tech blue + sidebar
   Diseño sobrio, minimalista, con micro-animaciones y elevaciones */
:root {
    /* Paleta base */
    --brand: #2563eb;
    /* azul principal */
    --brand-2: #0ea5e9;
    /* cian acento */
    --ink: #0f172a;
    /* texto */
    --muted: #64748b;
    --bg: #f6f8fb;
    /* fondo general */
    --panel: #ffffff;
    /* superficies */
    --line: rgba(2, 12, 27, .08);
    /* líneas sutiles */

    /* Accents y rings */
    --ring: rgba(37, 99, 235, .35);
    --ring-soft: rgba(37, 99, 235, .15);

    /* Tipografía y radios */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;

    /* Elevaciones (sombras) */
    --elev-1: 0 8px 24px rgba(2, 12, 27, .06), 0 2px 6px rgba(2, 12, 27, .04);
    --elev-2: 0 14px 36px rgba(2, 12, 27, .10), 0 3px 12px rgba(2, 12, 27, .06);
    --elev-3: 0 24px 56px rgba(2, 12, 27, .16), 0 6px 16px rgba(2, 12, 27, .10);

    /* Gradientes premium */
    --grad-brand: linear-gradient(135deg, var(--brand) 0%, #1e40af 40%, var(--brand-2) 100%);
    --grad-soft: linear-gradient(180deg, rgba(255, 255, 255, .8) 0%, rgba(255, 255, 255, .65) 100%);
}

html,
body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 1200px
}

/* ---------- Títulos / utilidades ---------- */
.page-title {
    font-weight: 800;
    letter-spacing: -.4px;
    font-size: clamp(1.6rem, 2.2vw + .4rem, 2.6rem);
    margin: 1rem 0 1.25rem;
}

.text-muted-2 {
    color: #8191a7
}

/* ---------- Botones premium ---------- */
.btn {
    border-radius: 12px;
    transition: transform .14s ease, box-shadow .2s ease, background .2s ease
}

.btn:active {
    transform: translateY(1px) scale(.98)
}

.btn-primary {
    background: var(--grad-brand);
    border: 0;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .25);
}

.btn-primary:hover {
    box-shadow: 0 10px 26px rgba(37, 99, 235, .35);
    filter: saturate(1.08)
}

.btn-outline-primary {
    color: var(--brand);
    border: 1px solid var(--brand);
    background: transparent;
}

.btn-outline-primary:hover {
    color: #fff;
    background: var(--grad-brand);
    border-color: transparent
}

.btn-soft {
    background: rgba(37, 99, 235, .08);
    color: #1e3a8a;
    border: 1px solid rgba(37, 99, 235, .18);
}

.btn-ghost-white {
    color: #eef2ff;
    border-color: rgba(255, 255, 255, .55)
}

.btn-ghost-white:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-color: transparent
}

/* ---------- Cards premium ---------- */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    box-shadow: var(--elev-1);
    transition: box-shadow .25s ease, transform .18s ease, border-color .2s ease;
    will-change: transform;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--elev-2);
    border-color: rgba(2, 12, 27, .12)
}

.card .card-title {
    font-weight: 700
}

/* Cards “vidrio” para KPIs */
.card-glass {
    background: rgba(255, 255, 255, .7);
    backdrop-filter: saturate(150%) blur(8px);
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: var(--elev-1);
}

/* ---------- Formularios & Focus ---------- */
.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid var(--line);
    transition: border-color .15s ease, box-shadow .2s ease;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 .35rem var(--ring-soft);
    border-color: #93c5fd;
}

/* ---------- Tablas ---------- */
.table {
    border-collapse: separate;
    border-spacing: 0 6px
}

.table thead th {
    background: #f1f5ff;
    color: #0f172a;
    font-weight: 700;
    border-bottom: 1px solid #d9e2ff;
}

.table tbody tr {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .2s ease;
}

.table tbody tr:hover {
    background: #f8fbff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(2, 12, 27, .06);
}

.table td,
.table th {
    vertical-align: middle
}

/* ---------- Chips / Badges ---------- */
.badge-tech {
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #fff;
    border-radius: 999px;
    padding: .35rem .6rem;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .22);
}

.bg-tech-soft {
    background: rgba(37, 99, 235, .10) !important;
    color: #1e3a8a !important
}

/* ---------- Layout con Sidebar (CLARA) ---------- */
.layout {
    display: flex;
    min-height: 100vh
}

/* Sidebar clara y elegante */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #eef3ff 0%, #ffffff 100%);
    color: #334155;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    padding: .75rem;
    border-right: 1px solid rgba(15, 23, 42, .06);
    box-shadow: inset -1px 0 0 rgba(15, 23, 42, .03), 8px 0 24px rgba(0, 0, 0, .06);
}

.brand {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: .2px;
    font-size: 1.08rem;
    padding: .75rem .75rem 1rem;
    display: flex;
    gap: .55rem;
    align-items: center;
}

.menu {
    margin: 0;
    padding: 0;
    list-style: none
}

.menu li {
    margin: .2rem 0
}

.menu a {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .6rem .85rem;
    border-radius: .75rem;
    color: #475569;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .12s ease;
}

.menu a:hover {
    background: rgba(37, 99, 235, .10);
    color: #0f172a;
    transform: translateX(1px)
}

.menu li.active>a {
    background: rgba(37, 99, 235, .16);
    color: #0f172a;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .25);
}

.menu i {
    width: 1.25rem;
    text-align: center
}

.sidebar-foot {
    opacity: .9
}

/* Topbar clara */
.content {
    flex: 1;
    display: flex;
    flex-direction: column
}

.topbar {
    height: 58px;
    display: flex;
    align-items: center;
    padding: 0 .9rem;
    background: #fff;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

#btnSidebar {
    font-size: 1.25rem
}

.content-inner {
    max-width: 1400px
}

/* ---------- Carrusel elegante (ver_respuesta) ---------- */
.card-media .card-header {
    background: #fff;
    border-bottom: 1px solid var(--line)
}

.carousel-elegant .carousel-inner {
    border-radius: var(--radius-md);
    background: #f8fafc
}

.media-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(260px, 58vh, 560px);
    background:
        radial-gradient(1200px 400px at 30% -10%, rgba(37, 99, 235, .08), transparent 60%),
        radial-gradient(1000px 500px at 120% 120%, rgba(14, 165, 233, .08), transparent 60%),
        #f8fafc;
    border-radius: var(--radius-md);
}

.media-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block
}

.pdf-stub {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 3rem;
    color: #9aa7bd;
    border: 2px dashed rgba(2, 12, 27, .12);
    border-radius: var(--radius-md);
}

.carousel-elegant .carousel-caption .glass {
    background: rgba(255, 255, 255, .75);
    backdrop-filter: saturate(140%) blur(8px);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 12px;
    color: #0f172a;
}

/* Tira de miniaturas */
.thumbstrip {
    display: flex;
    gap: .5rem;
    padding: .6rem .8rem;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.thumbstrip .thumb {
    border: 0;
    background: transparent;
    padding: 0;
    flex: 0 0 auto;
    cursor: pointer
}

.thumbstrip img {
    width: 76px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    box-shadow: 0 4px 10px rgba(2, 12, 27, .06);
    opacity: .85;
    transition: transform .15s ease, opacity .15s ease, box-shadow .2s ease;
}

.thumbstrip .thumb-pdf {
    display: inline-flex;
    width: 76px;
    height: 54px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px dashed rgba(2, 12, 27, .2);
    color: #9aa7bd;
    background: #f8fafc;
    font-weight: 800;
}

.thumbstrip .thumb.active img,
.thumbstrip .thumb:hover img {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(2, 12, 27, .10)
}

/* ---------- Animaciones de entrada ---------- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.fade-up {
    animation: fadeUp .35s ease both
}

/* ---------- Scrollbar (webkit) ---------- */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(37, 99, 235, .35), rgba(37, 99, 235, .15));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-track {
    background: transparent
}

/* ---------- Modo reducido de movimiento ---------- */
@media (prefers-reduced-motion:reduce) {

    .card,
    .btn,
    .menu a {
        transition: none
    }

    .fade-up {
        animation: none
    }
}

/* ---------- Responsive ---------- */
@media (max-width:991.98px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100dvh;
        z-index: 1040;
        box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    }

    body.sidebar-open .sidebar {
        left: 0;
        transition: left .2s ease
    }
}

/* ========================================================
   Grupos Selector — tarjetas premium
   ======================================================== */
.grupos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.25rem;
    margin-top: .25rem;
}

.grupo-card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--elev-1);
    transition: transform .22s ease, box-shadow .22s ease, border-color .18s ease;
    animation: gaFadeInUp .38s ease both;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.grupo-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--grad-brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
}

.grupo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--elev-3);
    border-color: rgba(37, 99, 235, .22);
    color: var(--ink);
}

.grupo-card:hover::before {
    transform: scaleX(1);
}

.grupo-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--grad-brand);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
    flex: 0 0 auto;
}

.grupo-card-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--brand);
    margin-bottom: .2rem;
}

.grupo-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 0;
    line-height: 1.3;
}

.grupo-card-stats {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.grupo-stat {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .73rem;
    font-weight: 600;
    padding: .25rem .6rem;
    border-radius: 999px;
}

.grupo-stat-blue  { background: rgba(37, 99, 235, .08);  color: #1e40af; }
.grupo-stat-green { background: rgba(16, 185, 129, .09); color: #065f46; }
.grupo-stat-gray  { background: rgba(100, 116, 139, .09); color: #334155; }

@keyframes gaFadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Staggered entrance */
.grupos-grid .grupo-card:nth-child(1)   { animation-delay: .04s }
.grupos-grid .grupo-card:nth-child(2)   { animation-delay: .08s }
.grupos-grid .grupo-card:nth-child(3)   { animation-delay: .12s }
.grupos-grid .grupo-card:nth-child(4)   { animation-delay: .16s }
.grupos-grid .grupo-card:nth-child(5)   { animation-delay: .20s }
.grupos-grid .grupo-card:nth-child(6)   { animation-delay: .24s }
.grupos-grid .grupo-card:nth-child(7)   { animation-delay: .28s }
.grupos-grid .grupo-card:nth-child(8)   { animation-delay: .32s }
.grupos-grid .grupo-card:nth-child(9)   { animation-delay: .36s }
.grupos-grid .grupo-card:nth-child(10)  { animation-delay: .40s }
.grupos-grid .grupo-card:nth-child(n+11){ animation-delay: .44s }

/* ========================================================
   Page header — ga-ph
   ======================================================== */
.ga-ph {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.ga-ph h2 {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -.3px;
    margin: 0 0 .15rem;
}

.ga-ph .sub {
    color: var(--muted, #64748b);
    font-size: .875rem;
    margin: 0;
}

/* ========================================================
   Search bar con icono — ga-search
   ======================================================== */
.ga-search {
    position: relative;
    max-width: 320px;
}

.ga-search .ga-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: .95rem;
}

.ga-search input {
    padding-left: 36px;
}

/* ========================================================
   Role badges
   ======================================================== */
.badge-role {
    padding: .28rem .65rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    display: inline-block;
}

.badge-role-admin      { background: rgba(239, 68, 68, .10); color: #b91c1c; }
.badge-role-consultor  { background: rgba(37, 99, 235, .10);  color: #1d4ed8; }
.badge-role-brigadista { background: rgba(16, 185, 129, .10); color: #059669; }
.badge-role-default    { background: rgba(100, 116, 139, .10); color: #475569; }

/* ========================================================
   Animated table rows
   ======================================================== */
@keyframes rowFadeIn {
    from { opacity: 0; transform: translateX(-5px); }
    to   { opacity: 1; transform: translateX(0); }
}

.g-table-wrap tbody tr {
    animation: rowFadeIn .2s ease both;
}
.g-table-wrap tbody tr:nth-child(1) { animation-delay: .03s }
.g-table-wrap tbody tr:nth-child(2) { animation-delay: .06s }
.g-table-wrap tbody tr:nth-child(3) { animation-delay: .09s }
.g-table-wrap tbody tr:nth-child(4) { animation-delay: .12s }
.g-table-wrap tbody tr:nth-child(5) { animation-delay: .15s }
.g-table-wrap tbody tr:nth-child(n+6) { animation-delay: .18s }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .grupo-card, .grupos-grid .grupo-card { animation: none; transition: none; }
    .grupo-card::before { transition: none; }
    .g-table-wrap tbody tr { animation: none; }
}