/* Estilos generales */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f9fafb;
  color: #333;
}

.container {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #007BFF;
}

/* Filtros */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.filters label {
  flex: 1 1 100%;
  font-weight: bold;
}

.filters select, .filters button {
  flex: 1 1 45%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.filters button {
  background: #007BFF;
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.filters button:hover {
  background: #0056b3;
}

/* Tabla */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto; /* 🔹 autoajuste de columnas */
}

table th, table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
  white-space: nowrap;       /* 🔹 texto en una sola línea */
  overflow: hidden;          /* 🔹 oculta exceso de texto */
  text-overflow: ellipsis;   /* 🔹 muestra "..." si el texto es muy largo */
}

table th {
  background: #007BFF;
  color: white;
  font-size: 0.95rem;
}

/* Colores según estado */
tr.disponible {
  background-color: #d4edda; /* verde suave */
  color: #155724;
}

tr.nodisponible {
  background-color: #f8d7da; /* rojo suave */
  color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.4rem;
  }

  .filters {
    flex-direction: column;
  }

  .filters select, .filters button {
    flex: 1 1 100%;
  }

  table th, table td {
    font-size: 0.85rem;
    padding: 6px;
  }
}

/* Vista normal: tabla */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

table th, table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table th {
  background: #007BFF;
  color: white;
}

/* Estados */
tr.disponible {
  background-color: #d4edda;
  color: #155724;
}

tr.nodisponible {
  background-color: #f8d7da;
  color: #721c24;
}

/* 🔹 Vista móvil: convertir filas en cards rectangulares */
@media (max-width: 768px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none; /* ocultar encabezados */
  }

  tr {
    display: flex;
    flex-direction: column; /* cada fila se convierte en card rectangular */
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    background: #fff;
  }

  td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border: none;
    font-size: 0.9rem;
  }

  td::before {
    content: attr(data-label); /* etiqueta de la columna */
    font-weight: bold;
    color: #007BFF;
    margin-right: 8px;
  }
}

.filters select, .filters option { text-transform: uppercase; }

.col-solar {
  font-weight: bold;
}
