/* =========================================================
   STYLE.CSS PRO - Plataforma Psicométrica / SaaS
   Ruta recomendada: /assets/css/style.css
   Diseñado para mantener compatibilidad con tus clases actuales
   ========================================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;

    --secondary: #7c3aed;
    --secondary-dark: #5b21b6;
    --secondary-soft: #ede9fe;

    --accent: #06b6d4;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --bg: #f4f7fb;
    --bg-soft: #eef4ff;
    --card: rgba(255, 255, 255, 0.92);
    --card-solid: #ffffff;
    --text: #172033;
    --text-soft: #475569;
    --muted: #64748b;
    --line: #e2e8f0;

    --shadow-sm: 0 8px 18px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 35px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 24px 55px rgba(37, 99, 235, 0.18);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-xl: 34px;

    --transition: all .22s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .16) 0, transparent 32%),
        radial-gradient(circle at top right, rgba(124, 58, 237, .14) 0, transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15,23,42,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.025) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 78%);
    z-index: -1;
}

.main {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 30px;
}

/* =========================
   LINKS / BOTONES GENERALES
   ========================= */

.btn-panel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--primary);
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(37,99,235,.13);
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 900;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.btn-panel:hover {
    transform: translateY(-2px);
    color: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-control,
.btn {
    width: 100%;
    border: 0;
    padding: 13px 18px;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 900;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: .2px;
    transition: var(--transition);
    box-shadow: 0 12px 24px rgba(37,99,235,.18);
}

.btn-control:hover,
.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.03);
}

.btn-control:active,
.btn:active,
.btn-small:active {
    transform: scale(.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #facc15);
    color: #422006;
    box-shadow: 0 12px 24px rgba(245,158,11,.18);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 12px 24px rgba(220,38,38,.18);
}

.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 13px;
    border-radius: 13px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
    color: white;
    border: 0;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-blue {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.btn-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-yellow {
    background: linear-gradient(135deg, #f59e0b, #fde047);
    color: #422006;
}

/* =========================
   HERO / CABECERAS
   ========================= */

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    padding: 36px;
    color: white;
    background:
        linear-gradient(135deg, rgba(37,99,235,.98), rgba(124,58,237,.94) 55%, rgba(6,182,212,.90));
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: calc(var(--radius-xl) - 1px);
    background: linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,0));
    z-index: -1;
}

.hero:after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -90px;
    top: -100px;
    background: rgba(255,255,255,.16);
    border-radius: 50%;
    box-shadow: -90px 150px 0 rgba(255,255,255,.07);
}

.hero h1 {
    margin: 0;
    font-size: clamp(27px, 4vw, 40px);
    font-weight: 950;
    letter-spacing: -.8px;
    line-height: 1.05;
}

.hero p {
    max-width: 780px;
    margin: 10px 0 0;
    opacity: .94;
    line-height: 1.55;
    font-size: 15px;
}

/* =========================
   ALERTAS
   ========================= */

.alert-ok,
.alert-error,
.notice {
    border-radius: var(--radius-md);
    padding: 15px 17px;
    margin-bottom: 18px;
    font-weight: 850;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.alert-ok {
    background: var(--success-soft);
    color: #166534;
    border-color: rgba(22,163,74,.18);
}

.alert-error {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: rgba(220,38,38,.18);
}

.notice {
    margin-top: 18px;
    background: linear-gradient(135deg, #fff7ed, #ecfeff);
    color: #334155;
    font-size: 14px;
    border-color: rgba(245,158,11,.18);
}

/* =========================
   ESTADISTICAS
   ========================= */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat {
    position: relative;
    overflow: hidden;
    background: var(--card);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,.85);
    transition: var(--transition);
}

.stat::after {
    content: "";
    position: absolute;
    right: -35px;
    bottom: -45px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(124,58,237,.10));
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat .icon {
    width: 48px;
    height: 48px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-soft), var(--secondary-soft));
    color: var(--primary);
}

.stat h3 {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.stat .num {
    margin-top: 8px;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 950;
    letter-spacing: -1px;
    color: var(--text);
}

/* =========================
   LAYOUT / TARJETAS
   ========================= */

.grid {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 22px;
}

.card {
    background: var(--card);
    backdrop-filter: blur(14px);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,.86);
    margin-bottom: 22px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.11);
}

.card h2 {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 950;
    letter-spacing: -.35px;
    color: var(--text);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.info-row:last-child {
    border-bottom: 0;
}

.info-row strong {
    color: var(--text-soft);
    font-weight: 900;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.activo {
    background: var(--success-soft);
    color: #166534;
}

.inactivo {
    background: var(--danger-soft);
    color: #991b1b;
}

/* =========================
   ACCIONES / MENUS
   ========================= */

.actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.action {
    position: relative;
    overflow: hidden;
    text-decoration: none;
    border-radius: var(--radius-md);
    padding: 18px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(226,232,240,.95);
    color: var(--text);
    transition: var(--transition);
    box-shadow: 0 8px 18px rgba(15,23,42,.045);
}

.action::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.05));
    opacity: 0;
    transition: var(--transition);
}

.action:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(37,99,235,.16);
    border-color: rgba(37,99,235,.18);
}

.action:hover::before {
    opacity: 1;
}

.action .big,
.action strong,
.action span {
    position: relative;
    z-index: 1;
}

.action .big {
    font-size: 30px;
    margin-bottom: 9px;
}

.action strong {
    display: block;
    font-size: 16px;
    font-weight: 950;
}

.action span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.42;
}

.control-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.control-actions form {
    flex: 1;
    min-width: 160px;
}

/* =========================
   FORMULARIOS
   ========================= */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 900;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    border: 1px solid #dbe3ee;
    font-size: 14px;
    outline: none;
    background: rgba(255,255,255,.92);
    color: var(--text);
    transition: var(--transition);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus {
    border-color: rgba(37,99,235,.72);
    box-shadow: 0 0 0 4px rgba(37,99,235,.13);
    background: #ffffff;
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* =========================
   TABLAS
   ========================= */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 13px 11px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .35px;
    background: rgba(248,250,252,.8);
}

tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(37,99,235,.035);
}

td:first-child,
th:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

td:last-child,
th:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.empty {
    text-align: center;
    padding: 24px;
    color: var(--muted);
    font-weight: 800;
}

.small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

/* =========================
   LISTAS DE PRUEBAS / CHECKS
   ========================= */

.pruebas-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.prueba-item {
    padding: 13px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 800;
    color: var(--text-soft);
}

.check-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.check-item {
    padding: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid var(--line);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: var(--transition);
}

.check-item:hover {
    border-color: rgba(37,99,235,.22);
    box-shadow: var(--shadow-sm);
}

.check-item input {
    margin-top: 4px;
    accent-color: var(--primary);
}

/* =========================
   PUESTOS
   ========================= */

.puesto-grid {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 22px;
}

.puesto-card {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid var(--line);
    margin-bottom: 14px;
    transition: var(--transition);
}

.puesto-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37,99,235,.18);
}

.puesto-card h3 {
    margin: 0 0 6px;
    font-weight: 950;
    letter-spacing: -.2px;
}

.puesto-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* =========================
   IMPORTES / ESTADOS
   ========================= */

.amount-positive {
    color: #15803d;
    font-weight: 950;
}

.amount-negative {
    color: #b91c1c;
    font-weight: 950;
}

/* =========================
   SCROLL / UTILIDADES
   ========================= */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #e8eef7;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 999px;
}

::selection {
    background: rgba(37,99,235,.22);
}

/* =========================
   ANIMACION SUAVE GENERAL
   ========================= */

.hero,
.card,
.stat,
.alert-ok,
.alert-error,
.notice {
    animation: fadeUp .32s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   RESPONSIVE
   ========================= */

@media(max-width:1100px) {
    .grid,
    .puesto-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width:760px) {
    .main {
        padding: 16px;
    }

    .hero {
        padding: 25px;
        border-radius: 26px;
    }

    .card,
    .stat {
        border-radius: 22px;
        padding: 18px;
    }

    .actions,
    .pruebas-list,
    .check-list,
    .stats {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .control-actions {
        flex-direction: column;
    }

    .control-actions form {
        width: 100%;
    }

    table {
        min-width: 720px;
    }

    .card:has(table) {
        overflow-x: auto;
    }
}

@media(max-width:420px) {
    .main {
        padding: 12px;
    }

    .hero {
        padding: 22px;
    }

    .hero h1 {
        font-size: 25px;
    }

    .hero p,
    .action span,
    .small {
        font-size: 12px;
    }
}
