body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f8f8f8;
}

header {
  background: #004aad;
  color: white;
  padding: 10px;
  text-align: center;
}

nav button {
  margin: 5px;
  padding: 10px 15px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

nav button:hover {
  background: #0056b3;
}

/* Botón nav activo: resalta la sección mostrada */
nav button.activo {
  background: #0056b3; /* un tono más oscuro del azul base */
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

main {
  padding: 20px;
}

.contenedor-informes {
  display: flex;
}

aside {
  width: 30%;
  background: white;
  padding: 15px;
  border-right: 1px solid #ddd;
}

section {
  flex-grow: 1;
  padding: 15px;
}

.lista-personas {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lista-personas li {
    padding: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 5px;
    background: #f4f4f4;
    transition: background 0.3s;
}

.lista-personas li:hover {
    background: #e0e0e0;
}

.lista-personas li.activo {
    background: #007bff;
    color: white;
    font-weight: bold;
}

.tarjeta-persona {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Utilidad: ocultar elementos por defecto */
.hidden { display: none !important; }

/* Card header */
.tarjeta-persona .card-header,
.tarjeta-persona h3 {
  border-bottom: 1px solid #e6eefc;
  padding-bottom: 10px;
  margin-bottom: 12px;
  color: #003366;
}

/* Read-only view rows */
.tarjeta-persona .view-row {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  align-items: center;
}
.tarjeta-persona .view-row .label {
  min-width: 140px;
  color: #555;
  font-weight: 700;
}

/* Grid layout for form fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  align-items: start;
}
.form-grid .field {
  display: flex;
  flex-direction: column;
}
.form-grid .field label { margin-bottom: 6px; font-weight:600; color:#333; }

/* Full-width actions row */
.actions.action-full { grid-column: 1 / -1; display:flex; justify-content:flex-end; gap:8px; }

/* Button variants */
.btn-primary { background:#007bff; color:#fff; padding:8px 12px; border-radius:6px; border:none; font-weight:700; }
.btn-primary:hover { background:#0056b3; }
.btn-secondary { background:#f0f0f0; color:#222; padding:8px 12px; border-radius:6px; border:none; font-weight:700; }
.btn-secondary:hover { background:#e0e0e0; }

/* Opciones (radios/checkboxes) dentro del formulario */
.options-group { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.options-group .option { display:flex; align-items:center; gap:6px; background:#f7f9fc; padding:6px 8px; border-radius:6px; border:1px solid #e6eefc; cursor:pointer; }
.options-group input[type="radio"], .options-group input[type="checkbox"] { transform:scale(1.05); }
.options-group .option:hover { background:#eef6ff; }

.mensaje { margin-top:8px; font-size:0.95rem; }

/* Make grid single column on small screens */
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .tarjeta-persona .view-row .label { min-width: 110px; }
}

/* Estilos para el formulario de edición dentro de la tarjeta de persona
   - botones y campos coherentes con el tema general
*/
.tarjeta-persona h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #003366;
}

.tarjeta-persona form {
  display: block;
}

.tarjeta-persona label {
  display: block;
  font-weight: 600;
  margin-top: 8px;
  font-size: 0.95rem;
  color: #333;
}

.tarjeta-persona input[type="text"],
.tarjeta-persona input[type="date"],
.tarjeta-persona input[type="email"],
.tarjeta-persona select,
.tarjeta-persona textarea {
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tarjeta-persona input[type="text"]:focus,
.tarjeta-persona input[type="date"]:focus,
.tarjeta-persona textarea:focus,
.tarjeta-persona select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.08);
}

.tarjeta-persona .actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.tarjeta-persona button {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.tarjeta-persona button#btn-guardar {
  background: #007bff;
  color: #fff;
}

.tarjeta-persona button#btn-guardar:hover {
  background: #0056b3;
}

.tarjeta-persona button#btn-cancelar,
.tarjeta-persona button#btn-editar {
  background: #f0f0f0;
  color: #222;
}

.tarjeta-persona button#btn-cancelar:hover,
.tarjeta-persona button#btn-editar:hover {
  background: #e0e0e0;
}

.tarjeta-persona #mensaje {
  margin-top: 8px;
  font-size: 0.95rem;
}

/* Pequeña responsividad para móviles */
@media (max-width: 700px) {
  .contenedor-informes {
    flex-direction: column;
  }

  aside { width: 100%; }
  section { width: 100%; }
}

.lista-personas {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lista-personas li {
    padding: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 5px;
    background: #f4f4f4;
    transition: background 0.2s;
}

.lista-personas li:hover {
    background: #e0e0e0;
}

.lista-personas li.activo {
    background: #007bff;
    color: white;
    font-weight: bold;
}

.tarjeta-persona {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Estilos para filtros y búsqueda */
.filtros-container {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.barra-busqueda {
    margin-bottom: 10px;
}

.input-busqueda {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.input-busqueda:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.filtros-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filtro-grupo {
    flex: 1;
}

.select-filtro {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.select-filtro:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.filtro-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filtro-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.filtro-btn.activo {
    background: #28a745;
    color: white;
    border-color: #28a745;
    font-weight: 600;
}

/* Etiqueta de filtro activo */
.etiqueta-filtro {
    margin-top: 8px;
    padding: 6px 12px;
    background: #e7f3ff;
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: 13px;
    color: #0066cc;
    font-weight: 500;
}

.etiqueta-filtro .limpiar-filtro {
    color: #dc3545;
    margin-left: 8px;
    cursor: pointer;
    text-decoration: underline;
    font-weight: normal;
}

.etiqueta-filtro .limpiar-filtro:hover {
    color: #c82333;
}

/* Responsive */
@media (max-width: 700px) {
    .filtros-row {
        flex-direction: column;
    }
    
    .filtro-grupo {
        width: 100%;
    }
    
    .filtro-btn {
        width: 100%;
    }
}

/* ===== ESTILOS PARA FILTROS Y BÚSQUEDA ===== */
.filtros-container {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.barra-busqueda {
    margin-bottom: 10px;
}

.input-busqueda {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.input-busqueda:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.filtros-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filtro-grupo {
    flex: 1;
}

.select-filtro {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.select-filtro:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.filtro-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filtro-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.filtro-btn.activo {
    background: #28a745;
    color: white;
    border-color: #28a745;
    font-weight: 600;
}

/* Etiqueta de filtro activo */
.etiqueta-filtro {
    margin-top: 8px;
    padding: 6px 12px;
    background: #e7f3ff;
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: 13px;
    color: #0066cc;
    font-weight: 500;
}

.etiqueta-filtro .limpiar-filtro {
    color: #dc3545;
    margin-left: 8px;
    cursor: pointer;
    text-decoration: underline;
    font-weight: normal;
}

.etiqueta-filtro .limpiar-filtro:hover {
    color: #c82333;
}

/* Mensaje sin resultados */
.sin-resultados {
    color: #6c757d !important;
    font-style: italic !important;
    text-align: center !important;
    padding: 20px !important;
    margin: 0 !important;
}

/* Responsive */
@media (max-width: 700px) {
    .filtros-row {
        flex-direction: column;
    }
    
    .filtro-grupo {
        width: 100%;
    }
    
    .filtro-btn {
        width: 100%;
    }
}

/* ===== ESTILOS BASE ===== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f8f8f8;
}

header {
  background: #004aad;
  color: white;
  padding: 10px;
  text-align: center;
}

nav button {
  margin: 5px;
  padding: 10px 15px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

nav button:hover {
  background: #0056b3;
}

nav button.activo {
  background: #0056b3;
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

main {
  padding: 20px;
}

.contenedor-informes {
  display: flex;
  gap: 20px;
}

aside {
  width: 30%;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

section.formulario {
  flex: 1;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== LISTA DE PERSONAS ===== */
.lista-personas {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 600px;
  overflow-y: auto;
}

.lista-personas li {
  padding: 12px;
  margin-bottom: 5px;
  cursor: pointer;
  border-radius: 6px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.lista-personas li:hover {
  background: #e9ecef;
  border-color: #007bff;
}

.lista-personas li.activo {
  background: #007bff;
  color: white;
  font-weight: bold;
  border-color: #0056b3;
}

/* ===== FILTROS Y BÚSQUEDA ===== */
.filtros-container {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.barra-busqueda {
  margin-bottom: 12px;
}

.input-busqueda {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  background: white;
}

.input-busqueda:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.filtros-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filtro-grupo {
  flex: 1;
}

.select-filtro {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  font-family: Arial, sans-serif;
}

.select-filtro:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.filtro-btn {
  padding: 10px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  color: #333;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: Arial, sans-serif;
  font-weight: 600;
}

.filtro-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.filtro-btn.activo {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

/* Etiqueta de filtro activo */
.etiqueta-filtro {
  margin-top: 10px;
  padding: 8px 12px;
  background: #e7f3ff;
  border: 1px solid #007bff;
  border-radius: 6px;
  font-size: 14px;
  color: #0066cc;
  font-weight: 500;
}

.etiqueta-filtro .limpiar-filtro {
  color: #dc3545;
  margin-left: 8px;
  cursor: pointer;
  text-decoration: underline;
  font-weight: normal;
}

.etiqueta-filtro .limpiar-filtro:hover {
  color: #c82333;
}

/* Mensaje sin resultados */
.sin-resultados {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
  margin: 0;
  background: #f8f9fa;
  border-radius: 6px;
}

/* ===== FORMULARIO PERSONA ===== */
.tarjeta-persona {
  background: white;
  padding: 0;
}

.tarjeta-persona h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #003366;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
}

.view-read {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.view-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  align-items: center;
  border-bottom: 1px solid #dee2e6;
}

.view-row:last-child {
  border-bottom: none;
}

.view-row .label {
  min-width: 160px;
  color: #495057;
  font-weight: 600;
}

.form-grid {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.field label {
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}

.field input[type="text"],
.field input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.option {
  display: flex;
  align-items: center;
  gap: 5px;
  background: white;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #545b62;
}

.mensaje {
  margin-top: 15px;
  padding: 10px;
  border-radius: 6px;
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .contenedor-informes {
    flex-direction: column;
  }
  
  aside {
    width: 100%;
  }
  
  .filtros-row {
    flex-direction: column;
  }
  
  .filtro-grupo {
    width: 100%;
  }
  
  .filtro-btn {
    width: 100%;
  }
  
  .view-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .view-row .label {
    min-width: auto;
    margin-bottom: 5px;
  }
}