
/* Layout: aplicación de escritorio con barra lateral oscura; el detalle de cada inmueble usa dos columnas (trabajo + resumen fijo).
   En móvil la barra lateral se vuelve una franja superior y todo pasa a una columna. */
:root {
  --bg: #F3F5F8; --panel: #FFFFFF; --panel-2: #F0F3F7; --line: #DFE5EC; --line-2: #E9EEF3;
  --fg: #102030; --muted: #5F6E7D; --faint: #8A97A5;
  --side: #0B2236; --side-2: #12304A; --side-fg: #E3ECF5; --side-muted: #8EA4BA;
  --accent: #0D9488; --accent-2: #0B7C72; --accent-fg: #FFFFFF; --accent-soft: #DAF3EF;
  --ok: #17804A; --ok-soft: #DFF3E8; --warn: #A15C00; --warn-soft: #FCEFD7; --bad: #BE3A33; --bad-soft: #FBE4E2;
  --info: #2B5E93; --info-soft: #E0EBF7; --violet: #6A4FB3; --violet-soft: #ECE6F8;
  --font: "Onest", "Segoe UI", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 12px; --r-s: 8px;
  --shadow: 0 1px 2px rgba(16,32,48,.05), 0 6px 20px rgba(16,32,48,.06);
  --shadow-lg: 0 10px 40px rgba(11,34,54,.18);
  --ease: cubic-bezier(.2,.8,.2,1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0B141D; --panel: #121F2B; --panel-2: #172735; --line: #233647; --line-2: #1D2F3E;
  --fg: #E7EEF5; --muted: #98A9B9; --faint: #6F8396;
  --side: #08111A; --side-2: #10202E; --side-fg: #DCE6F0; --side-muted: #7D93A8;
  --accent: #2DBFB1; --accent-2: #26A89C; --accent-fg: #04201D; --accent-soft: #11393A;
  --ok: #4CC487; --ok-soft: #133426; --warn: #E9B04F; --warn-soft: #382B12; --bad: #F2857C; --bad-soft: #3B1E1C;
  --info: #7FB3E6; --info-soft: #172E45; --violet: #B5A2F0; --violet-soft: #2A2342;
  --shadow: 0 1px 2px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.5); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0B141D; --panel: #121F2B; --panel-2: #172735; --line: #233647; --line-2: #1D2F3E;
  --fg: #E7EEF5; --muted: #98A9B9; --faint: #6F8396;
  --side: #08111A; --side-2: #10202E; --side-fg: #DCE6F0; --side-muted: #7D93A8;
  --accent: #2DBFB1; --accent-2: #26A89C; --accent-fg: #04201D; --accent-soft: #11393A;
  --ok: #4CC487; --ok-soft: #133426; --warn: #E9B04F; --warn-soft: #382B12; --bad: #F2857C; --bad-soft: #3B1E1C;
  --info: #7FB3E6; --info-soft: #172E45; --violet: #B5A2F0; --violet-soft: #2A2342;
  --shadow: 0 1px 2px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.5); color-scheme: dark }

* { box-sizing: border-box }
html, body { height: 100% }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px }
.mono { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums }
.num { font-variant-numeric: tabular-nums }
.muted { color: var(--muted) }
h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -.015em; text-wrap: balance; font-weight: 650 }
h2 { font-size: 15px; margin: 0; font-weight: 600 }
h3 { font-size: 13px; margin: 0; font-weight: 600 }
p { margin: 0 }

/* ---------- Login ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr) }
.login .brandside { background: var(--side); color: var(--side-fg); padding-block: 48px; padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: 40px;
  display: flex; flex-direction: column; gap: 28px; position: relative; overflow: hidden }
.login .brandside::before { content: ""; position: absolute; inset: auto -20% -40% auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(45,191,177,.22), transparent) }
.login .claim { font-size: 34px; line-height: 1.12; font-weight: 650; letter-spacing: -.02em; max-width: 14ch; position: relative }
.login .claim em { font-style: normal; color: #5FD6CA }
.login .bullets { display: flex; flex-direction: column; gap: 10px; color: var(--side-muted); position: relative; max-width: 40ch }
.login .bullets > span { display: flex; gap: 10px; align-items: flex-start }
.login .bullets b { color: var(--side-fg); font-weight: 500 }
.flow { position: relative; width: 100%; max-width: 440px }
.flow svg { width: 100%; height: auto; display: block }
.formside { display: grid; place-items: center; padding-block: 40px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)) }
.card-login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px }
.demo-accounts { display: grid; gap: 8px }
.acct { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--panel);
  text-align: left; transition: border-color .15s, transform .15s var(--ease) }
.acct:hover { border-color: var(--accent); transform: translateY(-1px) }
.acct[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.acct small { display: block; color: var(--muted) }
.lbl { font-size: 12.5px; font-weight: 500; color: var(--muted); display: block; margin-bottom: 5px }
.inp { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-s); padding: 9px 11px; transition: border-color .15s, box-shadow .15s }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.office { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; background: var(--panel); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow) }
.office .row { display: flex; gap: 14px; align-items: center }
.logo { width: 52px; height: 52px; border-radius: 12px; background: linear-gradient(135deg, #0D9488, #0B4F73); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 18px; flex: none; letter-spacing: -.02em }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px }
.facts div { background: var(--panel-2); border-radius: var(--r-s); padding: 8px 10px }
.facts b { display: block; font-size: 18px; font-variant-numeric: tabular-nums }
.facts span { font-size: 11.5px; color: var(--muted) }
.checks { display: flex; flex-direction: column; gap: 7px; font-size: 13px }
.checks > span { display: flex; gap: 8px; align-items: center; opacity: 0; transform: translateY(4px); animation: rise .35s var(--ease) forwards }
.tick { width: 18px; height: 18px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; flex: none }
.tick svg { width: 12px; height: 12px }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2) 0%, var(--line-2) 50%, var(--panel-2) 100%); background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: 100% }
.side { background: var(--side); color: var(--side-fg); display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh;
  padding-block: 18px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: 14px; overflow-y: auto }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px }
.brand .mk { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; color: #fff }
.brand b { font-size: 14.5px; letter-spacing: -.01em; display: block; line-height: 1.15 }
.brand span { font-size: 11.5px; color: var(--side-muted) }
.officebadge { background: var(--side-2); border-radius: 10px; padding: 10px; display: flex; gap: 10px; align-items: center; font-size: 12.5px }
.officebadge .logo { width: 34px; height: 34px; border-radius: 9px; font-size: 12px }
.officebadge small { color: var(--side-muted); display: block; font-size: 11px }
.verif { color: #5FD6CA; font-size: 11px; display: inline-flex; gap: 4px; align-items: center }
.verif svg { width: 12px; height: 12px }
.navgroup { display: flex; flex-direction: column; gap: 2px }
.navlabel { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); padding: 6px 10px 4px }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-fg); background: none; border: 0; text-align: left;
  width: 100%; position: relative; transition: background .15s }
.nav:hover { background: rgba(255,255,255,.06) }
.nav[aria-current="page"] { background: rgba(45,191,177,.16); color: #fff }
.nav[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #5FD6CA }
.nav svg { opacity: .85; flex: none }
.nav .count { margin-left: auto; font-size: 11px; background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; font-variant-numeric: tabular-nums }
.me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: var(--side-2) }
.me small { display: block; color: var(--side-muted); font-size: 11.5px }
.me button { margin-left: auto; background: none; border: 0; color: var(--side-muted); font-size: 12px }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; flex: none }

.main { min-width: 0; display: flex; flex-direction: column }
.top { display: flex; align-items: center; gap: 10px; background: var(--bg);
  border-bottom: 1px solid var(--line); padding-block: 10px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; flex-wrap: wrap }
.search { flex: 1; min-width: 180px; max-width: 420px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 9px;
  padding: 7px 10px; color: var(--muted); text-align: left }
.search > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0 }
.search kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px }
.search { position: relative }
.buscador-lista { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: min(380px, calc(100vw - 32px)); max-height: min(420px, 70vh); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 34, 54, .16); z-index: 30; padding: 6px }
.buscador-lista a { display: grid; gap: 2px; padding: 9px 10px; border-radius: 8px; color: var(--fg); text-decoration: none }
.buscador-lista a:hover, .buscador-lista a.marcado { background: var(--panel-2) }
.buscador-lista b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.buscador-lista small { font-size: 12.5px; color: var(--muted) }
.buscador-lista em { font-style: normal; font-size: 11.5px; color: var(--accent); font-weight: 600 }
.buscador-lista .mas { margin: 0; padding: 9px 10px; font-size: 12.5px; color: var(--muted) }
.spacer { flex: 1 }
.syncpill { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 5px 11px; white-space: nowrap }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2.2s infinite }
.iconbtn { position: relative; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; width: 38px; height: 36px; display: grid; place-items: center }
.iconbtn .dot { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px;
  display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg) }
.proto { font-size: 11.5px; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 4px 10px; white-space: nowrap }

.content { padding-block: 24px 64px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px; max-width: none; width: 100% }
.content.enter > * { animation: rise .32s var(--ease) both }
.content.enter > *:nth-child(2) { animation-delay: .04s } .content.enter > *:nth-child(3) { animation-delay: .08s } .content.enter > *:nth-child(4) { animation-delay: .12s }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap }
.sub { color: var(--muted); margin-top: 4px; max-width: 72ch }
.eyebrow { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 6px }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0 }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap }
.pb { padding: 16px 18px }
.grid { display: grid; gap: 16px }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)) }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)) }
.g21 { grid-template-columns: minmax(0,2fr) minmax(0,1fr) }
.detail { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 18px; align-items: start }
.sticky { position: sticky; top: calc(76px + env(safe-area-inset-top, 0px)) }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--r); box-shadow: var(--shadow); transition: transform .18s var(--ease), border-color .18s; position: relative; overflow: hidden }
button.kpi:hover { transform: translateY(-2px); border-color: var(--accent) }
.kpi .v { font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.02em }
.kpi .l { color: var(--muted); font-size: 12.5px; padding-right: 30px }
.kpi .ic { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center }
.kpi.bad .v { color: var(--bad) } .kpi.bad .ic { background: var(--bad-soft); color: var(--bad) }
.kpi.warn .v { color: var(--warn) } .kpi.warn .ic { background: var(--warn-soft); color: var(--warn) }
.kpi.ok .v { color: var(--ok) } .kpi.ok .ic { background: var(--ok-soft); color: var(--ok) }
.kpi.info .ic { background: var(--info-soft); color: var(--info) }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 8px 13px; display: inline-flex; align-items: center; gap: 7px; font-weight: 500;
  white-space: nowrap; transition: border-color .15s, background .15s, transform .1s }
.btn:hover { border-color: var(--accent) }
.btn:active { transform: scale(.98) }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent) }
.btn.primary:hover { background: var(--accent-2) }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px }
.btn.ghost { border-color: transparent; background: none; color: var(--accent); padding-left: 4px; padding-right: 4px }
.btn.block { width: 100%; justify-content: center; padding: 11px }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; border-radius: 999px; padding: 2px 9px; white-space: nowrap; font-weight: 500; line-height: 1.6 }
.chip svg { width: 12px; height: 12px }
.chip.bad { background: var(--bad-soft); color: var(--bad) } .chip.warn { background: var(--warn-soft); color: var(--warn) }
.chip.ok { background: var(--ok-soft); color: var(--ok) } .chip.info { background: var(--info-soft); color: var(--info) }
.chip.violet { background: var(--violet-soft); color: var(--violet) } .chip.neutral { background: var(--panel-2); color: var(--muted) }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.filters { display: flex; gap: 6px; flex-wrap: wrap }
.fchip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted) }
.fchip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg) }
.fchip .n { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 4px }

.tablewrap { overflow-x: auto }
table { width: 100%; border-collapse: collapse }
th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle }
tr:last-child td { border-bottom: 0 }
tr.click { cursor: pointer; transition: background .12s } tr.click:hover td { background: var(--panel-2) }

.ring { --p: 0; --c: var(--accent); width: 44px; height: 44px; flex: none; position: relative }
.ring svg { transform: rotate(-90deg); display: block }
.ring circle { fill: none; stroke-width: 4 }
.ring .bg { stroke: var(--panel-2) }
.ring .fgc { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: calc(113.1 * (1 - var(--p) / 100)); transition: stroke-dashoffset .7s var(--ease) }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-variant-numeric: tabular-nums }
.ring.big { width: 96px; height: 96px } .ring.big b { font-size: 22px; font-weight: 650 }

.listing { display: flex; gap: 14px; align-items: center }
.thumb { width: 60px; height: 46px; border-radius: 8px; flex: none }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); overflow-x: auto; padding: 0 10px }
.tab { border: 0; background: none; padding: 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center;
  transition: color .15s, border-color .15s }
.tab:hover { color: var(--fg) }
.tab[aria-selected="true"] { color: var(--fg); border-color: var(--accent); font-weight: 600 }
.tab .badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 10.5px; padding: 0 6px; font-variant-numeric: tabular-nums }

.groupt { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin: 18px 0 4px; font-weight: 600 }
.groupt:first-child { margin-top: 0 }
.field { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) 76px; gap: 12px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 8px; transition: background .3s }
.field + .field { border-top: 1px dashed var(--line-2) }
.field .k { font-size: 13.5px } .field .k small { display: block; color: var(--muted); font-size: 11.5px }
.field .val { min-width: 0 }
.field .val input, .field .val select, .field .val textarea { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 10px; transition: border-color .15s, box-shadow .15s }
.field .val input:focus, .field .val select:focus, .field .val textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.field.missing .val input, .field.missing .val select, .field.missing .val textarea { border-color: var(--bad); background: var(--bad-soft) }
.field.flash { background: var(--warn-soft) }
.field .tag { justify-self: end }

.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; display: block; transition: all .2s var(--ease) }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--fg) }
.drop b { color: var(--fg) }
.reqdocs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px }
.doc { display: grid; grid-template-columns: auto minmax(0,1fr) minmax(0,190px) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2);
  animation: rise .25s var(--ease) both }
.doc:last-child { border-bottom: 0 }
.doc .name { overflow-wrap: anywhere; font-size: 13px; font-weight: 500 }
.ficon { width: 32px; height: 40px; border-radius: 5px; background: var(--bad-soft); color: var(--bad); font-size: 9.5px; font-weight: 700; display: grid; place-items: center }

.map { display: grid; grid-template-columns: minmax(0,1fr) 24px minmax(0,1.2fr); gap: 8px; align-items: center; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-2) }
.map:last-child { border-bottom: 0 }
.map .from { color: var(--muted) } .map .arrow { color: var(--faint); text-align: center }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 10px }
.ph-img { aspect-ratio: 4/3; border-radius: 9px; max-width: 100%; display: flex; align-items: flex-end; padding: 6px 8px; color: #fff; font-size: 11px; font-weight: 500 }
.ph-img:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto }

.summary { display: flex; flex-direction: column; gap: 16px }
.summary .ringrow { display: flex; gap: 16px; align-items: center }
.missing-list { display: flex; flex-direction: column; gap: 2px }
.missing-list button { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 7px; font-size: 13px }
.missing-list button:hover { background: var(--bad-soft) }
.missing-list .x { width: 16px; height: 16px; border-radius: 50%; background: var(--bad-soft); color: var(--bad); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none }
.who { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--panel-2) }
.who .row { display: flex; gap: 10px; align-items: center }
.who small { color: var(--muted); display: block; font-size: 11.5px }

.stepper { display: flex; align-items: center; overflow-x: auto; padding-bottom: 2px }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); white-space: nowrap }
.step .dotx { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--panel) }
.step.done { color: var(--fg) } .step.done .dotx { background: var(--accent); border-color: var(--accent); color: var(--accent-fg) }
.step.now { color: var(--fg); font-weight: 600 } .step.now .dotx { border-color: var(--accent); color: var(--accent) }
.step + .step::before { content: ""; width: 34px; height: 2px; background: var(--line); margin-right: 2px }
.step.done + .step::before { background: var(--accent) }

.timeline { display: flex; flex-direction: column }
.tl { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 10px; align-items: start; padding-bottom: 14px; position: relative }
.tl:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line-2) }
.tl .b { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center }
.tl .b svg { width: 14px; height: 14px }
.tl b { font-weight: 600; font-size: 13.5px } .tl small { color: var(--muted); display: block; font-size: 12.5px }
.tl time { font-family: var(--mono); font-size: 11.5px; color: var(--faint) }

.task { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2) }
.task:last-child { border-bottom: 0 }
.task .t { flex: 1; min-width: 0 } .task .t small { display: block; color: var(--muted); font-size: 12.5px }

.toggle { position: relative; width: 40px; height: 23px; flex: none }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1 }
.toggle span { position: absolute; inset: 0; border-radius: 12px; background: var(--line); transition: background .2s }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease) }
.toggle input:checked + span { background: var(--accent) }
.toggle input:checked + span::after { transform: translateX(17px) }
.toggle input:disabled { cursor: not-allowed } .toggle input:disabled + span { opacity: .55 }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px }
.cfg { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2) }
.cfg:last-child { border-bottom: 0 }
.cfg .t { flex: 1; min-width: 0 } .cfg .t small { display: block; color: var(--muted); font-size: 12px }
.fill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums }
.fill i { display: block; width: 46px; height: 5px; border-radius: 3px; background: var(--panel-2); position: relative; overflow: hidden }
.fill i::after { content: ""; position: absolute; inset: 0; width: var(--w); background: var(--accent); border-radius: 3px }

.link-card { display: grid; grid-template-columns: minmax(0,1fr) 34px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-2) }
.link-card:last-child { border-bottom: 0 }
.person { display: flex; gap: 10px; align-items: center; min-width: 0 }
.person > div { min-width: 0 } .person b { display: block; font-size: 13.5px; overflow-wrap: anywhere } .person small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; display: block }
.plat { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600 }
.plat.xp { color: var(--violet) } .plat.ws { color: var(--info) }
.linkicon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--faint) }
.linkicon.on { background: var(--ok-soft); color: var(--ok) } .linkicon.half { background: var(--warn-soft); color: var(--warn) }
.setterbox { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); cursor: pointer }

.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; align-items: flex-start }
.notice .ni { flex: none; margin-top: 1px }
.notice.bad { background: var(--bad-soft) } .notice.bad .ni { color: var(--bad) }
.notice.ok { background: var(--ok-soft) } .notice.ok .ni { color: var(--ok) }
.notice.info { background: var(--info-soft) } .notice.info .ni { color: var(--info) }
.notice.violet { background: var(--violet-soft) } .notice.violet .ni { color: var(--violet) }
.notice b { display: block; margin-bottom: 1px }

.scrim { position: fixed; inset: 0; background: rgba(6,16,26,.42); z-index: 25; animation: fade .2s both }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 26;
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px);
  animation: slidein .28s var(--ease) both }
.drawer .dh { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line-2); gap: 10px }
.drawer .db { overflow-y: auto; padding: 6px 18px 18px; display: flex; flex-direction: column }
.noti { padding: 14px 0; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 10px; font-size: 13.5px }
.noti .u { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px }
.noti.read .u { background: transparent } .noti.read { color: var(--muted) }
.noti small { color: var(--faint); font-size: 12px }
.palette { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); z-index: 26; overflow: hidden; animation: pop .2s var(--ease) both }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line-2); padding: 16px 18px; font-size: 15px; background: none }
.palette input:focus { outline: none }
.palette .res { max-height: 340px; overflow-y: auto; padding: 6px }
.palette .res button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 9px 12px; border-radius: 8px; text-align: left }
.palette .res button:hover, .palette .res button.sel { background: var(--panel-2) }
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px;
  align-items: center; width: max-content; max-width: calc(100% - 32px) }
.toast { background: var(--side); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: center;
  animation: toastin .3s var(--ease) both }
.toast.out { animation: toastout .25s ease both }
.toast svg { color: #5FD6CA; flex: none }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 39 }

.dev-banner { display: flex; gap: 10px; align-items: center; border: 1px dashed var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 10px 14px; font-size: 13px }
.dev .side { background: #0A0F14 }
.menuitem { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2) }
.menuitem:last-child { border-bottom: 0 }
.grip { color: var(--faint); font-family: var(--mono); user-select: none }
.empty { color: var(--muted); padding: 26px; text-align: center }
.perm td:not(:first-child), .perm th:not(:first-child) { text-align: center }
.yes { color: var(--ok); font-weight: 600 } .no { color: var(--faint) }

@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes fade { from { opacity: 0 } }
@keyframes slidein { from { transform: translateX(30px); opacity: 0 } }
@keyframes pop { from { transform: translate(-50%, 8px) scale(.98); opacity: 0 } }
@keyframes toastin { from { transform: translateY(14px); opacity: 0 } }
@keyframes toastout { to { transform: translateY(10px); opacity: 0 } }
@keyframes shimmer { to { background-position: -200% 0 } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(23,128,74,.45) } 70% { box-shadow: 0 0 0 8px rgba(23,128,74,0) } 100% { box-shadow: 0 0 0 0 rgba(23,128,74,0) } }
@keyframes dash { to { stroke-dashoffset: -40 } }

@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)) } .detail { grid-template-columns: minmax(0,1fr) } .sticky { position: static } }
@media (max-width: 860px) { .g21, .g2 { grid-template-columns: minmax(0,1fr) } .login { grid-template-columns: minmax(0,1fr) } .login .brandside { padding-block: 32px } .flow { display: none } }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; gap: 6px; padding-block: 10px; padding-right: max(14px, env(safe-area-inset-right, 0px)) }
  .side .brand span, .navlabel, .officebadge, .me small, .me > div { display: none }
  .navgroup { flex-direction: row } .nav { width: auto; white-space: nowrap } .nav[aria-current="page"]::before { display: none }
  .me { margin-top: 0; padding: 4px; background: none }
  .field { grid-template-columns: minmax(0,1fr) auto } .field .val { grid-column: 1 / -1; grid-row: 2 }
  .doc { grid-template-columns: auto minmax(0,1fr) auto } .doc select { grid-column: 2 / -1 }
  .link-card { grid-template-columns: minmax(0,1fr) } .linkicon { transform: rotate(90deg) }
  .search kbd, .syncpill .txt { display: none }
}
@media (max-width: 460px) { .g4 { grid-template-columns: minmax(0,1fr) } .proto { display: none } h1 { font-size: 21px } .login .claim { font-size: 27px } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } .checks > span { opacity: 1; transform: none } }

/* ---------- Específico de la aplicación ---------- */
.flash-msg { padding: 11px 14px; border-radius: 10px; font-size: 13.5px }
.flash-msg.error { background: var(--bad-soft); color: var(--bad) }
.flash-msg.ok { background: var(--ok-soft); color: var(--ok) }
.form { display: flex; flex-direction: column; gap: 14px }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted) }
.check input { margin-top: 3px }
.check a, .legal a { color: var(--accent) }
.code { font-family: var(--mono); font-size: 26px; letter-spacing: .5em; text-align: center }
.wizard { max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px;
  padding-block: 32px 64px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)) }
.wsteps { display: flex; gap: 6px; overflow-x: auto }
.wsteps span { flex: 1; min-width: 90px; font-size: 12px; color: var(--faint); border-top: 3px solid var(--line); padding-top: 8px; white-space: nowrap }
.wsteps span.done { border-color: var(--accent); color: var(--muted) } .wsteps span.now { border-color: var(--accent); color: var(--fg); font-weight: 600 }
.opcion { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer }
.opcion:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.legal { max-width: 760px; margin: 0 auto; padding-block: 32px 64px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); line-height: 1.65 }
.legal h1 { margin-bottom: 8px } .legal h2 { margin-top: 26px; margin-bottom: 6px; font-size: 17px }
.legal blockquote { margin: 0; padding: 10px 14px; background: var(--warn-soft); border-radius: 10px }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: girar .8s linear infinite }
@keyframes girar { to { transform: rotate(360deg) } }
.topbar-simple { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; background: var(--side); color: var(--side-fg);
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)) }
.topbar-simple a { color: var(--side-fg) }

/* ---------- Ajustes de la aplicación real ---------- */
a.btn { text-decoration: none; color: var(--fg) }
a.btn.primary { color: var(--accent-fg) }
a.btn.ghost { color: var(--accent) }
a.kpi { color: inherit; text-decoration: none; transition: transform .18s var(--ease), border-color .18s }
a.kpi:hover { transform: translateY(-2px); border-color: var(--accent) }
a.task { color: inherit; text-decoration: none; border-radius: 10px; padding: 12px 10px; margin: 0 -10px; transition: background .15s; border-bottom: 0 }
a.task + a.task { border-top: 1px solid var(--line-2) }
a.task:hover { background: var(--panel-2) }
.task .chev { color: var(--faint); font-size: 22px; line-height: 1; transition: transform .15s var(--ease), color .15s; flex: none }
a.task:hover .chev { transform: translateX(3px); color: var(--accent) }
.task .t b { display: block; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }
.qbadge { width: 44px; height: 44px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none }
.task-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px }
.me { gap: 6px }
.me-link { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; flex: 1; min-width: 0; border-radius: 8px; padding: 2px }
.me-link:hover { background: rgba(255,255,255,.06) }
.me-link small { display: block; color: var(--side-muted); font-size: 11.5px }
.me form { margin-left: auto }
img.av { object-fit: cover; display: block }
.nav { text-decoration: none }
@media (max-width: 760px) {
  /* En el celular la navegación principal va abajo, al alcance del pulgar */
  .side { position: sticky; top: 0; z-index: 7 }
  .side .navgroup { display: contents }
  .side nav.navgroup:first-of-type ~ nav.navgroup { display: none }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--side);
    padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
    border-top: 1px solid rgba(255,255,255,.08) }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--side-muted); font-size: 10.5px; text-decoration: none; padding: 4px 0; position: relative }
  .tabbar a[aria-current="page"] { color: #fff }
  .tabbar a .count { position: absolute; top: 0; left: calc(50% + 6px); font-size: 10px; background: var(--bad); color: #fff; border-radius: 999px; padding: 0 5px }
  .content { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) }
  .side > nav, .side .navlabel { display: none !important }
  .me small, .me-link span { display: none }
  .top .search { min-width: 0 }
  .head h1 { font-size: 21px }
  .detail .sticky { order: -1 }
  .kpi .v { font-size: 24px }
}
@media (min-width: 761px) { .tabbar { display: none } }
@media (max-width: 760px) {
  .side .me { display: none }
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 10px }
  .kpi { padding: 12px 14px } .kpi .ic { display: none } .kpi .l { padding-right: 0; font-size: 12px }
  .side { justify-content: space-between }
}
/* La página siempre es visible: la entrada solo desliza, nunca parte de opacidad 0 */
@keyframes deslizar { from { transform: translateY(6px) } to { transform: none } }
.content.enter > *, .doc, .checks > span { animation-name: deslizar !important; opacity: 1 !important }

a.fchip { text-decoration: none }
.pasos-lista { display: grid; gap: 4px }
.pasos-lista a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; color: inherit; text-decoration: none }
.pasos-lista a:hover { background: var(--panel-2) }
.pasos-lista .ok-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex: none; border: 2px solid var(--line) }
.pasos-lista .hecho .ok-dot { background: var(--ok); border-color: var(--ok); color: #fff }
.pasos-lista .hecho span:last-child { color: var(--muted); text-decoration: line-through }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px }
.galeria img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; display: block }

/* ======================= Versión 0.3: menú desplegable, notificaciones, sincronización, dashboard ======================= */
.notice.warn { background: var(--warn-soft) } .notice.warn .ni { color: var(--warn) }
.plat.wasi { color: var(--info) }
.linkbtn { background: none; border: 0; color: var(--accent); font-size: 12.5px; padding: 0 }
.btn.warnbtn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn) }

/* Menú lateral desplegable por grupos y modo compacto */
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.colapsar { background: none; border: 0; color: var(--side-muted); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; flex: none }
.colapsar:hover { background: rgba(255,255,255,.08); color: var(--side-fg) }
.navhead { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; color: var(--side-muted);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 6px 10px 4px; border-radius: 6px }
.navhead:hover { color: var(--side-fg) }
.navhead svg { width: 14px; height: 14px; transition: transform .25s var(--ease) }
.navgroup.cerrado .navhead svg { transform: rotate(-90deg) }
.navitems { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .28s var(--ease), opacity .2s }
.navitems > div { overflow: hidden; display: flex; flex-direction: column; gap: 2px }
.navgroup.cerrado .navitems { grid-template-rows: 0fr; opacity: .35 }
.app { transition: grid-template-columns .28s var(--ease) }
.app.compacta { grid-template-columns: 76px minmax(0,1fr) }
.app.compacta:not(.asomada) .side { padding-left: 10px; padding-right: 10px }
.app.compacta:not(.asomada) .side-top { flex-direction: column }
.app.compacta:not(.asomada) .brand b, .app.compacta:not(.asomada) .brand span, .app.compacta:not(.asomada) .officebadge > div, .app.compacta:not(.asomada) .navhead span, .app.compacta:not(.asomada) .nav .nt,
.app.compacta:not(.asomada) .me-link > span, .app.compacta:not(.asomada) .navhead svg { display: none }
.app.compacta:not(.asomada) .officebadge { justify-content: center; padding: 8px }
.app.compacta:not(.asomada) .nav { justify-content: center; padding: 10px 0 }
.app.compacta:not(.asomada) .nav .count { position: absolute; top: 2px; right: 4px; font-size: 10px; padding: 0 5px }
.app.compacta:not(.asomada) .navgroup.cerrado .navitems { grid-template-rows: 1fr; opacity: 1 }
.app.compacta:not(.asomada) .navhead { justify-content: center; padding: 4px 0; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0; min-height: 6px }
.app.compacta:not(.asomada) .me { flex-direction: column; padding: 8px 4px }

/* Notificaciones desplegables */
.notimenu { position: relative }
.notipanel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 30; overflow: hidden; animation: caer .18s var(--ease) }
@keyframes caer { from { transform: translateY(-6px); opacity: .4 } to { transform: none; opacity: 1 } }
.notihead { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2) }
.notilista { max-height: min(420px, 60vh); overflow-y: auto }
.notiitem { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 10px; padding: 11px 14px; color: inherit; text-decoration: none; font-size: 13px;
  border-bottom: 1px solid var(--line-2); transition: background .15s }
.notiitem:hover { background: var(--panel-2) }
.notiitem .u { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px }
.notiitem.read { color: var(--muted) } .notiitem.read .u { background: transparent }
.notiitem small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px }
.notiitem .tx { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.notifoot { display: block; text-align: center; padding: 10px; font-size: 13px; color: var(--accent); text-decoration: none; background: var(--panel-2) }

/* Barra de sincronización */
.syncbar { position: sticky; top: 57px; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 20px 0; animation: caer .2s var(--ease) }
.syncbar-in { display: flex; align-items: center; gap: 10px; font-size: 13px }
.syncbar .pct { margin-left: auto; color: var(--muted); font-size: 12px }
.syncbar .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: girar .8s linear infinite; flex: none }
.syncbar.hecho .spin { animation: none; border-color: var(--ok); background: var(--ok) }
.syncbar .track { height: 3px; margin: 8px -20px 0; background: var(--line-2); overflow: hidden; position: relative }
.syncbar .track i { position: absolute; inset: 0 auto 0 0; width: 5%; background: linear-gradient(90deg, var(--accent), #5FD6CA); transition: width .6s var(--ease) }
.syncbar .track i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: brillo 1.4s linear infinite }
@keyframes brillo { from { transform: translateX(-100%) } to { transform: translateX(100%) } }
.autosync { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 8px 10px 8px 12px; font-size: 13px }
.autosync small { display: block; color: var(--muted); font-size: 11.5px }

/* Página de acceso restringido */
.bloqueo { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background: var(--side); position: relative; overflow: hidden }
.bloqueo-fondo span { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; animation: flotar 12s ease-in-out infinite alternate }
.bloqueo-fondo span:nth-child(1) { width: 380px; height: 380px; background: #0D9488; top: -80px; left: -60px }
.bloqueo-fondo span:nth-child(2) { width: 300px; height: 300px; background: #2B5E93; bottom: -60px; right: -40px; animation-delay: -4s }
.bloqueo-fondo span:nth-child(3) { width: 220px; height: 220px; background: #6A4FB3; top: 40%; left: 60%; animation-delay: -8s }
@keyframes flotar { to { transform: translate(40px, -30px) scale(1.12) } }
.bloqueo-tarjeta { position: relative; max-width: 560px; width: 100%; background: var(--panel); border-radius: 18px; padding: 30px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 12px; animation: subir .5s var(--ease) both }
@keyframes subir { from { transform: translateY(18px) } to { transform: none } }
.bloqueo-marca .brand b { color: var(--fg) } .bloqueo-marca .brand span { color: var(--muted) }
.candado { color: var(--warn); width: 72px; height: 72px; border-radius: 20px; background: var(--warn-soft); display: grid; place-items: center }
.candado .arco { animation: abrir 2.4s var(--ease) infinite; transform-origin: 42px 28px }
@keyframes abrir { 0%, 55%, 100% { transform: none } 70% { transform: translateY(-4px) rotate(-14deg) } 85% { transform: none } }
.bloqueo-pasos { display: grid; gap: 10px; margin: 6px 0 }
.bloqueo-pasos > div { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--panel-2); font-size: 13px; color: var(--muted) }
.bloqueo-pasos b { display: block; color: var(--fg); margin-bottom: 2px }
.bloqueo-pasos .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 13px }
.bloqueo-acciones { display: flex; gap: 8px; flex-wrap: wrap }

/* Ingreso: lado izquierdo animado */
.brandside.animada { overflow: hidden }
.brandside .orbe { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5; pointer-events: none; animation: flotar 14s ease-in-out infinite alternate }
.brandside .o1 { width: 340px; height: 340px; background: #0D9488; top: -120px; right: -80px }
.brandside .o2 { width: 260px; height: 260px; background: #2B5E93; bottom: -90px; left: -60px; animation-delay: -6s }
.rotador { display: inline-grid; vertical-align: top }
.rotador em { grid-area: 1 / 1; font-style: normal; color: #5FD6CA; opacity: 0; transform: translateY(14px); animation: rotar 12s var(--ease) infinite }
.rotador em:nth-child(2) { animation-delay: 3s } .rotador em:nth-child(3) { animation-delay: 6s } .rotador em:nth-child(4) { animation-delay: 9s }
@keyframes rotar { 0% { opacity: 0; transform: translateY(14px) } 4%, 21% { opacity: 1; transform: none } 25%, 100% { opacity: 0; transform: translateY(-14px) } }
.flujo { display: flex; align-items: center; gap: 6px; position: relative; max-width: 440px }
.flujo .nodo { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1); font-size: 12px; min-width: 78px; animation: latir 3s ease-in-out infinite }
.flujo .nodo small { color: var(--side-muted); font-size: 10.5px }
.flujo .nodo.bis { background: rgba(13,148,136,.25); border-color: rgba(95,214,202,.5); color: #5FD6CA; animation-delay: .5s }
.flujo .nodo.wasi { animation-delay: 1s }
@keyframes latir { 0%, 100% { transform: none } 50% { transform: translateY(-3px) } }
.flujo .via { flex: 1; height: 2px; background: rgba(255,255,255,.12); position: relative; overflow: hidden; border-radius: 2px }
.flujo .via i { position: absolute; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: #5FD6CA; box-shadow: 0 0 8px #5FD6CA; animation: viajar 2.4s linear infinite }
.flujo .via i:nth-child(2) { animation-delay: .8s } .flujo .via i:nth-child(3) { animation-delay: 1.6s }
@keyframes viajar { from { left: -8px } to { left: 100% } }
.brandside.animada .bullets > span { animation: entrar .7s var(--ease) both; animation-delay: var(--d, 0s) }
@keyframes entrar { from { opacity: 0; transform: translateX(-14px) } to { opacity: 1; transform: none } }
.bullets .ico { color: #5FD6CA; flex: none; animation: girar 8s linear infinite; display: inline-block }
.cifras-vivas { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; max-width: 440px; position: relative }
.cifras-vivas > div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05) }
.cifras-vivas b { display: block; font-size: 24px; color: #fff; font-variant-numeric: tabular-nums }
.cifras-vivas small { color: var(--side-muted); font-size: 11.5px; line-height: 1.3; display: block }
.aviso-red { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--warn-soft); font-size: 13px; animation: subir .4s var(--ease) both }
.aviso-red-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--warn); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none }
.aviso-red p { margin: 4px 0 6px; color: var(--muted) } .aviso-red ul { margin: 0; padding-left: 18px; color: var(--muted) }

/* Licencia */
.licencia-resumen { display: flex; flex-direction: column; gap: 10px }
.licencia-resumen > div:first-child b { display: block; font-size: 26px; letter-spacing: -.02em }
.licencia-resumen ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 4px }

/* Comparación de coincidencias */
.comparar { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px }
.cand { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column }
.cand.red { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft) }
.cand-foto { width: 100%; aspect-ratio: 16 / 10; max-height: 170px; object-fit: cover; background: var(--panel-2); display: block }
.cand-foto.sin { display: grid; place-items: center; color: var(--faint); font-size: 13px; aspect-ratio: auto; height: 64px }
.cand-cuerpo { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1 }
.cand dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 2px 10px; margin: 4px 0 0; font-size: 12.5px }
.cand dt { color: var(--muted) } .cand dd { margin: 0 } .cand dd.igual { color: var(--ok); font-weight: 600 }
.cand-acc { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px }

/* Subpestañas (configuración, equipo) */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none }
.subtabs a { padding: 9px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; margin-bottom: -1px }
.subtabs a:hover { color: var(--fg) }
.subtabs a[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent) }
.requisito { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--info-soft); font-size: 13px }
.requisito p { margin-top: 4px; color: var(--muted) }
.req-ic { display: flex; gap: 6px; align-items: center; flex: none; background: var(--panel); border-radius: 10px; padding: 8px 10px }

/* Dashboard */
.dash-filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.dash-filtros .filters { flex: 1 } .dash-filtros select { width: auto; min-width: 170px }
.dash-filtros button.fchip { cursor: pointer }
.dash-cifras { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px }
.dash-kpi { border-radius: var(--r); animation: subir .45s var(--ease) both; animation-delay: calc(var(--i) * 40ms) }
.dash-kpi .l { padding-right: 0 }
.dash-kpi details { margin-top: 6px; font-size: 12.5px } .dash-kpi summary { color: var(--accent); cursor: pointer }
.dash-kpi ul { margin: 6px 0 0; padding-left: 16px; max-height: 180px; overflow-y: auto } .dash-kpi li a { color: inherit }
.dash-graficas { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px }
.barras { display: grid; gap: 8px }
.barra { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0,1fr) auto; gap: 10px; align-items: center; font-size: 12.5px }
.barra .et { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted) }
.barra .pista { height: 10px; background: var(--panel-2); border-radius: 6px; overflow: hidden }
.barra .pista i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 6px; animation: crecer .8s var(--ease) both; animation-delay: calc(var(--i) * 50ms) }
@keyframes crecer { from { width: 0 } }
.barras.columnas { grid-template-columns: repeat(12, minmax(0,1fr)); align-items: end; height: 170px; gap: 6px }
.barras.columnas .barra { display: flex; flex-direction: column-reverse; height: 100%; gap: 4px; text-align: center }
.barras.columnas .barra .et { font-size: 10.5px }
.barras.columnas .barra .pista { flex: 1; height: auto; width: 100%; display: flex; align-items: flex-end; background: none }
.barras.columnas .barra .pista i { width: 100%; height: var(--w); animation-name: subircol }
@keyframes subircol { from { height: 0 } }
.widget-opciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px }
.widget-opciones .opcion { align-items: flex-start; font-size: 13px }
.widget-opciones .opcion small { display: block; color: var(--muted); font-size: 12px }
.widget-opciones .opcion .chip { margin-left: auto; flex: none }

@media (max-width: 760px) {
  .side .navgroup, .side .colapsar { display: none !important }
  .syncbar { top: 0 }
  .autosync { width: 100% }
  .flujo .nodo { min-width: 0; padding: 8px } .cifras-vivas, .brandside.animada .bullets { display: none }
  .login .brandside.animada { gap: 16px; padding-block: 22px }
  .barras.columnas { height: 140px } .barras.columnas .barra .et { font-size: 9px }
}
@media (prefers-reduced-motion: reduce) { .rotador em { animation: none } .rotador em:first-child { opacity: 1; transform: none } }

/* Entorno de pruebas: imposible confundirlo con el real */
.banda-pruebas { position: sticky; top: 0; z-index: 40; background: repeating-linear-gradient(135deg, #A15C00 0 14px, #8A4F00 14px 28px); color: #fff;
  font-size: 12.5px; text-align: center; padding: 6px 12px; letter-spacing: .01em }
body.entorno-pruebas .side { top: 31px; height: calc(100vh - 31px) }
body.entorno-pruebas .top { top: 31px }

/* ======================= Versión 0.4: marca, navegación suave, detalle del dashboard, consola, ayuda ======================= */
.brand .mk.mk-logo { background: none; width: 34px; height: 34px; border-radius: 9px; overflow: hidden }
.brand .mk.mk-logo svg { display: block }
.nav .count.warn { background: var(--warn) }
.cfg-cols { align-items: start }
.barra-guardar { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 4px;
  padding: 12px 16px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow) }
.barra-guardar .muted { font-size: 12.5px; margin-right: auto }

/* Barra de filtros (inmuebles, detalle del dashboard, consola) */
.barra-filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.barra-filtros .inp { width: auto; min-width: 160px; flex: 0 1 auto }
.barra-filtros input[type="search"] { flex: 1 1 240px }
.barra-filtros .inp.corto, .inp.corto { min-width: 0; width: 120px }
.resumen-lista { font-size: 13px; margin: -4px 0 0 }

/* Dashboard: todo se puede abrir */
a.dash-kpi { color: inherit; text-decoration: none; cursor: pointer; transition: transform .18s var(--ease), border-color .18s, box-shadow .18s }
a.dash-kpi:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow) }
a.dash-kpi.sin-enlace { cursor: default } a.dash-kpi.sin-enlace:hover { transform: none; border-color: var(--line); box-shadow: none }
.ver-detalle { margin-top: 6px; font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .15s }
a.dash-kpi:hover .ver-detalle, a.dash-kpi:focus-visible .ver-detalle { opacity: 1 }
a.barra { color: inherit; text-decoration: none; border-radius: 8px; padding: 3px 6px; margin: -3px -6px; transition: background .15s }
a.barra:hover { background: var(--panel-2) } a.barra:hover .pista i { filter: brightness(1.12) }
.dash-graficas .ph small { display: block; font-weight: 400; font-size: 12px; margin-top: 2px }
.dash-resumen { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px }
tfoot td { border-top: 2px solid var(--line); background: var(--panel-2) }

/* Navegación suave: barra fina de carga arriba */
.carga-nav { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--accent), #5FD6CA); opacity: 0;
  transition: width .6s var(--ease), opacity .3s }
.carga-nav.activa { width: 75%; opacity: 1; transition: width 1.6s var(--ease), opacity .1s }

/* Consola del desarrollador */
.consola-dev .officebadge .logo { background: var(--warn); color: #fff; font-size: 11px }

/* Centro de ayuda */
.ayuda { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start }
.ayuda-indice { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px }
.ayuda-indice nav { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px }
.ayuda-indice nav a { padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13.5px }
.ayuda-indice nav a:hover { background: var(--panel-2) }
.ayuda-indice nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600 }
.ayuda-contacto { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--panel-2) }
.ayuda-contacto b { color: var(--fg) } .ayuda-contacto a { color: var(--accent) }
.ayuda-articulo { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; min-width: 0 }
.doc-md { margin-top: 18px; line-height: 1.7; font-size: 14.5px }
.doc-md h2 { font-size: 18px; margin: 26px 0 8px; scroll-margin-top: 80px } .doc-md h3 { font-size: 15px; margin: 20px 0 6px; scroll-margin-top: 80px }
.doc-md p, .doc-md ul, .doc-md ol { margin: 0 0 12px } .doc-md li { margin-bottom: 4px }
.doc-md table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 13.5px }
.doc-md th, .doc-md td { border-bottom: 1px solid var(--line-2); padding: 8px 10px; text-align: left; vertical-align: top }
.doc-md th { background: var(--panel-2); font-weight: 600 }
.doc-md code { font-family: var(--mono); background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: .92em }
.doc-md a { color: var(--accent) }
.ayuda-pasos { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; flex-wrap: wrap }
.ayuda-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 18px }
.ayuda-tarjeta, .ayuda-resultado { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: inherit;
  text-decoration: none; transition: border-color .15s, transform .15s var(--ease) }
.ayuda-tarjeta:hover, .ayuda-resultado:hover { border-color: var(--accent); transform: translateY(-2px) }
.ayuda-tarjeta span, .ayuda-resultado span { color: var(--muted); font-size: 13px }
.ayuda-resultado { margin-top: 10px } .ayuda-resultado small { color: var(--accent); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em }

/* Asistente de ayuda flotante */
.asistente { position: fixed; right: 22px; bottom: 22px; z-index: 45 }
.asistente-boton { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 22px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(13,148,136,.45); transition: transform .18s var(--ease) }
.asistente-boton:hover { transform: scale(1.06) }
.asistente-panel { position: absolute; right: 0; bottom: 64px; width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px)); display: flex;
  flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: caer .2s var(--ease) }
.asistente-cab { display: flex; gap: 10px; align-items: center; padding: 14px 16px; background: var(--side); color: var(--side-fg) }
.asistente-cab small { display: block; color: var(--side-muted); font-size: 11.5px } .asistente-cab .linkbtn { margin-left: auto; color: var(--side-fg); font-size: 16px }
.asistente-pregunta { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line-2) }
.asistente-respuestas { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px }
.asistente-sugerida { text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px }
.asistente-sugerida:hover { border-color: var(--accent) }
.asistente-respuesta { display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none }
.asistente-respuesta:hover { border-color: var(--accent) } .asistente-respuesta small { color: var(--accent); font-size: 11px }
.asistente-respuesta span { color: var(--muted) }
.asistente-pie { display: block; padding: 10px; text-align: center; font-size: 12.5px; color: var(--accent); text-decoration: none; background: var(--panel-2) }

@media (max-width: 860px) { .ayuda { grid-template-columns: minmax(0,1fr) } .ayuda-indice { position: static } .ayuda-articulo { padding: 20px } }
@media (max-width: 760px) { .asistente { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)) } .barra-filtros .inp { flex: 1 1 100% } }

.asistente-panel[hidden], .notipanel[hidden], .syncbar[hidden] { display: none !important }

/* Ayuda por campo: "?" junto a cada dato y globo al pasar por lo que falta */
.que { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 4px; border-radius: 50%; vertical-align: 1px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; outline: none }
.que:hover, .que:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff }
.globo { position: absolute; z-index: 30; width: 290px; padding: 10px 12px; border-radius: 10px; background: var(--side); color: var(--side-fg);
  font-size: 12.5px; font-weight: 400; line-height: 1.5; text-transform: none; letter-spacing: 0; text-align: left; white-space: normal;
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s }
.que .globo { left: 50%; bottom: calc(100% + 8px); transform: translateX(-30%) }
.que:hover .globo, .que:focus .globo { opacity: 1; visibility: visible }
.falta-item { position: relative }
.falta-item .globo { right: calc(100% + 10px); top: 50%; transform: translateY(-50%) }
.falta-item:hover .globo, .falta-item:focus-visible .globo { opacity: 1; visibility: visible }
@media (max-width: 860px) { .falta-item .globo { right: 0; top: calc(100% + 4px); transform: none; width: min(290px, 80vw) } .que .globo { width: min(260px, 75vw) } }

/* Tablero del dashboard: 12 columnas, cada cuadro con su ancho y alto; se reordena y redimensiona arrastrando */
.tablero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 56px; grid-auto-flow: dense; gap: 12px }
.pieza { position: relative; grid-column: span var(--ancho); grid-row: span var(--alto); min-width: 0; min-height: 0;
  animation: subir .45s var(--ease) both; animation-delay: calc(var(--i) * 30ms) }
.pieza > .kpi, .pieza > .panel { height: 100%; margin: 0; overflow: auto }
.pieza > .panel { display: flex; flex-direction: column } .pieza > .panel > .pb { flex: 1; overflow: auto }
.pieza-asa, .pieza-tam { display: none }
.tablero.organizando .pieza { animation: none; cursor: default }
.tablero.organizando .pieza > .kpi, .tablero.organizando .pieza > .panel { outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -2px; pointer-events: none; user-select: none }
.tablero.organizando .pieza-asa { display: grid; place-items: center; position: absolute; z-index: 3; top: 8px; right: 8px; width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 16px; cursor: grab; touch-action: none }
.tablero.organizando .pieza-asa:hover, .tablero.organizando .pieza-asa:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff }
.tablero.organizando .pieza-tam { display: block; position: absolute; z-index: 3; right: 3px; bottom: 1px; padding: 2px 4px; font-size: 14px; line-height: 1;
  color: var(--accent); cursor: nwse-resize; touch-action: none; user-select: none }
.pieza.arrastrando { z-index: 5; opacity: .85 } .pieza.arrastrando > * { box-shadow: var(--shadow-lg) }
.pieza.arrastrando .pieza-asa { cursor: grabbing }
.pieza.cambiando > * { outline-style: solid !important }
.tablero-barra { position: sticky; top: 64px; z-index: 6; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px;
  border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 13px }
.tablero-barra > span:first-child { flex: 1 1 320px } .tablero-asa-ej { color: var(--accent); font-weight: 700 }
.tablero-estado { font-size: 12px; min-width: 70px; text-align: right }
@media (max-width: 760px) {
  .tablero { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto }
  .pieza { grid-column: span 2; grid-row: auto } .pieza-cifra { grid-column: span 1 }
  .pieza > .kpi, .pieza > .panel { height: auto; max-height: 520px }
  .tablero.organizando .pieza-tam { display: none }
}
.tablero-barra[hidden] { display: none }
.pieza { container-type: inline-size } .pieza > .kpi { overflow: hidden }
.pieza > .kpi .v { font-size: clamp(22px, 11cqi, 34px) }

/* Menú compacto: al pasar el cursor se asoma completo por encima del contenido y se vuelve a ocultar al salir */
.app.compacta.asomada .side { width: 248px; z-index: 40; box-shadow: 12px 0 32px rgba(8, 20, 33, .28); padding-left: 14px; padding-right: 14px }
.app.compacta .side { transition: width .22s var(--ease), box-shadow .22s }

/* Barras de desplazamiento con los colores de la marca */
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent }
.side { scrollbar-width: thin; scrollbar-color: transparent transparent }
.side:hover { scrollbar-color: rgba(255, 255, 255, .22) transparent }
::-webkit-scrollbar { width: 10px; height: 10px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--accent) 70%, transparent) }
.side::-webkit-scrollbar-thumb { background-color: transparent }
.side:hover::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .22) }
::-webkit-scrollbar-button { display: none; width: 0; height: 0 }

/* "?" de cada indicador del dashboard: explica de dónde sale el dato */
.pieza:hover, .pieza:focus-within { z-index: 4 }
.pieza-que { position: absolute; z-index: 2; top: 10px; right: 10px }
.pieza-que .que .globo { left: auto; right: -6px; transform: none }
.tablero.organizando .pieza-que, .tablero.organizando .que { display: none }
.pieza > .panel { overflow: visible } .pieza > .panel > .tablewrap { flex: 1; min-height: 0; overflow: auto }
.pieza .ph h2 .que { vertical-align: 2px }

/* Red de aliados */
.galeria-aliado { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity }
.galeria-aliado .foto-aliado { scroll-snap-align: start }
.galeria-aliado img { width: 168px; height: 126px; object-fit: cover; border-radius: 10px; display: block; background: var(--panel-2) }
.galeria-aliado.ordenable .foto-aliado:hover img { outline: 2px solid var(--accent); outline-offset: 2px }
#form-aliado textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg) }
.foto-aliado { position: relative; margin: 0 } .galeria-aliado.ordenable .foto-aliado { cursor: grab }
.foto-aliado.arrastrando { opacity: .4 }
.foto-pos { position: absolute; top: 6px; left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(8, 20, 33, .72); color: #fff; font-size: 11px; font-weight: 600 }
.foto-flechas { position: absolute; bottom: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s }
.foto-aliado:hover .foto-flechas, .foto-aliado:focus-within .foto-flechas { opacity: 1 }
.foto-mover { width: 26px; height: 26px; border-radius: 7px; border: 0; background: rgba(255, 255, 255, .92); color: #0B2236; font-size: 16px; line-height: 1; cursor: pointer }
.foto-mover:hover { background: var(--accent); color: #fff }
@media (hover: none) { .foto-flechas { opacity: 1 } }
.cola-revision { display: flex; align-items: center; gap: 12px } .cola-revision > span { flex: 1 }
.acciones-wasi { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2) }
.eliminar-wasi summary { cursor: pointer; color: var(--muted); font-size: 12.5px } .eliminar-wasi p { font-size: 12.5px; margin: 6px 0 0 }

/* WASI casi en tiempo real: indicador discreto y aviso de cambios */
.wasi-al-dia { margin-left: auto; margin-right: 10px; font-size: 12px; color: var(--muted); white-space: nowrap }
.wasi-al-dia:not(:empty)::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok, #16a34a); margin-right: 6px; vertical-align: 1px }
.wasi-cambios { position: fixed; z-index: 50; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center;
  padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--side); color: var(--side-fg); box-shadow: var(--shadow-lg); font-size: 13.5px }
.wasi-cambios[hidden] { display: none }
@media (max-width: 760px) { .wasi-al-dia { display: none } .wasi-cambios { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) } }

/* Pantalla de carga a pantalla completa (acciones que tardan) */
.carga-total { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% 30%, rgba(20, 184, 166, .16), transparent 60%), rgba(8, 20, 33, .78);
  backdrop-filter: blur(6px); animation: carga-aparece .25s ease-out both }
.carga-total[hidden] { display: none }
body.cargando-todo { overflow: hidden }
@keyframes carga-aparece { from { opacity: 0 } to { opacity: 1 } }
.carga-caja { width: min(440px, 100%); text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: carga-sube .4s cubic-bezier(.2, .8, .2, 1) both }
@keyframes carga-sube { from { transform: translateY(14px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.carga-ilustracion { position: relative; width: 132px; height: 132px; margin-bottom: 8px; color: #5FD6CA }
.carga-anillo { position: absolute; inset: 0; width: 100%; height: 100%; animation: carga-gira 1.4s linear infinite }
@keyframes carga-gira { to { transform: rotate(360deg) } }
.carga-orbita { position: absolute; inset: 10px; animation: carga-gira 3.2s linear infinite reverse }
.carga-orbita i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #5FD6CA; box-shadow: 0 0 12px #14B8A6 }
.carga-orbita i:nth-child(1) { top: 0; left: calc(50% - 4px) }
.carga-orbita i:nth-child(2) { bottom: 12%; left: 6%; opacity: .7; transform: scale(.8) }
.carga-orbita i:nth-child(3) { bottom: 12%; right: 6%; opacity: .45; transform: scale(.6) }
.carga-icono { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; color: #fff;
  animation: carga-late 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 14px rgba(20, 184, 166, .6)) }
@keyframes carga-late { 0%, 100% { transform: translateY(0) scale(1) } 50% { transform: translateY(-5px) scale(1.06) } }
.carga-titulo { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em }
.carga-frase { margin: 0; min-height: 22px; font-size: 15px; color: rgba(255, 255, 255, .82) }
.carga-frase.entra { animation: carga-frase .45s ease-out both }
@keyframes carga-frase { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.carga-barra { position: relative; width: 100%; height: 6px; margin-top: 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden }
.carga-barra i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #14B8A6, #5FD6CA);
  transition: width .6s ease }
.carga-total[data-modo="continuo"] .carga-barra i { width: 38% !important; animation: carga-barrido 1.5s ease-in-out infinite }
@keyframes carga-barrido { from { left: -40% } to { left: 102% } }
.carga-total[data-modo="listo"] .carga-icono { animation: none } .carga-total[data-modo="listo"] .carga-anillo { animation-duration: 3s }
.carga-pct { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .7); min-height: 18px }
.carga-nota { margin: 4px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .6) }
@media (prefers-reduced-motion: reduce) {
  .carga-anillo, .carga-orbita, .carga-icono, .carga-frase.entra, .carga-total[data-modo="continuo"] .carga-barra i { animation: none }
  .carga-total[data-modo="continuo"] .carga-barra i { left: 0; width: 60% !important }
}

/* Mapa de Google en las fichas */
.mapa-bisagra { margin: 6px 0 14px }
.mapa-herramientas { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px }
.mapa-ayuda { font-size: 12.5px }
.mapa-lienzo { height: 320px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--panel-2) }
.mapa-estado { font-size: 12.5px; margin: 6px 0 0; min-height: 16px } .mapa-nota { font-size: 12px; margin: -8px 0 12px }
@media (max-width: 760px) { .mapa-lienzo { height: 260px } }

/* De dónde sale el tablero que se ve: personal o de la inmobiliaria */
.tablero-origen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; padding: 8px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line) }
.tablero-origen > span { flex: 1 1 320px } .tablero-origen form { display: flex; gap: 8px; flex-wrap: wrap }
.tablero-origen.personal { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent) }
.modulos-licencia { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100% }
.modulos-licencia > b { width: 100% } .modulos-licencia > small { width: 100%; margin-top: -6px }
.modulos-licencia .opcion { padding: 8px 12px } .modulos-licencia .opcion small { display: block; color: var(--muted) }

/* Opciones de publicación en WASI (fichas) */
.publicacion-wasi { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px }
.publicacion-wasi .opcion { padding: 8px 12px } .publicacion-wasi textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg) }
.portales-wasi summary { cursor: pointer; padding: 6px 0 } .portales-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin: 6px 0 }
.portales-lista label { display: flex; gap: 6px; align-items: center; font-size: 13px }

/* Autoguardado: aviso discreto abajo a la izquierda mientras se guarda lo que se escribe */
.autoguardado { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--side); color: var(--side-fg);
  font-size: 12.5px; padding: 7px 12px; border-radius: 999px; box-shadow: 0 6px 20px rgba(11,34,54,.18); opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none }
.autoguardado.visible { opacity: 1; transform: none }
.autoguardado.ok { background: var(--ok) ; color: #fff }
.autoguardado.error { background: var(--bad); color: #fff }
@media (max-width: 760px) { .autoguardado { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) } }

/* Exclusividad del inmueble del aliado: visible de un vistazo */
.exclusividad { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 14px; border-radius: 10px; font-size: 16px; font-weight: 650 }
.exclusividad::before { content: ""; width: 10px; height: 10px; border-radius: 50% }
.exclusividad.si { background: #EFE7FB; color: #5B2E9E }
.exclusividad.si::before { background: #7C4DCC }
.exclusividad.no { background: var(--panel-2); color: var(--muted) }
.exclusividad.no::before { background: var(--faint) }

/* Visor de fotos: la foto en grande en la misma página */
.foto-aliado img { cursor: zoom-in }
.visor { position: fixed; inset: 0; z-index: 80; background: rgba(6,16,26,.92); display: flex; align-items: center; justify-content: center }
.visor[hidden] { display: none }
.visor img { max-width: min(92vw, 1400px); max-height: 84vh; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.4) }
.visor button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; border-radius: 999px;
  width: 48px; height: 48px; font-size: 30px; line-height: 1; display: grid; place-items: center }
.visor button:hover, .visor button:focus-visible { background: rgba(255,255,255,.25) }
.visor-cerrar { top: 16px; right: 16px }
.visor-nav.ant { left: 16px; top: 50%; transform: translateY(-50%) }
.visor-nav.sig { right: 16px; top: 50%; transform: translateY(-50%) }
.visor-cuenta { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; background: rgba(0,0,0,.35);
  padding: 4px 12px; border-radius: 999px }
@media (max-width: 760px) { .visor-nav { width: 40px; height: 40px; font-size: 24px } .visor img { max-width: 100vw; border-radius: 0 } }

.ubicacion { display: flex; gap: 8px; flex-wrap: wrap }
.ubicacion select { flex: 1 1 160px; min-width: 0 }

.field.completo .val input, .field.completo .val select, .field.completo .val textarea { border-color: var(--ok); background: var(--ok-soft) }
.missing-list a.hecho { text-decoration: line-through; opacity: .55 }
