/* ==========================================================================
   GLOBAL.CSS - Multinegocio Baboons (Unified & Refactored)
   ========================================================================== */

:root {
    /* --- PROFESSIONAL LIGHT PALETTE --- */
    --primary-color: #2563eb;    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --accent-color: #0ea5e9;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    
    /* --- EXTENDED PALETTE (Fix invisibles) --- */
    --secondary-color: #64748b;  /* Slate Gray */
    --secondary-hover: #475569;
    --light-color: #f8fafc;
    --light-hover: #f1f5f9;
    --dark-color: #0f172a;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;

    /* --- CLEAN UI THEME --- */
    --bg-body: #f8fafc;         /* Light Blue-Grey */
    --bg-card: #ffffff;
    --bg-header: #1e293b;       /* Dark Header (Safe contrast) */
    --bg-input: #ffffff;
    --bg-light: #f1f5f9;

    --text-main: #1e293b;       /* Dark Slate Text */
    --text-muted: #64748b;
    --text-light: #ffffff;

    --border-color: #e2e8f0;
    --glass-border: #e2e8f0;

    /* --- SPACING & RADIUS --- */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    /* --- TYPOGRAPHY --- */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Inter', sans-serif;

    /* --- SHADOWS --- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --header-height: 65px;
}

/* --- 1. RESET & BASE --- */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    font-weight: 500;
}

main {
    padding: var(--spacing-xl);
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- 2. LAYOUT COMPONENTS --- */

/* Header */
header {
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 0 var(--spacing-xl);
    display: none;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    height: 100%;
}

#header-logo {
    max-height: 48px; /* Fixed "huge" logo issue */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

#header-logo:hover {
    transform: scale(1.05);
}

/* Navigation */
.nav-container {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

#main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

#main-nav > a,
#main-nav .dropbtn,
.nav-link-home,
.auth-btn {
    background: rgba(255, 255, 255, 0.05); /* Sutil fondo base */
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light) !important;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* El botón Inicio mantiene su brillo especial */
.nav-link-home {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #f97316 100%);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
    border: none !important;
}

#main-nav > a:hover,
#main-nav .dropdown:hover > .dropbtn,
.auth-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Estilo para el botón activo o destacado (opcional para dar ritmo) */
#main-nav > a.active {
    background: var(--primary-gradient);
    color: white !important;
}
.nav-link-home:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

#main-nav > a.active,
#main-nav .dropdown.active > .dropbtn,
.nav-link-home.active {
    color: white !important;
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    border-radius: 12px;
    right: 0;
    margin-top: 5px; /* Reducimos un poco el gap visual */
    padding: 8px;
    border: 1px solid var(--glass-border);
    animation: dropdownFadeIn 0.2s ease-out;
}

/* ✨ Puente invisible para evitar que el menú se cierre al bajar el mouse */
.dropdown-content::before {
    content: "";
    position: absolute;
    top: -15px; 
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-content a {
    color: var(--text-muted);
    padding: 10px 16px;
    display: block;
    text-align: left;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Mobile Hamburger */
.hamburger-btn {
    display: none;
    font-size: 2em;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
}

/* Business Selector Bar */
#business-selector-bar {
    background-color: var(--bg-light);
    padding: 8px var(--spacing-xl);
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
    min-height: 40px;
}

#business-selector-bar label,
#business-display-name {
    font-weight: bold;
    font-size: 0.85em;
    margin: 0;
    color: var(--text-main);
}

#business-selector-bar select {
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.85em;
    margin-left: 5px;
}

#active-business-name-display {
    font-weight: normal;
}

/* --- 3. UTILITIES & COMPONENTS --- */

/* Buttons & Interactive Elements */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 12px -1px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white !important;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-success {
    background-color: var(--success-color);
    color: white !important;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white !important;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white !important;
}

/* Outline Buttons */
.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--gray-300);
    color: var(--text-muted) !important;
}

.btn-outline-secondary:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--text-main) !important;
}

/* Small Buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Glass Buttons */
.btn-glass-primary {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-glass-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.btn-glass-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Cards & Glassmorphism */
.card,
.app-card,
.stat-card,
.login-container,
.premium-glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-control,
.glass-input,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.3s;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* Custom Baboons Modals (Unified Premium Style) */
.baboons-modal {
    display: none;
    position: fixed;
    z-index: 2100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.baboons-modal-content {
    background-color: #ffffff;
    border-radius: 28px;
    width: 95%;
    max-width: 550px;
    box-shadow: 0 30px 60px -12px rgba(15, 23, 42, 0.3);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 1);
    animation: baboons-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes baboons-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.baboons-modal-content.large {
    max-width: 950px;
}

.baboons-modal-content .modal-body {
    overflow-y: auto;
    flex-grow: 1;
    padding: 25px;
    scrollbar-width: thin;
}

.baboons-modal-header {
    background: #1e293b;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.baboons-modal-header h3 {
    margin: 0;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.close-button {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close-button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Premium Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    display: block;
}
.baboons-modal-content input, 
.baboons-modal-content select, 
.baboons-modal-content textarea {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.3s;
}
.baboons-modal-content input:focus, 
.baboons-modal-content select:focus,
.baboons-modal-content textarea:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
    outline: none;
    background: white;
}
.baboons-modal-content .form-actions,
.baboons-modal-content form .form-actions {
    padding: 24px 30px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.baboons-modal-content .modal-body {
    padding: 24px 30px;
    overflow-y: auto;
}

/* --- 8. PREMIUM MODAL SYSTEM (Floating / High Depth) --- */
.premium-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2500;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.premium-modal-content {
    background-color: #fff;
    border-radius: 20px;
    border: none;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    margin: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    animation: modal-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-up {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.premium-modal-header {
    background: #212529;
    color: white;
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.premium-modal-header h1, 
.premium-modal-header h2, 
.premium-modal-header h3, 
.premium-modal-header h4, 
.premium-modal-header h5 {
    margin: 0;
    color: white;
}

.premium-modal-header .btn-close-modal {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
}

.premium-modal-header .btn-close-modal:hover {
    opacity: 0.7;
}

.premium-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex-grow: 1;
}

.premium-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #f0f0f0;
    background: #fdfdfd;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --- 8.5 BABOONS BULK BAR (Floating Premium) --- */
.baboons-bulk-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 850px;
    z-index: 2100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(0, 123, 255, 0.2) !important;
    border-radius: 100px !important;
    box-shadow: 0 15px 35px rgba(0, 123, 255, 0.15), 0 5px 15px rgba(0,0,0,0.05) !important;
    padding: 8px 12px;
    display: none;
    animation: bulk-slide-up 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bulk-slide-up {
    from { transform: translateX(-50%) translateY(100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.baboons-bulk-bar .card-body {
    padding: 0 15px !important;
    background: transparent !important;
}

.baboons-bulk-bar .selected-count-badge {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

/* --- 9. Loader --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader-spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Search Results */
.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    width: 100%;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: var(--shadow-md);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
}

.search-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    border-bottom: 1px solid #f0f0f0;
}

.search-item:hover {
    background-color: var(--bg-light);
}

/* Row Selection Styles */
tr.table-active {
    background-color: #e0eaff !important; /* Soft blue */
    border-left: 4px solid var(--primary-color) !important;
    transition: background-color 0.2s ease;
}

tr.table-active td {
    background-color: transparent !important;
    color: var(--dark-color) !important;
}

/* --- 4. DASHBOARD GRID (Merged) --- */
.app-dashboard {
    padding: var(--spacing-xl);
    text-align: center;
}

.dashboard-title {
    font-size: 2em;
    color: var(--text-main);
    margin-bottom: 30px;
    font-weight: 300;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    min-height: 120px;
    text-decoration: none;
    padding: 15px;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.app-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    object-fit: contain;
}

.app-name {
    font-size: 0.9em;
    color: #555;
    text-align: center;
    font-weight: 500;
}

/* --- 4.1 AUTOMATIC PREMIUM LIGHT THEME (Requested) --- */
/* Applied to anything inside .app-dashboard or .app-grid */
.app-dashboard .app-card, 
.app-grid .app-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    margin: 5px;
}

.app-dashboard .app-card:hover,
.app-grid .app-card:hover {
    background: #ffffff !important;
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}


.app-dashboard .app-name,
.app-grid .app-name {
    color: #1e293b !important;
    font-weight: 600;
}

.dashboard-title {
    color: #1e293b !important;
    font-weight: 700;
    margin-bottom: 25px;
}

/* 🎨 CLASE GLOBAL PARA TÍTULOS DE SECCIÓN */
.dashboard-section-title {
    color: #334155 !important;
    text-align: left;
    font-size: 1.15rem;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-left: 20px;
    font-weight: 700;
    border-left: 4px solid var(--primary-color);
}

/* 🛠️ PARCHE DE LIMPIEZA (RESPETAR ESTILOS ORIGINALES DE SUBMÓDULOS) */
#content-area {
    color: #1e293b;
}

#content-area h1,
#content-area h2,
#content-area h3:not(.dashboard-section-title) {
    color: #0f172a !important;
}

#content-area label,
#content-area .form-label,
#content-area th {
    color: #475569 !important;
    font-weight: 600 !important;
}

/* =================================================================
   ✨ MEJORAS GLOBALES DE INTERFAZ (ALTO CONTRASTE)
   ================================================================= */

/* 🚀 SOBREESCRITURA GLOBAL DE SWITCHES DE BOOTSTRAP */
.form-switch .form-check-input {
    width: 2.8rem !important;
    height: 1.5rem !important;
    background-color: #adb5bd !important; /* Gris visible cuando está apagado */
    border-color: #6c757d !important;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.15s ease-in-out;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='white'/%3e%3c/svg%3e") !important;
}

.form-switch .form-check-input:checked {
    background-color: #198754 !important; /* Verde Esmeralda intenso */
    border-color: #198754 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='white'/%3e%3c/svg%3e") !important;
    box-shadow: 0 0 8px rgba(25, 135, 84, 0.4) !important;
}

.form-switch .form-check-input:focus {
    border-color: #198754;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

.form-switch .form-check-input:not(:checked) {
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1) !important;
}

/* Etiquetas asociadas a switches */
.form-check-label {
    padding-left: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

#nprogress .bar {
    background: #007bff !important;
    height: 3px !important;
}

#content-area .card-body,
#content-area .table-container {
    background: #ffffff !important;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}

#content-area input,
#content-area select,
#content-area textarea {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

#content-area td {
    color: #334155 !important;
}


.nav-link-home {
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white !important;
    font-weight: 700;
}

.nav-link-home i {
    font-size: 1.1rem;
}

.nav-link-home:hover {
    background: rgba(255,255,255,0.2);
    color: #ffffff !important;
}

/* Background Support (Clean Light) */
body {
    background-color: #f8fafc;
}

/* --- 5. NOTIFICATIONS (Merged) --- */
#notification-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notif-toast {
    background: white;
    min-width: 300px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border-left: 6px solid #333;
    pointer-events: auto;
    cursor: pointer;
    animation: slideInRight 0.3s ease-out forwards;
}

.notif-toast.success {
    border-left-color: var(--success-color);
    color: #212529;
}

.notif-toast.error {
    border-left-color: var(--danger-color);
    color: #c0392b;
}

.notif-toast.warning {
    border-left-color: var(--warning-color);
    color: #d35400;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- 6. ROLES & VISIBILITY --- */
.admin-only,
.superadmin-only,
.operador-only {
    display: none !important;
}

body.rol-operador .operador-only {
    display: block !important;
}

body.rol-admin .admin-only,
body.rol-superadmin .admin-only {
    display: block !important;
}

body.rol-superadmin .superadmin-only {
    display: block !important;
}

/* Display Corrections for Specific Elements */
body.rol-admin .app-grid.admin-only,
body.rol-superadmin .app-grid.admin-only,
body.rol-superadmin .app-grid.superadmin-only {
    display: grid !important;
}

body.rol-admin .dropdown.admin-only,
body.rol-superadmin .dropdown.admin-only,
body.rol-superadmin .dropdown.superadmin-only {
    display: inline-block !important;
}

/* --- 7. APP MODE VISIBILITY (Obsolete - Handled Dynamically) --- */
/* Las clases .nav-retail, .nav-consorcio, etc. ya no son necesarias gracias al Navbar Dinámico */
/* --- 10. ADMIN SPECIFIC UTILITIES --- */
.tabs-premium {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 5px;
}

.tabs-premium .tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.tabs-premium .tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.tabs-premium .tab-accent { color: var(--success-color); border-color: rgba(16, 185, 129, 0.2); }
.tabs-premium .tab-info { color: var(--accent-color); border-color: rgba(6, 182, 212, 0.2); }

.tab-divider {
    width: 1px;
    height: 30px;
    background: var(--glass-border);
    align-self: center;
    margin: 0 5px;
}

.sticky-footer-actions {
    position: sticky;
    bottom: -25px;
    margin: 30px -25px -25px -25px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    z-index: 100;
}

.hover-bg-dark:hover {
    background: rgba(255, 255, 255, 0.03);
}

.text-accent { color: var(--accent-color); }

/* Glass Table */
.glass-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.glass-table thead th {
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 15px;
}

.glass-table tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
}

.glass-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.glass-table td {
    padding: 15px;
    border: none;
    vertical-align: middle;
}

.glass-table tr td:first-child { border-radius: 12px 0 0 12px; }
.glass-table tr td:last-child { border-radius: 0 12px 12px 0; }

body.app-distribuidora #main-nav .nav-distribuidora {
    display: block !important;
}

body.app-retail #main-nav a.nav-retail,
body.app-consorcio #main-nav a.nav-consorcio,
body.app-rentals #main-nav a.nav-rentals,
body.app-distribuidora #main-nav a.nav-distribuidora {
    display: revert !important;
}

/* --- 8. RESPONSIVE --- */
@media (max-width: 900px) {
    header {
        padding: 10px 15px;
        min-height: 50px;
    }

    .logo-container {
        height: 30px;
    }

    .hamburger-btn {
        display: block;
    }

    .nav-container {
        display: none;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background-color: #333333;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .nav-container.is-active {
        display: block;
    }

    #main-nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
        gap: 0;
    }

    #main-nav>a,
    #main-nav>.dropdown {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    #main-nav>a,
    #main-nav>.dropdown>.dropbtn {
        padding: 15px 20px;
        border-bottom: 1px solid #555555;
        border-radius: 0;
    }

    .dropdown-content {
        position: static;
        display: block;
        background-color: #444;
        box-shadow: none;
        padding-left: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    #business-selector-bar {
        padding: 8px 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .app-dashboard {
        padding: 20px 15px;
    }

    .app-dashboard .app-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 100%;
        gap: 15px;
    }
}

/* app/static/css/global.css additions */

/* --- TABLE STYLES (GENERIC) --- */
.table,
.tabla-bonita,
.tabla-venta-elegante {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
    font-size: 0.95em;
}

.table th,
.tabla-bonita th,
.tabla-venta-elegante th,
.table td,
.tabla-bonita td,
.tabla-venta-elegante td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table thead th,
.tabla-bonita thead th,
.tabla-venta-elegante thead th {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.table tbody tr:hover,
.tabla-bonita tbody tr:hover,
.tabla-venta-elegante tbody tr:hover {
    background-color: var(--bg-light);
}

.table-responsive,
.tabla-contenedor {
    overflow-x: auto;
    width: 100%;
}

/* --- FORM GRID UTILITIES --- */
.form-grid-3-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.grid-col-span-3 {
    grid-column: span 3;
}

@media (max-width: 900px) {
    .grid-col-span-3 {
        grid-column: span 1;
    }
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    margin-top: var(--spacing-md);
}

/* --- PAGE HEADER --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-sm);
}

.page-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* app/static/css/global.css additions */

/* --- MARGIN UTILITIES --- */
.mb-4 {
    margin-bottom: var(--spacing-lg);
}

/* --- GRID UTILITIES --- */
.grid-col-span-2 {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .grid-col-span-2 {
        grid-column: span 1;
    }
}

/* --- ROLE VISIBILITY --- */
.superadmin-only {
    display: none !important;
}

body.rol-superadmin .superadmin-only {
    display: flex !important;
}

/* --- PREMIUM ADMIN UTILITIES (Phase 3) --- */
.premium-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    text-transform: uppercase;
}

.status-success { background: rgba(16, 185, 129, 0.1); color: var(--success-color); border-color: rgba(16, 185, 129, 0.2); }
.status-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger-color); border-color: rgba(239, 68, 68, 0.2); }
.status-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); border-color: rgba(245, 158, 11, 0.2); }
.status-muted { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border-color: rgba(148, 163, 184, 0.2); }

.cursor-pointer { cursor: pointer; }

/* Modules specific */
.module-item {
    transition: background 0.2s;
}

.module-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.hover-bg-dark:hover {
    background: rgba(0, 0, 0, 0.2) !important;
}

#admin-module-search {
    border-radius: 12px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

/* --- GESTOR DE BLOQUES DE RESERVAS (NUEVO DISEÑO) --- */
.res-config-form-alta {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.res-grid-alta {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
    gap: 15px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .res-grid-alta {
        grid-template-columns: 1fr 1fr;
    }
}

.res-bloques-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.res-bloque-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.res-bloque-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.res-bloque-info {
    display: flex;
    flex-direction: column;
}

.res-bloque-dia {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 2px;
}

.res-bloque-horas {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

.res-bloque-int {
    font-size: 0.75rem;
    color: #64748b;
}

.btn-remove-bloque {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-bloque:hover {
    background: #ef4444;
    color: white;
}

/* --- RESTO BADGES & UTILITIES --- */
.bg-teal { background-color: #0d9488 !important; color: #fff !important; }
.bg-indigo { background-color: #6366f1 !important; color: #fff !important; }
.bg-orange { background-color: #f97316 !important; color: #fff !important; }
.bg-purple { background-color: #a855f7 !important; color: #fff !important; }

/* Custom Badge Adjustments */
.badge {
    padding: 6px 10px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- 15. SWEETALERT2 BABOONS PREMIUM V2 --- */
.premium-swal-v2 {
    font-family: 'Inter', sans-serif !important;
    border-radius: 35px !important;
    padding: 2.5rem !important;
    border: 1px solid rgba(255, 255, 255, 1) !important;
    box-shadow: 0 40px 100px -20px rgba(15, 23, 42, 0.4) !important;
    background: #ffffff !important;
}

.premium-swal-v2 .swal2-title {
    color: #0f172a !important;
    font-weight: 900 !important;
    letter-spacing: -0.04em !important;
    font-size: 2rem !important;
    margin-bottom: 1.5rem !important;
}

.premium-swal-v2 .swal2-input,
.premium-swal-v2 .swal2-select {
    border: 2px solid #e2e8f0 !important;
    border-radius: 18px !important;
    height: 60px !important;
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    padding: 0 20px !important;
    box-shadow: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: #f8fafc !important;
}

.premium-swal-v2 .swal2-input:focus,
.premium-swal-v2 .swal2-select:focus {
    border-color: #4361ee !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 5px rgba(67, 97, 238, 0.15) !important;
}

.premium-swal-confirm {
    background: #4361ee !important;
    color: white !important;
    border-radius: 18px !important;
    padding: 16px 40px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 10px 25px -5px rgba(67, 97, 238, 0.4) !important;
    margin: 5px !important;
}

.premium-swal-confirm:hover {
    background: #3651d1 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 30px -5px rgba(67, 97, 238, 0.5) !important;
}

.premium-swal-cancel {
    background: #e2e8f0 !important;
    color: #475569 !important;
    border-radius: 18px !important;
    padding: 16px 40px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    margin: 5px !important;
}

.premium-swal-cancel:hover {
    background: #cbd5e1 !important;
    color: #1e293b !important;
}

.premium-swal-v2 .swal2-validation-message {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
}

