:root {
  font-family: Arial, sans-serif;
  color: #1f2937;
  background-color: #f4f4f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

header {
  background-color: #1d4ed8;
  color: white;
  padding: 24px 16px;
  text-align: center;
}

header p {
  margin: 8px auto 0;
  max-width: 860px;
  color: #dbeafe;
}

main {
  max-width: 1140px;
  margin: 24px auto;
  padding: 0 16px 32px;
}

.legend {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.legend h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.legend-items {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

.legend-color.disponible {
  background-color: #d1fae5;
  border-color: #10b981;
}

.legend-color.vendido {
  background-color: #fee2e2;
  border-color: #ef4444;
}

.legend-color.apartado {
  background-color: #fef9c3;
  border-color: #f59e0b;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #f4f4f9;
  padding: 12px 0;
  z-index: 100;
  border-bottom: 1px solid #e5e7eb;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-button {
  background-color: #059669;
  border: none;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.action-button:hover {
  background-color: #047857;
}

button {
  background-color: #2563eb;
  border: none;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #1d4ed8;
}

.selection-summary {
  font-size: 1rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 16px;
}

.selection-summary a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  transition: all 0.2s ease;
}

.selection-summary a:hover {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.block-card {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.block-header {
  background-color: #e2e8f0;
  padding: 14px 16px;
  border-bottom: 1px solid #cbd5e1;
}

.block-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.block-header span {
  display: block;
  margin-top: 6px;
  color: #475569;
  font-size: 0.92rem;
}

.lots-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.lot {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lot:hover {
  border-color: #60a5fa;
  background-color: #eff6ff;
}

.lot.selected {
  background-color: #2563eb;
  border-color: #1d4ed8;
  color: white;
}

.lot.disponible {
  background-color: #d1fae5;
  border-color: #10b981;
}

.lot.vendido {
  background-color: #fee2e2;
  border-color: #ef4444;
  cursor: not-allowed;
}

.lot.apartado {
  background-color: #fef9c3;
  border-color: #f59e0b;
  cursor: not-allowed;
}

.lot.user-selected {
  background-color: #065f46;
  border-color: #064e3b;
  color: white;
}

.lot strong {
  font-size: 0.5rem;
  margin-bottom: 2px;
}

.lot small {
  font-size: 0.4rem;
  color: #475569;
}

.lot.selected small,
.lot.disponible small,
.lot.vendido small,
.lot.apartado small,
.lot.user-selected small {
  color: #dbeafe;
}

.selection-list {
  margin-top: 24px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 18px;
}

.selection-list h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.selection-list p {
  margin: 0;
  color: #334155;
}
.lot.apartado small {
  color: #1f2937;
}

.selection-list {
  margin-top: 24px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 18px;
}

.selection-list h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.selection-list p {
  margin: 0;
  color: #334155;
}
