:root {
  --ink: #17212b;
  --muted: #617080;
  --line: #d9e0e7;
  --panel: #ffffff;
  --soft: #f3f7f9;
  --brand: #0b6b5f;
  --brand-dark: #084d46;
  --accent: #b33b2e;
  --warning: #8a6100;
  --ok: #1f7a4d;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(19, 34, 45, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f8fafb;
  line-height: 1.55;
}
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}
.brand small { display: block; color: var(--muted); font-size: 0.78rem; }
.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}
.site-nav a, .link-button {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(18px, 4vw, 48px);
  color: var(--muted);
  background: #fff;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 28px;
  align-items: center;
  min-height: 430px;
  padding: clamp(34px, 6vw, 72px) 0;
}
.eyebrow {
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 14px; }
h1 { font-size: clamp(2rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
.lead { font-size: 1.22rem; color: #334250; max-width: 760px; }
.actions, .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.button-secondary {
  background: #fff;
  color: var(--brand-dark);
}
.danger {
  background: var(--accent);
  border-color: var(--accent);
}
.review-card, .panel, .sidebar-panel, .stat-card, .listing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.review-card { padding: 24px; }
.review-card ol { margin: 12px 0 0; padding-left: 20px; }
.section {
  margin: 28px 0;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.section.narrow { max-width: 880px; margin-left: auto; margin-right: auto; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.notice {
  margin: 28px 0;
  padding: 22px;
  border: 1px solid #e1c66d;
  border-left: 6px solid #c89a1d;
  border-radius: 6px;
  background: #fff8df;
}
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.listing-card { padding: 18px; }
.listing-card h2, .listing-card h3 { font-size: 1.15rem; }
.listing-card-top, .detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.badge, .status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 760;
  background: var(--soft);
  color: var(--ink);
}
.status-pendiente { background: #fff3cd; color: var(--warning); }
.status-aprobado { background: #dff3e8; color: var(--ok); }
.status-rechazado, .status-eliminado { background: #f7d9d6; color: var(--accent); }
.status-oculto { background: #e7edf3; color: #4c5b69; }

form label {
  display: grid;
  gap: 6px;
  font-weight: 680;
}
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c5ced8;
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; }
fieldset {
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}
legend {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.stack-form { display: grid; gap: 18px; }
.form-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}
.span-2 { grid-column: 1 / -1; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 9px 14px;
}
.checkbox-grid label, .acceptance {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 560;
}
.checkbox-grid input, .acceptance input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
}
.help { color: var(--muted); margin: 0; }
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}
.filters fieldset {
  display: grid;
  gap: 8px;
}
.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}
.alert-success { border-color: #b7e2c8; background: #edf9f2; color: #155a38; }
.alert-error { border-color: #f0b8b2; background: #fff0ee; color: #7a241b; }
.empty {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}
.sidebar-panel { padding: 20px; align-self: start; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.facts div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}
.facts dt { color: var(--muted); font-size: 0.88rem; }
.facts dd { margin: 4px 0 0; font-weight: 760; }
.tag-list, .plain-list, .checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}
.tag-list li, .checklist li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}
.plain-list { display: grid; }
.admin-actions { display: grid; gap: 18px; }
.admin-actions form {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.stat-card { padding: 18px; }
.stat-card span { color: var(--muted); display: block; }
.stat-card strong { font-size: 2rem; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th, td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
th { color: var(--muted); font-size: 0.86rem; }
.inline-form { display: inline; }
.two-column {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
}
.panel { padding: 20px; }
.user-list { display: grid; gap: 16px; }
.user-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

@media (max-width: 820px) {
  .site-header, .section-heading, .detail-layout, .home-hero, .two-column {
    grid-template-columns: 1fr;
  }
  .site-header { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 2.2rem; }
  .form-section, .user-row { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .detail-layout { display: block; }
  .sidebar-panel { margin-top: 18px; }
}

/* Programa Vivienda visual refresh */
:root {
  --ink: #102018;
  --muted: #5f7167;
  --line: #d9e5dc;
  --soft: #f4f8f1;
  --brand: #007236;
  --brand-dark: #00542b;
  --brand-deep: #003f25;
  --lime: #8cc63f;
  --lime-soft: #eff8e6;
  --shadow: 0 10px 30px rgba(0, 63, 37, 0.08);
}

body { background: #f7faf5; }

.site-header {
  padding: 10px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.97);
}

.brand {
  gap: 14px;
}

.brand-logo {
  width: 86px;
  height: 54px;
  object-fit: contain;
}

.brand strong {
  color: var(--brand-deep);
  font-size: 1.02rem;
}

.site-nav {
  gap: 8px;
}

.site-nav a,
.link-button {
  color: var(--brand-deep);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 12px;
}

.site-nav a:hover,
.link-button:hover {
  background: var(--lime-soft);
  border-color: #d5e8c2;
}

.site-nav .nav-cta {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.site-nav .nav-cta:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-footer img {
  width: 92px;
  height: 56px;
  object-fit: contain;
}

.site-footer p { margin: 0 0 4px; }

.home-hero {
  padding: clamp(34px, 6vw, 68px) 0;
}

.eyebrow { color: var(--brand); }

.notice {
  border: 1px solid #cfe5b8;
  border-left: 6px solid var(--lime);
  background: #fbfff4;
}

.brand-card {
  display: grid;
  gap: 14px;
}

.brand-card img {
  width: min(260px, 100%);
  justify-self: center;
}

.listing-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.listing-card {
  padding: 0;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 63, 37, 0.13);
}

.listing-card h2,
.listing-card h3 {
  font-size: 1.15rem;
}

.listing-card h2 {
  margin-top: 12px;
}

.listing-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.listing-card h2 a:hover { color: var(--brand); }

.listing-card-body { padding: 16px; }

.listing-media {
  display: block;
  background: linear-gradient(135deg, var(--lime-soft), #fff);
  text-decoration: none;
}

.listing-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.listing-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 22px;
}

.listing-placeholder img {
  width: min(230px, 80%);
  height: auto;
  object-fit: contain;
}

.listing-location,
.listing-specs {
  margin: 6px 0 0;
  color: var(--muted);
}

.badge,
.status {
  background: var(--lime-soft);
  color: var(--brand-deep);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--brand);
}

.filters-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.compact-row {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-top: 14px;
}

.filters-panel label {
  font-size: 0.92rem;
  color: var(--brand-deep);
}

.filter-row > label,
.filters-panel input,
.filters-panel select {
  min-width: 0;
}

.advanced-filters {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced-filters summary {
  width: fit-content;
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
}

.filters-panel .filter-group {
  display: block;
  margin-top: 14px;
}

.filter-group legend {
  margin-bottom: 8px;
  font-size: 0.96rem;
  color: var(--ink);
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #cfe0d1;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 650;
}

.filter-chip:has(input:checked) {
  border-color: var(--brand);
  background: var(--lime-soft);
  color: var(--brand-deep);
}

.filter-chip input {
  flex: 0 0 18px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

@media (max-width: 1020px) {
  .filter-row,
  .compact-row {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 24px, 1180px);
  }
  .section {
    padding: 18px;
  }
  h1 {
    font-size: 1.95rem;
    overflow-wrap: anywhere;
  }
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }
  .section-heading .button {
    width: fit-content;
  }
  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
    overflow: hidden;
  }
  .site-nav a,
  .link-button {
    justify-content: center;
    text-align: center;
    padding: 8px 8px;
  }
  .brand-logo { width: 72px; height: 46px; }
  .site-footer { align-items: flex-start; }
  .filter-row,
  .compact-row {
    grid-template-columns: 1fr !important;
    min-width: 0;
  }
  .filters-panel {
    overflow: hidden;
    padding: 14px;
  }
  .filters-panel input,
  .filters-panel select {
    max-width: calc(100vw - 92px);
  }
  .filter-actions {
    justify-content: flex-start;
  }
}
