:root {
  --ink: #18201d;
  --muted: #667169;
  --paper: #f7f3ec;
  --white: #fffaf3;
  --clay: #9d7258;
  --olive: #526655;
  --sea: #244f5a;
  --line: rgba(24, 32, 29, 0.14);
  --green-soft: #e3ece6;
  --amber-soft: #f0e2c5;
  --shadow: 0 24px 70px rgba(24, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f3f0ea;
  font-family: Inter, system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.subpage-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 236, 0.93);
  backdrop-filter: blur(18px);
}

.subpage-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.subpage-brand img {
  width: 118px;
}

.subpage-brand div {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.subpage-brand span,
.subpage-brand strong {
  display: block;
}

.subpage-brand span {
  color: var(--clay);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.subpage-brand strong {
  margin-top: 2px;
  font-size: 11px;
}

.subpage-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.button,
.button-quiet {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--white);
  background: var(--ink);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.button-quiet {
  border-color: var(--line);
  color: var(--ink);
  background: var(--white);
}

.detail-shell,
.document-shell,
.admin-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 70px;
}

.detail-breadcrumbs,
.document-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 9px;
}

.detail-hero {
  display: grid;
  overflow: hidden;
  min-height: 470px;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.6fr);
  border-radius: 18px;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.detail-hero-media {
  position: relative;
  min-height: 470px;
}

.detail-hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 55%, rgba(11, 20, 17, 0.56));
}

.detail-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-reference {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 18px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: white;
  background: rgba(15, 25, 22, 0.4);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.detail-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 58px);
  color: var(--white);
}

.eyebrow {
  color: #efd6aa;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-hero h1,
.detail-section h2,
.document-paper h1,
.admin-heading h1 {
  font-family: "Playfair Display", Georgia, serif;
}

.detail-hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
}

.detail-location {
  margin: 0 0 30px;
  color: rgba(255, 250, 243, 0.68);
  font-size: 10px;
}

.detail-price {
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.detail-price span,
.detail-price strong {
  display: block;
}

.detail-price span {
  color: rgba(255, 250, 243, 0.56);
  font-size: 8px;
  text-transform: uppercase;
}

.detail-price strong {
  margin-top: 5px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 30px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 26px;
}

.detail-metrics span {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-size: 10px;
  font-weight: 600;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.detail-section,
.detail-side-card,
.document-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.detail-section {
  padding: clamp(24px, 4vw, 42px);
}

.detail-section + .detail-section {
  margin-top: 16px;
}

.detail-section h2 {
  margin: 8px 0 16px;
  font-size: 30px;
}

.detail-section p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 24px;
}

.detail-kpis div {
  padding: 16px;
  border-radius: 9px;
  background: #f3efe8;
}

.detail-kpis span,
.detail-kpis strong {
  display: block;
}

.detail-kpis span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.detail-kpis strong {
  margin-top: 6px;
  font-size: 13px;
}

.detail-side {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 12px;
}

.detail-side-card {
  padding: 21px;
}

.detail-side-card h3 {
  margin: 8px 0 7px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
}

.detail-side-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.nda-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8b6426;
  font-size: 9px;
}

.nda-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: #c38a36;
}

.nda-state.is-complete {
  color: #2f7058;
}

.nda-state.is-complete::before {
  background: #43836a;
}

.progress-track {
  height: 7px;
  margin: 12px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2ded6;
}

.progress-track::before {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  content: "";
  background: var(--olive);
}

.private-panel {
  position: relative;
  overflow: hidden;
}

.private-panel:not(.is-unlocked) .private-sensitive {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.private-panel:not(.is-unlocked)::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  content: "Contenido protegido · firma la NDA para desbloquearlo";
  color: var(--ink);
  background: rgba(255, 250, 243, 0.86);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(3px);
}

.data-room-list {
  display: grid;
  gap: 8px;
}

.data-room-list a,
.data-room-list span {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 9px;
}

.document-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.login-layout {
  display: grid;
  min-height: 620px;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: clamp(40px, 8vw, 110px);
  align-items: center;
}
.login-intro h1 { max-width: 700px; margin: 14px 0; font-family: "Playfair Display", Georgia, serif; font-size: clamp(44px, 7vw, 78px); line-height: .98; }
.login-intro p { max-width: 620px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.login-intro .legal-note { max-width: 540px; margin-top: 24px; }
.login-status { min-height: 36px; margin: 14px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.login-card-title { margin: 7px 0 5px; font-family: "Playfair Display", Georgia, serif; font-size: 28px; }
.login-card-copy { margin: 0 0 18px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.signature-form button:disabled { opacity: .45; cursor: not-allowed; }

.document-paper {
  padding: clamp(30px, 6vw, 72px);
  border: 1px solid var(--line);
  background: #fffdf8;
  box-shadow: 0 18px 50px rgba(24, 32, 29, 0.08);
}

.document-paper h1 {
  max-width: 760px;
  margin: 20px 0 14px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.06;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.document-body {
  counter-reset: clause;
  margin-top: 34px;
}

.document-clause {
  position: relative;
  padding-left: 40px;
}

.document-clause + .document-clause {
  margin-top: 28px;
}

.document-clause::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--clay);
  content: counter(clause, decimal-leading-zero);
  counter-increment: clause;
  font-size: 10px;
  font-weight: 700;
}

.document-clause h2 {
  margin: 0 0 8px;
  font-size: 13px;
}

.document-clause p {
  margin: 0;
  color: #515b55;
  font-family: Georgia, serif;
  font-size: 12px;
  line-height: 1.8;
}

.document-aside {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 12px;
}

.document-card {
  padding: 21px;
}

.document-card h2 {
  margin: 7px 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 23px;
}

.document-card p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.signature-form {
  display: grid;
  gap: 12px;
}

.signature-form label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.signature-form input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdfa;
}

.signature-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.signature-success {
  padding: 20px;
  border: 1px solid #c8ddd0;
  border-radius: 10px;
  background: #e7f0e9;
}

.signature-success h3 {
  margin: 0 0 6px;
  color: #2f7058;
  font-size: 14px;
}

.signature-success p {
  margin: 0 0 14px;
}

.legal-note {
  padding: 14px;
  border-radius: 8px;
  color: #765f39;
  background: #f3ead8;
  font-size: 8px;
  line-height: 1.6;
}

.admin-shell {
  width: min(1440px, calc(100% - 40px));
}

.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 22px;
}

.admin-heading h1 {
  margin: 8px 0 0;
  font-size: 42px;
}

.admin-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.admin-metrics article {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.admin-metrics span,
.admin-metrics strong,
.admin-metrics small {
  display: block;
}

.admin-metrics span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.admin-metrics strong {
  margin: 5px 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 26px;
}

.admin-metrics small {
  color: #3b7560;
  font-size: 8px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.admin-card {
  padding: 22px;
}

.admin-card.full {
  grid-column: 1 / -1;
}

.admin-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.admin-card h2 {
  margin: 6px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 25px;
}

.admin-status {
  padding: 5px 8px;
  border-radius: 999px;
  color: #2f7058;
  background: var(--green-soft);
  font-size: 8px;
  font-weight: 700;
}

.admin-document {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f9f6f0;
}

.admin-document strong,
.admin-document span,
.admin-document small {
  display: block;
}

.admin-document span,
.admin-document small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.upload-label {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.upload-label input {
  display: none;
}

.admin-assignments {
  display: grid;
  gap: 8px;
}

.admin-assignment {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

.admin-assignment span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-assignment i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay);
}

.admin-assignment b {
  color: var(--muted);
  font-weight: 500;
}

.assignment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 14px;
}

.assignment-form input {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdfa;
  font-size: 9px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.admin-table th,
.admin-table td {
  padding: 13px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.admin-table th {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.publish-toggle {
  min-width: 70px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  color: #765f39;
  background: var(--amber-soft);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.publish-toggle.is-on {
  color: #2f7058;
  background: var(--green-soft);
}

@media (max-width: 900px) {
  .detail-hero,
  .detail-layout,
  .document-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .login-layout { grid-template-columns: 1fr; min-height: auto; padding-top: 42px; }

  .detail-side,
  .document-aside {
    position: static;
  }

  .admin-card.full {
    grid-column: auto;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .subpage-brand div,
  .subpage-actions .button-quiet {
    display: none;
  }

  .subpage-brand img {
    width: 100px;
  }

  .detail-shell,
  .document-shell,
  .admin-shell {
    width: min(100% - 24px, 1280px);
    padding-top: 16px;
  }

  .detail-hero {
    min-height: auto;
  }

  .detail-hero-media {
    min-height: 300px;
  }

  .detail-metrics,
  .detail-kpis,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-heading {
    display: block;
  }

  .admin-heading p {
    margin-top: 10px;
  }

  .admin-document,
  .assignment-form {
    grid-template-columns: 1fr;
  }

  .admin-table {
    min-width: 680px;
  }

  .admin-card.full {
    overflow-x: auto;
  }
}
