:root {
    --primary-indigo: #6366F1;
    --primary-purple: #8B5CF6;
    --primary-pink: #EC4899;
    --primary-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
    --primary-gradient-hover: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --secondary: #1E293B;
    --accent: #E67E22;
    --accent-hover: #D35400;
    
    --bg: #F8FAFC;
    --bg-light: #F8FAFC;
    --surface: #FFFFFF;
    --surface-color: #FFFFFF;
    --border: #E2E8F0;
    --border-color: #E2E8F0;
    --text: #0F172A;
    --text-main: #0F172A;
    --text-light: #64748B;
    --text-muted: #64748B;
    --white: #FFFFFF;
    
    --shadow: 0 4px 15px rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 35px -10px rgba(99, 102, 241, 0.15);
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --salud: #E67E22;
    --educacion: #8B5CF6;
}

/* Base Fonts & Typography */
h1, h2, h3, h4, h5, h6, .brand, .logo-text, .card-title, .page-title {
    font-family: 'Outfit', sans-serif !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: var(--bg) !important;
    color: var(--text) !important;
}

/* Theme Toggle Button Styling */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background-color: #F1F5F9;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.08);
    border-color: var(--primary-indigo);
}

/* High Contrast Dark Mode Theme Rules */
html[data-theme="dark"] {
    --bg: #0B0F17;
    --bg-light: #0B0F17;
    --bg-color: #0B0F17;
    --surface: #161F30;
    --surface-color: #161F30;
    --surface-dark: #0F172A;
    --border: #2D3A4F;
    --border-color: #2D3A4F;
    --text: #F8FAFC;
    --text-main: #F8FAFC;
    --text-light: #94A3B8;
    --text-muted: #94A3B8;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] body {
    background-color: #0B0F17 !important;
    color: #F8FAFC !important;
}

html[data-theme="dark"] .global-navbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .table-container,
html[data-theme="dark"] .modal-custom-content,
html[data-theme="dark"] .dropdown-content,
html[data-theme="dark"] .workspace-pill {
    background-color: #161F30 !important;
    border-color: #2D3A4F !important;
    color: #F8FAFC !important;
}

html[data-theme="dark"] h1, 
html[data-theme="dark"] h2, 
html[data-theme="dark"] h3, 
html[data-theme="dark"] h4, 
html[data-theme="dark"] h5, 
html[data-theme="dark"] h6,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .logo-text {
    color: #F8FAFC !important;
}

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background-color: #0F172A !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: #8B5CF6 !important;
    background-color: #111827 !important;
    color: #F8FAFC !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25) !important;
}

html[data-theme="dark"] .theme-toggle-btn {
    background-color: #1E293B !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
}

/* Utility Classes (Bootstrap-like) */
.text-white { color: var(--white) !important; }
.text-muted { color: var(--text-light) !important; }
.opacity-100 { opacity: 1 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-50 { opacity: 0.5 !important; }
.fw-bold { font-weight: 700 !important; }

/* Spacing Utilities */
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.p-3 { padding: 1rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }

/* Global Dark Theme Refinements */
select option {
    background: #1F2D3A; /* var(--secondary) hardcoded to ensure browser support */
    color: #F4F7F6; /* var(--text) */
}

::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 0.85rem;
}

h1,
h2,
h3,
h4 {
    color: var(--text-main);
    font-weight: 700;
}

/* Anulación de contraste para Modo Claro */
html:not([data-theme="dark"]) h1,
html:not([data-theme="dark"]) h2,
html:not([data-theme="dark"]) h3,
html:not([data-theme="dark"]) h4,
html:not([data-theme="dark"]) h5,
html:not([data-theme="dark"]) h6 {
    color: var(--text-main);
}

html:not([data-theme="dark"]) .card,
html:not([data-theme="dark"]) .stat-card-value,
html:not([data-theme="dark"]) .form-label,
html:not([data-theme="dark"]) label,
html:not([data-theme="dark"]) .table th,
html:not([data-theme="dark"]) .table td {
    color: var(--text-main);
}

/* Anular color: white o color: #fff en elementos dentro de tarjetas, tablas y controles cuando se está en Modo Claro */
html:not([data-theme="dark"]) .card [style*="color: white"],
html:not([data-theme="dark"]) .card [style*="color:white"],
html:not([data-theme="dark"]) .card [style*="color: #fff"],
html:not([data-theme="dark"]) .card [style*="color:#fff"],
html:not([data-theme="dark"]) .table [style*="color: white"],
html:not([data-theme="dark"]) .table [style*="color:white"],
html:not([data-theme="dark"]) .table [style*="color: #fff"],
html:not([data-theme="dark"]) .table [style*="color:#fff"],
html:not([data-theme="dark"]) .table-container [style*="color: white"],
html:not([data-theme="dark"]) .table-container [style*="color:white"],
html:not([data-theme="dark"]) .form-control[style*="color: white"],
html:not([data-theme="dark"]) .form-control[style*="color:white"],
html:not([data-theme="dark"]) select[style*="color: white"],
html:not([data-theme="dark"]) select[style*="color:white"],
html:not([data-theme="dark"]) input[style*="color: white"],
html:not([data-theme="dark"]) input[style*="color:white"],
html:not([data-theme="dark"]) textarea[style*="color: white"],
html:not([data-theme="dark"]) textarea[style*="color:white"] {
    color: var(--text-main) !important;
}

/* Adaptabilidad de fondos oscuros en Modo Claro para inputs, opciones, selects y tablas */
html:not([data-theme="dark"]) input,
html:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) textarea,
html:not([data-theme="dark"]) option {
    background-color: var(--surface) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

html:not([data-theme="dark"]) input[style*="background"],
html:not([data-theme="dark"]) select[style*="background"],
html:not([data-theme="dark"]) textarea[style*="background"],
html:not([data-theme="dark"]) option[style*="background"] {
    background: var(--surface) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Excepciones: Mantener texto blanco en botones primarios, badges y banners oscuros */
.btn-primary, .btn-primary *,
.price-badge, .cta-banner, .cta-banner *,
.badge-pill, .badge-pill * {
    color: #FFFFFF !important;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.3rem;
}

h3 {
    font-size: 1.1rem;
}

.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.full-container {
    width: 100%;
    padding: 2rem;
    max-width: 1600px; /* Opcional: para que no se vea exageradamente ancho en pantallas 4K */
    margin: 0 auto;
}

@media (max-width: 768px) {
    .full-container {
        padding: 1rem;
    }
}

/* Nuevo Layout con Navbar Global + Sidebar */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

.global-navbar {
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1200;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.app-main-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Navbar Components */
.navbar-left { display: flex; align-items: center; }
.app-logo { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.logo-img { height: 34px; width: auto; }
.logo-text { 
    font-size: 1.3rem; 
    font-weight: 800; 
    font-family: 'Outfit', sans-serif;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px; 
    white-space: nowrap; 
}

.navbar-toggler {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 1.5rem;
    transition: all 0.25s ease;
}

.navbar-toggler:hover {
    border-color: var(--primary-indigo);
    color: var(--primary-indigo);
    transform: scale(1.05);
}

.navbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
    height: 30px;
}

.breadcrumb-item {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover { color: var(--primary-indigo); }
.breadcrumb-item.active { color: var(--text-main); font-weight: 700; font-family: 'Outfit', sans-serif; }

.workspace-pill {
    background: var(--surface);
    border: 1px solid var(--border-color);
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.workspace-select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
}

.navbar-right { display: flex; align-items: center; gap: 1.2rem; }
.user-meta { display: flex; align-items: center; gap: 1rem; }
.user-info-text { text-align: right; display: flex; flex-direction: column; }
.user-name-top { font-size: 0.85rem; font-weight: 700; color: var(--text-main); line-height: 1.2; font-family: 'Outfit', sans-serif; }
.user-role-top { font-size: 0.68rem; color: var(--primary-indigo); font-weight: 800; text-transform: uppercase; margin-top: 2px; letter-spacing: 0.5px; }
.user-avatar-top { 
    width: 38px; 
    height: 38px; 
    border-radius: var(--radius-md); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 800; 
    color: white !important; 
    background: var(--primary-gradient) !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}
.logout-link-top { color: var(--text-muted); opacity: 0.7; font-size: 1.1rem; transition: 0.2s; padding: 5px; }
.logout-link-top:hover { color: #F43F5E; opacity: 1; transform: scale(1.1); }

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.sidebar.collapsed {
    width: 75px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    padding-left: 0.6rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.3rem;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-link:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    color: var(--primary-indigo) !important;
    transform: translateX(4px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
    color: var(--primary-indigo) !important;
    font-weight: 600 !important;
    border-left: 3px solid var(--primary-indigo) !important;
}

/* Sidebar Footer & User Block */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

.user-block {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: white;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.6rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 700;
}

.logout-btn {
    color: #e74c3c;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.logout-btn:hover {
    opacity: 1;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.content-viewport {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    padding: 1.5rem 0;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.breadcrumb-item {
    color: var(--text-light);
}

.breadcrumb-item.active {
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-only { display: none; }
.desktop-only { display: flex; }

.content-viewport {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
}

/* Workspace Pill */
.workspace-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.workspace-select {
    background: transparent;
    border: none;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
}

/* Flash Messages as Pills */
.flash-messages {
    padding: 1.5rem 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash-pill {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
}

/* Responsive */
@media (max-width: 992px) {
    .desktop-only { display: none; }
    .mobile-only { display: flex; }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px !important; /* Force width on mobile */
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-close {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .top-header {
        padding: 0 1rem;
    }

    .header-breadcrumb {
        display: none;
    }
}

/* Tarjetas */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    color: var(--text);
}

.kpi-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 160px; /* Fixed height for uniformity */
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 0; /* Let grid handle gap */
}

.card-link {
    display: block;
    height: 160px;
    text-decoration: none;
}

.card-link .kpi-card {
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background: rgba(43, 62, 79, 0.8);
    border-color: var(--accent);
}

.kpi-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 1px;
    margin: 0;
}

.kpi-card .value {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0.5rem 0;
    line-height: 1;
}

.kpi-card .label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.card-header {
    background: var(--secondary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1rem;
    margin: 0;
}

/* Formularios */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.form-control,
.form-select,
select.form-control,
input.form-control,
textarea.form-control,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
    background: var(--surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-main) !important;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--primary-indigo) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    background: var(--surface) !important;
    color: var(--text-main) !important;
}

select.form-control, .form-select, select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1rem) center;
    padding-right: 2.5rem;
}

select.form-control option, .form-select option, select option, option {
    background: var(--surface) !important;
    color: var(--text-main) !important;
    padding: 10px;
}

.form-select-sm {
    padding: 0.35rem 2rem 0.35rem 0.8rem;
    font-size: 0.75rem;
}

.bg-light, thead.bg-light, table thead {
    background-color: var(--bg-light) !important;
    color: var(--text-main) !important;
}

.form-control::placeholder, input::placeholder, textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

/* Selección de texto */
::selection {
    background: var(--accent);
    color: white;
}

::-moz-selection {
    background: var(--accent);
    color: white;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: inherit;
    border: 1px solid transparent;
    user-select: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    padding: 0.7rem 1.4rem;
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-light);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-light {
    background-color: var(--white);
    color: var(--primary) !important;
    border-color: var(--white);
}

.btn-light:hover {
    background-color: #f8f9fa;
    color: var(--secondary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-accent {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 4px;
}



.btn-text {
    background: transparent;
    color: #3498db;
    padding: 0.2rem 0.5rem;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.8rem;
    border: none;
}

.btn-text:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.btn-text-danger {
    color: #e53e3e;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

.btn-back:hover {
    color: var(--accent);
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
    transform: translateX(-3px);
}

/* Tablas */
.table-container {
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin: 1rem 0;
}

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

.table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--accent);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.2);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

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

.table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Utilidades */
.text-right {
    text-align: right;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.gap-2 {
    gap: 0.5rem;
}

.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.align-center {
    align-items: center;
}

/* Sistema de Grillas Fluidas */
.grid-1, .grid-2, .grid-3, .grid-4 {
    display: grid;
    gap: 1.5rem;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Stats and Dashboard specific utilities */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: var(--bg);
}

body::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border: 3px solid var(--bg);
    border-radius: 10px;
}

/* Responsive Utilities */
@media (max-width: 992px) {
    .nav-container {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-container {
        flex-wrap: wrap;
    }

    .nav-menu {
        display: none; /* Se activará con JS */
        width: 100%;
        flex-direction: column;
        gap: 0.8rem;
        padding: 1rem 0;
        border-top: 1px solid var(--border);
        margin-top: 0.5rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-link, .btn-xs, .navbar-item {
        width: 100%;
        justify-content: flex-start;
        height: 40px;
    }

    .profile-badge {
        flex-direction: row;
        border-left: none !important;
        padding-left: 0;
        justify-content: space-between;
        width: 100%;
    }

    .workspace-selector {
        width: 100%;
        margin: 0.5rem 0;
    }

    .workspace-selector select {
        width: 100%;
    }

    .d-flex {
        flex-direction: column;
    }

    .d-flex.flex-row-mobile {
        flex-direction: row;
    }

    .justify-between {
        justify-content: flex-start;
        gap: 1rem;
    }

    .text-right {
        text-align: left;
    }

    .card {
        padding: 1rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0.5rem -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .table th, .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .btn {
        width: 100%;
    }

    .btn-sm, .btn-xs {
        width: auto;
    }
}

/* --- Modales Globales --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-custom {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
    box-shadow: var(--shadow-lg);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-custom-header {
    padding: 1.25rem 1.5rem;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--accent);
}

.modal-custom-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-custom-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-custom-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-close-white {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.5;
    transition: 0.2s;
}

.btn-close-white:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Custom Scrollbar for Modals */
.modal-custom-body::-webkit-scrollbar {
    width: 8px;
}

.modal-custom-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-custom-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.modal-custom-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-container {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0 0.5rem;
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   LANDING PAGE STYLES (FLUJOPRO PUBLIC HOME - MATCHEADO CON APP REDES)
   ========================================================================== */

.landing-body {
    background-color: var(--bg);
    color: var(--text);
}

.landing-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 16px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

html[data-theme="light"] .landing-navbar {
    background: rgba(255, 255, 255, 0.85);
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.landing-nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.landing-nav-links a:hover {
    color: var(--primary-indigo);
}

.landing-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 160px 5% 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(236, 72, 153, 0.15) 50%, rgba(0, 0, 0, 0) 70%);
    filter: blur(70px);
    z-index: 0;
    pointer-events: none;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-indigo);
    margin-bottom: 28px;
    backdrop-filter: blur(8px);
    z-index: 1;
}

.hero-title {
    font-size: 58px;
    font-weight: 800;
    line-height: 1.1;
    max-width: 900px;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
    z-index: 1;
    font-family: 'Outfit', sans-serif;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 19px;
    color: var(--text-muted);
    max-width: 680px;
    margin-bottom: 40px;
    line-height: 1.6;
    z-index: 1;
}

.hero-cta {
    display: flex;
    gap: 16px;
    z-index: 1;
    margin-bottom: 60px;
}

/* Interactive UI Mockup */
.mockup-container {
    position: relative;
    width: 100%;
    max-width: 1050px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), var(--shadow-glow);
    backdrop-filter: blur(16px);
    overflow: hidden;
    z-index: 1;
    padding: 12px;
}

.mockup-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot-red { background: #FF5F56; }
.dot-yellow { background: #FFBD2E; }
.dot-green { background: #27C93F; }

.mockup-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    background: var(--bg);
    border-radius: 12px;
    min-height: 440px;
    text-align: left;
}

.mockup-sidebar {
    padding: 24px 16px;
    border-right: 1px solid var(--border-color);
}

.mockup-main {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Platforms / Modules Banner */
.platforms-banner {
    padding: 40px 5%;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.platforms-banner p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.platform-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 36px;
    flex-wrap: wrap;
}

.platform-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.platform-chip:hover {
    transform: translateY(-2px);
    border-color: var(--primary-indigo);
    box-shadow: var(--shadow-sm);
}

/* Features Grid */
.features-section {
    padding: 100px 5%;
    max-width: 1240px;
    margin: 0 auto;
    text-align: center;
}

.section-header {
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.section-header p {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: left;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--primary-indigo);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-indigo);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 14px;
}

/* Pricing Section */
.pricing-section {
    padding: 80px 5%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    margin-top: 40px;
}

.price-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: left;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.price-card.featured {
    border: 2px solid var(--primary-indigo);
    box-shadow: var(--shadow-lg);
}

.price-badge {
    position: absolute;
    top: -14px;
    right: 24px;
    background: var(--primary-gradient);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.price-card h3 {
    font-size: 22px;
    margin-bottom: 6px;
}

.price-card .price {
    font-size: 40px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin: 18px 0;
    color: var(--text-main);
}

.price-card .price span {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 400;
}

.feature-list {
    list-style: none;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.feature-list li i {
    color: #10B981;
}

/* CTA Banner */
.cta-banner {
    margin: 60px 5%;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: 60px 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.cta-banner h2 {
    font-size: 36px;
    font-weight: 800;
    color: white;
    margin-bottom: 14px;
}

.cta-banner p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto 28px;
}

/* Button Classes matching App Redes */
.btn-primary {
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4) !important;
    text-decoration: none !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 25px -4px rgba(99, 102, 241, 0.5) !important;
}

.btn-secondary {
    background: var(--surface) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    padding: 12px 24px !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.btn-secondary:hover {
    transform: translateY(-2px) !important;
    border-color: var(--primary-indigo) !important;
}

/* Landing Footer */
.landing-footer {
    padding: 36px 5%;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
}