/* ===== Panel de propiedades ===== */
:root {
  --paper: #F4F6FA; --white: #fff; --ink: #0E1A2B; --ink-2: #4A5670; --line: #D9DFEA;
  --accent: #2346E8; --accent-dk: #1733B8; --soft: #E4E9FD; --ok: #0E8F68; --warn: #B7791F; --red: #C0352B;
}
* { box-sizing: border-box; }
body { margin: 0; font: 400 16px/1.5 "Instrument Sans", system-ui, sans-serif; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.modo { padding: 12px 16px; text-align: center; font-size: .95rem; }
.modo p { margin: 0; }
.modo--real { background: #E3F7EF; color: #0B5E45; display: flex; gap: 10px; align-items: center; justify-content: center; }
.modo--real .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.modo--prueba { background: #FFF4D6; color: #5C4400; border-bottom: 1px solid #F0D58A; display: grid; gap: 4px; }
.modo__acc { display: flex; gap: 6px 18px; justify-content: center; flex-wrap: wrap; }
.modo__acc button, .modo__acc a { background: none; border: 0; padding: 0; color: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

.head { background: var(--white); border-bottom: 1px solid var(--line); }
.head__in, .tabs, .wrap { max-width: 1100px; margin: 0 auto; padding-inline: 16px; }
.head__in { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 14px; }
.head__sub { margin: 0; color: var(--ink-2); font-size: .9rem; }
.head h1 { margin: 2px 0 0; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; }
.head__nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .92rem; color: var(--ink-2); }
.head__nav a { color: var(--accent); font-weight: 600; text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; }
.head__nav a:hover { border-color: var(--accent); }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; border: 0; padding: 12px 14px; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.wrap { padding-top: 22px; padding-bottom: 80px; }
.muted { color: var(--ink-2); font-size: .92rem; margin: 0 0 10px; }
.hint { color: var(--ink-2); font-weight: 400; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--accent-dk); }
.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--white); border-color: var(--ink); }
.btn--danger { background: var(--white); color: var(--red); border-color: #F1C9C5; }
.btn--danger:hover { background: #FDECEC; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: .92rem; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; cursor: pointer; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.stats div { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; }
.stats b { font-size: 1.5rem; line-height: 1.1; }
.stats span { color: var(--ink-2); font-size: .88rem; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1 1 260px; }
input, select, textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--white); }
.toolbar select { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

.lista { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.row__img { padding: 0; border: 0; background: var(--paper); border-radius: 10px; overflow: hidden; width: 112px; height: 80px; cursor: pointer; display: grid; place-items: center; }
.row__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nofoto { font-size: .8rem; color: var(--ink-2); }
.row__code { margin: 0; color: var(--ink-2); font-size: .82rem; }
.row h3 { margin: 2px 0; font-size: 1.05rem; }
.row h3 button { all: unset; cursor: pointer; }
.row h3 button:hover { text-decoration: underline; }
.row h3 button:focus-visible { outline: 3px solid var(--accent); border-radius: 4px; }
.row__meta { margin: 0; color: var(--ink-2); font-size: .9rem; }
.row__meta b { color: var(--ink); }
.row__acc { display: flex; gap: 8px; align-items: center; }
.star { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: #C5CBD6; font-size: 1.15rem; cursor: pointer; }
.star[aria-pressed="true"] { color: #E0A100; border-color: #F2D88A; background: #FFF8E1; }
.estado { width: auto; padding: 7px 10px; font-weight: 600; font-size: .9rem; border-radius: 999px; }
.estado--disponible { color: var(--ok); border-color: #B6E5D3; background: #F0FAF6; }
.estado--reservada { color: var(--warn); border-color: #F0D58A; background: #FFF8E6; }
.estado--vendida, .estado--alquilada { color: #3F3F46; background: #F1F1F3; }
.estado--pausada { color: var(--ink-2); background: var(--paper); border-style: dashed; }
.empty { text-align: center; background: var(--white); border: 1px dashed var(--line); border-radius: 14px; padding: 32px 16px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.card h2 { margin: 0 0 4px; font-size: 1.2rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.span2 { grid-column: span 2; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
label.full { margin-top: 14px; }
label.check { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-weight: 500; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.asesor { display: grid; grid-template-columns: repeat(4, 1fr) 40px; gap: 10px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.save-row { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.saved { color: var(--ok); font-weight: 600; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.x:disabled { opacity: .4; cursor: not-allowed; }

/* Editor */
.editor { width: min(860px, calc(100% - 20px)); max-height: calc(100% - 20px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(14, 26, 43, .5); }
.editor::backdrop { background: rgba(14, 26, 43, .55); }
.editor form { display: flex; flex-direction: column; max-height: calc(100vh - 20px); }
.editor__head, .editor__foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--white); }
.editor__head { border-bottom: 1px solid var(--line); justify-content: space-between; }
.editor__head h2 { margin: 0; font-size: 1.2rem; }
.editor__body { overflow: auto; padding: 8px 20px 20px; }
.editor__foot { border-top: 1px solid var(--line); flex-wrap: wrap; }
.grow { flex: 1; }
fieldset { border: 0; padding: 0; margin: 18px 0 0; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; padding: 0; }
.err { background: #FDECEC; color: var(--red); padding: 10px 14px; border-radius: 10px; font-weight: 500; margin: 16px 0 0; }

.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.foto { position: relative; margin: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--paper); }
.foto.is-cover { border-color: var(--accent); }
.foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.foto figcaption { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.foto__acc { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: flex-end; }
.foto__acc button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,.92); cursor: pointer; font-weight: 700; }
.foto__acc button:disabled { opacity: .35; cursor: default; }
.foto__acc [data-rm] { color: var(--red); }
.fotos-acc { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.upload { cursor: pointer; }
.upload:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); max-width: calc(100% - 24px); font-weight: 500; }
.toast.is-error { background: var(--red); }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:last-child { grid-column: span 2; }
  .row { grid-template-columns: 84px minmax(0, 1fr); }
  .row__img { width: 84px; height: 66px; }
  .row__acc { grid-column: 1 / -1; justify-content: flex-end; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .asesor { grid-template-columns: 1fr 1fr; }
  .asesor .x { justify-self: end; }
  .toolbar .btn { flex: 1 1 100%; }
}
