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

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--secondary-color);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

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

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

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

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s;
}

.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: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer p {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem;
  background-color: #f5f7fa;
}

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

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

/* Content Sections */
.content-section {
  display: none;
}

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

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

/* 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);
}

.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;
}

/* Tables */
.table-container {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 2rem;
}

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

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.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 */
.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.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 */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

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

.chart {
  height: 300px;
}

/* Dashboard Recent */
.dashboard-recent {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 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: 2rem;
}

.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.5rem;
  margin-bottom: 2rem;
}

.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: #666;
}

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

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

.fondo-card.total {
  grid-column: 1 / -1;
  background-color: var(--secondary-color);
}

.fondo-card.total h3, .fondo-card.total .description {
  color: rgba(255, 255, 255, 0.8);
}

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

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

.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: 2rem;
}

.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 */
@media (max-width: 1200px) {
  .dashboard-summary {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .dashboard-charts, .dashboard-recent {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 240px;
  }
  
  .main-content {
    margin-left: 240px;
  }
  
  .dashboard-summary {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .anuncios-container {
    grid-template-columns: 1fr;
  }
  
  .fondos-summary {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .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 {
    margin-left: 0;
    padding: 4rem 1rem 1rem;
    width: 100%;
  }
  
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .main-header h1 {
    font-size: 1.5rem;
  }
  
  .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;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .section-header .btn, .section-header .button-group {
    width: 100%;
  }
  
  .button-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .dashboard-summary {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .summary-card {
    padding: 1rem;
  }
  
  .summary-card .amount {
    font-size: 1.5rem;
  }
  
  .anuncios-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .fondos-summary {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .parcialidades-info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Table responsive */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table {
    min-width: 600px;
  }
  
  .data-table th, .data-table td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
  
  /* Modal responsive */
  .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-group input, .form-group select, .form-group textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

@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;
    font-size: 0.8rem;
  }
  
  .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;
  }
}