/* =========================================
   1. RESET Y BASE
   ========================================= */
* {
    font-family: 'Pluto', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-font-smoothing: antialiased;
}

/* El body ahora es un contenedor Flex para centrar el login */
html, body {
    height: 100%;
    width: 100%;
    background-color: #0f172a; /* Fondo base oscuro */
    /* Fondo degradado moderno */
    background-image: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
                      radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
                      radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    color: #ffffff;
}

a { text-decoration: none; transition: 0.3s; }

/* =========================================
   2. LOGIN MODERN (Glassmorphism Centrado)
   ========================================= */

.login-wrapper {
    width: 100%;
    height: 100vh; /* Ocupa toda la pantalla */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Tarjeta Flotante */
.login-card {
    width: 100%;
    max-width: 900px;
    height: 550px;
    background: rgba(30, 41, 59, 0.7); /* Fondo semi-transparente */
    backdrop-filter: blur(20px);       /* Efecto cristal borroso */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    overflow: hidden;
}

/* Lado Izquierdo (Imagen) */
.login-image {
    width: 50%;
    position: relative;
    background-image: url("../../assets/img/backend.png");
    background-size: cover;
    background-position: center;
}

.overlay-image {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
}

.texto-imagen {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 2;
    color: white;
}
.texto-imagen h2 { font-size: 28px; font-weight: 700; margin-bottom: 5px; }
.texto-imagen p { font-size: 14px; opacity: 0.8; }

/* Lado Derecho (Formulario) */
.login-form {
    width: 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
}

.form-content {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.brand-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #94a3b8;
    text-transform: uppercase;
    display: block;
    margin-bottom: 25px;
}

.welcome-text { margin-bottom: 30px; }
.welcome-text .small { font-size: 14px; color: #cbd5e1; margin-bottom: 2px; }
.welcome-text .big { 
    font-size: 32px; 
    font-weight: 700; 
    color: #fff; 
    line-height: 1.1;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Inputs Animados */
.input-group {
    position: relative;
    margin-bottom: 25px;
    width: 100%;
}

.input-group input {
    width: 100%;
    padding: 12px 0;
    font-size: 15px;
    color: #fff;
    background: transparent;
    border: none;
    border-bottom: 2px solid #334155;
    transition: all 0.3s ease;
    border-radius: 0;
}

.input-group label {
    position: absolute;
    top: 12px;
    left: 0;
    font-size: 14px;
    color: #64748b;
    pointer-events: none;
    transition: 0.3s ease all;
}

.input-group input:focus,
.input-group input:not(:placeholder-shown) {
    border-bottom-color: #6366f1;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: -10px;
    font-size: 11px;
    color: #6366f1;
    font-weight: 600;
}

/* Botón Login */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(79, 70, 229, 0.6);
}

.footer-login {
    margin-top: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-footer {
    width: 100px;
    opacity: 0.6;
    margin-bottom: 10px;
    filter: grayscale(100%) brightness(200%);
}

.copyright { font-size: 11px; color: #475569; }
.copyright a { color: #64748b; }
.copyright a:hover { color: #fff; }

/* Responsive Login */
@media (max-width: 850px) {
    .login-image { display: none; }
    .login-card { max-width: 400px; height: auto; min-height: 500px; }
    .login-form { width: 100%; padding: 30px; }
}


/* =========================================
   3. PANEL INTERNO (SIDEBAR, MENU, ETC)
   (MANTENEMOS TU CÓDIGO ORIGINAL AQUÍ)
   ========================================= */

/* SIDEBAR */
.logo {
    position: fixed;
    top: 0;
    left: 0;
    width: 75px;
    height: 100vh;
    background: radial-gradient(circle at 0 0, #312E81 0, #111827 50%, #020617 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
    z-index: 100;
}

.logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 12px;
    background: #0F172A;
    padding: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.logo-divider {
    margin-top: 24px;
    width: 32px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.6);
}

/* TOPBAR */
.menu {
    position: fixed;
    top: 0;
    left: 75px;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 10px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    padding: 0 22px;
    z-index: 90;
}

/* Reset de color para el panel interno (ya que el body es oscuro por el login) */
.menu, .item-des, .item-des-mob, .item-des-small, .items-trans {
    color: #111827; /* Vuelve a color oscuro para textos */
}
/* Forzamos fondo claro en el contenedor principal si es necesario */
body.dashboard-mode {
    background: #F3F4F6 !important;
    background-image: none !important;
    overflow: auto !important;
    display: block !important;
}

/* Tabs desktop */
.opciones {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabs mobile (iconos) */
.opciones-mob {
    display: none;
    border-collapse: collapse;
}

.opciones-mob img {
    margin: 0 8px;
}

.item-menu {
    color: #6B7280;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.item-menu:hover {
    background-color: #E5EDFF;
    color: #1D4ED8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
}

.item-menu-active {
    background: #EEF2FF;
    color: #1D4ED8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Botón cerrar / perfil */
.cerrar {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.cerrar img {
    margin-right: 4px;
    cursor: pointer;
    filter: grayscale(0.1);
    transition: transform 0.1s ease, filter 0.1s ease;
}

.cerrar img:hover {
    transform: scale(1.05);
    filter: grayscale(0);
}

/* CONTENEDOR PRINCIPAL */
.items-trans {
    padding: 96px 24px 32px 114px; /* espacio por sidebar + topbar */
}

/* CARD PRINCIPAL POR ITEM (desktop) */
.item-des {    
    background: #FFFFFF;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 28px 28px 22px;
    width: 100%;
    max-width: 1180px;
    margin: 20px auto;
    border: 1px solid #E5E7EB;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.item-des:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    border-color: #CBD5F5;
}

/* CARD Tablet */
.item-des-mob {    
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    border-radius: 14px;
    padding: 20px;
    width: 90%;
    max-width: 840px !important;
    margin: 16px auto;
    border: 1px solid #E5E7EB;
    display: none;
}

/* CARD Mobile pequeña */
.item-des-small {    
    background: #FFFFFF;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 18px 16px;
    width: 94%;
    max-width: 420px;
    margin: 14px auto;
    border: 1px solid #E5E7EB;
    display: none;
}

.campo {
    padding: 10px;    
    border-radius: 8px;
    text-align: left;
    width: calc(100% - 20px);
}

.valor {
    color: #111827;
    font-size: 13px;
    font-weight: 600;
}

.etiquetaVal {
    font-size: 12px;
    color: #6B7280;
}

.item-des td,
.item-des-mob td {
    padding: 3px 5px;
}

/* GRUPOS / TAGS */
.separador-vertical {
    width: 2px;
    height: 20px; 
    background-color: #2563EB;
    border-radius: 999px;
}

.grupo {
    text-align: center;
    color: #fff;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
}

/* BOTONES CONTROL */
.control,
.control-off {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 8px 10px;
    border: 1px solid #D1D5DB;
    border-bottom-width: 4px;
    text-align: center;
    width: 140px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.control table,
.control-off table {
    margin: 0 auto;
} 

.control td,
.control-off td {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

/* Estados */
.control {
    border-bottom-color: #2563EB;
}

.control:hover {
    transform: translateY(-1px);
    background: #EFF6FF;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
    border-color: #2563EB;
}

.control-off {
    cursor: not-allowed;
    border-style: dashed;
    border-bottom-color: #9CA3AF;
    color: #9CA3AF;
}

.control-off td {
    color: #9CA3AF;
}

.fin {
    cursor: not-allowed !important;
    border-bottom-color: #F1416C !important;        
}

.msg-status,
.msg-status-off {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
}

.msg-status {
    background: #FEF2F2;
    color: #B91C1C;
}

.msg-status-off {
    background: #E5E7EB;
    color: #4B5563;
}

/* Footer Panel interno */
.copyright-in {
    font-size: 12px;
    font-weight: 400;
    width: 100%;
    text-align: center !important;
    background-color: #fff;
    position: absolute;
    bottom: 0px;
    left: 0px;
    padding: 10px 0;
}
.copyright-in a {
    color: #1F2763;
}

/* RESPONSIVE PANEL */

@media (max-width: 800px) {
    .logo {
        height: 64px;
        width: 64px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding-top: 0;
    }

    .logo-divider {
        display: none;
    }

    .items-trans {
        padding: 20px 16px 24px 16px;
    }

    .menu {
        left: 0;
        padding-left: 72px;
    }
}

/* Tablet */
@media (min-width: 528px) and (max-width: 1063px) {
    .item-des { display: none; } 
    .item-des-mob { display: block; }
    .item-des-small { display: none; }
    .valor { font-size: 14px; }
    .control, .control-off { width: 120px; padding: 6px 8px; }
}

/* Mobile */
@media (max-width: 527px) {
    .opciones-mob { display: table; }
    .opciones { display: none; }
    .menu { justify-content: flex-start; padding: 0 12px 0 64px; }
    .item-des { display: none; } 
    .item-des-mob { display: none; }
    .item-des-small { display: block; }
    .valor { font-size: 14px; }
    .control, .control-off {
        padding: 6px 4px !important;
        margin: 4px 0px !important;
        width: 108px;
    }
}

/* Ajustes extra */
@media (max-width: 1063px) {
    .control td, .control-off td { font-size: 12px; }
}

@media (max-width: 761px) {
    #msg-mob { display: none; }
    #control-mob { display: none; }
    #control-mob-2 { display: table; } 
}