/* =========================================================
   BASE.CSS – ESTILO GLOBAL VICARMA (MODO OSCURO)
   ========================================================= */

/* ================== PALETA CORPORATIVA ================== */
:root {
    --bg-main: #0B0E14;
    --bg-card: #11151C;
    --bg-elevated: #161B22;

    --text-main: #E6E6E6;
    --text-muted: #9AA0A6;

    --border-soft: #1F2937;
    --accent-red: #CB0222;
}

/* ================== FUENTE TITULOS ================== */
@font-face {
    font-family: 'Oswald';
    src: url('/Oswald-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* ================== RESET ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================== BODY ================== */
body {
    background: radial-gradient(
        ellipse at top,
        #11151C 0%,
        #0B0E14 60%
    );
    color: var(--text-main);
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
}

/* ================== LOGO FONDO CORPORATIVO ================== */
body::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);

    background: url('/imagenes/logotipo_transparente_blanco.png') no-repeat center;
    background-size: contain;

    opacity: 0.04;
    z-index: 0;
    pointer-events: none;
}

/* Mantener contenido encima */
body * {
    position: relative;
    z-index: 1;
}

/* ================== TITULOS ================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Oswald', sans-serif;
    font-weight: 400;          /* real */
    letter-spacing: 0.12em;    /* sensación de fuerza */
    text-transform: uppercase; /* opcional, muy VICARMA */
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

h1, h2, h3 {
    letter-spacing: 0.14em;
}



/* ================== LINKS ================== */
a {
    color: var(--text-main);
    text-decoration: none;
}
a:hover {
    color: var(--accent-red);
}

/* ================== FORMULARIOS ================== */
label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--text-muted);
}

input, select, textarea {
    width: 100%;
    height: 42px;
    padding: 6px 12px;

    background: rgba(11,14,20,.95);
    color: var(--text-main);

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;

    font-size: 14px;
}

#btnLogin {
    width: 100%;
    margin-top: 22px;
}

/* ===== CUANDO TIENE VALOR ===== */
input.filled,
textarea.filled,
select.filled {

    background: #EDEDED;
    color: #000000;
    border-color: var(--accent-red);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 2px rgba(203,2,34,.25);
}

/* ================== BOTONES ================== */
/* BOTÓN PRIMARIO */
.btn-primary {
    flex: 1;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 24px;
    line-height: 1;

    background: linear-gradient(
        180deg,
        #CB0222 0%,
        #9E0019 100%
    );

    border: none;
    border-radius: 14px;

    font-size: 15px;
    letter-spacing: 1px;
    color: #FFFFFF;

    cursor: pointer;

    box-shadow: 0 18px 40px rgba(203,2,34,.45);
}

/* BOTÓN SECUNDARIO */
.btn-secondary {
    height: 52px;
    min-width: 140px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 26px;
    line-height: 1;

    background: transparent;
    color: var(--text-main);

    border: 1px solid rgba(255,255,255,.25);
    border-radius: 14px;

    font-size: 14px;
    letter-spacing: 1px;

    cursor: pointer;

    transition:
        background .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.btn-secondary:hover {
    background: rgba(255,255,255,.06);
    border-color: var(--accent-red);
    box-shadow: 0 0 0 1px rgba(203,2,34,.35);
}



/* ================== LOGIN ================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    /* FONDO LIMPIO, SIN MARCO */
    background: #0B0E14;
}



.login-card {
    position: relative;

    width: 100%;
    max-width: 420px;

    background: linear-gradient(
        180deg,
        #131A2A 0%,   /* azul más visible */
        #0B0E14 100%
    );

    border-radius: 24px;
    padding: 36px 28px 32px;

    box-shadow:
        0 50px 90px rgba(0,0,0,.85),
        inset 0 1px 0 rgba(255,255,255,.035);

    /* RAYAS ROJAS */
    border-top: 2px solid var(--accent-red);
    border-bottom: 2px solid var(--accent-red);

    overflow: hidden;
}


/* TEXTURA / GRAIN SUAVE */
.login-card::after {
    content: "";
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at top,
            rgba(120,140,255,.06),
            transparent 55%
        ),
        linear-gradient(
            180deg,
            rgba(30,40,90,.08),
            transparent 60%
        );

    pointer-events: none;
}



.login-header {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.login-logo {
    width: 96px;
    height: auto;
}

.login-title {
    text-align: center;
    font-family: 'Oswald', Arial, sans-serif;
    letter-spacing: 3px;
    font-size: 22px;
    margin: 0 0 28px;
}

/* ================== SEPARADOR LOGIN ================== */
.login-separator {
    position: relative;
    margin-bottom: 26px;
    padding-top: 18px;
}

.login-separator::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);

    width: 68%;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.12),
        transparent
    );
}

.login-error {
    text-align: center;
    color: var(--accent-red);
    margin-top: 16px;
    font-size: 13px;
}




/* =========================================================
   EFECTO FUTURISTA DE APARICIÓN – LOGIN VICARMA
   ========================================================= */

/* Estado inicial (antes de aparecer) */
.login-animate {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    filter: blur(6px);
    transition:
        opacity 1.6s ease,
        transform 1.6s ease,
        filter 1.6s ease;
}

/* Estado visible */
.login-animate.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.form-actions {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: center;

    width: 100%;
    max-width: 1200px;   /* MISMO ancho que la tabla */
    margin: 0 auto;

    padding: 25px 20px;
    box-sizing: border-box;
}


/* ================== UTILIDADES ================== */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.hidden { display: none; }







/* ================== DROP AREA XML ================== */
.xml-lista {
    margin-top: 15px;
}

.xml-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 14px;
    margin-bottom: 8px;

    background: rgba(255,255,255,.06);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
}

.xml-nombre {
    font-size: 14px;
    color: #F0F0F0;
    word-break: break-all;
}

.xml-eliminar {
    background: transparent;
    border: none;
    color: var(--accent-red);
    font-size: 18px;
    cursor: pointer;
}

.xml-eliminar:hover {
    filter: brightness(1.2);
}

.xml-contador {
    margin-top: 8px;
    font-size: 13px;
    color: #ccc;
}

.xml-vacio {
    font-size: 14px;
    color: #aaa;
    padding: 10px;
}

.xml-drop-area {
    position: relative;
    width: 100%;
    min-height: 110px;
    align-items: center;
    justify-content: center;
}

.file-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.xml-drop-box {
    width: 100%;
    height: 160px;   /* 🔴 CLAVE: altura real, no min-height */
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    padding: 18px 20px;

    border: 2px dashed rgba(203, 2, 34, 0.7);
    border-radius: 16px;

    background: linear-gradient(
        180deg,
        rgba(203, 2, 34, 0.06),
        rgba(0, 0, 0, 0.15)
    );

    transition:
        border-color .25s ease,
        box-shadow .25s ease,
        background .25s ease;
}


/* TEXTO */
.xml-drop-box p {
    margin: 0;
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.4;
}

/* HOVER */
.xml-drop-area:hover .xml-drop-box {
    border-color: rgba(203, 2, 34, 1);
    box-shadow: 0 0 0 1px rgba(203, 2, 34, .35);
}

/* DRAG ACTIVO */
.xml-drop-area.dragover .xml-drop-box {
    background: linear-gradient(
        180deg,
        rgba(203, 2, 34, 0.15),
        rgba(203, 2, 34, 0.05)
    );

    box-shadow:
        0 0 0 2px rgba(203, 2, 34, .45),
        0 20px 45px rgba(203, 2, 34, .35);
}

/* El input es la capa clickeable */
.file-hidden {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    opacity: 0;
    cursor: pointer;
    z-index: 10;
}



/* ===== FIX DEFINITIVO DROP AREA ===== */



.module-card {
    width: 95%;
    margin: 30px auto;
    padding: 20px;

    background: rgba(0,0,0,.35);
    border-radius: 16px;
}

.module-card h2 {
    text-align: center;
    margin-bottom: 20px;
}

.module-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.label-text {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    letter-spacing: 0.08em;
}

.module-filter {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    color: #C4001A;
    font-weight: 600;
    letter-spacing: .5px;
}

.module-footer {
    text-align: center;
    margin: 30px 0;
}


/* ================== DASHBOARD GRID ================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    width: 95%;
    margin: 30px auto;
}

/* ================== COLUMNAS ================== */
.dashboard-left,
.dashboard-right {
    background: rgba(0,0,0,.35);
    border-radius: 18px;
    padding: 22px;
}

/* ================== TITULOS ================== */
.dashboard-section-title {
    text-align: center;
    margin-bottom: 18px;
    font-size: 15px;
    letter-spacing: .18em;
    color: var(--text-muted);
}

/* ================== TARJETAS ================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 14px;
    margin-bottom: 25px;
}

.dash-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    border-left: 3px solid #2c2c2c;
}

.dash-card.green {
    border-left: 3px solid #2ecc71;
}

.dash-card.red {
    border-left: 3px solid #CB0222;
}

.dash-card span {
    font-size: 12px;
    color: var(--text-muted);
}

.dash-card strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
}

/* ================== TABLAS ================== */
.dashboard-table h4 {
    margin-bottom: 10px;
    font-size: 14px;
    letter-spacing: .1em;
}

.dashboard-table table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
    padding: 10px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.dashboard-table th {
    color: var(--text-muted);
}

/* ================== RESPONSIVE ================== */
@media (max-width: 980px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-right {
    border-left: 2px solid rgba(203,2,34,.35);
}

.dash-card.full {
    grid-column: 1 / -1;
}

.toggle-eye {
    float: right;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
    margin-top: 6px;
}

.toggle-eye:hover {
    color: var(--accent-red);
}

.monto {
    user-select: none;
}

@media (max-width: 768px) {

    .form-actions {
        flex-direction: column;
        gap: 16px;
    }

    .form-actions button {
        width: 100%;
    }

    /* 🔴 CLAVE: neutralizar flex en móvil */
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        flex: none;
    }

    /* Ajuste visual correcto */
    .form-actions .btn-primary {
        padding: 14px 16px;
        font-size: 18px;
        border-radius: 14px;
    }

    .form-actions .btn-secondary {
        padding: 14px 16px;
        border-radius: 14px;
    }
}

/* ================== ESTADOS SISTEMA ================== */
.error {
    text-align: center;
    margin: 18px 0 10px 0;
    color: var(--accent-red);
    font-weight: 600;
    letter-spacing: .12em;
}

/* ===== BUSCADOR SELECT AJUSTE VICARMA ===== */

.form-group{
position:relative;
}

.lista-buscador{
position:absolute;
width:100%;
background:#0f172a;
border:1px solid #1f2a44;
border-radius:8px;
margin-top:2px;
display:none;
max-height:200px;
overflow-y:auto;
z-index:999;
}

.lista-buscador div{
padding:8px 12px;
cursor:pointer;
color:#cbd5e1;
}

.lista-buscador div:hover,
.lista-buscador .activo{
background:#dc2626;
color:#fff;
}

/* ===== TOAS COPIAR AL PORTAPAPELES ===== */

#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);

    background: rgba(11,14,20,0.95);
    color: #fff;

    padding: 16px 28px;
    border-radius: 12px;

    font-size: 16px;
    letter-spacing: 0.05em;

    border: 1px solid var(--accent-red);

    opacity: 0;
    transition: all 0.3s ease;

    z-index: 99999;
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
