/* main.css - Variables globales actualizadas para un diseño "premium" */
:root {
    /* Paleta vibrante y moderna (Dark Theme base) */
    --color-primary: #00e5ff;
    /* Cyan Neón para acciones principales */
    --color-primary-hover: #00b4d8;
    --color-secondary: #03045e;
    --color-bg-dark: #0f172a;
    /* Fondo principal oscuro (Slate) */
    --color-bg-card: rgba(30, 41, 59, 0.7);
    /* Glassmorphism fondo */

    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;

    --color-error: #ef4444;
    /* Rojo brillante para errores */
    --color-success: #10b981;

    --font-family-base: 'Poppins', sans-serif;
    --border-radius-lg: 16px;
    --border-radius-md: 8px;

    --transition-fast: 0.2s ease-in-out;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    color: var(--color-text-main);
    background-color: var(--color-bg-dark);
    /* Imagen de fondo sutil o gradiente para dar aspecto "Premium Gym" */
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Utilidades generales */
.hidden {
    display: none !important;
}

/* Animación de fade-in base */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Touch Targets Global para Mobile (Minimum 48px height) */
@media (max-width: 480px) {
    input, button, select, textarea, .nav-item {
        min-height: 48px;
    }
}

/* MODO CLARO / LIGHT THEME */
body.light-theme {
    background: #f1f5f9;
    --color-bg-dark: #f1f5f9;
    --color-bg-card: #ffffff;
    --color-text-main: #0f172a;
    --color-text-muted: #475569;
    --color-primary: #0284c7;
    --color-primary-hover: #0369a1;
}

body.light-theme .sidebar {
    background: rgba(255, 255, 255, 0.95) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .sidebar-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .nav-item {
    color: #475569 !important;
}

body.light-theme .nav-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #0f172a !important;
}

body.light-theme .nav-item.active {
    background: rgba(2, 132, 199, 0.1) !important;
    color: #0284c7 !important;
}

body.light-theme .content-header {
    background: rgba(255, 255, 255, 0.8) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .btn-icon {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #0f172a !important;
}

body.light-theme .btn-icon:hover {
    background: rgba(2, 132, 199, 0.1) !important;
    color: #0284c7 !important;
}

body.light-theme .stat-card,
body.light-theme .panel,
body.light-theme .admin-modal,
body.light-theme .notifications-dropdown {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .panel-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .panel h3,
body.light-theme .notif-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .notif-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .notif-item:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .welcome-banner {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(124, 58, 237, 0.05)) !important;
    border: 1px solid rgba(2, 132, 199, 0.2) !important;
}

/* Campos de formulario */
body.light-theme input,
body.light-theme select,
body.light-theme textarea {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* Modales y utilidades extra que tengan fondos rgba con negro */
body.light-theme .msg-dashboard,
body.light-theme .client-msg-dashboard,
body.light-theme #msg-view-new,
body.light-theme #msg-view-history,
body.light-theme #c-msg-thread {
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}

body.light-theme #msg-client-list,
body.light-theme #msg-history-list > div {
    background: #f1f5f9 !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}

body.light-theme label,
body.light-theme .client-checkbox + span {
    color: #475569 !important;
}


body.light-theme .btn-logout {
    border-color: rgba(0,0,0,0.1) !important;
}

/* Fuerza el texto oscuro en contenedores y títulos que tengan color:white inline (excluye botones) */
body.light-theme div[style*="color: white"],
body.light-theme div[style*="color:white"],
body.light-theme h2[style*="color: white"],
body.light-theme h2[style*="color:white"],
body.light-theme h3[style*="color: white"],
body.light-theme h3[style*="color:white"],
body.light-theme h4[style*="color: white"],
body.light-theme h4[style*="color:white"],
body.light-theme span[style*="color: white"],
body.light-theme span[style*="color:white"] {
    color: var(--color-text-main) !important;
}