/* 
 * RGM Advanced - Estilos Generales Centralizados
 * Compatible con Tailwind CSS y modo oscuro
 */

/* ===== BASE HTML/BODY ===== */
html, body {
  height: 100%;
}

html.transition-colors * {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ===== SIDEBAR ===== */
.sidebar-transition {
  transition: width 0.2s ease, transform 0.3s ease;
}

/* Sidebar con fondo distintivo en modo claro */
aside#sidebar,
#sidebar {
  background-color: #e5e7eb !important; /* gray-200 - diferenciado del contenido */
  border-right: 2px solid #d1d5db !important; /* gray-300 */
}

.dark aside#sidebar,
.dark #sidebar {
  background-color: #1f2937 !important; /* gray-800 */
  border-right-color: #374151 !important; /* gray-700 */
}

/* ===== Z-INDEX LAYERING ===== */
/* Asegurar que el contenido esté por encima de la marca de agua */
#app,
aside,
main,
nav,
table,
.bg-white,
.dark\:bg-gray-800,
.bg-gray-50,
.dark\:bg-gray-900 {
  position: relative;
  z-index: 1;
}

/* ===== SCROLLBAR MODERNA ===== */
/* Scrollbar para navegación */
nav::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

nav::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

nav::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.dark nav::-webkit-scrollbar-thumb,
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #475569;
}

nav::-webkit-scrollbar-thumb:hover,
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark nav::-webkit-scrollbar-thumb:hover,
.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Scrollbar para modales */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dark .modal-content::-webkit-scrollbar-thumb {
  background: #475569;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark .modal-content::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ===== MODAL STYLES ===== */
.modal-scroll {
  max-height: 80vh;
  overflow-y: auto;
}

.modal-backdrop {
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
}

.modal-content {
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== FORM INPUTS ===== */
.form-input {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== MOBILE MENU ===== */
/* Overlay del menú móvil */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar móvil moderno */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 280px;
  max-width: 85vw;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-sidebar.active {
  transform: translateX(0);
}

/* Botón hamburguesa mejorado */
.mobile-menu-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  background-color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.dark .mobile-menu-btn {
  background-color: #1f2937;
  border-color: #374151;
}

.mobile-menu-btn:hover {
  background-color: #f3f4f6;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dark .mobile-menu-btn:hover {
  background-color: #374151;
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

/* Icono hamburguesa animado */
.hamburger-icon {
  position: relative;
  width: 20px;
  height: 14px;
}

.hamburger-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #374151;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.dark .hamburger-icon span {
  background-color: #d1d5db;
}

.hamburger-icon span:nth-child(1) {
  top: 0;
}

.hamburger-icon span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-icon span:nth-child(3) {
  bottom: 0;
}

/* Estado activo del hamburguesa (X) */
.mobile-menu-btn.active .hamburger-icon span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Botón cerrar menú */
.close-menu-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  background-color: transparent;
  transition: background-color 0.2s ease;
}

.close-menu-btn:hover {
  background-color: #f3f4f6;
}

.dark .close-menu-btn:hover {
  background-color: #374151;
}

/* ===== HEADER MOBILE SPACING ===== */
/* Dar espacio al contenido en móvil para el header */
@media (max-width: 767px) {
  main {
    padding-top: 4.5rem !important;
  }
}

/* ===== CONTENIDO PRINCIPAL ===== */
/* Evitar que el contenido tenga problemas de scroll */
#app {
  min-height: 100vh;
  display: flex;
}

main {
  flex: 1;
  overflow-x: hidden;
}

/* ===== TABLAS RESPONSIVAS ===== */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== KANBAN STYLES ===== */
/* Columnas Kanban con colores específicos por status - MODO CLARO */
.kanban-column {
  min-height: 400px;
  border: 2px solid transparent;
}

/* Colores por columna en modo claro */
.kanban-column[data-status="prospectos"] {
  background-color: #dbeafe !important; /* blue-100 */
  border-color: #93c5fd !important; /* blue-300 */
}

.kanban-column[data-status="contactados"] {
  background-color: #fee2e2 !important; /* red-100 */
  border-color: #fca5a5 !important; /* red-300 */
}

.kanban-column[data-status="calificado"] {
  background-color: #fef3c7 !important; /* amber-100 */
  border-color: #fcd34d !important; /* amber-300 */
}

.kanban-column[data-status="visita-programada"] {
  background-color: #ede9fe !important; /* violet-100 */
  border-color: #c4b5fd !important; /* violet-300 */
}

.kanban-column[data-status="negociacion"] {
  background-color: #ffedd5 !important; /* orange-100 */
  border-color: #fdba74 !important; /* orange-300 */
}

.kanban-column[data-status="post-venta"] {
  background-color: #dcfce7 !important; /* green-100 */
  border-color: #86efac !important; /* green-300 */
}

/* Colores por columna en modo oscuro */
.dark .kanban-column[data-status="prospectos"] {
  background-color: #1e3a5f !important; /* blue-900 custom */
  border-color: #1d4ed8 !important; /* blue-700 */
}

.dark .kanban-column[data-status="contactados"] {
  background-color: #4c1d1d !important; /* red-900 custom */
  border-color: #b91c1c !important; /* red-700 */
}

.dark .kanban-column[data-status="calificado"] {
  background-color: #4d3b0a !important; /* amber-900 custom */
  border-color: #b45309 !important; /* amber-700 */
}

.dark .kanban-column[data-status="visita-programada"] {
  background-color: #3b1d5e !important; /* violet-900 custom */
  border-color: #7c3aed !important; /* violet-600 */
}

.dark .kanban-column[data-status="negociacion"] {
  background-color: #4d2c0a !important; /* orange-900 custom */
  border-color: #c2410c !important; /* orange-700 */
}

.dark .kanban-column[data-status="post-venta"] {
  background-color: #14412a !important; /* green-900 custom */
  border-color: #15803d !important; /* green-700 */
}

/* Tarjetas de prospectos en Kanban */
.prospect-card {
  cursor: grab;
  background-color: #ffffff !important;
  border: 1px solid #d1d5db !important; /* gray-300 - borde más visible */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.dark .prospect-card {
  background-color: #374151 !important;
  border-color: #4b5563 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.prospect-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.prospect-card:active {
  cursor: grabbing;
}

.prospect-card.dragging {
  opacity: 0.5;
  transform: rotate(3deg);
}

.kanban-column.drag-over {
  background-color: rgba(59, 130, 246, 0.1);
  border-style: dashed;
}

/* Scroll horizontal para Kanban */
.kanban-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
  cursor: grab;
  user-select: none;
}

.kanban-wrapper.grabbing {
  cursor: grabbing;
  scroll-behavior: auto;
}

.kanban-wrapper::-webkit-scrollbar {
  height: 8px;
}

.kanban-wrapper::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.kanban-wrapper::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.5);
  border-radius: 10px;
}

.kanban-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.7);
}

/* ===== ORGANIGRAMA ===== */
.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: white;
}

.dark .org-chart {
  background: #1f2937;
}

.org-node {
  background: #3b82f6;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  margin: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 200px;
}

.org-node.ceo {
  background: #7c3aed;
}

.org-node.manager {
  background: #3b82f6;
}

.org-node.employee {
  background: #10b981;
}

.org-level {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
}

.org-connector {
  width: 2px;
  height: 40px;
  background: #9ca3af;
  margin: 0 auto;
}

/* ===== SEARCH RESULTS ===== */
.search-results {
  max-height: 70vh;
  overflow-y: auto;
  background-color: #ffffff;
}

.dark .search-results {
  background-color: #1f2937;
}

/* ===== CALENDAR STYLES ===== */
/* Contenedor del calendario con fondo */
#calendarDays,
#calendarContainer {
  background-color: #e5e7eb; /* gray-200 */
  border-radius: 0.5rem;
  padding: 0.25rem;
}

.dark #calendarDays,
.dark #calendarContainer {
  background-color: #1f2937; /* gray-800 */
}

/* Días del calendario - colores alternados */
#calendarDays > div {
  background-color: #f9fafb !important; /* gray-50 */
  border: 1px solid #d1d5db !important; /* gray-300 */
  border-radius: 0.5rem;
  min-height: 2.5rem;
}

#calendarDays > div:nth-child(odd) {
  background-color: #e5e7eb !important; /* gray-200 */
}

/* Días con contenido (llamadas) - destacar */
#calendarDays > div:not(:empty) {
  background-color: #dbeafe !important; /* blue-100 */
  border-color: #93c5fd !important; /* blue-300 */
}

/* Hover en días del calendario */
#calendarDays > div:hover {
  background-color: #bfdbfe !important; /* blue-200 */
  border-color: #60a5fa !important; /* blue-400 */
  transform: scale(1.02);
  transition: all 0.15s ease;
}

/* Modo oscuro - días del calendario */
.dark #calendarDays > div {
  background-color: #374151 !important; /* gray-700 */
  border-color: #4b5563 !important; /* gray-600 */
}

.dark #calendarDays > div:nth-child(odd) {
  background-color: #1f2937 !important; /* gray-800 */
}

.dark #calendarDays > div:not(:empty) {
  background-color: #1e3a5f !important; /* blue-900 custom */
  border-color: #3b82f6 !important; /* blue-500 */
}

.dark #calendarDays > div:hover {
  background-color: #2563eb !important; /* blue-600 */
  border-color: #60a5fa !important;
}

/* ===== CALENDAR CONTAINER (Entrevistas - vista semanal/mensual) ===== */
#calendarContainer > div > div {
  background-color: #f3f4f6 !important; /* gray-100 */
  border: 1px solid #d1d5db !important;
}

#calendarContainer .grid > div:nth-child(even) {
  background-color: #e5e7eb !important; /* gray-200 */
}

.dark #calendarContainer > div > div {
  background-color: #374151 !important;
  border-color: #4b5563 !important;
}

.dark #calendarContainer .grid > div:nth-child(even) {
  background-color: #1f2937 !important;
}

/* Slots de hora en calendario semanal */
#calendarContainer .grid-cols-8 > div {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  min-height: 2rem;
}

#calendarContainer .grid-cols-8 > div:nth-child(odd) {
  background-color: #f3f4f6;
}

.dark #calendarContainer .grid-cols-8 > div {
  background-color: #1f2937;
  border-color: #374151;
}

.dark #calendarContainer .grid-cols-8 > div:nth-child(odd) {
  background-color: #111827;
}

/* Día actual destacado */
.calendar-today {
  background-color: #dbeafe !important;
  border-color: #3b82f6 !important;
  font-weight: bold;
}

.dark .calendar-today {
  background-color: #1e3a5f !important;
  border-color: #60a5fa !important;
}

/* Cabecera de días de la semana */
#calendarContainer .grid-cols-7 > div:first-child,
.calendar-header {
  background-color: #d1d5db !important; /* gray-300 */
  font-weight: 600;
}

.dark #calendarContainer .grid-cols-7 > div:first-child,
.dark .calendar-header {
  background-color: #4b5563 !important;
}

/* ===== DROPDOWN MENUS ===== */
/* Dropdowns y menús desplegables */
[class*="dropdown"],
.dropdown-menu,
.context-menu {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dark [class*="dropdown"],
.dark .dropdown-menu,
.dark .context-menu {
  background-color: #1f2937;
  border-color: #374151;
}

/* ===== TOOLTIP STYLES ===== */
.tooltip,
[role="tooltip"] {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.dark .tooltip,
.dark [role="tooltip"] {
  background-color: #f9fafb;
  color: #1f2937;
}

/* ===== NOTIFICATION BADGES ===== */
/* Badges de notificación con colores específicos */
.count-badge {
  font-weight: 600;
}

/* ===== GRADIENT CARDS (Recordatorios) ===== */
/* Mejorar contraste en cards con gradiente en modo claro */
.bg-gradient-to-br {
  border-width: 1px;
}

/* Gradientes específicos para modo claro */
.from-red-50 {
  --tw-gradient-from: #fef2f2;
}

.from-orange-50 {
  --tw-gradient-from: #fff7ed;
}

.from-blue-50 {
  --tw-gradient-from: #eff6ff;
}

.from-green-50 {
  --tw-gradient-from: #f0fdf4;
}

.from-yellow-50 {
  --tw-gradient-from: #fefce8;
}

.from-purple-50 {
  --tw-gradient-from: #faf5ff;
}

/* ===== FIELD STATES (for edit modals) ===== */
.field-unchanged {
  background-color: #f3f4f6 !important;
  border-color: #d1d5db !important;
  opacity: 0.7;
}

.dark .field-unchanged {
  background-color: #374151 !important;
  border-color: #4b5563 !important;
}

.field-changed {
  background-color: #fef3c7 !important;
  border-color: #f59e0b !important;
  border-width: 2px !important;
}

.dark .field-changed {
  background-color: #451a03 !important;
  border-color: #f59e0b !important;
}

/* ===== UTILITY CLASSES ===== */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in-left {
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-slide-in-up {
  animation: slideInUp 0.3s ease-out;
}

/* ===== FOCUS VISIBLE ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ===== TABLE STYLES - ZEBRA STRIPING ===== */
/* Filas alternadas con alta especificidad para sobreescribir Tailwind */
tbody tr {
  transition: background-color 0.15s ease;
}

table.striped-table tbody tr:nth-child(even),
tbody tr:nth-child(even) {
  background-color: #d1d5db !important; /* gray-300 - mucho más contraste */
}

tbody tr:nth-child(odd) {
  background-color: #f3f4f6 !important; /* gray-100 - visible */
}

/* Modo oscuro */
.dark tbody tr:nth-child(even) {
  background-color: #1e293b !important; /* slate-800 */
}

.dark tbody tr:nth-child(odd) {
  background-color: #0f172a !important; /* slate-900 */
}

/* Hover en filas */
tbody tr:hover {
  background-color: #93c5fd !important; /* blue-300 - más intenso */
}

.dark tbody tr:hover {
  background-color: #1e3a5f !important; /* blue-900/50 */
}

/* Bordes entre filas - más gruesos */
tbody tr {
  border-bottom: 2px solid #9ca3af !important; /* gray-400 - borde más visible y grueso */
}

.dark tbody tr {
  border-bottom: 2px solid #4b5563 !important; /* gray-600 */
}

/* Bordes verticales entre columnas - más visibles */
table th,
table td {
  border-right: 2px solid #9ca3af !important; /* gray-400 - más grueso y oscuro */
}

table th:last-child,
table td:last-child {
  border-right: none !important;
}

/* Borde izquierdo para primera columna */
table th:first-child,
table td:first-child {
  border-left: 2px solid #9ca3af !important;
}

.dark table th,
.dark table td {
  border-right: 2px solid #6b7280 !important; /* gray-500 - más visible en oscuro */
}

.dark table th:first-child,
.dark table td:first-child {
  border-left: 2px solid #6b7280 !important;
}

/* Celdas de tabla */
table tbody td {
  color: #111827 !important; /* gray-900 - texto más oscuro */
}

.dark table tbody td {
  color: #f3f4f6 !important; /* gray-100 - texto claro en modo oscuro */
}

/* Texto de todas las celdas en modo oscuro */
.dark table td,
.dark table th,
.dark tbody td,
.dark thead th {
  color: #f3f4f6 !important; /* gray-100 */
}

/* Encabezados de tabla más destacados */
table thead {
  background-color: #9ca3af !important; /* gray-400 - más oscuro */
}

table thead th {
  color: #111827 !important; /* gray-900 */
  font-weight: 700;
  border-bottom: 3px solid #6b7280 !important; /* gray-500 */
}

.dark table thead {
  background-color: #374151 !important; /* gray-700 */
}

.dark table thead th {
  color: #f3f4f6 !important; /* gray-100 */
  border-bottom-color: #6b7280 !important;
}

/* ===== FORM INPUTS - FONDO GRIS SUAVE ===== */
/* Inputs con fondo gris claro para mejor visibilidad en modo claro */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
textarea,
select {
  background-color: #f3f4f6 !important; /* gray-100 - más visible que gray-50 */
  border: 1px solid #9ca3af !important; /* gray-400 - borde más visible */
  color: #1f2937 !important; /* gray-800 */
  transition: all 0.15s ease;
}

/* Modo oscuro para inputs */
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="number"],
.dark input[type="tel"],
.dark input[type="url"],
.dark input[type="search"],
.dark input[type="date"],
.dark input[type="time"],
.dark input[type="datetime-local"],
.dark input[type="month"],
.dark input[type="week"],
.dark textarea,
.dark select {
  background-color: #1f2937 !important; /* gray-800 */
  border-color: #4b5563 !important; /* gray-600 */
  color: #f3f4f6 !important; /* gray-100 */
}

/* Clases específicas para inputs que pueden no tener type */
.form-input,
input.border,
input.rounded-lg,
select.border,
select.rounded-lg,
textarea.border,
textarea.rounded-lg {
  background-color: #f3f4f6 !important; /* gray-100 */
  border-color: #9ca3af !important; /* gray-400 */
  color: #1f2937 !important; /* gray-800 */
}

/* Clases específicas para inputs en modo oscuro */
.dark .form-input,
.dark input.border,
.dark input.rounded-lg,
.dark select.border,
.dark select.rounded-lg,
.dark textarea.border,
.dark textarea.rounded-lg {
  background-color: #1f2937 !important; /* gray-800 */
  border-color: #4b5563 !important; /* gray-600 */
  color: #f3f4f6 !important; /* gray-100 */
}

/* Estados focus para inputs */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
textarea:focus,
select:focus,
.form-input:focus,
input.border:focus,
input.rounded-lg:focus {
  border-color: #3b82f6 !important; /* blue-500 */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
  background-color: #ffffff !important; /* white en focus */
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
  border-color: #60a5fa !important; /* blue-400 */
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
  background-color: #111827 !important; /* gray-900 en focus */
}

/* Placeholder text */
input::placeholder,
textarea::placeholder {
  color: #9ca3af !important; /* gray-400 */
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: #6b7280 !important; /* gray-500 */
}

/* Date/time inputs específicos para modo claro (icono del calendario) */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  filter: none;
  cursor: pointer;
}

.dark input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="time"]::-webkit-calendar-picker-indicator,
.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.dark input[type="month"]::-webkit-calendar-picker-indicator,
.dark input[type="week"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Select arrow styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.dark select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Disabled inputs */
input:disabled,
textarea:disabled,
select:disabled {
  background-color: #f3f4f6 !important; /* gray-100 */
  color: #9ca3af !important; /* gray-400 */
  cursor: not-allowed;
}

.dark input:disabled,
.dark textarea:disabled,
.dark select:disabled {
  background-color: #374151 !important; /* gray-700 */
  color: #6b7280 !important; /* gray-500 */
}

/* ===== CARDS Y CONTENEDORES ===== */
/* Cards en modo claro */
.bg-white {
  background-color: #ffffff;
}

/* Cards con sombra sutil en modo claro */
section > .bg-white,
div > .bg-white {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.dark section > .bg-white,
.dark div > .bg-white {
  box-shadow: none;
}

/* ===== BADGES Y TAGS ===== */
/* Mejor contraste para badges en modo claro */
.bg-gray-100 {
  background-color: #f3f4f6;
}

.text-gray-700 {
  color: #374151;
}

/* ===== MODAL MEJORADOS ===== */
/* Fondo de modales */
.modal-content,
[class*="modal"] .bg-white {
  background-color: #ffffff;
}

.dark .modal-content,
.dark [class*="modal"] .bg-white {
  background-color: #1f2937;
}

/* ===== FILE INPUT STYLING ===== */
input[type="file"] {
  background-color: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #1f2937 !important;
}

.dark input[type="file"] {
  background-color: #1f2937 !important;
  border-color: #4b5563 !important;
  color: #f3f4f6 !important;
}

input[type="file"]::file-selector-button {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  margin-right: 1rem;
}

input[type="file"]::file-selector-button:hover {
  background-color: #2563eb;
}

/* ===== CHECKBOX Y RADIO ===== */
input[type="checkbox"],
input[type="radio"] {
  accent-color: #3b82f6;
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.dark input[type="checkbox"],
.dark input[type="radio"] {
  accent-color: #60a5fa;
}

/* ===== BORDES DE SECCIÓN ===== */
section.border,
div.border {
  border-color: #e5e7eb; /* gray-200 */
}

.dark section.border,
.dark div.border {
  border-color: #374151; /* gray-700 */
}

/* ===== PRINT STYLES ===== */
@media print {
  .no-print,
  .mobile-menu-btn,
  .mobile-menu-overlay,
  .mobile-sidebar,
  #page-watermark {
    display: none !important;
  }
  
  aside {
    display: none !important;
  }
  
  main {
    margin: 0 !important;
    padding: 1rem !important;
    width: 100% !important;
  }
}
