* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

.navbar {
  background: #1a237e;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-title {
  text-align: center;
  margin-bottom: 2rem;
  color: #1a237e;
  font-size: 2rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #1a237e;
  background: white;
  color: #1a237e;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

.tab-btn:hover {
  background: #e8eaf6;
}

.tab-btn.active {
  background: #1a237e;
  color: white;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}

.card h2 {
  color: #1a237e;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e8eaf6;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1a237e;
}

.form-group input[readonly] {
  background: #f5f5f5;
  color: #777;
}

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.btn-primary {
  background: #1a237e;
  color: white;
}

.btn-primary:hover {
  background: #283593;
}

.btn-danger {
  background: #d32f2f;
  color: white;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: #b71c1c;
}

.message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  display: none;
}

.message.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.message.error {
  display: block;
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.search-box {
  margin-bottom: 1rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
}

.search-box input:focus {
  outline: none;
  border-color: #1a237e;
}

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

th, td {
  padding: 0.85rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

th {
  background: #f5f5f5;
  font-weight: 600;
  color: #555;
}

tr:hover {
  background: #f5f5f5;
}

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

.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filters select {
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 150px;
}

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

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.stat-icon {
  font-size: 2.5rem;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8eaf6;
  border-radius: 12px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: #1a237e;
}

.stat-label {
  color: #777;
  font-size: 0.9rem;
}

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

.chart-container {
  margin-bottom: 1.5rem;
}

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

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

.mes-actual-info {
  display: flex;
  gap: 3rem;
  justify-content: center;
  padding: 1rem;
}

.mes-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mes-label {
  color: #777;
  font-size: 0.9rem;
}

.mes-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1a237e;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.bar-label {
  min-width: 100px;
  font-size: 0.85rem;
  color: #555;
}

.bar-wrapper {
  flex: 1;
  background: #e8eaf6;
  border-radius: 6px;
  height: 30px;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: linear-gradient(135deg, #1a237e, #3949ab);
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: fit-content;
  transition: width 0.5s ease;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }

  .container {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mes-actual-info {
    flex-direction: column;
    gap: 1rem;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.5rem;
  }

  .filters {
    flex-direction: column;
  }
}
