/* =========================================
   1. VARIABLES Y CONFIGURACIÓN GENERAL
   ========================================= */
:root {
    /* Paleta de Colores inspirada en Paneles Hosting */
    --plesk-bg-body: #f3f6f9;       /* Gris muy suave de fondo */
    --plesk-sidebar-bg: #262b36;    /* Azul oscuro noche (Sidebar) */
    --plesk-sidebar-width: 250px;
    --plesk-primary: #0d6efd;       /* Azul corporativo */
    --plesk-text-dark: #3a405b;     /* Texto principal */
    --plesk-text-muted: #6c757d;    /* Texto secundario */
    --card-shadow: 0 0.75rem 1.5rem rgba(18, 38, 63, 0.03);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--plesk-bg-body);
    color: var(--plesk-text-dark);
    overflow-x: hidden; /* Evita scroll horizontal */
}

a {
    text-decoration: none;
}

/* =========================================
   2. LAYOUT PRINCIPAL (Wrapper)
   ========================================= */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#content {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

/* =========================================
   3. SIDEBAR (Estilo Plesk Obsidian)
   ========================================= */
#sidebar {
    min-width: var(--plesk-sidebar-width);
    max-width: var(--plesk-sidebar-width);
    background: var(--plesk-sidebar-bg);
    color: #fff;
    transition: all 0.3s;
    z-index: 999;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#sidebar ul.components {
    padding: 15px 0;
}

#sidebar ul li {
    margin-bottom: 2px;
}

#sidebar ul li a {
    padding: 12px 25px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: #aeb4be; /* Gris claro para inactivos */
    transition: 0.2s;
    border-left: 4px solid transparent;
}

#sidebar ul li a i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Estado Hover */
#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

/* Estado Activo (Página actual) */
#sidebar ul li.active > a {
    color: #fff;
    background: rgba(13, 110, 253, 0.1); /* Azul muy tenue */
    border-left: 4px solid var(--plesk-primary); /* Borde azul a la izquierda */
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
}

/* Sidebar colapsado (Clase controlada por JS) */
#sidebar.active {
    margin-left: calc(var(--plesk-sidebar-width) * -1);
}

/* =========================================
   4. TOPBAR (Barra Superior)
   ========================================= */
.topbar-divider {
    width: 0;
    border-right: 1px solid #e3e6f0;
    height: calc(4.375rem - 2rem);
    margin: auto 1rem;
}

.navbar {
    background: #fff;
    border-bottom: 1px solid #e3e6f0;
}

/* =========================================
   5. COMPONENTES VISUALES (Tarjetas y Tablas)
   ========================================= */

/* Tarjetas estilo Plesk (Limpias y con sombra suave) */
.card-plesk {
    background: #fff;
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease-in-out;
}

.card-header-plesk {
    padding: 1rem 1.5rem;
    margin-bottom: 0;
    background-color: #fff;
    border-bottom: 1px solid #f0f2f5;
    font-weight: 600;
    color: var(--plesk-text-dark);
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Tablas */
.table th {
    font-weight: 600;
    color: var(--plesk-text-muted);
    border-top: none;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    color: var(--plesk-text-dark);
    font-size: 0.9rem;
}

/* Badges (Etiquetas) suavizadas */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Fuente monoespaciada para IPs y Keys */
.font-monospace {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
    color: #d63384; /* Color rosado tipo código */
    background: rgba(214, 51, 132, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
}

/* =========================================
   6. PÁGINA DE LOGIN (Index)
   ========================================= */
.login-body {
    background-color: var(--plesk-bg-body);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-top: 4px solid var(--plesk-primary);
}

/* =========================================
   7. RESPONSIVE (Móvil)
   ========================================= */
@media (max-width: 768px) {
    /* En móvil, el sidebar empieza oculto */
    #sidebar {
        margin-left: calc(var(--plesk-sidebar-width) * -1);
    }
    
    /* Y si le añadimos la clase active, se muestra */
    #sidebar.active {
        margin-left: 0;
    }
    
    #content {
        width: 100%;
    }
}