/* Sideline — barra superior compartida por los módulos de la app (Video y Playbook).
   Se carga después de los estilos de cada página y usa sus mismas variables (--panel, --line, --fg, --accent…). */
.topbar {
  display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px 8px 14px; box-shadow: 0 1px 2px rgba(20,40,60,.05);
}
.topbar .homelink { display: block; color: inherit; flex: none; }
.topbar .brandmark { display: block; height: 28px; width: auto; }
.topbar .spacer { flex: 1; }

/* pestañas de módulo */
.modnav { display: inline-flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.modnav .mod {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 11px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.modnav .mod svg { width: 18px; height: 18px; flex: none; }
.modnav .mod:hover { color: var(--fg); background: var(--panel); }
.modnav .mod.on { background: var(--fg); color: var(--on-fg); }
.modnav .mod.off { opacity: .55; }
.modnav .mod .lock { width: 13px; height: 13px; margin-left: -2px; }

/* menú de usuario */
.umenu { position: relative; }
.ubtn {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 3px 10px 3px 3px; max-width: 260px;
}
.ubtn:hover, .ubtn[aria-expanded="true"] { background: var(--panel-2); border-color: var(--line); }
.ubtn .av {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.ubtn .nm { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; text-align: left; }
.ubtn .nm b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.ubtn .nm small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.ubtn .car { width: 12px; height: 12px; color: var(--muted); flex: none; }
.pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; min-width: 220px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 10px 30px var(--shadow-c); display: flex; flex-direction: column;
}
.pop .pi {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px;
  padding: 9px 10px; color: var(--fg); text-decoration: none; font-size: 14px; cursor: pointer;
}
.pop .pi:hover { background: var(--panel-2); }
.pop .pi svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pop .pi.danger { color: var(--bad); }
.pop .pi.danger svg { color: var(--bad); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.pop .phd { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.pop .phd b { display: block; color: var(--fg); font-size: 14px; }

/* módulo no incluido en el plan */
.locked {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 44px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.locked svg.big { width: 56px; height: 56px; color: var(--accent); }
.locked h2 { margin: 0; font-size: 22px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.locked p { margin: 0; color: var(--muted); max-width: 52ch; line-height: 1.55; }
.locked .acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }

@media (max-width: 640px) {
  .topbar { padding: 8px 10px; gap: 10px 8px; }
  .topbar .status { max-width: 128px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .topbar .brandmark { height: 22px; }
  .modnav { order: 3; width: 100%; justify-content: stretch; }
  .modnav .mod { flex: 1; justify-content: center; }
  .ubtn .nm { display: none; }
  .ubtn { padding: 3px; }
}

/* ---------- tema claro / oscuro ----------
   Valores claros por omisión de los tonos «suaves»; cada página define el resto en su :root.
   El oscuro aplica con data-theme="dark" o, en modo automático, si el sistema está en oscuro. */
:root {
  --accent-soft: #fff1e6; --accent-hover: #b34c0b; --ok-soft: #e9f5ec; --bad-soft: #fdeeee;
  --hover-line: #b9c4cf; --on-fg: #ffffff; --scrim: rgba(20,40,60,.35); --shadow-c: rgba(20,40,60,.16);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e151c; --panel: #161f29; --panel-2: #1d2833; --line: #2a3744; --fg: #e4ebf2; --muted: #93a3b3;
    --accent: #e8742a; --accent-hover: #f08a45; --accent-soft: #3a2516; --good: #4bbf6b; --bad: #f07272;
    --ok-soft: #16301f; --bad-soft: #3a1c1c; --hover-line: #4a5a6a; --on-fg: #0e151c; --scrim: rgba(0,0,0,.55); --shadow-c: rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e151c; --panel: #161f29; --panel-2: #1d2833; --line: #2a3744; --fg: #e4ebf2; --muted: #93a3b3;
  --accent: #e8742a; --accent-hover: #f08a45; --accent-soft: #3a2516; --good: #4bbf6b; --bad: #f07272;
  --ok-soft: #16301f; --bad-soft: #3a1c1c; --hover-line: #4a5a6a; --on-fg: #0e151c; --scrim: rgba(0,0,0,.55); --shadow-c: rgba(0,0,0,.5);
}
.themebtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 0; flex: none; }
.themebtn:hover { border-color: var(--hover-line); }
.themebtn svg { width: 18px; height: 18px; }

/* ---------- franja de bienvenida dentro de la app (usa /assets/hello.css) ----------
   Versión compacta para dejar espacio al video; las pestañas de módulo viven aquí. */
.hello.compact { padding: 14px 22px 0; }
.hello.compact .hi { font-size: clamp(20px, 2.4vw, 27px); }
.hello.compact .sub { font-size: 13px; margin-top: 3px; }
.hello.compact .tabs { margin-top: 10px; }
/* en pantallas grandes, saludo y pestañas en una sola fila para dejarle altura al video */
@media (min-width: 981px) {
  .hello.compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 24px; padding: 12px 22px 0; }
  .hello.compact .hi { grid-column: 1; grid-row: 1; }
  .hello.compact .sub { grid-column: 1; grid-row: 2; margin-bottom: 12px; }
  .hello.compact .tabs { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; border-bottom: 0; align-self: end; }
}
.hello .modnav { background: none; border: 0; border-bottom: 1px solid rgba(16,32,47,.18); border-radius: 0; padding: 0; gap: 4px 28px; display: flex; }
.hello .modnav .mod { padding: 8px 2px 10px; border-radius: 0; color: #10202f; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.hello .modnav .mod:hover { background: none; color: #10202f; border-bottom-color: rgba(16,32,47,.35); }
.hello .modnav .mod.on { background: none; color: #10202f; font-weight: 700; border-bottom-color: #10202f; }
@media (max-width: 640px) { .hello .modnav { order: initial; width: auto; } .hello .modnav .mod { flex: none; } .hello.compact { padding: 12px 14px 0; } }
/* en la app la franja usa la misma paleta que el resto (claro u oscuro), sin el cielo azul */
.hello.compact { background: var(--panel); border: 1px solid var(--line); color: var(--fg); box-shadow: 0 1px 2px rgba(20,40,60,.05); }
.hello.compact .sub { color: var(--muted); }
.hello.compact .modnav { border-bottom-color: var(--line); }
.hello.compact .modnav .mod { color: var(--muted); }
.hello.compact .modnav .mod:hover { color: var(--fg); border-bottom-color: var(--line); }
.hello.compact .modnav .mod.on { color: var(--fg); border-bottom-color: var(--accent); }
