/* Media Inmuebles · estilos compartidos */
:root {
  --brand: #ff6b00;
  --brand-600: #e85f00;
  --brand-50: #fff3ea;
  --brand-100: #ffe2cc;
  --ink: #111111;
  --text: #1b1d22;
  --muted: #6b7080;
  --line: #e7e8ec;
  --line-2: #f0f1f4;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --ok: #1fa363;
  --warn: #f2a516;
  --bad: #e5484d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 6px 20px rgba(17, 17, 17, .06);
  --shadow-lg: 0 10px 40px rgba(17, 17, 17, .14);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: #d9dbe1; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #2a2a2a; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line-2); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: #fdecec; border-color: #f5c2c3; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.icon { width: 38px; padding: 0; }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.wa:hover { background: #1fbd5a; }
.btn svg, .ico { width: 18px; height: 18px; flex: none; }

/* ---------- formularios ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: #d6d8de; position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- chips / estatus ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.disponible, .pill.publico, .pill.vendido-ok { background: #e6f6ee; color: #137a48; }
.pill.apartado, .pill.en_proceso { background: #fff4dc; color: #a26b00; }
.pill.vendido { background: #fdecec; color: #c0353a; }
.pill.bloqueado, .pill.archivado, .pill.descartada { background: #eeeff2; color: #5b606c; }
.pill.nueva, .pill.borrador { background: var(--brand-50); color: var(--brand-600); }
.pill.live { background: #e6f6ee; color: #137a48; }
.pill.live .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- visor del mapa ---------- */
.mv-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; background: transparent; }
.mv-svg.is-panning { cursor: grabbing; }
.mv-lot {
  fill: var(--c); fill-opacity: .62; stroke: #fff; stroke-width: calc(1.6px / var(--k, 1)); cursor: pointer;
  transition: fill-opacity .15s; outline: none;
}
.mv-lot:hover, .mv-lot:focus-visible { fill-opacity: .85; }
.mv-lot.is-selected { fill-opacity: .92; stroke: var(--ink); stroke-width: calc(3px / var(--k, 1)); }
.mv-lot.is-dim { fill-opacity: .12; }
.mv-label {
  fill: #fff; font-family: var(--font); font-weight: 700; pointer-events: none;
  paint-order: stroke; stroke: rgba(0, 0, 0, .35); stroke-width: .9px;
}
.mv-label.is-dim { opacity: .3; }

/* ---------- avisos ---------- */
.toasts { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; animation: tin .2s ease-out; }
.toast.ok { background: #137a48; }
.toast.err { background: #b42318; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 500; background: rgba(17, 17, 17, .45); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 16px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h3 { margin-bottom: 6px; }
.muted { color: var(--muted); }
.wrap-anywhere { overflow-wrap: anywhere; }
