/* ==========================================================================
   1. VARIABLES GLOBALES Y RESET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Syne:wght@700;800&display=swap');

:root {
    --primary: #7c69ef;
    --primary-hover: #6854e8;
    --primary-light: rgba(124, 105, 239, 0.12);
    --accent-light: #e8e4ff;
    --accent: #7c69ef;

    --danger: #dc3545;
    --danger-hover: #bb2d3b;

    --success: #198754;
    --success-hover: #157347;

    --info: #17a2b8;
    --info-hover: #138496;

    --warning: #fbc02d;
    --warning-bg: #fff9c4;

    --bg-main: #f7f6fc;
    --bg: #f7f6fc;
    --bg-card: #ffffff;
    --bg-alt: #fafafa;

    --text-dark: #1e1b2e;
    --text-main: #2d3436;
    --text-muted: #8b85a0;

    --border-color: rgba(124, 105, 239, 0.12);
    --border-alt: #e5e7eb;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-card: 32px;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 25px 50px -15px rgba(124, 105, 239, 0.15);

    --font-family: 'Inter', sans-serif;
    --font-logo: 'Syne', sans-serif;
}


/* ==========================================================================
   RESET
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}


/* ==========================================================================
   2. ESTRUCTURA Y LAYOUT
   ========================================================================== */

.layout,
.layouts {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.main-content,
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 20px;
    padding: 30px;
    background-color: transparent;
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
}

.panel-lateral {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* ==========================================================================
   3. TIPOGRAFÍA
   ========================================================================== */

h1,
h2 {
    font-family: var(--font-logo) !important;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 25px;
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-family: var(--font-family);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0;
    margin-bottom: 10px;
}

p {
    font-family: var(--font-family);
    margin: 6px 0 18px;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.7;
}

strong {
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: var(--primary);
}

hr {
    border: none;
    height: 2px;
    background: var(--primary-light);
    margin: 35px 0;
}


/* ==========================================================================
   4. LISTAS Y CONTENEDORES
   ========================================================================== */

.content ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 30px 0;
    padding: 0;
    width: 100%;
}

.content ul li {
    background: #fcfcfc;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 18px;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s ease, background 0.25s ease;
}

.content ul li:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
}

.contenedor-empleados,
.contenedor-aprobaciones,
.form-container,
.contenedor-estadisticas-lider {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-top: 0;
    margin-bottom: 30px;
    width: 100%;
}


/* ==========================================================================
   5. ESTADÍSTICAS Y MÉTRICAS
   ========================================================================== */

.contenedor-estadisticas-lider {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contenedor-estadisticas-lider header h1 {
    color: var(--primary);
    margin: 0;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--accent-light);
    display: inline-block;
    padding-bottom: 5px;
}

.metrics-grid-lider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.metrics-grid-lider .card {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metrics-grid-lider .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(124, 105, 239, 0.1);
    border-color: var(--primary);
}

.metrics-grid-lider .card h3 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.metrics-grid-lider .card .valor-principal {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}


/* ==========================================================================
   6. APROBACIONES
   ========================================================================== */

.contenedor-aprobaciones section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.contenedor-aprobaciones section h2 {
    grid-column: 1 / -1;
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
}

.card-aprobacion {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-aprobacion h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 10px;
}

.card-aprobacion:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.card-aprobacion form {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0;
    background: transparent;
    box-shadow: none;
}


/* ==========================================================================
   7. FORMULARIOS E INPUTS
   ========================================================================== */

form {
    background: #fff;
    padding: 35px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

header {
    margin-bottom: 30px;
}

header h2,
header h1 {
    margin: 0;
    font-family: var(--font-logo) !important;
    font-size: 2.3rem;
    color: var(--primary);
}

header p {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group,
.input-group {
    margin-bottom: 20px;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="password"],
input:not([type]),
select,
textarea {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #eae8f5;
    border-radius: 16px;
    padding: 14px 18px;
    margin-top: 5px;
    margin-bottom: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    outline: none;
}

select {
    appearance: none;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

input::placeholder {
    color: #b8b3cc;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}


/* ==========================================================================
   8. BOTONES
   ========================================================================== */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 16px;
    padding: 15px 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.guardar-button,
button[type="submit"],
.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 8px 20px -4px rgba(124, 105, 239, 0.35);
    gap: 10px;
}

.guardar-button:hover,
button[type="submit"]:hover,
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -4px rgba(124, 105, 239, 0.5);
}

button[type="submit"]:active {
    transform: translateY(0);
}

.btn-cancel,
button[type="reset"] {
    background-color: #e2e8f0;
    color: #475569;
}

.btn-cancel:hover,
button[type="reset"]:hover {
    background-color: #cbd5e1;
}


/* ==========================================================================
   9. GESTIÓN DE EMPLEADOS Y TABLAS
   ========================================================================== */

.contenedor-empleados {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.encabezado-tabla {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 25px;
}

.tabla-datos {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.tabla-datos th {
    background-color: #f8f9fa;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

.tabla-datos td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
    vertical-align: middle;
}


/* ==========================================================================
   10. LOGIN NEVULA
   ========================================================================== */


/* Fondo */

body:has(#galaxyCanvas) {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    margin: 0;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(124, 105, 239, 0.12),
            transparent 35%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(124, 105, 239, 0.10),
            transparent 35%
        ),
        var(--bg-main);
}


/* Canvas */

#galaxyCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}


/* Tarjeta */

.login-card {
    position: relative;
    z-index: 2;

    display: flex;

    width: min(1050px, 92vw);
    min-height: 560px;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.94);

    border: 1px solid rgba(255, 255, 255, 0.95);

    border-radius: 28px;

    box-shadow:
        0 25px 60px rgba(45, 36, 80, 0.13),
        0 8px 25px rgba(124, 105, 239, 0.07);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    animation: fadeInCard 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInCard {

    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* ==========================================================================
   LADO IZQUIERDO
   ========================================================================== */

.login-form-side {
    flex: 1.08;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 55px 70px;

    background: #f7f6fc;
}

.login-content {
    width: 100%;
    max-width: 390px;
}


/* ==========================================================================
   LOGO
   ========================================================================== */

.login-form-side .logo-container {

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 10px;

    width: 100%;

    margin-bottom: 12px;

    text-align: center;
}

.login-form-side .logo-container img {

    width: 55px;
    height: 55px;

    object-fit: contain;

    border-radius: 14px;

    filter:
        drop-shadow(
            0 5px 12px rgba(124, 105, 239, 0.18)
        );
}

.login-form-side .logo-text {

    margin: 0;

    font-family: var(--font-logo);

    font-size: 2.45rem;

    font-weight: 800;

    line-height: 1;

    letter-spacing: -1px;

    color: var(--text-dark);
}

.login-form-side .logo-text span {
    color: var(--primary);
}

.login-form-side .brand-subtitle {

    margin: 0 0 32px;

    color: var(--text-muted);

    font-size: 0.9rem;

    line-height: 1.6;

    text-align: center;
}


/* ==========================================================================
   FORMULARIO
   ========================================================================== */

.login-normal {
    width: 100%;
}

.login-normal form {

    width: 100%;
    max-width: none;

    margin: 0;

    padding: 0;

    background: transparent;

    border-radius: 0;

    box-shadow: none;
}

.login-normal .input-group {

    width: 100%;

    margin-bottom: 19px;
}

.login-normal label {

    display: block;

    margin-bottom: 7px;

    color: var(--text-dark);

    font-size: 0.82rem;

    font-weight: 600;
}


/* ==========================================================================
   INPUTS LOGIN
   ========================================================================== */

.login-normal input[type="text"],
.login-normal input[type="password"] {

    width: 100%;
    height: 49px;

    margin: 0;

    padding: 0 16px;

    background: #ffffff;

    border: 1px solid #e7e3f2;

    border-radius: 13px;

    color: var(--text-dark);

    font-size: 0.9rem;

    outline: none;

    box-shadow:
        0 2px 8px rgba(45, 36, 80, 0.025);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.login-normal input:hover {
    border-color: #d9d3ec;
}

.login-normal input:focus {

    border-color: var(--primary);

    box-shadow:
        0 0 0 3px var(--primary-light),
        0 4px 12px rgba(124, 105, 239, 0.07);
}

.login-normal input::placeholder {
    color: #b8b3cc;
}


/* ==========================================================================
   CONTRASEÑA
   ========================================================================== */

.login-normal .password-wrapper {

    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
}

.login-normal .password-wrapper input {
    padding-right: 48px;
}

.login-normal .toggle-password {

    position: absolute;

    right: 9px;
    top: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    padding: 0;
    margin: 0;

    transform: translateY(-50%);

    background: transparent;

    border: none;

    border-radius: 9px;

    color: var(--text-muted);

    font-size: 0.85rem;

    cursor: pointer;

    box-shadow: none;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.login-normal .toggle-password:hover {

    background: var(--primary-light);

    color: var(--primary);

    transform: translateY(-50%);
}


/* ==========================================================================
   BOTÓN
   ========================================================================== */

.login-normal form > button[type="submit"] {

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 49px;

    margin: 8px 0 0;

    padding: 0 20px;

    gap: 10px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #8979ed
        );

    color: #ffffff;

    border: none;

    border-radius: 13px;

    font-size: 0.88rem;

    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 8px 18px rgba(124, 105, 239, 0.22);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.login-normal form > button[type="submit"] i {

    font-size: 0.8rem;

    transition:
        transform 0.2s ease;
}

.login-normal form > button[type="submit"]:hover {

    transform: translateY(-2px);

    filter: brightness(1.03);

    box-shadow:
        0 11px 23px rgba(124, 105, 239, 0.28);
}

.login-normal form > button[type="submit"]:hover i {
    transform: translateX(3px);
}

.login-normal form > button[type="submit"]:active {
    transform: translateY(0);
}


/* ==========================================================================
   LADO QR
   ========================================================================== */

.login-card > .login-brand-side {

    position: relative;

    flex: 0.92;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px 55px;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fbfaff
        );

    border-left: 1px solid #ebe8f4;

    overflow: hidden;
}

.login-card > .login-brand-side::before,
.login-card > .login-brand-side::after {

    content: "";

    position: absolute;

    border-radius: 50%;

    pointer-events: none;
}

.login-card > .login-brand-side::before {

    width: 260px;
    height: 260px;

    top: -150px;
    right: -120px;

    background: rgba(124, 105, 239, 0.08);

    filter: blur(10px);
}

.login-card > .login-brand-side::after {

    width: 220px;
    height: 220px;

    bottom: -140px;
    left: -110px;

    background: rgba(124, 105, 239, 0.055);

    filter: blur(15px);
}


/* ==========================================================================
   CONTENEDOR QR
   ========================================================================== */

.qr-login {

    position: relative;

    z-index: 2;

    width: 100%;
    max-width: 350px;

    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;
}

.qr-login h2 {

    margin: 0 0 7px;

    color: var(--text-dark);

    font-family: var(--font-logo) !important;

    font-size: 1.65rem;

    font-weight: 800;

    line-height: 1.2;
}

.qr-login > p:first-of-type {

    max-width: 290px;

    margin: 0 auto;

    color: var(--text-muted);

    font-size: 0.82rem;

    line-height: 1.55;
}


/* ==========================================================================
   CÓDIGO QR
   ========================================================================== */

#qrcode {

    display: flex;

    align-items: center;
    justify-content: center;

    width: 190px;
    height: 190px;

    margin: 23px auto 16px;

    padding: 13px;

    background: #ffffff;

    border: 1px solid #ece9f5;

    border-radius: 18px;

    box-shadow:
        0 12px 28px rgba(45, 36, 80, 0.09);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

#qrcode:hover {

    transform: translateY(-2px);

    box-shadow:
        0 16px 34px rgba(124, 105, 239, 0.13);
}

#qrcode img,
#qrcode canvas {

    display: block;

    width: 164px !important;
    height: 164px !important;

    border-radius: 3px;
}


/* ==========================================================================
   ESTADO QR
   ========================================================================== */

#qr-timer {

    margin: 0 !important;

    color: var(--text-muted) !important;

    font-size: 0.76rem !important;

    line-height: 1.4;
}

#qr-status {

    min-height: 20px;

    margin: 6px 0 0 !important;

    color: var(--primary) !important;

    font-size: 0.8rem !important;

    font-weight: 600;

    line-height: 1.4;
}


/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {

    .content,
    .main-content {
        padding: 20px;
    }

    form {
        padding: 20px;
    }

    .login-card {
        width: 94vw;
    }

    .login-form-side {
        padding: 45px 50px;
    }

    .login-card > .login-brand-side {
        padding: 45px 40px;
    }

}


/* ==========================================================================
   TABLET / CELULAR
   ========================================================================== */

@media (max-width: 768px) {

    body:has(#galaxyCanvas) {

        overflow-y: auto;

        min-height: 100vh;

        height: auto;

        padding: 25px 0;
    }

    .login-card {

        flex-direction: column;

        width: calc(100% - 30px);

        max-width: 480px;

        min-height: auto;

        margin: auto;

        border-radius: 24px;
    }

    .login-form-side {
        padding: 40px 30px;
    }

    .login-card > .login-brand-side {

        padding: 40px 30px;

        border-left: none;

        border-top: 1px solid #ebe8f4;
    }

    .login-form-side .logo-container {

        align-items: center;

        justify-content: center;

        text-align: center;
    }

    .login-form-side .brand-subtitle {
        text-align: center;
    }

    .login-content {
        max-width: 400px;
    }

}


/* ==========================================================================
   CELULARES PEQUEÑOS
   ========================================================================== */

@media (max-width: 480px) {

    .login-card {
        width: calc(100% - 22px);
    }

    .login-form-side,
    .login-card > .login-brand-side {
        padding: 32px 22px;
    }

    .login-form-side .logo-text {
        font-size: 2.1rem;
    }

    .login-form-side .logo-container img {

        width: 42px;
        height: 42px;
    }

    .login-form-side .brand-subtitle {

        font-size: 0.84rem;

        margin-bottom: 25px;
    }

    #qrcode {

        width: 175px;
        height: 175px;

        margin-top: 19px;
    }

    #qrcode img,
    #qrcode canvas {

        width: 149px !important;
        height: 149px !important;
    }

}


/* ==========================================================================
   12. PANTALLAS CON POCA ALTURA
   ========================================================================== */

@media (max-height: 700px) and (min-width: 769px) {

    .login-card {
        min-height: 500px;
    }

    .login-form-side {

        padding-top: 35px;
        padding-bottom: 35px;
    }

    .login-card > .login-brand-side {

        padding-top: 30px;
        padding-bottom: 30px;
    }

    .login-form-side .brand-subtitle {
        margin-bottom: 23px;
    }

    .login-normal .input-group {
        margin-bottom: 14px;
    }

    #qrcode {

        width: 165px;
        height: 165px;

        margin-top: 15px;
        margin-bottom: 10px;
    }

    #qrcode img,
    #qrcode canvas {

        width: 139px !important;
        height: 139px !important;
    }

}