/* SIONO 360 — panel de administración */
:root {
  /* Tokens del manual de marca SIONO (tema azul) */
  --azul-siono: #1a324f;
  --azul-noche: #0f1f33;
  --azul-medio: #223f63;
  --arena: #c4b5a7;
  --arena-claro: #eae3db;
  --arena-texto: #7a6a5b;
  --marfil: #faf8f5;
  --ink-muted: #c9d2dc;
  --line-token: #3a5577;
  /* Alias usados en el resto de la hoja */
  --bg: var(--azul-siono);
  --bg-2: var(--azul-noche);
  --panel: var(--azul-medio);
  --panel-2: #29496f;
  --line: var(--line-token);
  --line-2: var(--line-token);
  --text: #ffffff;
  --muted: var(--ink-muted);
  --beige: var(--arena);
  --beige-2: var(--arena);
  --ok: #4fc98c;
  --warn: #e8a93a;
  --bad: #e0625c;
  --radius: 8px;
  --serif: 'Cormorant Garamond', Cormorant, Georgia, serif;
  --sans: Montserrat, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.gold { color: var(--beige); font-weight: 600; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.end { justify-content: flex-end; }
.ml-auto { margin-left: auto; }
.mt { margin-top: 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.eyebrow {
  margin: 0 0 8px; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--beige); font-weight: 600;
}
kbd {
  font: 600 11px var(--sans); padding: 1px 6px; border-radius: 5px;
  background: rgba(255, 255, 255, .1); border: 1px solid var(--line-2);
}

/* ---------- Marca ---------- */
.brand-script {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  letter-spacing: .01em; color: #fff; line-height: 1;
}
.brand-lockup { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 26px; }
.brand-lockup .brand-script { font-size: 54px; }
.brand-sub { font-size: 10.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--beige); }
.brand-mini { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand-mini .brand-script { font-size: 28px; }
.tag {
  font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--bg);
  background: var(--beige); padding: 2px 7px; border-radius: 99px;
}
.display {
  font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5vw, 52px);
  line-height: 1.02; margin: 0; letter-spacing: -.01em;
}
.display em { color: var(--beige); font-style: italic; }

/* ---------- Botones ---------- */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: 600 13px var(--sans); letter-spacing: .01em; cursor: pointer; text-decoration: none;
  transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s, color .25s;
  white-space: nowrap; color: var(--text); background: none;
}
.btn:active { transform: scale(.97); }
.btn.lg { --h: 48px; padding: 0 26px; font-size: 14px; }
.btn.sm { --h: 34px; padding: 0 14px; font-size: 12.5px; }
.btn.xs { --h: 28px; padding: 0 12px; font-size: 12px; }
.btn.primary {
  background: linear-gradient(135deg, #e6d3b1, var(--beige) 45%, var(--beige-2));
  color: #111827; box-shadow: 0 6px 24px -8px rgba(216, 195, 160, .55);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -8px rgba(216, 195, 160, .7); }
.btn.ghost { border-color: var(--line-2); background: var(--panel); }
.btn.ghost:hover { border-color: rgba(216, 195, 160, .5); background: var(--panel-2); }
.btn.link { padding: 0 6px; color: var(--muted); }
.btn.link:hover { color: var(--text); }
.btn.danger-ghost { color: #ff9c99; border-color: rgba(239, 100, 97, .3); }
.btn.danger-ghost:hover { background: rgba(239, 100, 97, .12); }
.btn:focus-visible, .tool:focus-visible, .tab:focus-visible { outline: 2px solid var(--beige); outline-offset: 2px; }
.plus { font-size: 20px; font-weight: 400; line-height: 0; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; font: 500 14px var(--sans); color: var(--text);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; transition: border-color .2s, background .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--beige); background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(216, 195, 160, .15);
}
select option { background: var(--bg-2); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 40px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .25s; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .25s var(--ease);
}
.switch input:checked + .track { background: var(--beige-2); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--beige); outline-offset: 2px; }

.alert { padding: 12px 16px; border-radius: 12px; font-weight: 500; margin: 0 0 16px; }
.alert.err { background: rgba(239, 100, 97, .12); border: 1px solid rgba(239, 100, 97, .35); color: #ffb3b1; }
.alert.ok { background: rgba(62, 207, 142, .1); border: 1px solid rgba(62, 207, 142, .35); color: #9ff0c8; }

/* ---------- Inicio de sesión ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.auth-bg .grid {
  position: absolute; inset: -50%;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(800px) rotateX(62deg) translateY(-10%);
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 60%);
  animation: gridMove 18s linear infinite;
}
@keyframes gridMove { to { background-position: 0 64px, 64px 0; } }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.orb.o1 { width: 520px; height: 520px; background: #1f3564; top: -160px; left: -120px; animation: float 16s ease-in-out infinite; }
.orb.o2 { width: 420px; height: 420px; background: #6a5535; bottom: -160px; right: -80px; opacity: .35; animation: float 20s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translate(40px, 30px) scale(1.08); } }
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 400px; padding: 40px 32px;
  background: rgba(13, 21, 38, .72); border: 1px solid var(--line-2); border-radius: 24px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.auth-card h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 0 0 6px; text-align: center; }
.auth-card > p { text-align: center; margin: 0 0 22px; }

/* ---------- Estructura del panel ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; background: rgba(8, 13, 24, .8); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.container { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }

.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.tour-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s;
}
.tour-card:hover { transform: translateY(-4px); border-color: rgba(216, 195, 160, .35); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .7); }
.tour-cover { display: block; position: relative; aspect-ratio: 2 / 1; overflow: hidden; background: var(--bg-2); }
.tour-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tour-card:hover .tour-cover img { transform: scale(1.08) translateX(-3%); }
.cover-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.pill {
  position: absolute; left: 12px; bottom: 12px; font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 99px; background: rgba(8, 13, 24, .7); backdrop-filter: blur(8px); border: 1px solid var(--line-2);
}
.tour-body { padding: 18px 18px 16px; }
.tour-body h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.tour-body p { margin: 0 0 14px; }

.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--line-2); border-radius: 24px; background: var(--panel); }
.empty h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 22px 0 6px; }
.empty p { max-width: 440px; margin: 0 auto 24px; }
.empty-orb {
  width: 110px; height: 110px; margin: 0 auto; border-radius: 50%; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(216, 195, 160, .35), rgba(22, 35, 63, .6) 60%);
  border: 1px solid rgba(216, 195, 160, .4);
}
.empty-orb::before, .empty-orb::after {
  content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid rgba(216, 195, 160, .45);
  animation: ringY 5s linear infinite;
}
.empty-orb::after { animation-duration: 7s; animation-direction: reverse; transform: rotateX(70deg); }
@keyframes ringY { from { transform: rotateY(0) rotateX(0); } to { transform: rotateY(360deg) rotateX(0); } }
.empty-orb span { font-family: var(--serif); font-size: 26px; font-style: italic; color: var(--beige); }

/* ---------- Modales ---------- */
dialog.modal {
  width: min(460px, calc(100vw - 32px)); padding: 28px; border-radius: 22px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .8);
}
dialog.modal::backdrop { background: rgba(3, 6, 12, .65); backdrop-filter: blur(6px); }
dialog.modal[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
dialog.modal h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 26px; }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 13px;
  background: #1a2542; border: 1px solid var(--line-2); box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .6);
  transition: opacity .3s, transform .35s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(62, 207, 142, .45); }
.toast.err { border-color: rgba(239, 100, 97, .5); color: #ffc0be; }

/* ---------- Animación de entrada ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease) var(--d, 0ms), transform .8s var(--ease) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* =================================================================
   EDITOR
   ================================================================= */
body.editor { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.editor .topbar { position: relative; padding: 10px 16px; }
.ed-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ed-title strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-state { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--panel-2); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.save-state[data-state=busy]::before { background: var(--warn); animation: blink 1s infinite; }
.save-state[data-state=err] { color: #ffb3b1; }
.save-state[data-state=err]::before { background: var(--bad); }
@keyframes blink { 50% { opacity: .2; } }

.ed-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr 300px; }
.ed-side, .ed-inspector { background: var(--bg-2); overflow-y: auto; min-height: 0; }
.ed-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.ed-inspector { border-left: 1px solid var(--line); padding: 18px 16px; }
.tabs { display: flex; padding: 10px 10px 0; gap: 4px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.tab {
  flex: 1; background: none; border: 0; color: var(--muted); font: 600 12.5px var(--sans); padding: 10px 6px 12px; cursor: pointer;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--beige); }
.tab-panel { display: none; padding: 16px; }
.tab-panel.active { display: block; animation: fadeIn .35s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; text-align: center; cursor: pointer;
  border: 1.5px dashed rgba(216, 195, 160, .4); border-radius: 16px; background: rgba(216, 195, 160, .04);
  transition: background .25s, border-color .25s, transform .25s var(--ease);
}
.dropzone:hover, .dropzone.over { background: rgba(216, 195, 160, .1); border-color: var(--beige); }
.dropzone.over { transform: scale(1.02); }
.dz-icon { font-size: 22px; color: var(--beige); line-height: 1; }
.upload-queue { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.uq-item { font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.uq-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq-st { color: var(--muted); }
.uq-item .bar { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.uq-item .bar i { display: block; height: 100%; width: 0; background: var(--beige); transition: width .3s; }
.uq-item.done .bar i { background: var(--ok); }
.uq-item.fail .bar i { background: var(--bad); }
.uq-item.fail .uq-st { color: #ffb3b1; }

.scene-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scene-item {
  display: grid; grid-template-columns: 76px 1fr; gap: 4px 10px; padding: 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; background: var(--panel); transition: background .2s, border-color .2s;
}
.scene-item:hover { background: var(--panel-2); }
.scene-item.active { border-color: rgba(216, 195, 160, .55); background: rgba(216, 195, 160, .08); }
.scene-item img { width: 76px; height: 38px; object-fit: cover; border-radius: 7px; grid-row: span 2; }
.si-body { min-width: 0; display: flex; flex-direction: column; }
.si-body strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-actions { display: flex; gap: 2px; opacity: .45; transition: opacity .2s; }
.scene-item:hover .si-actions, .scene-item.active .si-actions { opacity: 1; }
.si-actions button {
  width: 24px; height: 22px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--text);
  cursor: pointer; font-size: 11px; line-height: 1;
}
.si-actions button:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.si-actions button:disabled { opacity: .3; cursor: default; }
.si-actions .danger:hover { background: rgba(239, 100, 97, .3) !important; }

.slug-row { display: flex; flex-direction: column; gap: 4px; }
.slug-row .muted { word-break: break-all; }
#embed-code { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Visor del editor */
.ed-stage { position: relative; min-width: 0; background: #000; }
.pano { position: absolute; inset: 0; }
.pano.placing, .pano.placing .pnlm-dragfix, .pano.placing .pnlm-grab { cursor: crosshair !important; }
.pano.lot-hover .pnlm-dragfix, .pano.lot-hover .pnlm-grab { cursor: pointer !important; }
.tool-bar {
  position: absolute; z-index: 6; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: rgba(8, 13, 24, .72); border: 1px solid var(--line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tool {
  display: flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--text); cursor: pointer;
  font: 600 12.5px var(--sans); padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s;
}
.tool:hover { background: rgba(255, 255, 255, .08); }
.tool.active { background: var(--beige); color: #111827; }
.ic { width: 16px; height: 16px; display: inline-block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic-arrow { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E"); }
.ic-info { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.01'/%3E%3C/svg%3E"); }
.ic-lot { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M4 7l7-3 9 4-2 11-12 1z'/%3E%3C/svg%3E"); }
.mode-hint {
  position: absolute; z-index: 6; top: 66px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 8px 10px 8px 16px; border-radius: 14px; font-size: 12.5px;
  background: rgba(22, 35, 63, .88); border: 1px solid rgba(216, 195, 160, .35); backdrop-filter: blur(10px);
  animation: fadeIn .3s var(--ease);
}
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 16px; color: var(--muted); background: radial-gradient(ellipse at center, #111b31, #05080f); }

/* Inspector */
.insp-block + .insp-block:not(:empty) { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.insp-block .field { margin-bottom: 12px; }
.btn-col { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.btn-col .btn { justify-content: flex-start; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mini-list li {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px;
  background: var(--panel); border: 1px solid transparent; transition: background .2s, border-color .2s;
}
.mini-list li:hover { background: var(--panel-2); }
.mini-list li.on { border-color: rgba(216, 195, 160, .5); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.st-disponible, .chip.st-disponible i { background: var(--ok); }
.dot.st-reservado, .chip.st-reservado i { background: var(--warn); }
.dot.st-vendido, .chip.st-vendido i { background: var(--bad); }
.lot-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--panel-2); }
.chip i { width: 7px; height: 7px; border-radius: 50%; }
.status-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); margin-bottom: 12px; }
.seg { border: 0; background: none; color: var(--muted); font: 600 12px var(--sans); padding: 8px 4px; border-radius: 9px; cursor: pointer; transition: background .2s, color .2s; }
.seg:hover { color: var(--text); }
.seg.on.st-disponible { background: rgba(62, 207, 142, .2); color: #8ff0c1; }
.seg.on.st-reservado { background: rgba(242, 184, 75, .2); color: #ffd98f; }
.seg.on.st-vendido { background: rgba(239, 100, 97, .2); color: #ffaaa8; }

@media (max-width: 1100px) {
  .ed-layout { grid-template-columns: 260px 1fr; }
  .ed-inspector { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); max-height: 40vh; }
  body.editor { height: auto; min-height: 100vh; overflow: auto; }
  .ed-layout { grid-template-rows: 70vh auto; }
}
@media (max-width: 720px) {
  .ed-layout { grid-template-columns: 1fr; grid-template-rows: auto 60vh auto; }
  .ed-side { border-right: 0; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .container { padding: 28px 16px 60px; }
  .tool { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Portada ---------- */
.home-hero { position: relative; z-index: 1; max-width: 720px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.home-hero .display { font-size: clamp(40px, 7vw, 72px); }
.home-hero p.muted { font-size: 16px; max-width: 540px; margin: 0; }
.home-hero .empty-orb { margin-bottom: 10px; }


/* =================================================================
   Ajustes del manual de marca SIONO
   ================================================================= */
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .3em; color: var(--arena); }
.display { font-family: var(--sans); font-weight: 700; letter-spacing: -.03em; line-height: 1.06; font-size: clamp(32px, 4.4vw, 48px); }
.bajada { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 26px; line-height: 1.25; color: var(--ink-muted); margin: 6px 0 0; }
.descripcion { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 20px; line-height: 1.35; color: var(--ink-muted); }

.btn { border-radius: var(--radius); }
.btn.primary { background: var(--arena); color: var(--azul-siono); box-shadow: none; }
.btn.primary:hover { background: #d0c3b7; box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .6); }
.btn.ghost { background: transparent; border-color: var(--ink-muted); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); border-color: #fff; }
.btn.danger-ghost { color: #ffc9c6; border-color: rgba(224, 98, 92, .6); }
.btn:focus-visible, .tool:focus-visible, .tab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

input:not([type=checkbox]):not([type=file]), select, textarea { background: var(--azul-noche); border-color: var(--ink-muted); border-radius: var(--radius); }
input:focus, select:focus, textarea:focus { border-color: #fff; background: var(--azul-noche); box-shadow: 0 0 0 3px rgba(196, 181, 167, .25); }
select option { background: var(--azul-noche); }
.switch input:checked + .track { background: var(--arena); }
.switch input:checked + .track::after { background: var(--azul-siono); }

/* Logo e isotipo (nunca se escribe "SIONO" con una fuente) */
.logo { display: block; height: auto; }
.logo-login { width: 190px; margin: 0 auto 28px; }
.logo-top { height: 30px; width: auto; }
.brand-mini { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.tag { border-radius: 4px; background: var(--arena); color: var(--azul-siono); letter-spacing: .2em; padding: 3px 7px 3px 9px; }
.isotipo-deco {
  position: fixed; z-index: 0; pointer-events: none; opacity: 0;
  width: min(78vh, 720px); right: max(-18vh, -180px); bottom: -14vh;
  animation: decoIn 1.6s var(--ease) .2s forwards;
}
@keyframes decoIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

body.auth { background: var(--azul-siono); }
.auth-card { background: var(--azul-noche); border: 1px solid var(--line-token); border-radius: var(--radius); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7); backdrop-filter: none; -webkit-backdrop-filter: none; }
.auth-card h1 { font-family: var(--sans); font-weight: 600; font-size: 24px; letter-spacing: -.01em; }
.auth-card > p { font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.35; color: var(--ink-muted); }

.topbar { background: var(--azul-noche); border-bottom-color: var(--line-token); backdrop-filter: none; -webkit-backdrop-filter: none; }
.tour-card { background: var(--azul-medio); border: 0; border-radius: var(--radius); }
.tour-card:hover { border-color: transparent; box-shadow: 0 22px 44px -26px rgba(0, 0, 0, .8); }
.tour-cover { border-radius: var(--radius) var(--radius) 0 0; }
.pill { border-radius: 4px; background: var(--azul-noche); border: 0; letter-spacing: .02em; }
.tour-body h3 { font-weight: 600; letter-spacing: -.01em; }
.empty { background: var(--azul-medio); border: 0; border-radius: var(--radius); }
.empty h2 { font-family: var(--sans); font-weight: 600; font-size: 26px; letter-spacing: -.01em; }
.empty p.muted { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.35; }
.empty-mark { width: 96px; margin: 0 auto; display: block; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; transform: scale(.96); } }

dialog.modal { background: var(--azul-noche); border-color: var(--line-token); border-radius: var(--radius); }
dialog.modal h2 { font-family: var(--sans); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
dialog.modal::backdrop { background: rgba(15, 31, 51, .75); }
.toast { background: var(--azul-noche); border-radius: var(--radius); }

/* Editor */
.ed-side, .ed-inspector, .tabs { background: var(--azul-noche); }
.tab.active { border-bottom-color: var(--arena); }
.dropzone { border-radius: var(--radius); border-color: var(--arena); background: rgba(196, 181, 167, .06); }
.scene-item, .mini-list li, .uq-item { border-radius: var(--radius); background: var(--azul-siono); }
.scene-item:hover, .mini-list li:hover { background: var(--azul-medio); }
.scene-item.active { background: var(--azul-medio); border-color: var(--arena); }
.scene-item img { border-radius: 4px; }
.si-actions button { border-radius: 4px; }
.tool-bar { border-radius: var(--radius); background: rgba(15, 31, 51, .85); border-color: var(--line-token); }
.tool { border-radius: 6px; }
.tool.active { background: var(--arena); color: var(--azul-siono); }
.mode-hint { border-radius: var(--radius); background: rgba(15, 31, 51, .92); border-color: var(--arena); }
.status-seg, .seg { border-radius: var(--radius); }
.status-seg { background: var(--azul-siono); }
.stage-empty { background: var(--azul-siono); }
.stage-empty p { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--ink-muted); }
.save-state { border-radius: 4px; background: var(--azul-siono); }
.home-hero .display { font-size: clamp(38px, 6vw, 64px); }
.home-hero .bajada { max-width: 560px; }
.home-hero .logo { width: 220px; margin-bottom: 18px; }
.auth-card > p.eyebrow { font: 500 12px/1.3 var(--sans); letter-spacing: .3em; color: var(--arena); margin: 0 0 18px; }

/* =================================================================
   Cuentas, equipo, lotes y actividad
   ================================================================= */
.container.wide { max-width: 1320px; }
.container.narrow { max-width: 820px; }
.center { text-align: center; }
.wrap { flex-wrap: wrap; }
.warn-text { color: var(--warn); }
.eyebrow a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(196, 181, 167, .4); }
.eyebrow a:hover { border-color: var(--arena); }

/* Navegación principal */
.main-nav { display: flex; gap: 2px; margin-left: 18px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 8px 14px; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 13px;
  color: var(--ink-muted); white-space: nowrap; transition: background .2s, color .2s;
}
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.main-nav a.on { color: var(--azul-siono); background: var(--arena); }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; margin-right: 6px; }
.who strong { font-size: 13px; }
.who small { font-size: 11px; color: var(--ink-muted); }

/* Acceso */
.google-wrap { display: flex; justify-content: center; min-height: 44px; margin: 4px 0 6px; }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--ink-muted); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-token); }

/* Paneles y tablas */
.panel { background: var(--azul-medio); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.table-card { background: var(--azul-medio); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--arena);
  padding: 14px 16px; border-bottom: 1px solid var(--line-token); white-space: nowrap;
}
table.data td { padding: 13px 16px; border-bottom: 1px solid rgba(58, 85, 119, .55); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.off td { opacity: .5; }
table.data tr.clickable { cursor: pointer; transition: background .15s; }
table.data tr.clickable:hover td { background: rgba(255, 255, 255, .04); }
table.data .actions { text-align: right; white-space: nowrap; }
table.data .actions form { display: inline-block; margin-left: 4px; }
table.data.compact td { padding: 10px 0; }
.role-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: var(--azul-siono); color: var(--ink-muted); }
.role-tag.r-inmobiliaria { background: rgba(196, 181, 167, .2); color: var(--arena); }
.role-tag.r-superadmin { background: var(--arena); color: var(--azul-siono); }

/* Invitación */
.invite-box { background: rgba(196, 181, 167, .1); border: 1px solid var(--arena); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.invite-box p { margin: 0 0 10px; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 320px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

/* Lotes */
.lot-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--azul-medio); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat-n { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat-l { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-muted); }
.stat-bar { height: 4px; border-radius: 2px; background: var(--azul-siono); margin-top: 10px; overflow: hidden; }
.stat-bar i { display: block; height: 100%; border-radius: inherit; transition: width .6s var(--ease); }
.stat.st-disponible .stat-n { color: #8fe6bb; } .stat.st-disponible .stat-bar i { background: var(--ok); }
.stat.st-reservado .stat-n { color: #f6cf85; } .stat.st-reservado .stat-bar i { background: var(--warn); }
.stat.st-vendido .stat-n { color: #f0a19d; } .stat.st-vendido .stat-bar i { background: var(--bad); }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1 1 240px; max-width: 360px; }
.toolbar.filters select, .toolbar.filters input { width: auto; flex: 0 1 auto; }
.date-f { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.filter-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--azul-medio); flex-wrap: wrap; }
.filter-seg button { border: 0; background: none; color: var(--ink-muted); font: 600 12.5px var(--sans); padding: 8px 14px; border-radius: 6px; cursor: pointer; }
.filter-seg button:hover { color: #fff; }
.filter-seg button.on { background: var(--arena); color: var(--azul-siono); }
dialog.modal.wide { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.client-box { border: 1px solid var(--line-token); border-radius: var(--radius); padding: 14px 16px 12px; margin: 0; display: flex; flex-direction: column; gap: 12px; transition: opacity .2s; }
.client-box legend { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--arena); padding: 0 6px; }
.client-box.dim { opacity: .45; }
.alert.warn { background: rgba(232, 169, 58, .12); border: 1px solid rgba(232, 169, 58, .45); color: #f6cf85; }
.history summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-muted); }
.history ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; max-height: 220px; overflow-y: auto; }
.history li { padding: 8px 10px; border-radius: 6px; background: var(--azul-siono); }
input:disabled, textarea:disabled, select:disabled, .seg:disabled { opacity: .55; cursor: not-allowed; }

/* Actividad */
.act-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--ink-muted); }
.act-dot.a-lot { background: var(--arena); }
.act-dot.a-login, .act-dot.a-logout { background: #6f8fb8; }
.act-dot.a-user, .act-dot.a-company { background: #b49ad8; }
.act-dot.a-tour, .act-dot.a-scene { background: var(--ok); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0 30px; }
.howto { margin-top: 16px; font-size: 13.5px; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--arena); }
.howto ol { padding-left: 20px; line-height: 1.7; color: var(--ink-muted); }
.howto code { background: var(--azul-noche); padding: 2px 6px; border-radius: 4px; color: #fff; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; margin: 6px 0 0; }
  .who { display: none; }
  .lot-stats { grid-template-columns: repeat(2, 1fr); }
  /* Tablas como tarjetas en el celular */
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { padding: 12px 14px; border-bottom: 1px solid var(--line-token); }
  table.data td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  table.data td[data-label]::before { content: attr(data-label); flex: 0 0 96px; font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--arena); padding-top: 2px; }
  table.data .actions { text-align: left; padding-top: 8px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Marca de la inmobiliaria */
.ok-text { color: #8fe6bb; }
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.logo-drop { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; }
.logo-current { height: 110px; border-radius: var(--radius); display: grid; place-items: center; padding: 14px; border: 1px solid var(--line-token); }
.logo-current img { max-width: 100%; max-height: 80px; object-fit: contain; }
.color-row { display: flex; gap: 8px; }
.color-row input[type=color] { width: 48px; height: 42px; padding: 3px; border-radius: var(--radius); border: 1px solid var(--ink-muted); background: var(--azul-noche); cursor: pointer; flex: none; }
.color-row input:not([type=color]) { font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.brand-preview {
  --p-accent: #c4b5a7; --p-dark: #0f1f33; --p-ink: #1a324f;
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, #6f9fd2 0%, #a9c6e0 45%, #9a8a6a 46%, #6c5f45 100%) center / cover;
}
.brand-preview::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .25)); }
.bp-card { position: absolute; z-index: 1; top: 14px; left: 14px; padding: 12px 16px; border-radius: 8px; background: color-mix(in srgb, var(--p-dark) 75%, transparent); backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 2px; max-width: 60%; }
.bp-card img { max-height: 30px; max-width: 150px; object-fit: contain; object-position: left; margin-bottom: 4px; }
.bp-client { font-size: 9px; letter-spacing: .3em; text-transform: uppercase; color: var(--p-accent); }
.bp-card strong { font-size: 16px; }
.bp-card em { font-family: var(--serif); font-size: 16px; color: var(--ink-muted); }
.bp-hs { position: absolute; z-index: 1; left: 38%; top: 58%; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; background: color-mix(in srgb, var(--p-accent) 55%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--p-accent) 35%, transparent); }
.bp-sheet { position: absolute; z-index: 1; right: 14px; bottom: 14px; width: 46%; padding: 14px; border-radius: 8px; background: color-mix(in srgb, var(--p-dark) 90%, transparent); display: flex; flex-direction: column; gap: 6px; }
.bp-badge { align-self: flex-start; font-size: 9px; letter-spacing: .2em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: rgba(79, 201, 140, .18); color: #8fe6bb; }
.bp-sheet strong { font-size: 20px; }
.bp-cta { text-align: center; padding: 9px; border-radius: 8px; font-weight: 600; font-size: 12px; background: var(--p-accent); color: var(--p-ink); }
.bp-credit { position: absolute; z-index: 1; left: 14px; bottom: 12px; font-size: 8px; letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 255, 255, .8); display: flex; align-items: center; gap: 6px; }
.bp-credit img { height: 12px; }
@media (max-width: 900px) { .brand-layout { grid-template-columns: 1fr; } .logo-drop { grid-template-columns: 1fr; } }
