* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  color: #222;
}
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #1f2d3d;
  color: white;
}
.navbar .brand { color: white; font-weight: bold; text-decoration: none; font-size: 1.2rem; }
.navbar nav a { color: white; margin-left: 1.5rem; text-decoration: none; }
.navbar nav a:hover { text-decoration: underline; }

.hero {
  padding: 4rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, #3a6073, #16222a);
  color: white;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.features {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  max-width: 280px;
}
.card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 1rem;
  display: block;
}

.form-section {
  max-width: 400px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.form-section form { display: flex; flex-direction: column; gap: 0.5rem; }
.form-section label { font-weight: bold; margin-top: 0.5rem; }
.form-section input, .form-section select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.form-section button {
  margin-top: 1rem;
  padding: 0.6rem;
  border: none;
  border-radius: 4px;
  background-color: #1f2d3d;
  color: white;
  cursor: pointer;
}

.form-section.wide { max-width: 900px; }
.form-section.extra-wide { max-width: 1400px; }

.users-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.users-table th, .users-table td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #eee; }
.row-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.row-actions form { flex-direction: row; gap: 0.4rem; align-items: center; margin: 0; }
.row-actions button { margin-top: 0; padding: 0.4rem 0.7rem; }

.buscador { flex-direction: row; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.buscador input[type="search"] { flex: 1; min-width: 0; }
.buscador button { margin-top: 0; white-space: nowrap; }

.resultado-resumen { color: #5b6f7d; margin-bottom: 1rem; }

/* Contenedor con scroll propio: es lo que permite congelar la cabecera. */
.tabla-scroll {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid #e3eaef;
  border-radius: 6px;
}
.estadias-table { font-size: 0.9rem; }
.estadias-table th, .estadias-table td { white-space: nowrap; vertical-align: top; }
.estadias-table .observaciones {
  white-space: normal;
  min-width: 220px;
  max-width: 380px;
  color: #5b6f7d;
}
.dato-extra { color: #5b6f7d; font-size: 0.85em; }

/* Filtrado por clic en las celdas */
.pista-filtros { color: #5b6f7d; font-size: 0.9rem; margin: -0.5rem 0 1rem; }

/* Cabecera congelada mientras se recorre la tabla, como al fijar paneles. */
.estadias-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: #f7fafc;
  box-shadow: inset 0 -1px 0 #c8d5de;
  border-bottom: none;
}

.estadias-table tbody td { cursor: pointer; }
.estadias-table tbody td:hover {
  background-color: #eef3f6;
  box-shadow: inset 0 0 0 1px #c8d5de;
}
.estadias-table tbody td.celda-filtrada {
  background-color: #dce7ee;
  font-weight: bold;
}

.filtros-activos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.filtros-rotulo { color: #5b6f7d; font-size: 0.9rem; }

.filtro-etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 320px;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c8d5de;
  border-radius: 999px;
  background: #eef3f6;
  color: #1f2d3d;
  font-size: 0.85rem;
  cursor: pointer;
}
.filtro-etiqueta:hover { background: #dce7ee; }
.filtro-columna { color: #5b6f7d; }
.filtro-valor {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filtro-quitar { color: #8fa9bb; font-weight: bold; }
.filtro-etiqueta:hover .filtro-quitar { color: #a33; }

.limpiar-filtros {
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid #c8d5de;
  border-radius: 999px;
  background: white;
  color: #1f2d3d;
  cursor: pointer;
}
.limpiar-filtros:hover { background: #eef3f6; }

.flash-container { max-width: 600px; margin: 1rem auto; }
.flash { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 0.5rem; }
.flash-error { background-color: #fdecea; color: #a33; }
.flash-success { background-color: #eafaf0; color: #2a7a4a; }

/* Pie de página: identifica en qué nube corre esta copia del sitio.
   El color del borde superior es lo que distingue las dos versiones. */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }

.site-footer {
  margin-top: 3rem;
  padding: 1.25rem 2rem;
  background-color: #1f2d3d;
  color: #cfd8e0;
  text-align: center;
  font-size: 0.9rem;
  border-top: 4px solid #4285f4;
}
.site-footer .nube { color: white; font-weight: bold; }
.site-footer .detalle {
  display: block;
  margin-top: 0.25rem;
  color: #93a4b3;
  font-size: 0.85rem;
}
