/* ==========================================================================
   Alexandra · panel
   ========================================================================== */

:root {
  --bg: #f2eee6;
  --surface: #fbf9f5;
  --surface-2: #ebe6db;
  --ink: #1a1c19;
  --ink-2: #4f524c;
  --ink-3: #85867f;
  --line: #ddd6c8;
  --line-soft: #e7e1d5;
  --forest: #22362b;
  --forest-2: #2e4739;
  --forest-ink: #eef0ea;
  --clay: #97583a;
  --clay-bg: #f3e6dc;
  --danger: #9d3a28;

  --serif: "Newsreader", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --side-w: 248px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }
.icon { flex-shrink: 0; }
[hidden] { display: none !important; }

/* ---------- Estructura ---------- */

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 20px;
  background: var(--forest);
  color: var(--forest-ink);
}
.side__brand { display: flex; flex-direction: column; padding: 0 12px 28px; line-height: 1; }
.side__brand span { font-family: var(--serif); font-size: 1.7rem; letter-spacing: -.03em; }
.side__brand small { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; opacity: .55; margin-top: 6px; }

.side__nav { display: grid; gap: 2px; }
.side__nav a, .side__foot a, .side__foot button {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: rgba(238, 240, 234, .72);
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  transition: background .2s, color .2s;
}
.side__nav a:hover, .side__foot a:hover, .side__foot button:hover { color: var(--forest-ink); background: rgba(238, 240, 234, .06); }
.side__nav a.is-active { color: var(--forest-ink); background: rgba(238, 240, 234, .11); }
.side__nav a span { flex: 1; }
.side__foot { margin-top: auto; display: grid; gap: 2px; padding-top: 16px; border-top: 1px solid rgba(238, 240, 234, .12); }
.side__foot form { margin: 0; }

.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--clay-bg); color: var(--clay); font-size: .75rem; font-weight: 600; }

.main { min-width: 0; }
.topbar { display: none; }
.content { max-width: 1180px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 48px) 80px; }

.scrim { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .side.is-open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(26, 28, 25, .4); z-index: 40; }
  .side.is-open ~ .scrim, body.side-open .scrim { display: block; }
  .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px; background: var(--forest); color: var(--forest-ink); }
  .topbar__menu { background: none; border: 0; color: inherit; padding: 6px; margin-left: -6px; display: grid; }
  .topbar__brand { font-family: var(--serif); font-size: 1.35rem; flex: 1; }
  .topbar__leads { position: relative; display: grid; place-items: center; width: 40px; height: 40px; }
  .topbar__leads .badge { position: absolute; top: 0; right: -4px; min-width: 18px; height: 18px; font-size: .68rem; padding: 0 5px; }
}

/* ---------- Encabezados ---------- */

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.page-head h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 3.4vw, 2.8rem); letter-spacing: -.025em; line-height: 1.05; }
.page-head h1 em { color: var(--forest-2); }
.eyebrow { font-size: .76rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }

.back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .9rem; margin-bottom: 18px; }
.back:hover { color: var(--ink); }

/* ---------- Botones ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 500; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; }
.btn--dark { background: var(--forest); color: var(--forest-ink); }
.btn--dark:hover { background: var(--forest-2); }
.btn--line { border-color: var(--line); background: var(--surface); }
.btn--line:hover { border-color: var(--ink); }
.btn--danger { border-color: #e2c3ba; color: var(--danger); background: transparent; }
.btn--danger:hover { background: #f6e3de; }
.btn--sm { height: 38px; padding: 0 14px; font-size: .88rem; }
.btn--block { width: 100%; }

.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--ink-2); transition: all .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn--danger:hover { background: #f6e3de; color: var(--danger); }

.link { color: var(--ink-2); font-size: .9rem; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; background: none; border: 0; padding: 0; }
.link:hover { color: var(--ink); text-decoration-color: var(--ink); }
.link--danger { color: var(--danger); }

/* ---------- Avisos ---------- */

.alert { padding: 12px 16px; border-radius: 10px; font-size: .92rem; margin-bottom: 20px; }
.alert--error { background: #f6e3de; color: #8a321f; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: .92rem;
  box-shadow: 0 16px 40px -16px rgba(26, 28, 25, .5);
  animation: toast-in .4s var(--ease), toast-out .4s var(--ease) 3.6s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 12px); visibility: hidden; } }

/* ---------- Tarjetas y paneles ---------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); transition: border-color .2s; }
a.stat:hover { border-color: var(--line); }
.stat strong { font-family: var(--serif); font-weight: 400; font-size: 2.6rem; line-height: 1.05; letter-spacing: -.02em; }
.stat__label { font-size: .85rem; color: var(--ink-2); }
.stat__hint { font-size: .8rem; color: var(--ink-3); }
.stat--accent { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.stat--accent .stat__label, .stat--accent .stat__hint { color: rgba(238, 240, 234, .65); }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 26px); }
.panel + .panel { margin-top: 16px; }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel__head h2, .panel__title { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; letter-spacing: -.015em; }
.panel > .panel__title { margin-bottom: 18px; }
.panel__head .panel__title { margin: 0; }
.panel--sticky { position: sticky; top: 24px; display: grid; gap: 16px; }
.panel--sticky .panel__title { margin: 0; }

.list li + li { border-top: 1px solid var(--line-soft); }
.list__row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; margin: 0 -6px; border-radius: 10px; transition: background .2s; }
.list__row:hover { background: var(--bg); }
.list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.list__main strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__main small { color: var(--ink-3); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list__meta small { color: var(--ink-3); font-size: .78rem; }
.list__meta--nums { flex-direction: row; gap: 14px; color: var(--ink-2); font-size: .88rem; }
.list__meta--nums span { display: inline-flex; align-items: center; gap: 5px; }
.list__meta--nums .icon { color: var(--ink-3); }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 9px; }
.empty-note { color: var(--ink-3); padding: 12px 0; }

.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); font-family: var(--serif); font-size: 1.15rem; flex-shrink: 0; }

.status { display: inline-block; font-size: .74rem; font-weight: 500; padding: 4px 9px; border-radius: 6px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.status--new { background: var(--clay-bg); color: var(--clay); }
.status--contacted { background: #e4ebe2; color: var(--forest-2); }
.status--closed { background: var(--forest); color: var(--forest-ink); }
.status--discarded { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }

/* ---------- Barra de herramientas ---------- */

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; color: var(--ink-2); font-size: .9rem; transition: background .2s, color .2s; }
.tabs a:hover { background: var(--surface-2); color: var(--ink); }
.tabs a.is-active { background: var(--ink); color: var(--bg); }
.tabs a span { font-size: .78rem; opacity: .6; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line-soft); background: var(--surface); border-radius: 999px; color: var(--ink-3); }
.search:focus-within { border-color: var(--ink-2); }
.search input { border: 0; background: none; outline: none; width: 180px; color: var(--ink); }
.filter-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; }

/* ---------- Tabla de propiedades ---------- */

.table { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.table__head, .table__row { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.1fr) 150px 150px 160px; align-items: center; gap: 16px; padding: 12px 18px; }
.table__head { font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line-soft); }
.table__row + .table__row { border-top: 1px solid var(--line-soft); }
.table__row.is-muted .prop img { opacity: .5; filter: grayscale(1); }
.prop { display: flex; align-items: center; gap: 14px; min-width: 0; }
.prop img { width: 64px; height: 52px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.prop span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.prop strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.prop small { color: var(--ink-3); font-size: .84rem; }
.prop em { font-style: normal; color: var(--clay); }
.cell-price { display: flex; flex-direction: column; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.35; }
.cell-price small { font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.cell-status { margin: 0; }
.status-select { appearance: none; height: 34px; padding: 0 30px 0 12px; border-radius: 8px; border: 1px solid transparent; font-size: .86rem; font-weight: 500; cursor: pointer;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%234f524c' stroke-width='1.6' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.status-select--available { background-color: #e4ebe2; color: var(--forest-2); }
.status-select--reserved { background-color: var(--clay-bg); color: var(--clay); }
.cell-nums { display: flex; gap: 14px; color: var(--ink-2); font-size: .88rem; }
.cell-nums > * { display: inline-flex; align-items: center; gap: 5px; }
.cell-nums .icon { color: var(--ink-3); }
.cell-nums a:hover { color: var(--ink); text-decoration: underline; }
.cell-actions { display: flex; justify-content: flex-end; gap: 2px; }
.cell-actions form { margin: 0; }

@media (max-width: 1100px) {
  .table__head { display: none; }
  .table__row { grid-template-columns: 1fr auto; grid-template-areas: "prop actions" "price status" "nums nums"; row-gap: 10px; padding: 16px; }
  .prop { grid-area: prop; }
  .cell-actions { grid-area: actions; }
  .cell-price { grid-area: price; }
  .cell-status { grid-area: status; }
  .cell-nums { grid-area: nums; }
}

.empty-state { text-align: center; padding: 64px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin-bottom: 8px; }
.empty-state .btn { margin-top: 20px; }

/* ---------- Formularios ---------- */

.stack { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label, .field > span:first-child { font-size: .86rem; font-weight: 500; color: var(--ink-2); }
.field .optional { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.field select { appearance: none; padding-right: 36px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%234f524c' stroke-width='1.6' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.field textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(34, 54, 43, .12); }
.field input[type=file] { font-size: .88rem; color: var(--ink-2); }
.field input[type=file]::file-selector-button { height: 38px; padding: 0 14px; margin-right: 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; }
.field__hint { font-size: .8rem; color: var(--ink-3); }
.field__error { font-size: .82rem; color: var(--danger); }
.field.is-invalid input, .field.is-invalid select { border-color: #c98b7c; }

.input-group { display: flex; }
.input-group select { width: auto !important; flex: 0 0 84px; border-radius: 10px 0 0 10px !important; border-right: 0 !important; background-color: var(--bg) !important; }
.input-group input { border-radius: 0 10px 10px 0 !important; }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 > .field, .grid-3 > .field, .grid-4 > .field { margin-bottom: 16px; }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 12px; }
.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; height: 38px; border-radius: 9px; font-size: .9rem; color: var(--ink-2); transition: all .2s; }
.segmented input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(26, 28, 25, .1); }
.segmented input:focus-visible + span { outline: 2px solid var(--forest); }

.switch { position: relative; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track { position: relative; flex-shrink: 0; width: 40px; height: 24px; margin-top: 1px; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + .switch__track { background: var(--forest); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--forest); outline-offset: 2px; }
.switch > span:last-child { display: flex; flex-direction: column; line-height: 1.35; }
.switch strong { font-weight: 500; }
.switch small { color: var(--ink-3); font-size: .82rem; }
.panel > .switch { margin-top: 8px; }

/* ---------- Editor ---------- */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.editor__main { min-width: 0; }
.editor__side { position: sticky; top: 24px; }
@media (max-width: 1000px) {
  .editor { grid-template-columns: 1fr; }
  .editor__side { position: static; order: -1; }
  .panel--sticky { position: static; }
}

.side-links { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: .9rem; color: var(--ink-2); }
.side-links > * { display: flex; align-items: center; gap: 8px; }
.side-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photos--new:empty { display: none; }
.photos--new { margin-top: 12px; }
.photo { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: grab; }
.photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo.is-dragging { opacity: .4; }
.photo.is-over { outline: 2px dashed var(--forest); outline-offset: 2px; }
.photo__cover { position: absolute; left: 8px; top: 8px; display: none; font-size: .72rem; font-weight: 500; padding: 4px 8px; border-radius: 6px; background: rgba(251, 249, 245, .95); }
.photos [data-photo]:first-child .photo__cover { display: block; }
.photo__del { position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(251, 249, 245, .95); color: var(--ink-2); cursor: pointer; }
.photo__del input { position: absolute; opacity: 0; pointer-events: none; }
.photo__del:hover { color: var(--danger); }
.photo.is-removed img { opacity: .25; filter: grayscale(1); }
.photo.is-removed .photo__del { background: var(--danger); color: #fff; }
.photo.is-removed::after { content: "Se quitará al guardar"; position: absolute; left: 8px; bottom: 8px; font-size: .74rem; color: var(--danger); font-weight: 500; }
.photo--new { cursor: default; }
.photo--new::after { content: "Nueva"; position: absolute; left: 8px; bottom: 8px; font-size: .72rem; font-weight: 500; padding: 4px 8px; border-radius: 6px; background: var(--forest); color: var(--forest-ink); }

.dropzone { position: relative; aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed var(--line); border-radius: 10px; color: var(--ink-2); text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--forest); background: #fff; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { font-weight: 500; font-size: .9rem; margin-top: 4px; }
.dropzone span { font-size: .76rem; color: var(--ink-3); }

.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 28px; padding: 20px 24px; border: 1px solid #ecd3cb; border-radius: var(--radius); }
.danger-zone strong { font-weight: 500; }
.danger-zone p { font-size: .88rem; margin-top: 2px; }

/* ---------- Interesados ---------- */

.leads { display: grid; gap: 8px; }
.lead { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); transition: border-color .2s; }
.lead[open] { border-color: var(--line); }
.lead--new { border-left: 3px solid var(--clay); }
.lead summary { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1.4fr) 90px 100px 20px; align-items: center; gap: 16px; padding: 14px 18px; cursor: pointer; list-style: none; }
.lead summary::-webkit-details-marker { display: none; }
.lead__who { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.lead__who strong { font-weight: 500; }
.lead__who small, .lead__what { color: var(--ink-3); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead__what { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.lead__what img { width: 38px; height: 30px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.lead__what span { overflow: hidden; text-overflow: ellipsis; }
.lead__when { font-size: .84rem; color: var(--ink-3); }
.lead .status { justify-self: start; }
.lead__chev { color: var(--ink-3); transition: transform .25s var(--ease); }
.lead[open] .lead__chev { transform: rotate(180deg); }
.lead:target { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px rgba(151, 88, 58, .25); } 100% { box-shadow: none; } }

.lead__body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; padding: 6px 18px 20px 74px; }
.lead__msg { margin: 0 0 18px; padding: 14px 16px; background: var(--bg); border-radius: 10px; font-family: var(--serif); font-size: 1.12rem; line-height: 1.5; }
.lead__data { display: grid; gap: 8px; margin: 0 0 18px; font-size: .9rem; }
.lead__data div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.lead__data dt { color: var(--ink-3); }
.lead__data dd { margin: 0; }
.lead__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead__form { padding-left: 24px; border-left: 1px solid var(--line-soft); }
.lead__form .field select, .lead__form .field input { height: 40px; }
.lead__form-foot { display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 900px) {
  .lead summary { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av who status" "av what when"; row-gap: 4px; }
  .lead summary .avatar { grid-area: av; }
  .lead__who { grid-area: who; }
  .lead__what { grid-area: what; }
  .lead__when { grid-area: when; text-align: right; }
  .lead .status { grid-area: status; justify-self: end; }
  .lead__chev { display: none; }
  .lead__body { grid-template-columns: 1fr; padding: 4px 18px 20px; }
  .lead__form { padding-left: 0; border-left: 0; padding-top: 18px; border-top: 1px solid var(--line-soft); }
}

/* ---------- Perfil ---------- */

.profile-photo { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.profile-photo img { width: 104px; height: 128px; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--surface-2); }
.hero-preview { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.hero-preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
@media (max-width: 600px) { .hero-preview { grid-template-columns: 1fr; } }
.account { margin-top: 28px; display: grid; gap: 18px; }

/* ---------- Login ---------- */

.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login__media { background: var(--surface-2) center / cover no-repeat; }
.login__panel { display: grid; place-items: center; padding: 40px 24px; }
.login__box { width: 100%; max-width: 380px; }
.login__brand { font-family: var(--serif); font-size: 1.6rem; letter-spacing: -.03em; margin-bottom: 48px; }
.login h1 { font-family: var(--serif); font-weight: 400; font-size: 2.6rem; letter-spacing: -.025em; line-height: 1.05; margin-bottom: 10px; }
.login h1 em { color: var(--forest-2); }
.login .muted { margin-bottom: 32px; }
.login__back { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-size: .9rem; color: var(--ink-2); }
.login__back:hover { color: var(--ink); }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__media { display: none; }
}
