/* ============================================================
 * Vilkax · /app/ — end-user PWA dashboard
 * ============================================================
 *
 * This is the end-user-facing surface. Different from /admin/wolf-den
 * (operator) and from / (marketing) — it's the THIRD dashboard
 * layer, and the one that ships inside the installed PWA on
 * Android / iOS / Mac / Windows / Linux.
 *
 * Reuses brand tokens from /style.css. Layout is "dashboard
 * dense" — multiple cards per row on desktop, single-column on
 * phones. No hero composition here — the user came here to DO
 * something, not absorb brand.
 */

.app-body {
  background: var(--bg-absolute, #0B1426);
  /* Override the centered-hero layout /style.css applies to <body>. */
  display: block;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(11, 20, 38, 0.85);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-brand-mark {
  /* Pass-146 — bumped 36 → 44 px to match the bigger brand
     posture across web surfaces. */
  width: 44px;
  height: 44px;
  filter:
    drop-shadow(0 4px 12px rgba(37, 99, 235, 0.35))
    drop-shadow(0 0 20px rgba(59, 130, 246, 0.18));
}
.app-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.app-brand-name {
  font-weight: 800;
  letter-spacing: 0.20em;
  color: var(--text-strong);
  font-size: 13px;
}
.app-brand-sub {
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}
.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.app-nav-link {
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color 180ms ease, background 180ms ease;
}
.app-nav-link:hover { color: var(--text-strong); background: rgba(255, 255, 255, 0.04); }
.app-nav-link.is-active {
  color: var(--brand-primary-bright, #3b82f6);
  background: rgba(59, 130, 246, 0.10);
}
.app-install-btn {
  margin-left: 8px;
  background: linear-gradient(135deg, var(--brand-primary-bright, #3b82f6), var(--brand-primary, #2563EB));
  color: #fff;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-brand, "Manrope", sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.30);
}
.app-install-btn:hover { filter: brightness(1.10); }

/* ── Tier badge + sign-in link in the nav ───────────────────── */
.app-tier-badge {
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.app-tier-badge[data-tier="free"]       { color: #94a3b8; }
.app-tier-badge[data-tier="pro"]        { color: var(--brand-primary-bright, #3b82f6); }
.app-tier-badge[data-tier="enterprise"] { color: #10b981; }
.app-signin-link {
  margin-left: 6px;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brand-primary-bright, #3b82f6);
  text-decoration: none;
}
.app-signin-link:hover { text-decoration: underline; }

@media (max-width: 540px) {
  .app-header   { flex-wrap: wrap; }
  .app-nav-link { padding: 8px 9px; font-size: 11px; letter-spacing: 0.05em; }
}

/* ── Main column ─────────────────────────────────────────────── */
.app-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Shield banner (the orb + headline + 24h counter) ─────── */
.app-shield {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 22px;
  border-radius: 18px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(37, 99, 235, 0.14), transparent 60%),
    rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
.app-shield-orb {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%,
      rgba(59, 130, 246, 0.55),
      rgba(37, 99, 235, 0.20) 60%,
      transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: appPulse 3.5s ease-in-out infinite;
}
.app-shield-orb-core {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, #3b82f6 0%, #2563EB 100%);
  box-shadow: 0 0 32px rgba(59, 130, 246, 0.65), inset 0 0 12px rgba(255, 255, 255, 0.30);
}
.app-shield[data-state="degraded"] .app-shield-orb-core {
  background: radial-gradient(circle, #fbbf24, #f59e0b);
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.55), inset 0 0 10px rgba(255, 255, 255, 0.30);
}
.app-shield[data-state="offline"] .app-shield-orb-core {
  background: radial-gradient(circle, #ff6b6b, #b91c1c);
  box-shadow: 0 0 24px rgba(255, 107, 107, 0.45), inset 0 0 10px rgba(255, 255, 255, 0.25);
}
@keyframes appPulse {
  0%, 100% { transform: scale(1.000); opacity: 1; }
  50%      { transform: scale(1.030); opacity: 0.88; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shield-orb { animation: none; }
}
.app-shield-headline {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-strong);
  line-height: 1.2;
}
.app-shield-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.app-shield-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
}
.app-shield-meta-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.app-shield-meta-lbl {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .app-shield      { grid-template-columns: 64px 1fr; }
  .app-shield-orb  { width: 64px; height: 64px; }
  .app-shield-orb-core { width: 34px; height: 34px; }
  .app-shield-meta { grid-column: 1 / -1; text-align: left; flex-direction: row; align-items: baseline; gap: 8px; margin-top: 4px; }
  .app-shield-meta-num { font-size: 24px; }
}

/* ── Card grid (live counters) ───────────────────────────────── */
.app-grid {
  display: grid;
  gap: 14px;
}
.app-grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.app-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.app-card-full {
  /* Full-width card with a header — used for the AB board,
   * coverage, OS info, and the locked personal panel. */
  padding: 20px 22px;
  gap: 12px;
}
.app-card-lbl {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.app-card-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.app-card-foot {
  font-size: 11px;
  color: var(--text-muted);
}
.app-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.app-card-h {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-strong);
}
.app-card-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.app-card-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── AB engine row ─────────────────────────────────────────── */
.app-ab {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-ab-row {
  display: grid;
  grid-template-columns: 1fr auto 110px auto;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.app-ab-row:last-child { border-bottom: 0; }
.app-ab-model {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--text-strong);
}
.app-ab-msgs {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.app-ab-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}
.app-ab-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 320ms ease;
}
.app-ab-bar-fill[data-low="true"] {
  background: linear-gradient(90deg, #ff6b6b, #f97316);
}
.app-ab-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

/* ── Coverage pills ───────────────────────────────────────── */
.app-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.app-cov-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.app-cov-pill[data-on="true"] {
  border-color: rgba(16, 185, 129, 0.40);
  color: #10b981;
}
.app-cov-pill[data-on="false"] {
  border-color: rgba(148, 163, 184, 0.30);
  color: #94a3b8;
}
.app-cov-pill-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* ── OS feature matrix ─────────────────────────────────────── */
.app-os-hint {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-strong);
}
.app-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.app-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}
.app-feature-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.app-feature[data-on="true"]  .app-feature-icon { background: rgba(16, 185, 129, 0.18); color: #10b981; }
.app-feature[data-on="false"] .app-feature-icon { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.app-feature-name { color: var(--text-strong); font-weight: 600; }
.app-feature-state { margin-left: auto; font-size: 11px; color: var(--text-muted); }

/* ── Locked personal panel ─────────────────────────────────── */
.app-card-locked {
  position: relative;
  opacity: 0.92;
}
.app-card-locked::before {
  content: "🔒";
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 16px;
  opacity: 0.55;
}
.app-locked-body {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.app-empty {
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 14px;
  margin: 0;
}

/* ── Footer ────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 20px 16px 30px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* ============================================================
 * /business/ portal — reuses .app-* primitives, adds hero + CTA
 * ============================================================ */

.biz-hero {
  display: grid;
  grid-template-columns: 1fr 160px;
  align-items: center;
  gap: 24px;
  padding: 32px 28px;
  border-radius: 20px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(37, 99, 235, 0.16), transparent 55%),
    rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  margin-bottom: 4px;
}
.biz-hero-h {
  margin: 0 0 12px;
  font-size: clamp(22px, 3.0vw, 32px);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text-strong);
  line-height: 1.2;
}
.biz-hero-accent {
  color: var(--brand-primary-bright, #3b82f6);
}
.biz-hero-sub {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}
.biz-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.biz-hero-cta .submit-btn {
  text-decoration: none;
  display: inline-block;
}
.biz-secondary {
  color: var(--brand-primary-bright, #3b82f6);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.biz-secondary:hover { text-decoration: underline; }
.biz-hero-foot {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--text-dim);
}
.biz-hero-orb {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%,
      rgba(59, 130, 246, 0.45),
      rgba(37, 99, 235, 0.16) 60%,
      transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: appPulse 4.5s ease-in-out infinite;
}
.biz-hero-orb-core {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, #3b82f6 0%, #2563EB 100%);
  box-shadow: 0 0 48px rgba(59, 130, 246, 0.55), inset 0 0 16px rgba(255, 255, 255, 0.30);
}

@media (max-width: 720px) {
  .biz-hero { grid-template-columns: 1fr; padding: 24px 20px; }
  .biz-hero-orb { display: none; }
}

/* ── Business capability grid ────────────────────────────── */
.biz-grid {
  display: grid;
  gap: 14px;
}
.biz-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.biz-cap-h {
  margin: 6px 0 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-strong);
}
.biz-cap-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.biz-cap-body code {
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 11px;
}

/* ── Feature list (the "what you'll see" bullets) ─────────── */
.biz-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.biz-feature-list li {
  position: relative;
  padding: 8px 12px 8px 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}
.biz-feature-list li::before {
  content: "▸";
  position: absolute;
  left: 10px;
  top: 9px;
  color: var(--brand-primary-bright, #3b82f6);
  font-weight: 700;
}
.biz-feature-list strong {
  color: var(--text-strong);
  font-weight: 700;
}
.biz-feature-list em {
  font-style: italic;
  color: var(--text-strong);
}
.biz-feature-list code {
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 11px;
}

/* ── Footer CTA ──────────────────────────────────────────── */
.biz-cta-foot {
  text-align: center;
  padding: 22px 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.biz-cta-foot a {
  margin-left: 6px;
}
