/* Dashboard Layout */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--secondary-color);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  max-height: 100vh;
  left: -280px;
  top: 0;
  z-index: 1000;
  transition: left 0.3s ease;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-header img {
  max-height: 45px;
  object-fit: contain;
}

.sidebar-header h2 {
  color: #fff;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.sidebar-header p {
  opacity: 0.7;
  margin-bottom: 0;
  font-size: 0.8rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  justify-content: space-evenly;
}

.sidebar-nav li {
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s;
  font-size: 0.9rem;
  white-space: nowrap;
}

.sidebar-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.sidebar-nav li.active a {
  background-color: var(--primary-color);
  color: #fff;
  border-left: 4px solid #fff;
}

.sidebar-nav i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  background: transparent;
}

.sidebar-footer p {
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #fff;
}

.sidebar-footer .btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-footer .btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 0;
  padding: 4rem 2rem 2rem;
  background-color: #f5f7fa;
  min-height: 100vh;
  width: 100%;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  max-width: 1400px;
}

/* Contenedor para centrar el contenido */
.content-section {
  display: none;
  width: 100%;
  max-width: 1400px;
}

.content-section.active {
  display: block;
}

.date-display {
  font-size: 1.1rem;
  color: #666;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  width: 100%;
}

.section-header h2 {
  order: 2;
  text-align: right;
}

.section-header > div,
.section-header > button {
  order: 1;
}

/* Filter Controls */
.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.filter-controls.hidden {
  display: none;
}

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

.filter-group label {
  margin-bottom: 0;
  white-space: nowrap;
}

.filter-group select, .filter-group input {
  min-width: 150px;
}

/* Toggle filters button */
#toggle-filters-cuotas {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#toggle-filters-cuotas i {
  transition: transform 0.3s ease;
}

/* Tables */
.table-container {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: visible;
  margin-bottom: 1.5rem;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

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

.data-table th, .data-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.data-table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.data-table tbody tr:hover {
  background-color: rgba(52, 152, 219, 0.05);
}

.data-table .actions {
  display: flex;
  gap: 0.5rem;
}

/* Dashboard Summary - 3 columnas */
.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
}

.summary-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #666;
}

.summary-card .amount {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.summary-card .description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Dashboard Charts - 2 columnas */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-container {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-container h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #666;
}

.chart {
  position: relative;
  height: 300px;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart canvas {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  max-height: 300px !important;
}

/* Asegurar que Chart.js respete el contenedor */
.chart > div {
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
}

/* Dashboard Recent */
/* Dashboard Recent - 3 columnas */
.dashboard-recent {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.recent-container {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.recent-container h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #666;
}

.recent-list {
  max-height: 400px;
  overflow-y: auto;
}

/* Anuncios */
.anuncios-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.anuncio-card {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  position: relative;
}

.anuncio-card.importante {
  border-left: 4px solid var(--warning-color);
}

.anuncio-card.urgente {
  border-left: 4px solid var(--danger-color);
}

.anuncio-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.anuncio-card .anuncio-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #666;
}

.anuncio-card .anuncio-content {
  margin-bottom: 1rem;
  white-space: pre-line;
}

.anuncio-card .anuncio-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.anuncio-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.anuncio-badge.general {
  background-color: var(--primary-color);
  color: #fff;
}

.anuncio-badge.importante {
  background-color: var(--warning-color);
  color: #fff;
}

.anuncio-badge.urgente {
  background-color: var(--danger-color);
  color: #fff;
}

/* Fondos */
.fondos-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  margin-top: 0;
}

.fondo-card {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
}

.fondo-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.fondo-card .amount {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.fondo-card .description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.fondo-card.total {
  grid-column: 1 / -1;
  background: var(--gradient) !important;
}

.fondo-card.total h3, 
.fondo-card.total .description,
.fondo-card.total .description span {
  color: rgba(255, 255, 255, 0.9) !important;
}

.fondo-card.total .amount {
  color: #fff !important;
  font-size: 2.5rem;
}

/* Parcialidades */
.parcialidades-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.info-card {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.info-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #666;
}

.info-card ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.info-card li {
  margin-bottom: 0.5rem;
}

.progress-container {
  margin-top: 1rem;
}

.progress-bar {
  height: 1.5rem;
  background-color: #e9ecef;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.parcialidades-progress {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.parcialidades-progress h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #666;
}

.depto-progress {
  margin-bottom: 1rem;
}

.depto-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.depto-progress-bar {
  height: 1rem;
  background-color: #e9ecef;
  border-radius: 0.25rem;
  overflow: hidden;
}

.depto-progress {
  height: 100%;
  background-color: var(--primary-color);
}

.depto-progress.completed {
  background-color: var(--success-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Responsive - Tablets y pantallas medianas */
@media (max-width: 1200px) {
  .dashboard-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
  
  .dashboard-recent {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .dashboard-summary {
    grid-template-columns: 1fr;
  }
  
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
  
  .dashboard-recent {
    grid-template-columns: 1fr;
  }
  
  .anuncios-container {
    grid-template-columns: 1fr;
  }
  
  .fondos-summary {
    grid-template-columns: 1fr;
  }
}

/* ESTE MEDIA QUERY SE MOVIÓ A LA SECCIÓN CONSOLIDADA AL FINAL */

@media (max-width: 480px) {
  .main-content {
    padding: 4rem 0.5rem 0.5rem;
  }
  
  .summary-card {
    padding: 0.75rem;
  }
  
  .summary-card h3 {
    font-size: 1rem;
  }
  
  .summary-card .amount {
    font-size: 1.25rem;
  }
  
  .summary-card .description {
    font-size: 0.8rem;
  }
  
  .data-table th, .data-table td {
    padding: 0.375rem 0.15rem;
    font-size: 0.65rem;
  }
  
  /* Ocultar email en móviles muy pequeños */
  #usuarios-table th:nth-child(2),
  #usuarios-table td:nth-child(2) {
    display: none;
  }
  
  /* Ocultar departamento en móviles muy pequeños */
  #usuarios-table th:nth-child(3),
  #usuarios-table td:nth-child(3) {
    display: none;
  }
  
  .data-table .actions {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .data-table .actions .btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
  }
  
  #usuarios-table th:nth-child(7),
  #usuarios-table td:nth-child(7) {
    width: 60px;
    min-width: 60px;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .sidebar-header {
    padding: 1rem;
  }
  
  .sidebar-header h2 {
    font-size: 1.25rem;
  }
  
  .sidebar-nav a {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .sidebar-footer {
    padding: 1rem;
  }
  
  .anuncio-card, .info-card, .fondo-card {
    padding: 1rem;
  }
  
  .progress-info {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* Configuración Section */
.config-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--light-gray);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.config-tab-content {
  display: none;
}

.config-tab-content.active {
  display: block;
}

.config-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.config-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.config-card h3 {
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.config-card .description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.proyectos-summary {
  background: var(--light-gray);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.proyectos-summary p {
  margin: 0.5rem 0;
  color: var(--secondary-color);
}

.proyectos-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.proyecto-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--light-gray);
  border-radius: 6px;
  border-left: 4px solid var(--primary-color);
}

.proyecto-info h4 {
  margin: 0 0 0.5rem 0;
  color: var(--secondary-color);
}

.proyecto-monto {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 0.5rem 0;
}

.proyecto-actions {
  display: flex;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
}

.badge-urgente {
  background-color: #dc3545;
  color: white;
}

.badge-alta {
  background-color: #fd7e14;
  color: white;
}

.badge-media {
  background-color: #ffc107;
  color: #000;
}

.badge-baja {
  background-color: #28a745;
  color: white;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--light-gray);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  font-weight: 600;
  color: var(--secondary-color);
}

.info-item p {
  margin: 0;
  color: #666;
}

.empty-message {
  text-align: center;
  padding: 1.5rem;
  color: #666;
  font-style: italic;
}

/* Documentos */
.documentos-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.documento-item {
  background: var(--light-gray);
  padding: 1rem;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.documento-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.documento-item-header i {
  font-size: 2rem;
  color: var(--primary-color);
}

.documento-info h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--secondary-color);
}

.documento-info p {
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
  color: #666;
}

.documento-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.documento-actions button {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.5rem;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
}

.form-group input[readonly] {
  background-color: var(--light-gray);
  cursor: not-allowed;
}

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.form-actions button {
  flex: 1;
}

/* Responsive para configuración - CONSOLIDADO ABAJO */
/* ============================================
   RESPONSIVE DASHBOARD - MOBILE
   ============================================ */

@media (max-width: 1024px) {
  .sidebar {
    width: 250px;
  }
  
  .main-content {
    margin-left: 250px;
  }
}

/* MEDIA QUERY CONSOLIDADO AL FINAL */

@media (max-width: 480px) {
  .sidebar-header img {
    height: 35px !important;
  }
  
  .sidebar-nav ul {
    grid-template-columns: 1fr;
  }
  
  .main-content {
    padding: 0.75rem;
  }
  
  .summary-card {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Contenedor scroll para tablas */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}

.table-responsive .data-table {
  min-width: 700px;
}




  
  /* Config container stack */
  .config-container {
    grid-template-columns: 1fr;
  }
  
  /* Charts responsive */
  .chart-container {
    padding: 1rem;
  }
  
  .chart {
    height: 250px;
  }
  
  .chart canvas {
    max-height: 250px !important;
  }
}

@media (max-width: 480px) {
  /* Sidebar completamente apilado */
  .sidebar-nav ul {
    grid-template-columns: 1fr;
  }
  
  .sidebar-nav a {
    padding: 1rem;
  }
  
  /* Solo 3 columnas en móvil pequeño */
  .data-table th:nth-child(n+4),
  .data-table td:nth-child(n+4) {
    display: none;
  }
  
  /* Summary cards más compactas */
  .summary-card {
    padding: 1rem;
  }
  
  .summary-card .amount {
    font-size: 1.5rem;
  }
  
  .summary-card h3 {
    font-size: 0.85rem;
  }
  
  /* Botones full width */
  .btn,
  .btn-primary,
  .btn-secondary {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .section-header .btn {
    width: 100%;
  }
}

/* Botón hamburguesa para sidebar - SIEMPRE VISIBLE */
.mobile-sidebar-toggle {
  display: flex;
  position: fixed;
  top: 1rem;
  left: 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 1.25rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  opacity: 1;
  pointer-events: auto;
}

/* Ocultar botón hamburguesa cuando sidebar está activo */
.sidebar.active + .main-content .mobile-sidebar-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
}

.mobile-sidebar-toggle:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.mobile-sidebar-toggle:active {
  transform: scale(0.95);
}

/* Botón cerrar sidebar */
.sidebar-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.sidebar-close:hover {
  background: rgba(255,255,255,0.3);
}

.sidebar-header {
  position: relative;
}

/* Overlay para cerrar sidebar al hacer clic fuera */
.mobile-overlay.active {
  display: block;
}

/* No hay cambios específicos en media queries para el sidebar 
   ya que ahora es deslizante en todas las resoluciones */

/* ============================================
   MEDIA QUERIES CONSOLIDADOS
   ============================================ */

/* Tablets y móviles grandes (768px) */
@media (max-width: 768px) {
  /* Sidebar responsive */
  .mobile-menu-toggle {
    display: block;
  }
  
  .dashboard-container {
    position: relative;
  }
  
  .sidebar {
    width: 280px;
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .mobile-overlay.active {
    display: block;
  }
  
  /* Main content */
  .main-content {
    margin-left: 0;
    padding: 3.5rem 1rem 1rem;
    width: 100%;
  }
  
  .main-header {
    display: flex;
    border-bottom: none;
    margin-bottom: 1rem;
    padding-bottom: 0;
  }
  
  .main-header h1,
  .main-header .date-display {
    display: none;
  }
  
  .main-header .mobile-sidebar-toggle {
    display: flex;
    position: fixed;
  }
  
  .content-section {
    max-width: 100%;
  }
  
  /* Dashboard */
  .dashboard-summary {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dashboard-charts {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dashboard-recent {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .summary-card {
    padding: 1rem;
  }
  
  .summary-card .amount {
    font-size: 1.5rem;
  }
  
  /* Filtros */
  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .filter-group {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .filter-group select, .filter-group input {
    width: 100%;
    min-width: auto;
  }
  
  /* Sections */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .section-header h2 {
    order: 0;
    text-align: left;
    width: 100%;
  }
  
  .section-header > div,
  .section-header > button {
    order: 1;
  }
  
  .section-header .btn, .section-header .button-group {
    width: 100%;
  }
  
  .button-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  /* Tables */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100vw;
  }
  
  .data-table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
  }
  
  .data-table th, .data-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    white-space: normal;
    word-wrap: break-word;
    max-width: none;
  }
  
  /* Ocultar columna Editor en tabla usuarios */
  #usuarios-table th:nth-child(5),
  #usuarios-table td:nth-child(5) {
    display: none;
  }
  
  #usuarios-table th:nth-child(7),
  #usuarios-table td:nth-child(7) {
    width: 80px;
    min-width: 80px;
  }
  
  #usuarios-table th:nth-child(6),
  #usuarios-table td:nth-child(6) {
    width: 70px;
    min-width: 70px;
  }
  
  /* Ocultar columnas en tabla cuotas */
  #cuotas-table th:nth-child(3),
  #cuotas-table td:nth-child(3),
  #cuotas-table th:nth-child(7),
  #cuotas-table td:nth-child(7) {
    display: none;
  }
  
  #cuotas-table th:nth-child(8),
  #cuotas-table td:nth-child(8) {
    width: 80px;
    min-width: 80px;
  }
  
  /* Ocultar columnas en tabla gastos */
  #gastos-table th:nth-child(4),
  #gastos-table td:nth-child(4),
  #gastos-table th:nth-child(5),
  #gastos-table td:nth-child(5) {
    display: none;
  }
  
  #gastos-table th:nth-child(6),
  #gastos-table td:nth-child(6) {
    width: 80px;
    min-width: 80px;
  }
  
  .data-table .actions {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  /* Containers */
  .anuncios-container,
  .fondos-summary,
  .parcialidades-info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .chart-container {
    padding: 1rem;
  }
  
  .chart {
    height: 250px;
  }
  
  .chart canvas {
    max-height: 250px !important;
  }
  
  .recent-container {
    padding: 1rem;
  }
  
  /* Forms */
  .form-grid {
    grid-template-columns: 1fr !important;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-group input, .form-group select, .form-group textarea {
    font-size: 16px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  /* Modals */
  .modal-content {
    margin: 1rem;
    width: 95%;
    max-width: 95%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-actions button {
    width: 100%;
  }
  
  /* Configuración */
  .config-tabs {
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }
  
  .config-container {
    grid-template-columns: 1fr;
  }
  
  .proyecto-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .proyecto-actions {
    margin-top: 1rem;
    width: 100%;
  }
  
  .proyecto-actions button {
    flex: 1;
  }
  
  .documentos-container {
    grid-template-columns: 1fr;
  }
  
  /* Botones */
  .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .action-buttons .btn {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }
  
  /* Cards */
  .anuncio-card,
  .info-card,
  .fondo-card {
    margin-bottom: 1rem;
  }
}

/* Móviles pequeños (480px) */
@media (max-width: 480px) {
  .main-content {
    padding: 3.5rem 0.75rem 0.75rem;
  }
  
  /* Ocultar Email y Departamento en tabla usuarios */
  #usuarios-table th:nth-child(2),
  #usuarios-table td:nth-child(2),
  #usuarios-table th:nth-child(3),
  #usuarios-table td:nth-child(3) {
    display: none;
  }
  
  /* Ocultar más columnas en tabla cuotas */
  #cuotas-table th:nth-child(6),
  #cuotas-table td:nth-child(6) {
    display: none;
  }
  
  /* Ocultar Fecha en tabla gastos */
  #gastos-table th:nth-child(1),
  #gastos-table td:nth-child(1) {
    display: none;
  }
  
  .data-table .actions {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .data-table .actions .btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
  }
  
  #usuarios-table th:nth-child(7),
  #usuarios-table td:nth-child(7) {
    width: 60px;
    min-width: 60px;
  }
}
