/* =========================================================================
   INVENTORY + PROPERTY DETAIL
   ========================================================================= */

/* Grid view */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.prop-card { background: var(--bg-surface); border: 1px solid var(--border-1); border-radius: 4px; overflow: hidden; cursor: pointer; transition: border-color 120ms, box-shadow 120ms; display: flex; flex-direction: column; }
.prop-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.prop-photo { aspect-ratio: 16/10; background: linear-gradient(135deg, var(--neutral-700), var(--neutral-800)); position: relative; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.2); font-family: var(--font-display); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.prop-photo .ph-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 10px; justify-content: space-between; }
.prop-photo .ph-top { display: flex; justify-content: space-between; align-items: flex-start; }
.prop-photo .ph-bot { display: flex; justify-content: space-between; align-items: flex-end; }
.prop-photo .ph-price { background: var(--revin-red); color: #fff; padding: 4px 10px; font-family: var(--font-display); font-size: 14px; letter-spacing: .02em; }
.prop-photo .ph-count { background: rgba(0,0,0,.5); color: #fff; padding: 2px 8px; font-size: 10px; font-family: var(--font-mono); display: inline-flex; align-items: center; gap: 4px; }
.prop-photo .ph-count .icon { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }
.prop-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.prop-addr { font-size: 14px; font-weight: 600; color: var(--fg-1); line-height: 1.3; }
.prop-loc { font-size: 11px; color: var(--fg-2); display: flex; align-items: center; gap: 6px; }
.prop-loc .icon { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; }
.prop-specs { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-3); margin-top: auto; }
.prop-spec { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--fg-2); font-weight: 500; }
.prop-spec .icon { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }
.prop-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border-3); }
.prop-mgr { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg-2); }
.prop-mgr .ava { width: 18px; height: 18px; border-radius: 999px; background: var(--revin-black); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; }

/* Property detail */
.pd-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.pd-hero { background: var(--bg-surface); border: 1px solid var(--border-1); border-radius: 4px; overflow: hidden; }
.pd-photos { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2px; height: 320px; background: var(--neutral-800); }
.pd-photo { background: linear-gradient(135deg, var(--neutral-600), var(--neutral-800)); position: relative; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.15); font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.pd-photo.tall { grid-row: 1 / -1; }
.pd-photo .badge-more { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; padding: 4px 8px; font-size: 11px; font-family: var(--font-mono); border-radius: 2px; }
.pd-meta { padding: 20px 24px; }
.pd-meta-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.pd-addr-block { min-width: 0; }
.pd-addr { font-family: var(--font-display); font-size: 24px; line-height: 1.15; letter-spacing: .02em; text-transform: uppercase; color: var(--fg-1); margin: 0; }
.pd-loc { font-size: 13px; color: var(--fg-2); margin-top: 4px; }
.pd-id { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); margin-top: 6px; letter-spacing: .04em; }
.pd-prices { text-align: right; flex-shrink: 0; }
.pd-price-now { font-family: var(--font-display); font-size: 28px; letter-spacing: .02em; color: var(--fg-1); }
.pd-price-lbl { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .08em; }
.pd-price-tgt { font-size: 12px; color: var(--success); margin-top: 4px; font-weight: 600; }
.pd-kv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding-top: 16px; border-top: 1px solid var(--border-1); }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-lbl { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.kv-val { font-size: 14px; font-weight: 600; color: var(--fg-1); }

/* FLIP calculator */
.flip-calc { padding: 16px; }
.flip-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-3); align-items: center; }
.flip-row:last-of-type { border-bottom: 1px solid var(--border-1); margin-bottom: 12px; }
.flip-lbl { font-size: 12px; color: var(--fg-2); font-weight: 500; }
.flip-row.input-row .flip-lbl { color: var(--fg-1); font-weight: 600; }
.flip-val { font-family: var(--font-mono); font-size: 13px; color: var(--fg-1); text-align: right; font-weight: 600; }
.flip-input { font-family: var(--font-mono); font-size: 13px; padding: 6px 8px; background: var(--bg-inset); border: 1px solid var(--border-2); border-radius: 2px; color: var(--fg-1); outline: none; text-align: right; width: 100%; }
.flip-input:focus { border-color: var(--revin-red); box-shadow: 0 0 0 2px rgba(226,35,44,.2); }
.flip-summary { background: var(--revin-black); color: #fff; padding: 14px 16px; border-radius: 2px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.flip-summary .out-lbl { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--neutral-300); }
/* Sin `color` propio: hereda el #fff de .flip-summary. Así una clase .fin-*
   (0,1,0) puede pintarlo; con `color:#fff` aquí (0,2,0) nunca ganaría. */
.flip-summary .out-val { font-family: var(--font-display); font-size: 20px; letter-spacing: .02em; margin-top: 2px; }
.flip-summary .out-val.good { color: var(--red-200); }
.flip-summary .out-sub { font-size: 11px; color: var(--neutral-400); font-family: var(--font-mono); margin-top: 1px; }

/* Tasks list */
.task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border-3); }
.task:last-child { border-bottom: none; }
.task .chk { width: 16px; height: 16px; border: 1.5px solid var(--border-2); border-radius: 2px; margin-top: 1px; flex-shrink: 0; cursor: pointer; background: var(--bg-surface); position: relative; }
.task .chk.done { background: var(--revin-red); border-color: var(--revin-red); }
.task .chk.done::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13px; color: var(--fg-1); }
.task.done .task-title { color: var(--fg-3); text-decoration: line-through; }
.task-meta { display: flex; gap: 10px; margin-top: 3px; font-size: 11px; color: var(--fg-3); align-items: center; }
.task-meta .due { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .due .icon { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; }
.task-meta .due.urgent { color: var(--revin-red); font-weight: 600; }

/* Docs list */
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border-3); cursor: pointer; }
.doc:last-child { border-bottom: none; }
.doc:hover { background: var(--bg-inset); }
.doc .ico-doc { width: 28px; height: 36px; background: var(--bg-inset); border: 1px solid var(--border-1); border-radius: 2px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font-family: var(--font-mono); font-size: 8px; font-weight: 700; color: var(--fg-2); flex-shrink: 0; }
.doc .ico-doc.pdf { color: var(--revin-red); border-color: var(--red-200); }
.doc-meta { flex: 1; min-width: 0; }
.doc-name { font-family: var(--font-mono); font-size: 11px; color: var(--fg-1); text-transform: uppercase; letter-spacing: .02em; word-break: break-all; line-height: 1.3; }
.doc-sub { font-size: 11px; color: var(--fg-3); margin-top: 2px; display: flex; gap: 8px; }
.doc-actions { display: flex; gap: 4px; opacity: 0; }
.doc:hover .doc-actions { opacity: 1; }

/* Activity timeline */
.activity { display: flex; flex-direction: column; }
.act-item { display: flex; gap: 12px; padding: 12px 16px; position: relative; border-bottom: 1px solid var(--border-3); }
.act-item:last-child { border-bottom: none; }
.act-rail { width: 24px; display: flex; flex-direction: column; align-items: center; position: relative; }
.act-rail::after { content: ""; position: absolute; top: 14px; bottom: -12px; left: 50%; width: 1px; background: var(--border-1); }
.act-item:last-child .act-rail::after { display: none; }
.act-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--neutral-400); border: 1.5px solid var(--bg-surface); z-index: 1; margin-top: 5px; }
.act-dot.red { background: var(--revin-red); }
.act-dot.green { background: var(--success); }
.act-dot.info { background: var(--info); }
.act-body { flex: 1; min-width: 0; }
.act-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-1); }
.act-head .who { font-weight: 600; }
.act-head .time { color: var(--fg-3); margin-left: auto; font-size: 11px; font-family: var(--font-mono); }
.act-text { font-size: 12px; color: var(--fg-2); margin-top: 2px; line-height: 1.5; }
.act-text .ref { font-family: var(--font-mono); font-size: 11px; color: var(--fg-1); background: var(--bg-inset); padding: 1px 5px; border-radius: 2px; }

/* Publish status */
.pub-list { display: flex; flex-direction: column; }
.pub-row { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border-3); }
.pub-row:last-child { border-bottom: none; }
.pub-logo { width: 28px; height: 28px; border-radius: 4px; background: var(--bg-inset); border: 1px solid var(--border-1); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 11px; color: var(--fg-2); letter-spacing: .04em; flex-shrink: 0; }
.pub-logo.idealista { background: #C8DC22; color: #161A1D; border-color: #B6CA1A; }
.pub-logo.fotocasa { background: #5050FA; color: #fff; border-color: #4040EA; }
.pub-logo.web { background: var(--revin-black); color: var(--revin-red); }
.pub-name { font-size: 13px; font-weight: 600; color: var(--fg-1); }
.pub-sub { font-size: 11px; color: var(--fg-2); margin-top: 1px; }
.pub-stats { font-family: var(--font-mono); font-size: 11px; color: var(--fg-2); text-align: right; }
.pub-stats .big { font-size: 16px; color: var(--fg-1); font-weight: 700; }

/* Conditional intake form */
.intake-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.intake-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.intake-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.intake-grid .full { grid-column: 1 / -1; }
.stepper-num { display: flex; align-items: center; gap: 0; border: 1px solid var(--border-2); border-radius: 4px; overflow: hidden; background: var(--bg-surface); }
.stepper-num button { width: 28px; height: 32px; background: var(--bg-inset); border: none; color: var(--fg-1); font-size: 16px; font-weight: 600; cursor: pointer; }
.stepper-num button:hover { background: var(--bg-surface-2); }
.stepper-num input { border: none; border-left: 1px solid var(--border-1); border-right: 1px solid var(--border-1); width: 48px; text-align: center; font-family: var(--font-mono); font-size: 13px; font-weight: 600; background: var(--bg-surface); color: var(--fg-1); padding: 6px 0; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
.cbox { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-1); cursor: pointer; padding: 4px 0; }
.cbox input { appearance: none; width: 16px; height: 16px; border: 1.5px solid var(--border-2); border-radius: 2px; background: var(--bg-surface); cursor: pointer; position: relative; flex-shrink: 0; margin: 0; }
.cbox input:checked { background: var(--revin-red); border-color: var(--revin-red); }
.cbox input:checked::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 7px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg); }
.tag-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-opt { padding: 6px 12px; background: var(--bg-surface); border: 1px solid var(--border-2); border-radius: 4px; color: var(--fg-1); font-size: 12px; cursor: pointer; font-weight: 500; }
.tag-opt:hover { background: var(--bg-inset); }
.tag-opt.active { background: var(--revin-black); color: #fff; border-color: var(--revin-black); }
.dropzone { border: 1.5px dashed var(--border-2); border-radius: 4px; padding: 24px; text-align: center; color: var(--fg-3); font-size: 13px; background: var(--bg-inset); cursor: pointer; }
.dropzone:hover { border-color: var(--revin-red); color: var(--fg-2); background: var(--bg-surface); }
.dropzone .icon { width: 32px; height: 32px; stroke: currentColor; stroke-width: 1.5; fill: none; margin: 0 auto 8px; display: block; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.thumb { aspect-ratio: 1; background: linear-gradient(135deg, var(--neutral-600), var(--neutral-800)); position: relative; border-radius: 2px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.2); font-family: var(--font-mono); font-size: 9px; cursor: pointer; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; background: rgba(0,0,0,.7); border-radius: 999px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; opacity: 0; }
.thumb:hover .x { opacity: 1; }

/* Section heading inside cards */
.sec-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-2); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-3); }
.sec-h.first { margin-top: 0; }
.sec-h + .intake-grid, .sec-h + .checkbox-grid { margin-bottom: 24px; }

/* Fotos REALES en la ficha. Antes eran rectángulos grises con el nombre de la
   estancia escrito a mano, iguales tuviera fotos o no. */
.pd-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-photo.pd-sin-fotos {
  flex-direction: column; gap: 12px; color: var(--neutral-300);
  background: linear-gradient(135deg, var(--neutral-700), var(--neutral-800));
}
.pd-photo .pd-foto-etq {
  position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.7); color: #fff;
  padding: 3px 7px; font-size: 10px; font-family: var(--font-mono);
  border-radius: 2px; letter-spacing: .04em;
}
.pd-anadir-foto {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.72); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 3px; padding: 6px 10px; font: inherit; font-size: 11px; cursor: pointer;
}
.pd-anadir-foto:hover { background: rgba(0,0,0,.88); }
.pd-anadir-foto .icon { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; }
.pd-photos { position: relative; }

/* Editar desde la lista, sin tener que entrar en la ficha y volver. */
.inv-editar {
  background: none; border: 1px solid var(--border-1); border-radius: 3px;
  width: 28px; height: 28px; display: inline-flex; align-items: center;
  justify-content: center; color: var(--fg-3); cursor: pointer; padding: 0;
}
.inv-editar:hover { color: var(--revin-red); border-color: var(--revin-red); background: var(--red-50); }
.inv-editar .icon { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

.ph-derecha { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.prop-editar {
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.28); border-radius: 3px;
  width: 24px; height: 24px; display: inline-flex; align-items: center;
  justify-content: center; color: #fff; cursor: pointer; padding: 0;
}
.prop-editar:hover { background: var(--revin-red); border-color: var(--revin-red); }
.prop-editar .icon { stroke: currentColor; stroke-width: 2; fill: none; }

/* Cambiar de cajón desde la ficha. Cambia el prefijo de la referencia
   conservando año y número: CAP-26-014 → VEN-26-014. */
.inv-cajon { display: inline-flex; align-items: center; gap: 4px; padding-left: 8px; border-left: 1px solid var(--border-1); }
.inv-cajon .et { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); margin-right: 2px; }
.inv-cajon-b {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  background: var(--bg-surface); border: 1px solid var(--border-1); color: var(--fg-3);
  border-radius: 3px; padding: 6px 9px; cursor: pointer;
}
.inv-cajon-b:hover:not(:disabled) { border-color: var(--revin-red); color: var(--revin-red); }
.inv-cajon-b.puesto { background: var(--revin-black); border-color: var(--revin-black); color: #fff; cursor: default; }
.inv-cajon-b:disabled { opacity: .5; cursor: default; }
