/* layout.css — shell: cabecera con navegación + contenido */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line-strong);
  display: flex; align-items: center; gap: var(--space-5); min-height: var(--header-h); padding: 0 var(--space-6);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--cta); clip-path: polygon(0 0, 140px 0, 140px 100%, 0 100%); }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1; gap: 3px; flex: 0 0 auto; }
.brand-logo { display: block; height: 38px; width: auto; color: #000; overflow: visible; }
.brand-logo .letra { transform-box: fill-box; transform-origin: 50% 100%; cursor: pointer; }
.brand-logo .letra:hover { animation: letra-salto .38s cubic-bezier(.3,.7,.4,1); }
@keyframes letra-salto { 0%{transform:translateY(0) scale(1,1)} 20%{transform:translateY(0) scale(1.08,.88)} 50%{transform:translateY(-75%) scale(.92,1.14)} 75%{transform:translateY(0) scale(1.06,.92)} 100%{transform:translateY(0) scale(1,1)} }
@media (prefers-reduced-motion: reduce){ .brand-logo .letra:hover{animation:none} }   /* negro sobre fondo blanco */
.brand-tag { font-family: var(--font-ui); font-style: normal; font-weight: 600; font-size: 0.7rem; color: var(--ink-3); letter-spacing: 0.01em; }

.nav { display: flex; align-items: stretch; gap: var(--space-1); align-self: stretch; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 var(--space-4); white-space: nowrap;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: var(--text-md);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.nav-item:hover { color: var(--ink); background: var(--bg-sunken); }
.nav-item[aria-current="page"] { color: var(--ink); border-bottom-color: var(--cta); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--accent); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmdk-trigger {
  display: flex; align-items: center; gap: 10px; min-height: 38px; min-width: 190px;
  padding: 0 var(--space-3); background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--ink-3); text-align: left;
}
.cmdk-trigger:hover { border-color: var(--line-strong); background: var(--bg); }
.cmdk-trigger svg { width: 16px; height: 16px; }
.cmdk-trigger span { flex: 1; font-size: var(--text-sm); }
kbd {
  font-family: var(--font-ui); font-size: 11px; font-weight: 700; color: var(--ink-3);
  background: var(--bg); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px;
}
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--ink-3); }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.status-dot[data-state="ok"]::before { background: #2E9E5B; }
.status-dot[data-state="down"]::before { background: #C8372D; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: var(--text-sm); }
.user-meta { line-height: 1.25; }
.user-meta strong { display: block; font-size: var(--text-sm); }
.user-meta small { color: var(--ink-3); font-size: var(--text-xs); }
.link-btn { background: none; border: 0; padding: 4px 6px; color: var(--ink-3); font-size: var(--text-sm); font-weight: 600; border-radius: 6px; }
.link-btn:hover { color: var(--ink); background: var(--bg-sunken); }

.content { padding: var(--space-6); max-width: 1320px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-6); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.page-head h1 { font-size: var(--text-2xl); line-height: 1.15; }
.page-head p { color: var(--ink-3); margin-top: var(--space-1); }

.grid-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }

@media (max-width: 1100px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; height: auto; padding-top: var(--space-2); row-gap: 0; }
  .topbar-end { order: 2; margin-left: auto; }
  .nav { order: 3; flex: 1 0 100%; margin: 0 calc(-1 * var(--space-4)); padding: 0 var(--space-3); border-top: 1px solid var(--line); }
  .nav-item { padding: 0 var(--space-3); min-height: 44px; }
  .topbar::after { display: none; }
  .user-meta, .cmdk-trigger kbd, .brand-tag, .status-dot { display: none; }
  .content { padding: var(--space-4); }
  .page-head h1 { font-size: var(--text-xl); }
}
@media (max-width: 480px) {
  .grid-kpi { grid-template-columns: minmax(0, 1fr); }
}
.nav-item { flex: 0 0 auto; }
@media (max-width: 1480px) { .cmdk-trigger span { display: none; } .cmdk-trigger { min-width: 0; } }

/* ── Fondo "aurora suave" (todas las pantallas, también el login): manchas de color que flotan despacio sobre arena ── */
.fondo-mar { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #F6F1E8; }
.fm-m { position: absolute; border-radius: 50%; will-change: transform; }
/* degradados radiales (sin filtros de desenfoque: más ligeros para el navegador) */
.fm-m--1 { left: -12%; top: 18%; width: 62vw; height: 62vw; max-width: 900px; max-height: 900px; background: radial-gradient(circle, rgba(255,159,28,.62) 0%, rgba(255,159,28,.28) 38%, transparent 68%); animation: fm-d1 34s ease-in-out infinite alternate; }
.fm-m--2 { right: -14%; top: -18%; width: 60vw; height: 60vw; max-width: 880px; max-height: 880px; background: radial-gradient(circle, rgba(53,197,187,.58) 0%, rgba(53,197,187,.26) 40%, transparent 68%); animation: fm-d2 42s ease-in-out infinite alternate; }
.fm-m--3 { left: 30%; bottom: -30%; width: 66vw; height: 56vw; max-width: 960px; max-height: 800px; background: radial-gradient(circle, rgba(255,211,107,.85) 0%, rgba(255,211,107,.4) 42%, transparent 70%); animation: fm-d3 38s ease-in-out infinite alternate; }
.fm-m--4 { right: 2%; bottom: -4%; width: 34vw; height: 34vw; max-width: 520px; max-height: 520px; background: radial-gradient(circle, rgba(11,122,117,.34) 0%, rgba(11,122,117,.14) 45%, transparent 70%); animation: fm-d4 30s ease-in-out infinite alternate; }
@keyframes fm-d1 { to { transform: translate(14vw, -8vh) scale(1.12); } }
@keyframes fm-d2 { to { transform: translate(-12vw, 12vh) scale(1.1); } }
@keyframes fm-d3 { to { transform: translate(-16vw, -10vh) scale(1.08); } }
@keyframes fm-d4 { to { transform: translate(-10vw, -14vh) scale(1.2); } }
@media (max-width: 760px) { .fm-m--1, .fm-m--2 { width: 120vw; height: 120vw; } .fm-m--3 { width: 130vw; height: 110vw; } }
@media (prefers-reduced-motion: reduce) { .fm-m { animation: none; } }
