/* --- VARIABLES Y RESET --- */
:root {
    --primary-color: #0f172a;
    /* Slate 900 */
    --primary-light: #1e293b;
    /* Slate 800 */
    --accent-color: #2563eb;
    /* Blue 600 */
    --accent-hover: #1d4ed8;
    /* Blue 700 */
    --accent-secondary: #a855f7;
    /* Purple 600 */
    --accent-vibrant: #06b6d4;
    /* Cyan 600 */
    --bg-color: #f8fafc;
    /* Slate 50 */
    --surface-color: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;

    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;

    --sidebar-width: 280px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Legacy Compatibility */
    --color-principal: var(--primary-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Shared defaults */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: #0b1120;
    /* Slate 950 */
    color: var(--white);
    display: flex;
    overflow: scroll;
    flex-direction: column;
    height: 100vh;
    padding: 32px 20px;
    z-index: 50;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-header {
    margin-bottom: 48px;
    text-align: center;
}

.logo-container {
    width: 64px;
    height: 64px;
    background: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    padding: 8px;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
}

.brand-logo {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--white);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-icon {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.nav-link.active {
    background: var(--accent-color);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* --- MAIN CONTENT --- */
.main-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    scroll-behavior: smooth;
    height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.025em;
}

/* --- CARDS --- */
.card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.card-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-vibrant {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    color: white;
    border: none;
}

.card-vibrant .card-title,
.card-vibrant .balance-amount {
    color: white;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 8px 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, filter 0.3s ease;
}

.balance-updating {
    transform: scale(0.95);
    opacity: 0.5;
    filter: blur(4px);
}

/* --- LOGIN PAGE --- */
#login-screen {
    position: fixed;
    inset: 0;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    background: var(--surface-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

/* --- TABLES --- */
.table-container {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 12px 24px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.custom-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background-color: #f8fafc;
}

/* --- UI COMPONENTS --- */
.badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(to right, var(--accent-color), var(--accent-hover));
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.btn-vibrant {
    background: linear-gradient(to right, var(--accent-secondary), #d946ef);
    color: white;
    border: none;
}

.btn-vibrant:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-main);
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    ring: 2px solid rgba(37, 99, 235, 0.1);
}

/* --- MODALS --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* --- TOASTS --- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- DOCUMENT UPLOAD LIST --- */
.doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent-color);
}

/* --- GRID LAYOUTS --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* --- ANIMATIONS --- */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

/* --- PUBLIC SITE OVERRIDES --- */
body.public-body {
    display: block;
    height: auto;
    overflow-y: auto;
    text-align: left;
    /* Reset from old css 'text-align: center' if needed, but 'mjo' had center */
}

/* Ported Styles from MJO */


* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

section {
    margin-bottom: 50px;
}

i {
    margin: 0 5px 0 0;
}

article {
    text-align: left;
    padding: 20px;

    & p,
    h2,
    h3,
    ol {
        max-width: 800px;
        margin: auto;
    }

    & ol {
        padding-left: 40px;
    }
}

h3,
h2 {
    padding: 20px;
}

p {
    line-height: 1.5rem;
    padding-bottom: 30px;
}

.btn-contacto {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    margin-top: 20px;
    text-decoration: none;
}

.btn-contacto i {
    margin: 10px;
}

a.btn-contacto:link,
a.btn-contacto:active,
a.btn-contacto:visited {
    color: var(--primary-color);
}

a.btn-contacto:hover {
    background-color: var(--success);
    border: 2px solid var(--success);
    color: white;

    & .icono-menu {
        color: white;
    }
}

.encabezado {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 35vh;
}

.img-article,
.fondo-encabezado {
    width: 100%;
    height: 40vh;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.img-article {
    z-index: -90;
    filter: blur(1px);
}

.fondo-encabezado {
    z-index: -89;
    background-color: var(--primary-color);
    opacity: .6;
}

.title-article {
    font-size: 2rem;
}

.tabla-usuarios {
    /* border: 1px solid; */
    width: 100%;
    border-collapse: collapse;

    & tr:nth-child(even) {
        background-color: #f2f2f2;
    }

    & tr:hover {
        background-color: var(--primary-color);
        color: white;
    }

    & th,
    td {
        border-bottom: 1px solid;
        padding: 15px;
    }

    & th {
        background-color: var(--primary-color);
        color: white;
    }
}


input[type=file] {
    display: none;
}


/* --- EXTRACTED INLINE STYLES --- */

menu {
    width: 100%;
    height: 60px;
    background-color: var(--color-principal);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9;
}

/* Seccion que empuja el contenido hacia abajo */
#posMennu {
    height: 60px;
    width: 100%;
    z-index: -1;
}

.menuSections {
    padding: 0 30px;

    & ul {
        list-style: none;
    }
}

.logo-menu {
    font-size: 30px;
    color: white;
}

.menuItems {
    margin: 0 10px;
    display: flex;
    cursor: pointer;
}

.logoPrincipal {
    width: 25%;
}

.blanco {
    color: white;
}

.d-flex {
    display: flex;
}

a:active.cfr,
a:link.cfr,
a:hover.cfr,
a:visited.cfr {
    color: white;
    font-weight: 700;
    text-decoration: none;
}

a:active.menu,
a:link.menu,
a:hover.menu,
a:visited.menu {
    color: white;
    font-weight: 400;
    text-decoration: none;
}

#contacto-wpp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9;
}

.colorWpp {
    color: #14e147;
}

.v-tablet {
    display: none;
}

@media only screen and (min-width:768px) {
    .v-tablet {
        display: block;
    }
}


.menu-completo {
    position: fixed;
    width: 100%;
    height: 100vh;
    top: -200vh;
    left: 0;
    z-index: 10;
    background-color: var(--color-principal);
    color: white;
    overflow: auto;
}

.menu-completo ul li {
    padding: 10px;
}

.showMenu {
    top: 0;
    transition: all 0.5s ease-in-out;
}

.unShowMenu {
    top: -100vh;
    transition: all 0.5s ease-in-out;
}

.pointer {
    cursor: pointer;
}


video {
    position: absolute;
    top: 0;
    height: 60vh;
    height: calc(80vh - 3rem);
    z-index: -1;
    transform-origin: center;
}

li {
    list-style: none;
}

.home-video {
    overflow: hidden;
    position: relative;
    height: calc(80vh - 3rem);
    display: flex;
    justify-content: center;
    align-items: center;
}

.text-home-video {
    display: block;
}

.slide-empresas {
    background-color: white;
    overflow: hidden;
}

.slide-empresas ul {
    list-style: none;
}

.slider {
    width: 100vw;
    height: auto;
    margin: auto;
    overflow: hidden;
}

.slider .slide-track {
    display: flex;
    animation: scroll 40s linear infinite;
    -webkit-animation: scroll 40s linear infinite;
    width: calc(200px * 14);
}

.slider .slide {
    width: 200px;
}

.slider .slide img {
    width: 100%;
}

.slide {
    margin-right: 50px;
}

.registrarse {
    padding: 30px 0;
    color: white;
    background-color: var(--color-principal);
}

.italic {
    font-style: italic;
}

.tradingview-widget-container>div {
    text-align: center;
    height: 60vh;
    max-width: 90%;
    margin: auto;
}

.resumen-final {
    padding: 30px 0;
    margin-bottom: 0;
    color: white;
    background-size: cover;
    background-image: url("../images/trading_Moment.jpg");
    background-repeat: no-repeat;
}

.mar-top-30px {
    text-align: center;
    margin: 30px 0;

    & ul li {
        margin: 10px 0;
    }
}

@keyframes scroll {
    0% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }

    100% {
        -webkit-transform: translateX(calc(-200px * 7));
        transform: translateX(calc(-200px * 7));
    }
}

@media (min-width:480px) {

    video {
        height: auto;
        width: 100%;
        transform: scale(2);
    }

    .view-tablet {
        display: flex;
    }
}


footer {
    background: black;
    color: white;
}

.link-final {
    padding: 20px 10px;
}


.disclaimer {
    padding: 10px;
}

.link-final {
    text-align: center;
}

a:active.verMas,
a:link.verMas,
a:hover.verMas,
a:visited.verMas {
    color: white;
    font-weight: 700;
}