/* ============================================================
   Kairós — base.css · Reset, tipografía y layout del shell
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--k-font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--k-ink);
  background: var(--k-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: var(--k-ink); }
input, textarea, select { color: var(--k-ink) !important; } /* D-24: legibilidad siempre */
a { color: var(--k-accent); text-decoration: none; }
h1, h2, h3 { font-family: var(--k-font-display); font-weight: 400; line-height: 1.2; }

::selection { background: var(--k-accent); color: var(--k-accent-contrast); }

:focus-visible {
  outline: 2px solid var(--k-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Shell ─────────────────────────────────────────────────── */

#app { display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  height: var(--k-topbar-h);
  padding: 0 20px;
  background: color-mix(in srgb, var(--k-surface) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--k-line);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-star {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgb(4 8 16 / .35), 0 0 0 1px var(--k-line);
}
.brand-name {
  font-family: var(--k-font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-sub {
  display: block; font-family: var(--k-font-body);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--k-ink-3);
}

.mode-badge {
  flex: none; align-self: center;
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--k-warn) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--k-warn) 12%, transparent);
  color: var(--k-ink-2);
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  white-space: nowrap;
}

.layout { display: flex; flex: 1; min-height: 0; }

.sidenav {
  width: var(--k-sidenav-w); flex: none;
  padding: 18px 12px;
  border-right: 1px solid var(--k-line);
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: var(--k-topbar-h);
  height: calc(100dvh - var(--k-topbar-h));
  overflow-y: auto;
}
.sidenav-label {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--k-ink-3); padding: 10px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--k-ink-2);
  cursor: pointer;
  text-align: left;
  transition: background var(--k-t-fast) var(--k-ease), color var(--k-t-fast) var(--k-ease);
}
.nav-item:hover { background: var(--k-surface-3); color: var(--k-ink); }
.nav-item.active {
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
  font-weight: 600;
}
[data-business='general'] .nav-item.active { color: var(--k-accent-ink); }
.nav-item .ico { width: 19px; height: 19px; flex: none; }
.nav-item .count {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--k-accent-strong);
  color: #FFFFFF;
  font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}

.view {
  flex: 1; min-width: 0;
  padding: 26px clamp(16px, 3.5vw, 40px) 40px;
  overflow-x: hidden;
}

/* Transición de vista */
.view-enter { animation: viewIn var(--k-t) var(--k-ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ── Footer de marca (patrón genesis-landing: quote + sello + crédito) ── */

.footer {
  display: grid; justify-items: center;
  border-top: 1px solid var(--k-line);
  padding: 42px 20px 48px;
  text-align: center;
  color: var(--k-ink-3);
}
.footer-quote { display: grid; gap: 10px; max-width: 680px; text-wrap: balance; }
.footer-line-primary {
  font-family: var(--k-font-display);
  font-size: clamp(1.15rem, 2.3vw, 1.7rem);
  font-weight: 600; line-height: 1.35; letter-spacing: .01em;
  color: var(--k-ink);
}
.footer-line-primary strong { color: var(--k-gold); font-weight: 800; }
.footer-line-secondary {
  font-size: clamp(.85rem, 1.5vw, 1rem);
  font-weight: 500; letter-spacing: .05em;
  color: var(--k-ink-3);
}
.footer-seal {
  display: grid; justify-items: center;
  margin-top: 32px; padding-top: 30px;
  position: relative;
}
.footer-seal::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(620px, 92%); height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--k-accent) 55%, transparent), transparent);
}
.seal {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 9px 20px 9px 11px;
  border: 1px solid color-mix(in srgb, var(--k-accent) 24%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--k-surface) 74%, transparent);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.seal:hover {
  border-color: color-mix(in srgb, var(--k-gold) 55%, transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--k-accent) 20%, transparent);
}
.seal-logo {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--k-accent) 35%, transparent));
}
.seal-body { display: grid; gap: 3px; text-align: left; }
.seal-wordmark {
  font-family: var(--k-font-display);
  font-size: .98rem; font-weight: 800; letter-spacing: .02em;
  color: var(--k-ink); line-height: 1;
}
.seal-wordmark b, .seal-wordmark strong { color: var(--k-gold); font-weight: 800; }
.seal-tagline {
  font-size: .64rem; font-weight: 700;
  letter-spacing: .17em; text-transform: uppercase;
  color: var(--k-ink-3); line-height: 1;
}
.footer-credit { margin-top: 18px; font-size: 11.5px; color: var(--k-ink-3); }
.footer-credit b { color: var(--k-ink-2); font-weight: 600; letter-spacing: .04em; }
.footer a { color: var(--k-ink-2); border-bottom: 1px dotted var(--k-line-strong); }
.footer a:hover { color: var(--k-accent); }
a.seal { text-decoration: none; border-bottom: 0; }
a.seal:hover { color: inherit; }

/* ── Responsive ────────────────────────────────────────────── */

.bottomnav { display: none; }

@media (max-width: 920px) {
  .sidenav { display: none; }
  .brand-sub { display: none; }
  .bottomnav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: color-mix(in srgb, var(--k-surface) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--k-line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    overflow-x: auto;
    scrollbar-width: none;
  }
  .bottomnav::-webkit-scrollbar { display: none; }
  .bottomnav .nav-item {
    flex: none; flex-direction: column; gap: 3px;
    width: auto;
    padding: 6px 13px;
    font-size: 10.5px;
    border-radius: 12px;
  }
  .bottomnav .nav-item .count { position: absolute; transform: translate(14px, -6px); }
  .bottomnav .nav-item { position: relative; }
  .view { padding-bottom: 96px; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-name, .brand-sub { display: none; }
  .view { padding: 18px 14px 110px; }
  .footer { padding: 32px 12px 40px; }
  .footer-quote { gap: 8px; }
  .seal { max-width: 100%; padding: 8px 16px 8px 11px; gap: 11px; }
}
