/* public/luma-app.css
   v54 (ver docs/decisions/0027): interior nuevo de la app. Se carga DESPUES
   de styles.css y solo cambia el "marco" (barra superior, dock, menu,
   inicio, paleta ⌘K, recorrido de la boda) y el tono general. Todo usa las
   variables de branding de cada estudio (--salt fondo, --ink texto, --clay
   color principal, --sand acento, --font-serif/--font-sans), asi que cada
   tenant se ve con SU marca: LUMA en blanco roto y lima, La Sal con la suya. */
:root {
  --on-clay: #FFFFFF;
  --on-sand: #111111;
  --card: #FFFFFF;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.18);
  --soft: rgba(0, 0, 0, 0.04);
  --muted: rgba(0, 0, 0, 0.62);
  --radius-xl: 28px;
  --radius-l: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[hidden] { display: none !important; }
#app { display: block; min-height: 100vh; }
body { background: var(--salt); }

/* ---------- Barra superior (HUD) ---------- */
.hud {
  position: sticky; top: 0; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 14px max(16px, calc((100vw - 1320px) / 2));
  background: color-mix(in srgb, var(--salt) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hud-brand { display: flex; align-items: center; min-height: 44px; }
.hud-logo { height: 30px; width: auto; max-width: 170px; object-fit: contain; display: block; }
.hud-search {
  flex: 1 1 280px; min-width: 0; min-height: 46px;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 10px 16px; font: inherit; font-size: 15px; text-align: left; cursor: text;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.hud-search:hover { border-color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.hud-search-text { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd {
  font-family: var(--font-serif); font-size: 11px; line-height: 1;
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 7px;
  color: var(--muted); background: transparent; white-space: nowrap;
}
.hud-season { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.hud-season-row { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-serif); font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.hud-season-n { color: var(--ink); }
.hud-season-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.hud-season-bar i { display: block; height: 100%; border-radius: 6px; background: var(--clay); transition: width .6s var(--ease); }
.hud-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 10px 16px; font: inherit; font-family: var(--font-serif); font-size: 13px; cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}
.hud-btn:hover { transform: translateY(-2px); border-color: var(--ink); }
.hud-account { position: relative; }
.hud-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--sand); color: var(--on-sand);
  font-family: var(--font-serif); font-weight: 700; font-size: 16px; cursor: pointer;
  transition: transform .18s ease;
}
.hud-avatar:hover { transform: scale(1.06); }
.hud-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  width: 280px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 20px; padding: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.14); display: flex; flex-direction: column; gap: 6px;
  animation: popIn .18s var(--ease) both;
}
.hud-pop[hidden] { display: none; }
.hud-pop-name { font-size: 12px; color: var(--muted); padding: 4px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
.hud-pop-link { display: block; text-align: left; background: none; border: 0; font: inherit; color: var(--ink); padding: 10px 8px; border-radius: 10px; cursor: pointer; }
.hud-pop-link:hover { background: var(--soft); }
.hud-pop-logout { color: var(--danger); }
.hud-pop .owner-switch { padding: 6px 8px; }
.hud-pop .owner-switch-label { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.hud-pop .pill { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.hud-pop .pill.active { background: var(--ink); color: var(--salt); border-color: var(--ink); }

/* ---------- Contenido ---------- */
.main { max-width: 1320px; margin: 0 auto; padding: 28px 24px 130px; min-width: 0; flex: none; width: 100%; box-sizing: border-box; }
.main .card { border-radius: var(--radius-l); border-color: var(--line); }

/* ---------- Dock (acciones rapidas) ---------- */
.dock {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 45;
  display: flex; gap: 4px; max-width: calc(100vw - 24px); overflow-x: auto;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px;
  box-shadow: 0 20px 60px rgba(0,0,0,.14);
}
.dock-item {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; min-height: 44px;
  background: transparent; color: var(--ink); border: 0; border-radius: 999px;
  padding: 10px 16px; font: inherit; font-family: var(--font-serif); font-size: 13px; cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.dock-item:hover { transform: translateY(-3px); background: var(--soft); }
.dock-item.is-active { background: var(--sand); color: var(--on-sand); font-weight: 600; }
.dock-item kbd { border-color: var(--line); }

/* ---------- Menu (panel) ---------- */
.drawer[hidden] { display: none; }
.drawer { position: fixed; inset: 0; z-index: 70; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.28); animation: fadeIn .2s ease both; }
.drawer-panel {
  position: absolute; top: 12px; bottom: 12px; left: 12px; width: min(380px, calc(100vw - 24px));
  overflow-y: auto; background: var(--card); color: var(--ink);
  border-radius: 26px; padding: 20px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 40px 100px rgba(0,0,0,.25); animation: slideIn .28s var(--ease) both;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-title { font-family: var(--font-serif); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.drawer-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); cursor: pointer; font-size: 16px; }
.drawer .nav-group { gap: 2px; }
.drawer .nav-label { color: var(--muted); font-family: var(--font-serif); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px; }
.drawer .nav-link {
  display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 11px 12px; border-radius: 12px;
  font-size: 15px; transition: background .15s ease;
}
.drawer .nav-link:hover { background: var(--soft); }
.drawer .nav-link.active { background: var(--sand); color: var(--on-sand); }
.drawer .nav-badge { margin-left: auto; background: var(--clay); color: var(--on-clay); }
.drawer .nav-kbd { margin-left: auto; }
.drawer .nav-badge + .nav-kbd { margin-left: 6px; }
.drawer .nav-link-home { font-weight: 600; }
.drawer .sidebar-search-input { background: var(--salt); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; width: 100%; box-sizing: border-box; font: inherit; }
.drawer .sidebar-search-results { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); }
.drawer-groups { display: flex; flex-direction: column; gap: 16px; }
.drawer #sidebar-bulk-upload { width: 100%; }

/* ---------- Inicio (hub) ---------- */
.hub { display: flex; flex-direction: column; }
.hub-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 8px 0 26px; }
.hub-date { font-family: var(--font-serif); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.hub-title { font-family: var(--font-serif); font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -1px; line-height: 1.05; margin: 0; }
.hub-sub { margin: 0; color: var(--muted); font-size: 16px; }
.hub-sub strong { color: var(--ink); background: var(--sand); color: var(--on-sand); padding: 1px 8px; border-radius: 8px; }
.hub-h2 { font-family: var(--font-serif); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; margin: 0; font-weight: 600; }
.hub-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: stretch; }

.quests { flex: 1.25 1 440px; min-width: 0; background: var(--sand); color: var(--on-sand); border-radius: var(--radius-xl); padding: 28px; display: flex; flex-direction: column; }
.quests-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.quests-count { font-family: var(--font-serif); font-size: 28px; font-weight: 600; }
.quests-bar { height: 8px; border-radius: 8px; background: rgba(0,0,0,.14); margin-bottom: 14px; overflow: hidden; }
.quests-bar i { display: block; height: 100%; border-radius: 8px; background: var(--ink); transition: width .6s var(--ease); }
.quest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.quest { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; transition: background .18s ease, opacity .4s ease; }
.quest:hover { background: rgba(0,0,0,.06); }
.quest-check {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; border: 2px solid currentColor; background: transparent; cursor: pointer; position: relative;
  transition: transform .15s ease, background .2s ease;
}
.quest-check:hover { transform: scale(1.1); }
.quest-text { flex-grow: 1; min-width: 0; color: inherit; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.quest-sub { opacity: .7; font-weight: 400; }
.quest-tag { font-family: var(--font-serif); font-size: 10px; letter-spacing: 1px; opacity: .75; white-space: nowrap; }
.quest-late { opacity: 1; background: var(--danger); color: #fff; padding: 3px 7px; border-radius: 6px; }
.quest-done .quest-check { background: var(--ink); border-color: var(--ink); animation: pop .35s var(--ease); }
.quest-done .quest-check::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--sand); font-weight: 700; font-size: 14px; }
.quest-done .quest-text { text-decoration: line-through; opacity: .55; }
.quests-empty { padding: 14px 10px; opacity: .8; }
.quests-more { margin-top: 8px; padding: 8px 10px; color: inherit; font-family: var(--font-serif); font-size: 12px; }
.quests-add { margin-top: auto; align-self: flex-start; background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 999px; padding: 10px 16px; font: inherit; font-family: var(--font-serif); font-size: 13px; cursor: pointer; min-height: 44px; opacity: .85; }
.quests-add:hover { opacity: 1; }

.next { flex: 1 1 360px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 28px; }
.next-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.next-all { font-family: var(--font-serif); font-size: 12px; color: var(--muted); padding: 8px 0; }
.next-all:hover { color: var(--ink); }
.next-list { display: flex; flex-direction: column; gap: 10px; }
.next-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease; }
.next-item:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 14px 32px rgba(0,0,0,.07); }
.next-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.next-name { font-family: var(--font-serif); font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-meta { font-size: 13px; color: var(--muted); }
.next-pill { font-family: var(--font-serif); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 9px; white-space: nowrap; color: var(--muted); }

.lvl-ring-track { stroke: var(--line); }
.lvl-ring-fill { stroke: var(--clay); transition: stroke-dasharray .8s var(--ease); }
.lvl-ring-text { fill: var(--ink); font-family: var(--font-serif); font-size: 14px; font-weight: 600; }
.lvl-ring { flex-shrink: 0; }

.hub-zones-title { margin: 40px 0 14px; color: var(--muted); }
.zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.zone {
  min-height: 140px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 24px; padding: 20px;
  transition: transform .22s var(--ease), border-color .22s ease, box-shadow .22s ease;
}
.zone:hover { transform: translateY(-6px); border-color: var(--ink); box-shadow: 0 18px 40px rgba(0,0,0,.08); }
.zone:hover .zone-key { background: var(--sand); color: var(--on-sand); border-color: var(--ink); }
.zone-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.zone-name { font-family: var(--font-serif); font-weight: 600; font-size: 16px; }
.zone-key { transition: background .2s ease, color .2s ease; }
.zone-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.zone-n { font-family: var(--font-serif); font-size: 38px; line-height: 1; }
.zone-sub { font-size: 13px; color: var(--muted); text-align: right; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--clay); margin-right: 6px; vertical-align: middle; animation: pulse 2.4s ease-in-out infinite; }

/* ---------- Recorrido de una boda ---------- */
.lvl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 24px 26px 20px; margin: 0 0 18px; }
.lvl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.lvl-title { font-family: var(--font-serif); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.lvl-meta { font-size: 13px; color: var(--muted); }
.lvl-meta strong { color: var(--ink); font-family: var(--font-serif); font-size: 16px; }
.lvl-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.lvl-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lvl-step::after { content: ""; position: absolute; top: 20px; left: 50%; width: 100%; height: 4px; background: var(--line); z-index: 0; }
.lvl-step:last-child::after { display: none; }
.lvl-done::after { background: var(--clay); }
.lvl-dot { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-weight: 700; background: var(--salt); border: 1px solid var(--line-strong); color: var(--muted); }
.lvl-done .lvl-dot { background: var(--clay); color: var(--on-clay); border-color: var(--clay); }
.lvl-now .lvl-dot { background: var(--sand); color: var(--on-sand); border: 3px solid var(--ink); animation: glow 2.2s ease-in-out infinite; }
.lvl-name { font-family: var(--font-serif); font-size: 12px; color: var(--muted); }
.lvl-now .lvl-name { color: var(--ink); font-weight: 700; }
.lvl-done .lvl-name { color: var(--ink); }

/* ---------- Paleta de comandos ---------- */
.palette { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.32); animation: fadeIn .15s ease both; }
.palette-box { position: relative; width: 100%; max-width: 680px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 26px; box-shadow: 0 40px 120px rgba(0,0,0,.25); overflow: hidden; animation: popIn .22s var(--ease) both; }
.palette-input-row { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input-row input { flex-grow: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-family: var(--font-serif); font-size: 19px; }
.palette-list { max-height: min(56vh, 520px); overflow-y: auto; padding: 8px; }
.palette-group { font-family: var(--font-serif); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 12px 12px 6px; }
.palette-opt { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; cursor: pointer; }
.palette-opt:hover { background: var(--soft); }
.palette-opt.is-sel { background: var(--sand); color: var(--on-sand); }
.palette-opt.is-sel kbd { color: inherit; border-color: currentColor; }
.palette-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); flex-shrink: 0; }
.palette-opt.is-sel .palette-icon { background: var(--ink); color: var(--sand); }
.palette-label { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-sub { opacity: .65; font-size: 13px; }
.palette-empty { padding: 20px; color: var(--muted); }
.palette-foot { display: flex; flex-wrap: wrap; gap: 18px; padding: 12px 22px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Celebracion ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; background: var(--sand); border: 1px solid var(--ink); animation: fall 1.6s cubic-bezier(.3,.6,.4,1) forwards; }
.confetti i:nth-child(3n) { background: var(--clay); }
.confetti i:nth-child(4n) { background: var(--ink); }

/* ---------- Animaciones ---------- */
.anim-in { animation: rise .5s var(--ease) both; }
.anim-d1 { animation-delay: .07s; }
.anim-d2 { animation-delay: .14s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,0,.2); } 50% { box-shadow: 0 0 0 10px rgba(0,0,0,0); } }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  .anim-in, .quest-done .quest-check, .lvl-now .lvl-dot, .pulse-dot, .drawer-panel, .palette-box, .hud-pop { animation: none !important; }
  .zone, .next-item, .dock-item, .hud-btn { transition: none !important; }
}

/* ---------- Movil ---------- */
@media (max-width: 760px) {
  .next-item { flex-wrap: wrap; align-items: flex-start; }
  .next-main { flex-basis: calc(100% - 70px); }
  .next-pill { margin-left: 70px; }
  .hud { padding: 10px 12px; gap: 10px; }
  .hud-search { order: 3; flex-basis: 100%; }
  .hud-season { display: none !important; }
  .hud-btn-text, .hud-btn kbd { display: none; }
  .hud-brand { flex-grow: 1; }
  .main { padding: 18px 14px 120px; }
  .quests, .next { padding: 22px; }
  .lvl-path { grid-template-columns: repeat(7, minmax(44px, 1fr)); overflow-x: auto; }
  .lvl-name { font-size: 10px; }
  .dock-hide-sm { display: none; }
  .dock { bottom: 12px; }
  .dock-item { padding: 10px 12px; }
  .dock-item kbd { display: none; }
}
