/* Reset y variables CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1659EF;
    --primary-hover: #1347CC;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f7f8fc;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --border-focus: #1659EF;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary-color: #2563EB;
    --primary-hover: #1659EF;
    --secondary-color: #9ca3af;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border: #334155;
    --border-light: #475569;
    --border-focus: #1659EF;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern';
}

/* Layout principal */
.main-header {
    background: #1659EF;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(37, 105, 237, 0.15);
    width: calc(100% + 240px);
    margin-left: -240px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-content {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    padding-left: 241px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 50px;
    width: auto;
    filter: brightness(0) invert(1);
}

.header-content h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0;
}

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

/* Theme toggle button */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn svg {
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
    display: block !important;
}

/* Light mode - show sun, hide moon */
.theme-toggle-btn .moon-icon {
    display: none;
}

.theme-toggle-btn .sun-icon {
    display: block;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        order: -1; /* Move hamburger to the left */
    }
    
    /* Mobile header layout: hamburger - logo - dark mode */
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        position: relative;
    }
    
    .header-left {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
    }
    
    .header-actions {
        display: flex;
        justify-content: space-between;
        width: 100%;
        z-index: 2;
        position: relative;
    }
    
    /* Theme toggle stays on the right */
    .theme-toggle-btn {
        order: 1;
    }
    
    /* Mobile header logo */
    .mobile-header-logo {
        height: 48px;
        width: auto;
        max-width: 180px;
        display: block !important;
    }
    
    /* Show sidebar toggle on mobile for hamburger menu */
    .sidebar-toggle {
        display: flex !important;
    }
}

/* Hide mobile header logo on desktop */
@media (min-width: 769px) {
    .mobile-header-logo {
        display: none !important;
    }
    
    /* Hide sidebar toggle on desktop - sidebar always expanded */
    .sidebar-toggle {
        display: none !important;
    }
}

.user-info {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* Página de login moderna */
.modern-login-page {
    min-height: 100vh;
    background: #1659EF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.modern-login-container {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #1659EF;
    overflow: hidden;
    margin: 0;
}

/* Lado izquierdo - Formulario */
.login-left {
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #1659EF;
    position: relative;
    min-height: 100vh;
}

.login-content {
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.company-logo {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-align: center;
}

.welcome-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 2.5rem;
    line-height: 1.5;
    text-align: center;
}

.modern-form {
    width: 100%;
}

.modern-form-group {
    margin-bottom: 1.5rem;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.modern-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    outline: none;
    color: white;
    backdrop-filter: blur(10px);
}

.modern-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.modern-input:focus {
    border-color: #EDB842;
    box-shadow: 0 0 0 4px rgba(237, 184, 66, 0.2);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.modern-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #EDB842 0%, #f1c253 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    letter-spacing: 0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modern-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(237, 184, 66, 0.4);
    background: linear-gradient(135deg, #f1c253 0%, #EDB842 100%);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.modern-btn-primary:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.login-footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    line-height: 1.6;
}

.error-message-modern {
    background: rgba(237, 184, 66, 0.1);
    color: #EDB842;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(237, 184, 66, 0.3);
    font-size: 0.875rem;
}

/* Lado derecho - Imagen con Logo */
.login-right {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ocultar logo móvil en desktop por defecto */
.mobile-logo {
    display: none;
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: brightness(0.7) contrast(1.1);
    transition: all 0.3s ease;
}

.logo-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
}

.overlay-logo {
    width: 350px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.95;
    transition: all 0.3s ease;
    drop-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.overlay-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(37, 105, 237, 0.1) 0%,
        rgba(37, 105, 237, 0.2) 50%,
        rgba(29, 78, 216, 0.3) 100%
    );
    z-index: 2;
}

/* Responsive */
@media (max-width: 968px) {
    .modern-login-container {
        grid-template-columns: 1fr;
        height: 100vh;
        min-height: 100vh;
    }
    
    .login-left {
        padding: 2rem 1.5rem;
    }
    
    .login-right {
        display: none;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    /* Mobile logo styles */
    .mobile-logo {
        text-align: center;
        margin-bottom: 1.5rem;
        display: block;
    }
    
    .mobile-brand-logo {
        height: 120px;
        width: auto;
        max-width: 360px;
        filter: brightness(0) invert(1);
    }
    
    /* Hide theme toggle button on mobile */
    .login-left .theme-toggle-btn {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .login-left {
        padding: 1.5rem 1rem;
    }
    
    .welcome-title {
        font-size: 1.75rem;
    }
    
    .company-logo {
        height: 40px;
    }
}

/* Botones */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: #EDB842;
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(237, 184, 66, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: #d1a235;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(237, 184, 66, 0.3);
}

.btn-secondary {
    background: #1659EF;
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(37, 105, 237, 0.2);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.btn-secondary:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 105, 237, 0.3);
}

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

/* Editor rico */
.rich-editor {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--surface);
}

.rich-editor .ql-toolbar {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    background: var(--background);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 0.5rem;
}

.rich-editor .ql-container {
    border: none;
    font-family: var(--font-family);
    font-size: 0.875rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.rich-editor .ql-editor {
    min-height: 80px;
    padding: 0.75rem;
    line-height: 1.5;
}

.rich-editor .ql-editor.ql-blank::before {
    color: var(--text-tertiary);
    font-style: normal;
}

.rich-editor:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Controlar espaciado en editores Quill */
.rich-editor .ql-editor p {
    margin: 0;
    line-height: 1.4;
    padding: 0;
}

.rich-editor .ql-editor p + p {
    margin-top: 0.5em;
}

.rich-editor .ql-editor br {
    line-height: 1.4;
    margin: 0;
    padding: 0;
}

/* Controlar espacios en blanco y saltos de línea */
.rich-editor .ql-editor p:empty {
    margin: 0;
    padding: 0;
    line-height: 1;
}

/* Remover espaciado extra de elementos vacíos */
.rich-editor .ql-editor br + br {
    display: none;
}

/* Editores HTML plano */
.html-editor {
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--surface);
    padding: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    color: var(--text-primary);
    width: 100%;
}

.html-editor:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Botones toggle */
.toggle-view-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.toggle-view-btn:hover {
    background: var(--text-primary);
    transform: translateY(-1px);
}

.toggle-view-btn:active {
    transform: translateY(0);
}

/* Container para Valor con preview */
.valor-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.valor-select {
    flex: 1;
    position: relative;
    padding-left: 30px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.estado-save-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--success-color);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.estado-save-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.estado-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.estado-save-btn svg {
    width: 16px;
    height: 16px;
}

.estado-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.estado-save-btn:disabled:hover {
    background: var(--success-color);
    transform: none;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* Loading spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ========== SIDEBAR STYLES ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

/* Sidebar collapsed styles - only used on mobile */
.sidebar.collapsed {
    width: 80px;
}

@media (min-width: 769px) {
    /* Prevent sidebar from being collapsed on desktop */
    .sidebar.collapsed {
        width: 240px !important;
    }
}

.sidebar-header {
    padding: 1rem 1rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 70px;
}

/* En desktop, centrar el logo cuando no hay toggle */
@media (min-width: 769px) {
    .sidebar-header {
        justify-content: center;
    }
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar-brand .brand-logo {
    height: 72px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

/* Lógica de cambio de logo según el tema */
[data-theme="dark"] .sidebar-brand .light-logo {
    display: none;
}

[data-theme="dark"] .sidebar-brand .dark-logo {
    display: block !important;
}

[data-theme="light"] .sidebar-brand .light-logo {
    display: block;
}

[data-theme="light"] .sidebar-brand .dark-logo {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    opacity: 0;
    pointer-events: none;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.menu-item {
    margin: 0.1rem 0;
}

.menu-separator {
    margin: 1rem 0 0.5rem 0;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
}

.menu-separator span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

[data-theme="dark"] .menu-separator {
    border-top-color: #374151;
}

[data-theme="dark"] .menu-separator span {
    color: #9CA3AF;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin: 0 0.5rem;
    transition: all 0.2s ease;
    position: relative;
    gap: 0.75rem;
}

.menu-link:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.menu-item.active .menu-link {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 105, 237, 0.3);
}

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 20px;
    flex-shrink: 0;
}

.menu-text {
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.3s ease;
    flex: 1;
}

.sidebar.collapsed .menu-text {
    opacity: 0;
    pointer-events: none;
}

.menu-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.menu-item.active .menu-badge {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .menu-badge {
    opacity: 0;
    pointer-events: none;
}

/* Ajustar el menu-link cuando el sidebar está colapsado (solo móvil) */
@media (max-width: 768px) {
    .sidebar.collapsed .menu-link {
        padding: 0.875rem 1.5rem;
        margin: 0 0.25rem;
        justify-content: center;
    }
}

.menu-lock {
    color: var(--warning-color);
    opacity: 1;
    transition: opacity 0.3s ease;
    margin-right: 0.25rem;
}

.sidebar.collapsed .menu-lock {
    opacity: 0;
    pointer-events: none;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--background);
    transition: all 0.2s ease;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

/* Logout button in sidebar */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    color: var(--error-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.logout-btn:hover {
    background: var(--error-color);
    color: white;
    transform: translateX(2px);
}

.logout-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.logout-text {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .logout-text {
    opacity: 0;
    pointer-events: none;
}

/* Ajustar el botón de logout cuando el sidebar está colapsado (solo móvil) */
@media (max-width: 768px) {
    .sidebar.collapsed .logout-btn {
        padding: 0.875rem 1.5rem;
        justify-content: center;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Layout adjustment for main content */
.main-layout {
    margin-left: 240px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile collapsed layout */
.main-layout.sidebar-collapsed {
    margin-left: 80px;
}

.main-layout.sidebar-collapsed .main-header {
    width: calc(100% + 80px);
    margin-left: -80px;
}

.main-layout.sidebar-collapsed .header-content {
    padding-left: 81px;
}

@media (min-width: 769px) {
    /* Prevent layout changes on desktop when "collapsed" */
    .main-layout.sidebar-collapsed {
        margin-left: 240px !important;
    }
    
    .main-layout.sidebar-collapsed .main-header {
        width: calc(100% + 240px) !important;
        margin-left: -240px !important;
    }
    
    .main-layout.sidebar-collapsed .header-content {
        padding-left: 241px !important;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-layout {
        margin-left: 0;
    }
    
    .main-layout.sidebar-collapsed {
        margin-left: 0;
    }
    
    .main-header {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    .header-content {
        padding-left: 1rem !important;
    }
}

/* Dark mode sidebar */
[data-theme="dark"] {
    .sidebar {
        background: var(--surface);
        border-right-color: var(--border);
    }
    
    .sidebar-header {
        border-bottom-color: var(--border);
    }
    
    .sidebar-footer {
        border-top-color: var(--border);
    }
    
    .logout-btn {
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.2);
    }
    
    .logout-btn:hover {
        background: var(--error-color);
        color: white;
    }
    
    .menu-badge {
        background: var(--primary-color);
    }
}

/* ========== POI MODAL STYLES ========== */
.poi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.poi-modal {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 450px;
    padding: 2rem;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.poi-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.poi-modal-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.poi-modal-header p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.poi-form .form-group {
    margin-bottom: 1.5rem;
}

.poi-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.poi-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.poi-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 105, 237, 0.1);
    background: var(--surface);
}

.poi-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.poi-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.poi-footer p {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin: 0;
}

/* Coordinates cell styling */
.coords-cell {
    width: 120px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* Dark mode POI modal */
[data-theme="dark"] {
    .poi-modal {
        background: var(--surface);
    }
    
    .poi-input {
        background: var(--background);
        border-color: var(--border);
        color: var(--text-primary);
    }
    
    .poi-input:focus {
        background: var(--surface);
        border-color: var(--primary-color);
    }
    
    .poi-footer {
        border-top-color: var(--border);
    }
}

/* ========== MAP PAGE STYLES ========== */
.map-toolbar {
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.map-info h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    letter-spacing: -0.025em;
}

.map-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-number.stat-primary {
    color: var(--primary-color);
}

.stat-number.stat-secondary {
    color: var(--warning-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.map-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.map-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    text-decoration: none;
}

.map-control-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-container {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.map-container.fullscreen-active {
    height: 100vh;
    border-radius: 0;
}

.map-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    overflow: auto;
}

/* Optimización para mapa embebido */
.map-container {
    position: relative;
    width: 100%;
    height: 75vh;
    min-height: 600px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Modo pantalla completa mejorado */
.map-container.fullscreen-active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

.map-container.fullscreen-active .map-iframe {
    width: 100vw;
    height: 100vh;
}

.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.map-loading p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.map-info-panel {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.info-panel-content h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: 8px;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.info-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.info-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.info-link:hover {
    color: var(--primary-hover);
}

/* Responsive map page */
@media (max-width: 968px) {
    .map-toolbar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .map-stats {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .map-controls {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .map-container {
        height: 50vh;
        min-height: 400px;
    }
    
    .map-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .map-info-panel {
        padding: 1.5rem;
    }
}

/* Dark mode map page */
[data-theme="dark"] {
    .map-toolbar {
        background: var(--surface);
        border-color: var(--border);
    }
    
    .map-container {
        background: var(--surface);
        border-color: var(--border);
    }
    
    .map-loading {
        background: var(--surface);
    }
    
    .loading-spinner {
        border-color: var(--border);
        border-top-color: var(--primary-color);
    }
    
    .map-info-panel {
        background: var(--surface);
        border-color: var(--border);
    }
    
    .info-card {
        background: var(--background);
        border-color: var(--border);
    }
    
    .map-control-btn {
        background: var(--background);
        border-color: var(--border);
        color: var(--text-secondary);
    }
    
    .map-control-btn:hover {
        background: var(--surface-hover);
        color: var(--text-primary);
    }
}

/* ========== DASHBOARD STYLES ========== */
.dashboard-header {
    margin-bottom: 2rem;
    text-align: center;
}


.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin: 0;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-card.kpi-total::before {
    background: var(--primary-color);
}

.kpi-card.kpi-disponible::before {
    background: var(--success-color);
}

.kpi-card.kpi-apartado::before {
    background: var(--warning-color);
}

.kpi-card.kpi-vendido::before {
    background: var(--error-color);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-total .kpi-icon {
    background: rgba(37, 105, 237, 0.1);
    color: var(--primary-color);
}

.kpi-disponible .kpi-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.kpi-apartado .kpi-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.kpi-vendido .kpi-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.kpi-content {
    flex: 1;
}

.kpi-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dashboard Content Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-content {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

/* Desarrollos List */
.desarrollo-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.desarrollo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.desarrollo-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.desarrollo-count {
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(37, 105, 237, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    min-width: 32px;
    text-align: center;
}

/* POI Summary */
.poi-summary {
    text-align: center;
    padding: 1rem 0;
}

.poi-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--warning-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.poi-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.poi-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Quick Links */
.quick-links {
    margin-bottom: 2rem;
}

.quick-links h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.quick-link-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.quick-link-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.quick-link-content {
    flex: 1;
}

.quick-link-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.quick-link-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.empty-state-small {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-state-small p {
    margin: 0;
    font-style: italic;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .kpi-card {
        padding: 1rem;
    }
    
    .kpi-number {
        font-size: 1.75rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    .poi-number {
        font-size: 2.5rem;
    }
}

/* Dark mode dashboard */
[data-theme="dark"] {
    .dashboard-card {
        background: var(--surface);
        border-color: var(--border);
    }
    
    .kpi-card {
        background: var(--surface);
        border-color: var(--border);
    }
    
    .desarrollo-item {
        background: var(--background);
        border-color: var(--border);
    }
    
    .quick-link-card {
        background: var(--surface);
        border-color: var(--border);
    }
    
    .quick-link-card:hover {
        border-color: var(--primary-color);
    }
    
}

/* ========== PANEL LATERAL DE COLUMNAS ========== */
.columns-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: var(--surface);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.columns-panel.active {
    right: 0;
}

.columns-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.columns-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Presets Section */
.presets-section {
    margin-bottom: 2rem;
}

.presets-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.preset-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.preset-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.preset-btn svg {
    width: 24px;
    height: 24px;
}

/* Columns Section */
.columns-section {
    margin-bottom: 2rem;
}

.columns-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.column-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.column-toggle {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--background);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.column-toggle:hover {
    background: var(--surface-hover);
}

.column-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.column-toggle span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Panel Footer */
.panel-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.column-counter {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.column-counter strong {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.btn-reset {
    width: 100%;
    padding: 0.75rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-reset:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-reset svg {
    width: 16px;
    height: 16px;
}

/* Botón de configuración de columnas */
.btn-columns-config {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-columns-config:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-columns-config .columns-count {
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-columns-config:hover .columns-count {
    background: white;
    color: var(--primary-color);
}

/* Responsive para panel lateral */
@media (max-width: 768px) {
    .columns-panel {
        width: 100%;
        right: -100%;
    }
    
    .preset-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-columns-config {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn-columns-config span {
        display: none;
    }
}

/* Dark mode para panel lateral */
[data-theme="dark"] {
    .columns-panel {
        background: var(--surface);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .panel-header {
        background: var(--background);
        border-bottom-color: var(--border);
    }
    
    .panel-close:hover {
        background: var(--surface-hover);
    }
    
    .preset-btn {
        background: var(--background);
        border-color: var(--border);
        color: var(--text-secondary);
    }
    
    .preset-btn:hover {
        background: var(--surface-hover);
        border-color: var(--primary-color);
        color: var(--primary-color);
    }
    
    .preset-btn.active {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
    }
    
    .column-toggle {
        background: var(--background);
    }
    
    .column-toggle:hover {
        background: var(--surface-hover);
    }
    
    .panel-footer {
        background: var(--background);
        border-top-color: var(--border);
    }
    
    .btn-reset {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text-primary);
    }
    
    .btn-reset:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
    }
    
    .columns-panel-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group label small {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Toolbar modernizado con búsqueda */
.toolbar {
    margin-bottom: 2rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-info h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
}

.toolbar-info p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

.toolbar-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

.toolbar-search {
    display: flex;
    align-items: center;
}

.search-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 320px;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    background: #fafbff;
    transition: all 0.2s ease;
    font-weight: 500;
}

.search-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: var(--surface);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Tabla de puntos - Estilo Notion */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.points-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    font-weight: 400;
}

.points-table thead {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-light);
}

.points-table th {
    padding: 0.25rem 0.5rem; /* EXTREMADAMENTE reducido */
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.65rem; /* Más pequeño */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    position: relative;
    border-right: 1px solid var(--border-light);
    height: 35px; /* Altura fija muy pequeña */
    line-height: 1.2;
}

.points-table th:last-child {
    border-right: none;
}

.points-table td {
    padding: 0.25rem 0.5rem; /* EXTREMADAMENTE reducido */
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    vertical-align: middle;
    position: relative;
    font-size: 0.75rem; /* Más pequeño */
    line-height: 1.2; /* Más compacto */
    height: 40px; /* Altura fija muy pequeña */
    max-height: 40px; /* Evitar crecimiento */
}

.points-table td:last-child {
    border-right: none;
}

.points-table tbody tr:hover {
    background: var(--surface-hover);
}

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

/* Celdas específicas - Estilo Notion */
.index-cell {
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: center;
    width: 60px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: #f8fafc;
    border-radius: var(--border-radius-sm);
}

[data-theme="dark"] .index-cell {
    background: var(--surface);
}

.name-cell {
    min-width: 250px;
    white-space: normal;
    word-wrap: break-word;
}

/* Permitir interpretación normal de HTML en tabla */
.points-table .name-cell br,
.points-table .description-cell br {
    display: inline;
}

/* Solo manejar elementos completamente vacíos */
.points-table .name-cell:empty::before,
.points-table .description-cell:empty::before {
    content: '-';
    color: var(--text-tertiary);
    font-style: italic;
}

/* Spacing de párrafos SOLO en tabla - sin interferir con HTML */
.points-table .name-cell p,
.points-table .description-cell p {
    margin: 0;
    line-height: 1.4;
    padding: 0;
    display: block;
}

.points-table .name-cell p + p,
.points-table .description-cell p + p {
    margin-top: 0.5em;
}

.name-cell strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
    display: block;
    margin-bottom: 0.125rem;
    letter-spacing: -0.01em;
}

.lote-cell {
    width: 150px;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* .description-cell reglas movidas al final para evitar conflictos */

.category-cell {
    width: 120px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease;
}

.category-badge::before {
    content: '🏢';
    margin-right: 0.25rem;
    font-size: 0.6rem;
}

.category-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.text-cell {
    min-width: 100px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.number-cell {
    width: 80px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
}

.url-cell {
    width: 80px;
    text-align: center;
}

.url-cell a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: #f0f7ff;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.url-cell a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.html-cell {
    width: 80px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.color-cell {
    width: 120px;
    text-align: center;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.value-cell {
    min-width: 150px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

/* Badges de valor/estado */
.valor-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.badge-disponible {
    background-color: #22c55e;
    color: white;
}

.badge-apartado {
    background-color: #f59e0b;
    color: white;
}

.badge-vendido {
    background-color: #ef4444;
    color: white;
}

.badge-default {
    background-color: #6b7280;
    color: white;
}

/* .actions-cell reglas movidas al final para evitar conflictos */

.btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: #1659EF;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border: none;
    box-shadow: 0 2px 4px rgba(37, 105, 237, 0.2);
    letter-spacing: -0.01em;
}

.btn-edit:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 105, 237, 0.3);
}

.btn-edit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Botón de eliminar */
.btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: var(--error-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-left: 0.5rem;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-delete:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

/* Botón de éxito/confirmación */
.btn-success {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #10b981;
    color: white;
    border: 2px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-success:hover::before {
    left: 100%;
}

.btn-success:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-success:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2), 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Botón secundario */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

/* Asegurar que los botones sean clickeables */
.actions-cell .btn-edit,
.actions-cell .btn-delete,
.actions-cell .btn-secondary {
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

/* Formulario de edición */
.edit-form {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-sections {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2.5rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h2 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--background);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    background: var(--background);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Mensajes */
.success-message, .error-message {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.success-message {
    background: #d1fae5;
    color: var(--success-color);
    border: 1px solid #a7f3d0;
}

.error-message {
    background: #fee2e2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-secondary);
    background: var(--surface);
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-light);
}

.empty-state p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    font-weight: 500;
    color: var(--text-primary);
}

.empty-state::before {
    content: '🔍';
    display: block;
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-actions {
        order: -1;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    /* Tabla responsive */
    .table-container {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .points-table th,
    .points-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .points-table th {
        padding: 0.75rem 0.25rem;
    }
    
    .name-cell {
        min-width: 150px;
    }
    
    .coords-cell {
        width: 90px;
    }
    
    .category-badge {
        font-size: 0.65rem;
        padding: 0.125rem 0.375rem;
    }
    
    .btn-edit,
    .btn-delete,
    .btn-secondary {
        font-size: 0.65rem;
        padding: 0.375rem 0.5rem;
    }
    
    .btn-edit svg,
    .btn-delete svg,
    .btn-secondary svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-form {
        padding: 1.5rem;
    }
    
    .point-card {
        padding: 1rem;
    }
    
    .form-sections {
        padding: 1rem;
    }
    
    .form-actions {
        padding: 1rem;
    }
}

/* Estilos personalizados para Choices.js */
.estado-choices {
    position: relative;
}

.estado-choices .choices__inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    min-height: auto;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.estado-choices .choices__inner:focus,
.estado-choices.is-focused .choices__inner {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.estado-choices .choices__list--single {
    padding: 0;
}

.estado-choices .choices__item {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.estado-choices .choices__list--dropdown {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin-top: 0.25rem;
    z-index: 100;
}

.estado-choices .choices__item--choice {
    padding: 0.75rem;
    transition: background-color 0.2s ease;
}

.estado-choices .choices__item--choice:hover,
.estado-choices .choices__item--choice.is-highlighted {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.estado-choices .choices__item--choice.is-selected {
    background: var(--primary-color);
    color: white;
}

/* Integración con el color preview */
.valor-container .estado-choices {
    flex: 1;
}

.valor-container .estado-choices .choices__inner {
    padding-left: 30px;
    background: white;
}

/* ==================== ESTILOS COMPACTOS PARA TABLA DE INVENTARIO ==================== */

/* Elementos editables - EXTREMADAMENTE compactos */
.precio-editable,
.descripcion-editable {
    min-height: auto;
    line-height: 1.1;
    height: fit-content;
    max-height: 35px;
    overflow: hidden;
}

.precio-display,
.descripcion-display {
    display: inline-block;
    padding: 0.05rem 0.15rem; /* Muy pequeño */
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: auto;
    line-height: 1.1;
    font-size: 0.7rem; /* Más pequeño */
    max-height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.descripcion-display {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 35px;
}

.precio-display:hover,
.descripcion-display:hover {
    background-color: var(--surface-hover);
}

/* Inputs editables EXTREMADAMENTE compactos */
.precio-input,
.descripcion-input {
    width: 100%;
    padding: 0.15rem;
    font-size: 0.7rem; /* Más pequeño */
    border: 1px solid var(--border-color);
    border-radius: 2px;
    line-height: 1.1;
    height: 30px; /* Altura fija */
}

.descripcion-input {
    min-height: 35px; /* Muy compacto */
    max-height: 35px;
    resize: none; /* Evitar resize para mantener compacto */
}

/* Estados y badges EXTREMADAMENTE compactos */
.estado-dropdown select {
    padding: 0.15rem 0.3rem; /* Muy pequeño */
    font-size: 0.65rem; /* Más pequeño */
    border-radius: 2px;
    line-height: 1.1;
    height: 28px; /* Altura fija */
}

.unidad-badge {
    padding: 0.05rem 0.25rem; /* Muy pequeño */
    font-size: 0.6rem; /* Más pequeño */
    border-radius: 2px;
    line-height: 1.1;
    height: 20px; /* Altura fija */
    display: inline-flex;
    align-items: center;
}

/* SKU link EXTREMADAMENTE compacto */
.sku-link {
    font-size: 0.7rem; /* Más pequeño */
    font-weight: 600;
    line-height: 1.1;
}

/* Botón editar EXTREMADAMENTE compacto */
.btn-edit {
    padding: 0.15rem 0.3rem; /* Muy pequeño */
    font-size: 0.65rem; /* Más pequeño */
    line-height: 1.1;
    border-radius: 2px;
    height: 28px; /* Altura fija */
}

/* Precio con formato especial EXTREMADAMENTE compacto */
.precio-empty,
.descripcion-empty {
    font-style: italic;
    color: var(--text-tertiary);
    font-size: 0.65rem; /* Más pequeño */
    line-height: 1.1;
}

/* Forzar altura compacta en todos los elementos de celda */
.points-table td * {
    max-height: 35px !important;
    line-height: 1.1 !important;
}

/* Overflow control para celdas */
.points-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== OPTIMIZACIONES ESPECÍFICAS POR COLUMNA ==================== */

/* Estado dropdown - optimizado para 130px */
.estado-dropdown select {
    width: 100%;
    max-width: 120px;
}

/* Unidad badge - optimizado para 40px */
.unidad-badge {
    font-size: 0.55rem !important; /* Aún más pequeño para caber en 40px */
    padding: 0.05rem 0.15rem !important; /* Padding mínimo */
    min-width: 30px;
    text-align: center;
    white-space: nowrap;
}

/* Descripción - sin límite de ancho (se controla desde lista.php) */
.descripcion-editable {
    width: 100%;
    /* max-width removido para permitir columnas más anchas */
}

.descripcion-display {
    width: 100%;
    /* max-width removido para permitir columnas más anchas */
    word-wrap: break-word;
}

/* Acciones - optimizada para 60px */
.btn-edit {
    width: 50px !important;
    padding: 0.1rem 0.2rem !important; /* Padding ultra-mínimo */
    font-size: 0.6rem !important; /* Texto muy pequeño */
    text-align: center !important; /* Centrar texto horizontalmente */
    white-space: nowrap;
    display: flex !important; /* Usar flex para mejor control */
    align-items: center !important; /* Centrar verticalmente */
    justify-content: center !important; /* Centrar horizontalmente */
}

/* SKU - mantener compacto en 80px */
.sku-link {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== FIN OPTIMIZACIONES ESPECÍFICAS ==================== */

/* ==================== FIN ESTILOS COMPACTOS ==================== */

/* Estilos personalizados para DataTables */
.dataTables_wrapper {
    font-family: var(--font-family);
    margin-top: 0;
}

/* Header de tabla personalizado */
.tabla-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-bottom: 2px solid var(--border-light);
}

/* Contador de elementos */
.contador-elementos {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.contador-numero {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.contador-texto {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Búsqueda integrada en toolbar */
.search-container {
    position: relative;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fafbff;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 105, 237, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
    background: var(--surface);
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 2;
}

.search-input-modern {
    border: none;
    outline: none;
    background: transparent;
    padding: 0.875rem 3rem 0.875rem 3.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    width: 350px;
    font-weight: 500;
}

.search-input-modern::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.clear-button {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-button:hover {
    background: var(--background);
    color: var(--text-secondary);
    transform: scale(1.1);
}

/* Responsive para toolbar con búsqueda */
@media (max-width: 968px) {
    .toolbar {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
        text-align: center;
    }
    
    .toolbar-search {
        justify-content: center;
    }
    
    .search-input-modern {
        width: 100% !important;
        max-width: none !important;
        padding: 0.5rem 3rem 0.5rem 3.5rem; /* Reducir padding vertical */
    }
    
    .search-wrapper {
        width: 100% !important;
        margin: 0 !important;
        min-height: 40px; /* Altura fija compacta */
        height: 40px;
    }
    
    .toolbar-search {
        width: 100% !important;
    }
    
    /* Hide CSV buttons on mobile */
    .action-buttons {
        display: none !important;
    }
    
    /* Theme toggle responsive */
    .theme-toggle-btn {
        width: 36px;
        height: 36px;
    }
}

/* Contenido de tabla */
.tabla-contenido {
    margin: 0;
}


/* Configurar elementos nativos de DataTables */
.dataTables_wrapper .dataTables_length {
    display: none; /* Ocultar selector de longitud (usamos nuestros filtros) */
}

.dataTables_wrapper .dataTables_info {
    display: block; /* Mostrar información de paginación */
}

.dataTables_wrapper .dataTables_paginate {
    display: block; /* Mostrar controles de paginación */
}

/* Ocultar el filtro nativo pero mantener funcionalidad */
.dataTables_wrapper .dataTables_filter {
    display: none !important;
    visibility: hidden;
    position: absolute;
    left: -9999px;
}

/* Mejorar tabla base */
.dataTables_wrapper .dataTable {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.dataTables_wrapper .dataTable thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    padding: 1rem 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dataTables_wrapper .dataTable thead th:hover {
    background: #f1f5f9;
}

.dataTables_wrapper .dataTable tbody td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.dataTables_wrapper .dataTable tbody tr:hover {
    background: var(--surface-hover);
}

/* Controlar anchos específicos de columnas */
.dataTables_wrapper table.dataTable {
    table-layout: fixed;
    width: 100% !important;
}

/* Reglas de DataTables movidas al final para consolidación */

/* Indicadores de ordenamiento */
.dataTables_wrapper .dataTable thead .sorting::after,
.dataTables_wrapper .dataTable thead .sorting_asc::after,
.dataTables_wrapper .dataTable thead .sorting_desc::after {
    opacity: 0.5;
    font-size: 0.7rem;
}

.dataTables_wrapper .dataTable thead .sorting_asc::after {
    content: " ↑";
    opacity: 1;
    color: var(--primary-color);
}

.dataTables_wrapper .dataTable thead .sorting_desc::after {
    content: " ↓";
    opacity: 1;
    color: var(--primary-color);
}

/* Dark mode specific styles */
[data-theme="dark"] {
    /* DataTables dark mode */
    .dataTables_wrapper .dataTable thead th {
        background: #1e293b;
        color: var(--text-primary);
        border-bottom-color: var(--border);
    }
    
    .dataTables_wrapper .dataTable thead th:hover {
        background: #334155;
    }
    
    .points-table thead {
        background: #1e293b;
    }
    
    .dataTables_wrapper .dataTable tbody tr:hover {
        background: var(--surface-hover);
    }
    
    /* Search wrapper dark mode */
    .search-wrapper {
        background: var(--surface);
        border-color: var(--border);
    }
    
    .search-wrapper:focus-within {
        background: var(--background);
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .search-input-modern {
        color: var(--text-primary);
    }
    
    .search-input-modern::placeholder {
        color: var(--text-tertiary);
    }
    
    /* Clear button dark mode */
    .clear-button:hover {
        background: var(--surface-hover);
        color: var(--text-primary);
    }
    
    /* Toolbar dark mode */
    .toolbar {
        background: var(--surface);
        border-color: var(--border);
    }
    
    /* Rich editor dark mode */
    .rich-editor {
        background: var(--surface);
        border-color: var(--border);
    }
    
    .rich-editor .ql-toolbar {
        background: var(--background);
        border-bottom-color: var(--border);
    }
    
    .rich-editor .ql-editor {
        background: var(--surface);
        color: var(--text-primary);
    }
    
    /* Quill toolbar buttons dark mode */
    .rich-editor .ql-toolbar .ql-formats button {
        color: white !important;
    }
    
    .rich-editor .ql-toolbar .ql-formats button:hover {
        color: #f1f5f9 !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    .rich-editor .ql-toolbar .ql-formats button.ql-active {
        color: var(--primary-color) !important;
        background: rgba(59, 130, 246, 0.2) !important;
    }
    
    /* Quill toolbar dropdowns dark mode */
    .rich-editor .ql-toolbar .ql-formats .ql-picker {
        color: white !important;
    }
    
    .rich-editor .ql-toolbar .ql-formats .ql-picker-label {
        color: white !important;
    }
    
    .rich-editor .ql-toolbar .ql-formats .ql-picker-label:hover {
        color: #f1f5f9 !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    /* Quill stroke icons dark mode */
    .rich-editor .ql-toolbar .ql-formats button svg {
        stroke: white !important;
    }
    
    .rich-editor .ql-toolbar .ql-formats button:hover svg {
        stroke: #f1f5f9 !important;
    }
    
    .rich-editor .ql-toolbar .ql-formats button.ql-active svg {
        stroke: var(--primary-color) !important;
    }
    
    /* HTML editor dark mode */
    .html-editor {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text-primary);
    }
    
    /* Choices.js dark mode */
    .estado-choices .choices__inner {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text-primary);
    }
    
    .estado-choices .choices__list--dropdown {
        background: var(--surface);
        border-color: var(--border);
        box-shadow: var(--shadow-lg);
    }
    
    .estado-choices .choices__item {
        color: var(--text-primary);
    }
    
    .estado-choices .choices__item--choice {
        color: var(--text-primary);
    }
    
    .estado-choices .choices__item--choice:hover,
    .estado-choices .choices__item--choice.is-highlighted {
        background: var(--surface-hover);
        color: var(--text-primary);
    }
    
    .estado-choices .choices__item--choice.is-selected {
        background: var(--primary-color);
        color: white;
    }
    
    /* Form inputs dark mode */
    .form-group input,
    .form-group textarea,
    .form-group select {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text-primary);
    }
    
    .form-group input::placeholder,
    .form-group textarea::placeholder {
        color: var(--text-tertiary);
    }
    
    /* Modern form inputs dark mode */
    .modern-input {
        background: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
    }
    
    .modern-input:focus {
        background: rgba(255, 255, 255, 0.1) !important;
        border-color: #EDB842 !important;
    }
    
    /* Form sections dark mode */
    .form-sections {
        background: var(--surface);
    }
    
    .form-actions {
        background: var(--background);
        border-top-color: var(--border);
    }
    
    /* Toggle view button dark mode */
    .toggle-view-btn {
        background: var(--secondary-color);
        color: var(--text-primary);
    }
    
    .toggle-view-btn:hover {
        background: var(--text-secondary);
    }
    
    /* Estado container dark mode */
    .valor-container .estado-choices .choices__inner {
        background: var(--surface);
    }
    
    .valor-select {
        background: var(--surface);
    }
    
    /* Estado save button dark mode */
    .estado-save-btn {
        border-color: var(--border);
    }
    
    /* Color preview dark mode */
    .color-preview {
        border-color: var(--border);
    }
    
    /* Login page dark mode */
    .modern-login-page {
        background: var(--background) !important;
    }
    
    .modern-login-container {
        background: var(--background) !important;
    }
    
    .login-left {
        background: var(--background) !important;
    }
    
    .welcome-title {
        color: var(--text-primary) !important;
    }
    
    .welcome-subtitle {
        color: var(--text-secondary) !important;
    }
    
    .modern-input {
        background: var(--surface) !important;
        border-color: var(--border) !important;
        color: var(--text-primary) !important;
    }
    
    .modern-input::placeholder {
        color: var(--text-tertiary) !important;
    }
    
    .modern-input:focus {
        border-color: #EDB842 !important;
        background: var(--background) !important;
        box-shadow: 0 0 0 4px rgba(237, 184, 66, 0.2) !important;
    }
    
    .login-footer p {
        color: var(--text-secondary) !important;
    }
    
    .error-message-modern {
        background: rgba(239, 68, 68, 0.1) !important;
        border-color: rgba(239, 68, 68, 0.3) !important;
        color: #ef4444 !important;
    }
    
    /* Company logo in dark mode */
    .company-logo {
        filter: brightness(0) invert(1) !important;
    }
    
    /* Theme toggle in login page */
    .login-left .theme-toggle-btn {
        background: var(--surface) !important;
        border-color: var(--border) !important;
        color: var(--text-primary) !important;
    }
    
    .login-left .theme-toggle-btn:hover {
        background: var(--surface-hover) !important;
        border-color: var(--border-focus) !important;
    }
}

/* ========================================
   CORRECCIONES DE TABLA DE INVENTARIO
   ======================================== */

/* Estilos para badges de unidad */
.unidad-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    min-width: 40px;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unidad-mxn {
    background-color: #22c55e;
    color: white;
}

.unidad-usd {
    background-color: #3b82f6;
    color: white;
}

.unidad-usd-m2 {
    background-color: #8b5cf6;
    color: white;
}

.unidad-mxn-m2 {
    background-color: #10b981;
    color: white;
}

.unidad-default {
    background-color: #6b7280;
    color: white;
}

/* ========================================
   DEFINICIONES FINALES DE COLUMNAS DE TABLA
   ======================================== */

/* Columna Unidad - Compacta */
.unidad-cell {
    min-width: 50px !important;
    max-width: 50px !important;
    width: 50px !important;
    text-align: center !important;
    padding: 2px 4px !important;
    font-size: 0.75rem;
}

/* Columna Descripción - Muy Ampliada */
.description-cell {
    min-width: 400px !important;
    max-width: 600px !important;
    width: 500px !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Columna Etapa - Centrada */
.etapa-cell {
    min-width: 80px !important;
    max-width: 80px !important;
    width: 80px !important;
    text-align: center !important;
}

/* Columna Área - Numérica */
.area-cell {
    text-align: right !important;
    min-width: 80px !important;
    max-width: 95px !important;
    width: 85px !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 0.9rem !important;
    padding: 4px 8px !important;
    white-space: nowrap !important;
}

.area-number {
    font-weight: 500;
    color: var(--text-primary);
}

.area-unit {
    font-size: 0.75rem !important;
    color: var(--text-secondary);
    margin-left: 2px;
    font-weight: normal;
}

/* Columna Acciones - Sin fondo blanco */
.actions-cell {
    min-width: 100px !important;
    max-width: 100px !important;
    width: 100px !important;
    text-align: center !important;
    background: transparent !important;
    background-color: transparent !important;
    white-space: nowrap;
}

/* Forzar estilos en todas las variantes de DataTables */
table.dataTable tbody tr td.unidad-cell,
.dataTables_wrapper table.dataTable tbody tr td.unidad-cell,
table.dataTable tbody tr.odd td.unidad-cell,
table.dataTable tbody tr.even td.unidad-cell {
    min-width: 50px !important;
    max-width: 50px !important;
    width: 50px !important;
    text-align: center !important;
    padding: 2px 4px !important;
    font-size: 0.75rem !important;
}

table.dataTable tbody tr td.description-cell,
.dataTables_wrapper table.dataTable tbody tr td.description-cell,
table.dataTable tbody tr.odd td.description-cell,
table.dataTable tbody tr.even td.description-cell {
    min-width: 400px !important;
    max-width: 600px !important;
    width: 500px !important;
    word-wrap: break-word !important;
    white-space: normal !important;
}

table.dataTable tbody tr td.actions-cell,
.dataTables_wrapper table.dataTable tbody tr td.actions-cell,
table.dataTable tbody tr.odd td.actions-cell,
table.dataTable tbody tr.even td.actions-cell {
    background: transparent !important;
    background-color: transparent !important;
    min-width: 100px !important;
    width: 100px !important;
    text-align: center !important;
}

table.dataTable tbody tr:hover td.actions-cell,
.dataTables_wrapper table.dataTable tbody tr:hover td.actions-cell {
    background: var(--surface-hover) !important;
    background-color: var(--surface-hover) !important;
}

/* Botón Editar */
.actions-cell .btn-edit {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 0.8rem !important;
    text-decoration: none !important;
    display: inline-block !important;
}

.actions-cell .btn-edit:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-1px) !important;
}

/* ========================================
   LAYOUT MODERNO COMPACTO
   ======================================== */

.page-header {
    margin-bottom: 1rem;
}

.page-info {
    text-align: center;
}

.page-info h2 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.page-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modern-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Búsqueda compacta - reducido para más espacio a filtros */
.search-container {
    flex: 0 1 300px;
    min-width: 200px;
    max-width: 350px;
}

/* Filtros compactos - expandir para usar espacio disponible */
.filters-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-start;
}

.filter-group-compact {
    display: flex;
    align-items: center;
}

.filter-select-compact {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.85rem;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select-compact:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.filter-select-compact:hover {
    border-color: var(--border-hover);
}

.btn-clear-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Ocultar texto en desktop por defecto */
.btn-clear-compact .btn-clear-text {
    display: none;
}

.btn-clear-compact:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
    transform: translateY(-1px);
}

/* Botones de acción compactos - mantener en el extremo derecho */
.action-buttons-compact {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-icon-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-icon-compact:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-icon-compact .columns-count {
    font-weight: 600;
    font-size: 0.75rem;
}

/* Indicador visual para exportar filtrado */
.btn-icon-compact.btn-filtered {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    position: relative;
}

.btn-icon-compact.btn-filtered:hover {
    background: var(--primary-hover);
}

.btn-icon-compact.btn-filtered::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border: 2px solid var(--surface);
    border-radius: 50%;
    animation: pulse-filter 2s infinite;
}

@keyframes pulse-filter {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive para toolbar moderno */
@media (max-width: 1024px) {
    .modern-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem !important; /* Reducir gap también en tablet */
        margin-bottom: 1rem !important; /* Reducir también en tablet */
    }
    
    .search-container {
        order: 1;
        width: 100%;
        margin-bottom: 0 !important; /* Eliminar margin residual */
    }
    
    .filters-compact {
        order: 2;
        justify-content: center;
        flex: none;
    }
    
    .action-buttons-compact {
        order: 3;
        justify-content: center;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    /* Reducir gap del toolbar moderno en móvil */
    .modern-toolbar {
        gap: 0 !important; /* CERO gap - eliminar completamente el espacio flexbox */
        padding: 0.75rem 1rem !important; /* Reducir padding interno */
        margin-bottom: 0.5rem !important; /* CLAVE: Eliminar el espacio blanco */
    }
    
    /* Reducir también page-header en móvil */
    .page-header {
        margin-bottom: 0.5rem !important;
    }
    
    .search-container {
        margin-bottom: 0 !important; /* Eliminar margin residual también en 768px */
        margin-top: 0 !important;
        padding: 0 !important;
    }
    
    .filters-compact {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }
    
    .filter-group-compact {
        width: 100%;
    }
    
    .filter-select-compact {
        width: 100%;
        min-width: auto;
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 6px;
        height: 42px;
        box-sizing: border-box;
    }
    
    /* El botón de limpiar ocupa las dos columnas */
    .filters-compact .btn-clear-compact {
        grid-column: 1 / -1;
        width: 100%;
        height: 42px;
        margin-top: 0.125rem !important;
        margin-bottom: 0 !important;
        border-radius: 6px;
        font-size: 0.8rem;
        background: var(--surface);
        border: 1px solid var(--border);
        color: var(--text-secondary);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .filters-compact .btn-clear-compact:hover {
        background: var(--error-color);
        border-color: var(--error-color);
        color: white;
    }
    
    /* Mostrar texto en móvil */
    .filters-compact .btn-clear-compact .btn-clear-text {
        display: inline;
        font-size: 0.8rem;
    }
    
    /* SOLUCIÓN ALTERNATIVA: CSS Grid si flexbox falla */
    .modern-toolbar {
        display: grid !important;
        grid-template-rows: auto auto auto;
        grid-gap: 0 !important;
        grid-row-gap: 0 !important;
        row-gap: 0 !important;
    }
    
    /* Compactación extrema adicional - forzar eliminación de espacios */
    .modern-toolbar * {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .search-wrapper {
        margin: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .action-buttons-compact {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Para pantallas muy pequeñas, volver a una columna */
@media (max-width: 480px) {
    .filters-compact {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .filters-compact .btn-clear-compact {
        grid-column: 1;
        margin-top: 0.5rem;
    }
}

/* Legacy filters (mantener compatibilidad) */
.filters-section {
    margin-bottom: 1rem;
}

.filters-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: block;
}

.filters-form {
    margin: 0;
}

.filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-select:hover {
    border-color: var(--border-hover);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface-tertiary);
    color: var(--text-secondary);
}

.btn-clear-filters:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .filter-actions {
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .btn-clear-filters {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .filter-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-clear-filters {
        width: 100%;
    }
}

/* ========================================
   ESTILOS PERSONALIZADOS DE PAGINACIÓN
   ======================================== */

/* Contenedor principal de paginación - mejor integración */
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
}

/* Información de registros - mejor posicionamiento y estilo */
.dataTables_wrapper .dataTables_info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 1.5rem 0 0.75rem 0;
    text-align: left;
    padding-left: 1rem;
}

/* Botones de paginación - diseño consistente con el sistema */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    margin: 0 0.125rem;
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 38px;
    height: 38px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Hover en botones de paginación - más sutil */
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Botón activo/actual - página actual */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(22, 89, 239, 0.25);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: white !important;
    transform: translateY(-1px);
}

/* Botones deshabilitados - Previous/Next cuando no aplicable */
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    background: var(--surface-disabled, var(--surface)) !important;
    color: var(--text-disabled, var(--text-secondary)) !important;
    border-color: var(--border-light, var(--border)) !important;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: var(--surface-disabled, var(--surface)) !important;
    color: var(--text-disabled, var(--text-secondary)) !important;
    border-color: var(--border-light, var(--border)) !important;
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

/* Botones Previous/Next específicos */
.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    font-weight: 600;
    padding: 0.5rem 1rem;
}

/* Los estilos base ya usan variables CSS, no necesitamos duplicar para tema oscuro */
/* Las variables CSS se actualizan automáticamente según el tema */

/* Responsive para móvil */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
        min-width: 32px;
        height: 32px;
        margin: 0 0.0625rem;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button.previous,
    .dataTables_wrapper .dataTables_paginate .paginate_button.next {
        padding: 0.375rem 0.75rem;
    }
    
    .dataTables_wrapper .dataTables_info {
        font-size: 0.8rem;
        margin: 0.75rem 0;
    }
}

/* ========================================
   FUERZA BRUTA CSS - PAGINACIÓN DATATABLES
   ======================================== */

/* Máxima especificidad para sobrescribir DataTables por completo */
table.dataTable + .dataTables_wrapper .dataTables_paginate,
div.dataTables_wrapper div.dataTables_paginate,
.dataTables_wrapper div.dataTables_paginate,
body .dataTables_wrapper .dataTables_paginate {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 1.5rem 0 1rem 0 !important;
    padding: 1rem 1.5rem !important;
    background: var(--surface) !important;
    border-radius: var(--border-radius) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Info text con máxima especificidad */
table.dataTable + .dataTables_wrapper .dataTables_info,
div.dataTables_wrapper div.dataTables_info,
.dataTables_wrapper div.dataTables_info,
body .dataTables_wrapper .dataTables_info {
    color: var(--text-secondary) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    margin: 1.5rem 0 0 0 !important;
    text-align: left !important;
    padding: 0 1rem !important;
    background: transparent !important;
    border: none !important;
}

/* Botones de paginación - fuerza bruta total */
table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button,
div.dataTables_wrapper div.dataTables_paginate .paginate_button,
.dataTables_wrapper div.dataTables_paginate .paginate_button,
body .dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate a.paginate_button,
.dataTables_wrapper .dataTables_paginate span.paginate_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem 0.75rem !important;
    margin: 0 0.125rem !important;
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--border-radius-sm) !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    min-width: 40px !important;
    height: 40px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    line-height: 1 !important;
}

/* Hover - fuerza bruta */
table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
div.dataTables_wrapper div.dataTables_paginate .paginate_button:hover,
.dataTables_wrapper div.dataTables_paginate .paginate_button:hover,
body .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate a.paginate_button:hover,
.dataTables_wrapper .dataTables_paginate span.paginate_button:hover {
    background: var(--surface-hover, #f8fafc) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-hover, #cbd5e1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
    text-decoration: none !important;
}

/* Botón actual/activo - máxima especificidad */
table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button.current,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.current,
.dataTables_wrapper div.dataTables_paginate .paginate_button.current,
body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate a.paginate_button.current,
.dataTables_wrapper .dataTables_paginate span.paginate_button.current {
    background: var(--primary-color, #1659EF) !important;
    color: white !important;
    border-color: var(--primary-color, #1659EF) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(22, 89, 239, 0.25) !important;
}

/* Hover del botón actual */
table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper div.dataTables_paginate .paginate_button.current:hover,
body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate a.paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate span.paginate_button.current:hover {
    background: var(--primary-hover, #1347CC) !important;
    border-color: var(--primary-hover, #1347CC) !important;
    color: white !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

/* Botones deshabilitados */
table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper div.dataTables_paginate .paginate_button.disabled,
body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate span.paginate_button.disabled {
    background: var(--surface-disabled, #f1f5f9) !important;
    color: var(--text-disabled, #9ca3af) !important;
    border-color: var(--border-light, #e2e8f0) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    transform: none !important;
    pointer-events: none !important;
}

/* Previous/Next específicos */
table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button.previous,
table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button.next,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.previous,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.next,
.dataTables_wrapper div.dataTables_paginate .paginate_button.previous,
.dataTables_wrapper div.dataTables_paginate .paginate_button.next,
body .dataTables_wrapper .dataTables_paginate .paginate_button.previous,
body .dataTables_wrapper .dataTables_paginate .paginate_button.next {
    font-weight: 600 !important;
    padding: 0.5rem 1rem !important;
}

/* Tema oscuro específico */
[data-theme="dark"] table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button,
[data-theme="dark"] div.dataTables_wrapper div.dataTables_paginate .paginate_button,
[data-theme="dark"] .dataTables_wrapper div.dataTables_paginate .paginate_button,
[data-theme="dark"] body .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] table.dataTable + .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
[data-theme="dark"] div.dataTables_wrapper div.dataTables_paginate .paginate_button:hover,
[data-theme="dark"] .dataTables_wrapper div.dataTables_paginate .paginate_button:hover,
[data-theme="dark"] body .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-hover) !important;
}