/* =============================================================================
 * header.css — Persistent header + Activity Center HUD (DL-S-019/020)
 * Tokens only (theme.css): --bg-2,--panel,--panel-2,--line,--line-2,--blue,
 * --blue-bright,--blue-glow,--gold,--green,--red,--text,--muted,--muted-2,
 * --sans,--disp,--r,--ease,--t,--elev-2,--wrap. No bare hex, no new fonts.
 * ========================================================================== */

/* ---- header shell ---- */
.udt-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.udt-header-inner {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 62px;
}
.udt-brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.udt-brand-logo { height: 34px; width: auto; display: block; }

.udt-nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.udt-nav-link {
  font-family: var(--sans); font-size: 13.5px; font-weight: 500;
  color: var(--muted); text-decoration: none;
  padding: 8px 12px; border-radius: 8px;
  transition: color var(--t), background-color var(--t);
  white-space: nowrap;
}
.udt-nav-link:hover { color: var(--text); background: var(--panel); }
.udt-nav-link.active { color: var(--blue-bright); background: var(--panel); }

.udt-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.udt-chip {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
  padding: 6px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
}
.udt-chip .k { font-family: var(--sans); font-size: 9px; letter-spacing: .08em; color: var(--muted-2); text-transform: uppercase; }
.udt-chip .v { font-family: var(--disp); font-size: 15px; font-weight: 700; }
.udt-chip .v.cash { color: var(--text); }
.udt-chip .v.pts { color: var(--gold); }

.udt-activity-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 13px; cursor: pointer;
  transition: border-color var(--t), color var(--t), box-shadow var(--t);
}
.udt-activity-btn:hover { border-color: var(--blue); color: var(--blue-bright); box-shadow: 0 6px 22px -10px var(--blue-glow); }
.udt-activity-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 8px -1px var(--blue-glow); }

.udt-acct {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--text); font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 5px 11px 5px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px;
  transition: border-color var(--t);
}
.udt-acct:hover { border-color: var(--line-2); }
.udt-acct .ava {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue); color: var(--bg-2); font-weight: 800; font-size: 12px;
}

/* ---- scrim (fixed; fades; never in flow) ---- */
.udt-scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 8, 13, .6);
  opacity: 0; transition: opacity var(--t); pointer-events: none;
}
.udt-scrim[hidden] { display: none; }
body.udt-center-open .udt-scrim { opacity: 1; pointer-events: auto; }

/* ---- Activity Center drawer (fixed + translateX; zero layout shift) ---- */
.udt-activity {
  position: fixed; top: 0; right: 0; z-index: 51;
  width: 380px; max-width: 92vw; height: 100vh; height: 100dvh;
  background: var(--panel); border-left: 1px solid var(--line-2);
  box-shadow: var(--elev-2);
  transform: translateX(100%);
  transition: transform var(--t);
  display: flex; flex-direction: column;
  will-change: transform;
}
body.udt-center-open .udt-activity { transform: translateX(0); }

.udt-activity-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.udt-activity-head h2 { font-family: var(--disp); font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.udt-activity-close {
  background: transparent; border: none; color: var(--muted); font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: 7px; transition: color var(--t), background-color var(--t);
}
.udt-activity-close:hover { color: var(--text); background: var(--panel-2); }

.udt-activity-body { overflow-y: auto; flex: 1; padding: 16px 20px 24px; }
.udt-activity-sec { margin-bottom: 22px; }
.udt-activity-sec h3 {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted-2); margin: 0 0 11px;
}

/* milestones */
.udt-milestone { margin-bottom: 13px; }
.udt-ms-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.udt-ms-name { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--text); }
.udt-ms-cost { font-family: var(--disp); font-size: 12px; color: var(--muted); }
.udt-ms-bar { height: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.udt-ms-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-deep), var(--blue)); transition: width var(--t); }
.udt-milestone.reached .udt-ms-bar i { background: linear-gradient(90deg, var(--gold), var(--gold)); }
.udt-milestone.reached .udt-ms-cost { color: var(--gold); }

/* settlement lines */
.udt-line { padding: 10px 0; border-bottom: 1px solid var(--line); }
.udt-line-main { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.udt-line-fmt { font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--text); }
.udt-line-rank { font-family: var(--disp); font-size: 13px; font-weight: 700; color: var(--muted); }
.udt-line.dq .udt-line-rank { color: var(--red); }
.udt-line-meta { display: flex; gap: 12px; align-items: baseline; font-family: var(--disp); font-size: 12px; }
.udt-line-pnl.pos { color: var(--green); }
.udt-line-pnl.neg { color: var(--red); }
.udt-line-prize { color: var(--gold); }
.udt-line-time { color: var(--muted-2); margin-left: auto; }
.udt-empty { font-family: var(--sans); font-size: 13px; color: var(--muted-2); padding: 8px 0; }

/* ---- responsive: nav collapses; chips/drawer adapt ---- */
@media (max-width: 860px) {
  .udt-nav { display: none; }
  .udt-header-inner { gap: 12px; }
}
@media (max-width: 520px) {
  .udt-chip .k { display: none; }
  .udt-chip { padding: 7px 9px; }
  .udt-acct span[data-role='hdr-name'] { display: none; }
  .udt-activity-btn { padding: 8px 10px; }
}
@media (max-width: 430px) {
  .udt-header-inner { gap: 8px; }
  .udt-header-right { gap: 6px; }
  .udt-chip { padding: 6px 8px; font-size: 12px; }
  /* Activity button becomes icon-dot only; label text hidden */
  .udt-activity-btn { padding: 8px; font-size: 0; }
  .udt-activity-btn .dot { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .udt-activity, .udt-scrim, .udt-ms-bar i { transition: none; }
}

/* logout control in header account area */
.udt-logout {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--t), border-color var(--t);
}
.udt-logout:hover { color: var(--red); border-color: var(--red); }

/* C-6 · header unverified alert badge (gold, routes to onboarding) */
.udt-verify-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--gold); text-decoration: none;
  background: rgba(255, 194, 71, .08);
  border: 1px solid var(--gold); border-radius: 9px;
  padding: 7px 12px; transition: background-color var(--t);
}
.udt-verify-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px -1px var(--gold); }
.udt-verify-badge:hover { background: rgba(255, 194, 71, .16); }

/* NOT module · Activity Center notification feed (PRD §14 / DL-S-015) */
.udt-notif { display: flex; gap: 11px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.udt-notif:last-child { border-bottom: none; }
.udt-notif-ico {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted);
}
.udt-notif.ok .udt-notif-ico { background: rgba(35,209,139,.14); border-color: rgba(35,209,139,.4); color: var(--green); }
.udt-notif.gold .udt-notif-ico { background: rgba(255,194,71,.14); border-color: rgba(255,194,71,.45); color: var(--gold); }
.udt-notif-body { flex: 1; min-width: 0; }
.udt-notif-text { font-family: var(--sans); font-size: 13px; color: var(--text); line-height: 1.35; }
.udt-notif-meta { font-family: var(--sans); font-size: 11px; color: var(--muted-2); margin-top: 2px; }

/* Touch targets ≥44px on touch devices (ui-ux-pro-max priority 2) */
@media (pointer: coarse) {
  .udt-activity-btn, .udt-logout, .udt-acct, .udt-nav-link { min-height: 44px; }
  .udt-logout, .udt-activity-btn { min-width: 44px; }
}
