/* ---------- Logo ---------- */
/* Logo "Mirada" en SVG (§8.1): no se reconstruye con tipografía. */
.logo { display: block; width: auto; flex: none; }

/* ---------- Barra superior ---------- */
.top-bar { background: var(--bar); color: var(--bar-ink); }
.top-bar__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}
.top-bar__home { display: inline-flex; align-items: center; text-decoration: none; }
.top-bar__nav { display: flex; gap: 6px; flex: 1; }
.top-bar__link {
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--bar-muted);
  text-decoration: none;
}
a.top-bar__link:hover { color: var(--bar-ink); background: rgba(255, 255, 255, .06); }
.top-bar__link.is-active { color: var(--bar-ink); background: rgba(255, 255, 255, .1); }
.top-bar__link[aria-disabled="true"] { opacity: .6; cursor: default; }
.top-bar :focus-visible { outline-color: var(--bar-ink); }

/* ---------- Menú de usuario ---------- */
.user-menu { position: relative; margin-left: auto; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bar-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  /* Área táctil de 44 px sin cambiar el círculo */
  box-shadow: 0 0 0 4px transparent;
}
.user-menu[open] .avatar,
.avatar:hover { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 260px;
  padding: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
}
.user-menu__who {
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.user-menu__section { padding: 10px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.user-menu__section + .user-menu__section { border-top: 1px solid var(--line-soft); }
.user-menu__label { font-size: 13px; color: var(--muted); }
.user-menu__item {
  min-height: 44px;
  width: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
}
.user-menu__item:hover { background: var(--tint); }
form.user-menu__section:has(.user-menu__item) { padding: 6px 0 0; }

/* ---------- Control segmentado (tema) ---------- */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.segmented__form { margin: 0; display: contents; }
.segmented__option {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 14px;
  color: var(--muted-strong);
}
.segmented__option:hover { background: var(--line-soft); }
.segmented__option[aria-pressed="true"] { background: var(--tint); color: var(--link); font-weight: 600; }

/* ---------- Página ---------- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  text-transform: uppercase;
}
.page-lede { margin-top: 6px; color: var(--muted); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
}
.empty-state { padding: 32px 16px; text-align: center; color: var(--muted); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { color: var(--primary-ink); filter: brightness(1.12); border-color: var(--primary); }
.btn--block { width: 100%; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-weight: 600; font-size: 14px; }
.field__hint { font-size: 13px; color: var(--muted); }
.input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
.input:focus-visible { outline-offset: 0; border-color: var(--link); }

/* ---------- Mensajes ---------- */
.flash { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
.flash--notice { background: var(--ok-bg); color: var(--ok); }
.flash--alert { background: var(--fix-bg); color: var(--fix); }

/* ---------- Pantallas de autenticación ---------- */
.auth { display: flex; flex-direction: column; }
.auth__bar {
  background: var(--bar);
  padding: 28px 24px 72px;
  display: flex;
  justify-content: center;
}

.auth__main {
  flex: 1;
  width: 100%;
  max-width: 420px;
  margin: -48px auto 0;
  padding: 0 16px 32px;
}
.auth__card { padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; }
.auth__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  text-transform: uppercase;
}
.auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; }

@media (max-width: 600px) {
  .top-bar__inner { padding: 12px 16px; gap: 8px 16px; }
  .top-bar__nav { order: 3; flex-basis: 100%; }
  .page { padding: 20px 16px; }
  .page-title { font-size: 32px; }
}
