@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   VARIABLES Y DARK MODE
   ============================================ */
:root {
    --accent: #1e3a5f;
    --accent-dark: #152c47;
    --accent-rgb: 30, 58, 95;
}

/* Dark Mode */
html.dark body {
    background-color: #0f172a;
    color: #f1f5f9;
}

html.dark aside {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.dark header {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.dark main {
    background-color: #0f172a;
}

html.dark #settingsPanel {
    background-color: #0f172a;
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark p.text-gray-900 {
    color: #ffffff !important;
}

html.dark .text-gray-900 {
    color: #ffffff !important;
}

html.dark .text-gray-800 {
    color: #f1f5f9 !important;
}

html.dark .text-gray-700 {
    color: #e2e8f0 !important;
}

html.dark .text-gray-600 {
    color: #cbd5e1 !important;
}

html.dark .text-gray-500 {
    color: #94a3b8 !important;
}

html.dark .text-gray-400 {
    color: #94a3b8 !important;
}

/* Improved contrast from 64748b */
html.dark .bg-white {
    background-color: #1e293b !important;
}

html.dark .bg-gray-50\/50 {
    background-color: #0f172a !important;
}

html.dark .bg-gray-100 {
    background-color: #1e293b !important;
}

html.dark .border-gray-100 {
    border-color: #334155 !important;
}

html.dark .border-gray-200 {
    border-color: #334155 !important;
}

html.dark .divide-gray-50>* {
    border-color: #334155 !important;
}

html.dark .bg-gray-50 {
    background-color: #0f172a !important;
}

/* Configuración Panel - Dark Mode Overrides */
html.dark #settingsPanel h2 {
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #ffffff !important;
}

html.dark #settingsPanel p.font-medium {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #e2e8f0 !important;
}

html.dark #settingsPanel p.font-light {
    font-weight: 400 !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
}

html.dark #settingsPanel .px-6.py-4 i[data-lucide] {
    color: #10b981 !important;
}

html.dark #settingsPanel .bg-green-50 {
    background-color: #064e3b !important;
    color: #34d399 !important;
    border-color: #10b981 !important;
}

html.dark #settingsPanel .bg-green-500 {
    background-color: #34d399 !important;
}

html.dark #darkModeToggle[aria-checked="true"] {
    background-color: #10b981 !important;
}

html.dark #settingsPanel .p-6 {
    padding: 24px !important;
}

html.dark #settingsPanel .space-y-5>*:not(:last-child) {
    border-bottom: 1px solid #334155;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

html.dark #settingsPanel .space-y-5>* {
    margin-top: 0 !important;
}

/* Sidebar Active Item in Dark Mode */
html.dark nav a.bg-\[\#1e3a5f\]\/5 {
    background-color: #1e293b !important;
    border-left: 3px solid #10b981 !important;
    border-radius: 0 8px 8px 0;
    color: #f1f5f9 !important;
}

html.dark nav a.bg-\[\#1e3a5f\]\/5 i {
    color: #10b981 !important;
}

/* Nuevo Cliente Modal - Light Mode Override */
html:not(.dark) #addClientModal>div {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

html:not(.dark) #addClientModal .modal-overlay {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

html:not(.dark) #addClientModal h3 {
    color: #111827 !important;
}

html:not(.dark) #addClientModal label {
    color: #374151 !important;
}

html:not(.dark) #addClientModal input,
html:not(.dark) #addClientModal select {
    background-color: #f9fafb !important;
    border: 1px solid #d1d5db !important;
    color: #111827 !important;
}

html:not(.dark) #addClientModal input::placeholder {
    color: #9ca3af !important;
}

html:not(.dark) #addClientModal input:focus,
html:not(.dark) #addClientModal select:focus {
    border: 1px solid #10b981 !important;
}

html:not(.dark) #addClientModal h3 span {
    background-color: rgba(16, 185, 129, 0.10) !important;
}

html:not(.dark) #addClientModal h3 i {
    color: #10b981 !important;
}

/* Nuevo Cliente Modal - Dark Mode */
html.dark #addClientModal>div {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 16px !important;
}

html.dark #addClientModal .modal-overlay {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

html.dark #addClientModal .sticky.top-0 {
    background-color: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
}

html.dark #addClientModal .sticky.top-0 h2 {
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 700 !important;
}

html.dark #addClientModal #closeClientModal {
    color: #64748b !important;
}

html.dark #addClientModal #closeClientModal:hover {
    color: #f1f5f9 !important;
    background-color: transparent !important;
}

html.dark #addClientModal label {
    color: #cbd5e1 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-bottom: 6px !important;
}

html.dark #addClientModal input,
html.dark #addClientModal select {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

html.dark #addClientModal input:focus,
html.dark #addClientModal select:focus {
    border: 1px solid #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
    outline: none !important;
}

html.dark #addClientModal input::placeholder {
    color: #64748b !important;
}

/* Nuevo Cliente Modal - Footer Botones Dark Mode */
html.dark #addClientModal form>div:last-child {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    padding-top: 20px !important;
    border-top: 1px solid #1e293b !important;
}

html.dark #addClientModal #cancelClientBtn {
    background-color: transparent !important;
    border: 1px solid #475569 !important;
    color: #94a3b8 !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
}

html.dark #addClientModal #cancelClientBtn:hover {
    border-color: #94a3b8 !important;
    color: #f1f5f9 !important;
    background-color: transparent !important;
}

html.dark #addClientModal button[type="submit"] {
    background-color: #10b981 !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

html.dark #addClientModal button[type="submit"]:hover {
    background-color: #059669 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35) !important;
}

/* Modal de Ayuda - Light Mode */
html:not(.dark) #helpModal .help-modal-card {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

html:not(.dark) #helpModal .help-modal-title,
html:not(.dark) #helpModal .help-accordion-title {
    color: #111827 !important;
}

html:not(.dark) #helpModal .help-accordion-text {
    color: #6b7280 !important;
}

html:not(.dark) #helpModal .help-accordion-item {
    border-color: #e5e7eb !important;
}

html:not(.dark) #helpModal .help-accordion-btn.active {
    background-color: rgba(16, 185, 129, 0.08) !important;
    border-left: 3px solid #10b981 !important;
}

/* Modal de Ayuda - Dark Mode */
html.dark #helpModal .help-modal-card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

html.dark #helpModal .help-modal-title,
html.dark #helpModal .help-accordion-title {
    color: #ffffff !important;
}

html.dark #helpModal .help-accordion-text {
    color: #94a3b8 !important;
}

html.dark #helpModal .help-accordion-item {
    border-color: #1e293b !important;
}

html.dark #helpModal .help-accordion-btn.active {
    background-color: rgba(16, 185, 129, 0.08) !important;
    border-left: 3px solid #10b981 !important;
}

/* Modal de Ayuda - General */
#helpModal .help-accordion-btn.active .help-accordion-icon {
    transform: rotate(180deg);
}

#helpModal .help-accordion-btn {
    padding-left: 8px;
    padding-right: 8px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

#helpModal .help-accordion-content>div {
    padding-left: 11px;
    padding-right: 8px;
}

html.dark input,
html.dark select,
html.dark textarea {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html.dark input::placeholder {
    color: #94a3b8 !important;
}

html.dark .table-row-hover:hover {
    background-color: #1e293b !important;
}

html.dark .hover\:bg-gray-50:hover {
    background-color: #1e293b !important;
}

html.dark .hover\:bg-gray-100:hover {
    background-color: #334155 !important;
}

html.dark .rounded-lg.border {
    border-color: #334155 !important;
}

html.dark .shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4) !important;
}

html.dark .modal-overlay {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

html.dark .bg-\[\#1e3a5f\]\/5 {
    background-color: rgba(var(--accent-rgb), 0.15) !important;
}

/* Accent color variable */
.accent-dynamic {
    background-color: var(--accent) !important;
}

.accent-dynamic:hover {
    background-color: var(--accent-dark) !important;
}

body {
    background-color: #fafafa;
}

* {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #fafafa;
}

:focus-visible {
    outline: 2px solid #1e3a5f;
    outline-offset: 2px;
}



/* Clases de Utilidad y Componentes (ExportPro) */
.accent-border {
    border-left: 3px solid #1e3a5f;
}

.accent-bg {
    background-color: #1e3a5f;
}

.accent-text {
    color: #1e3a5f;
}

.accent-hover:hover {
    background-color: #152c47;
}

.card-hover {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.card-hover:hover {
    border-color: #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.table-row-hover:hover {
    background-color: #f9fafb;
}

.modal-overlay {
    background-color: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.tab-active {
    border-bottom: 4px solid #1e3a5f;
    color: #111827;
    background-color: #f3f4f6;
    font-weight: 800;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.drag-zone {
    border: 2px dashed #e5e7eb;
    transition: all 0.3s ease;
}

.drag-zone:hover,
.drag-zone.drag-over {
    border-color: #1e3a5f;
    background-color: #f0f4f8;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Estilo personalizado para selects */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

/* Tooltip personalizado */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}

/* Animaciones */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-enter {
    animation: slideIn 0.3s ease forwards;
}

.toast-exit {
    animation: slideOut 0.3s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#clientsTableBody tr {
    animation: fadeInUp 0.3s ease forwards;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 1000px 100%;
}

/* ============================================
   UTILIDADES DE ICONOS (Migrados desde inline styles)
   ============================================ */
.icon-box-green {
    background-color: rgba(16, 185, 129, 0.12);
    padding: 5px;
}

.icon-green-sm {
    width: 14px;
    height: 14px;
    stroke-width: 1.5;
    color: #10B981;
}

/* ============================================
   GESTIÓN DE USUARIOS - Dark Mode
   ============================================ */
html.dark #userManagementSection {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.dark #userManagementSection h2 {
    color: #ffffff !important;
    font-weight: 700 !important;
}

html.dark #userManagementSection .bg-blue-50 {
    background-color: rgba(30, 58, 95, 0.5) !important;
    color: #93c5fd !important;
    border-color: #2563eb !important;
}

html.dark #userManagementSection .bg-gray-100 {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

html.dark #userManagementSection .bg-green-50 {
    background-color: #064e3b !important;
    color: #34d399 !important;
    border-color: #10b981 !important;
}

html.dark #userManagementSection .bg-red-50 {
    background-color: #7f1d1d !important;
    color: #fca5a5 !important;
    border-color: #ef4444 !important;
}

html.dark #inviteFormContainer {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

html.dark #inviteFormContainer label {
    color: #cbd5e1 !important;
}

html.dark #userManagementSection #toggleInviteForm {
    background-color: #1e3a5f !important;
}

html.dark #userManagementSection #toggleInviteForm:hover {
    background-color: #152c47 !important;
}