/* =====================================================================
   MARKETING GROWTH OS — shell styles (Sprint 1)
   Uses brand tokens from /brand-tokens.css. Dark canvas, orange accent,
   Inter. Desktop: fixed sidebar + header. Mobile: bottom nav (5 areas),
   tables -> cards, 44px touch targets (spec §24).
   ===================================================================== */
:root { --mkt-sidebar: 248px; --mkt-header: 56px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.mkt-body {
  background: var(--brand-dark); color: var(--brand-text);
  font-family: var(--font-body); -webkit-font-smoothing: antialiased;
}
.mkt-boot { padding: 40px; color: var(--brand-muted); }
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.mkt-shell { display: grid; grid-template-columns: var(--mkt-sidebar) 1fr; min-height: 100vh; }
.mkt-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--mkt-sidebar);
  background: var(--brand-panel); border-right: 1px solid var(--brand-line);
  display: flex; flex-direction: column; overflow-y: auto;
}
.mkt-main { grid-column: 2; display: flex; flex-direction: column; min-width: 0; }

/* ---------- Sidebar ---------- */
.mkt-brand { padding: 16px; border-bottom: 1px solid var(--brand-line); }
.mkt-brand b { font-family: var(--font-head); color: var(--brand-orange); font-size: 15px; letter-spacing: -.01em; }
.mkt-brand small { display: block; color: var(--brand-muted); font-size: 11px; margin-top: 2px; }
.mkt-nav { padding: 8px; flex: 1; }
.mkt-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px;
  border-radius: 8px; color: var(--brand-text); font-size: 14px; font-weight: 500;
}
.mkt-nav a:hover { background: rgba(255,255,255,.04); }
.mkt-nav a.active { background: var(--brand-orange); color: #fff; }
.mkt-side-foot { padding: 12px; border-top: 1px solid var(--brand-line); font-size: 12px; color: var(--brand-muted); }
.mkt-side-foot a { color: var(--brand-orange-soft); }

/* ---------- Header ---------- */
.mkt-header {
  position: sticky; top: 0; z-index: 5; height: var(--mkt-header);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: rgba(11,11,13,.85); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--brand-line);
}
.mkt-header h1 { font-family: var(--font-head); font-size: 16px; margin: 0; font-weight: 700; }
.mkt-header .spacer { flex: 1; }
.mkt-user { font-size: 12px; color: var(--brand-muted); }
.mkt-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--brand-line); color: var(--brand-muted); }
.mkt-badge.role { color: var(--brand-orange-soft); border-color: var(--brand-orange-dim); }

/* ---------- Content ---------- */
.mkt-content { padding: 20px; }
.mkt-page-title { font-family: var(--font-head); font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.mkt-page-sub { color: var(--brand-muted); font-size: 13px; margin: 0 0 20px; }

/* Sticky filter bar (shell placeholder) */
.mkt-filters {
  position: sticky; top: var(--mkt-header); z-index: 4;
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--brand-line); background: var(--brand-dark);
}
.mkt-chip { padding: 6px 12px; min-height: 32px; border: 1px solid var(--brand-line);
  border-radius: 999px; font-size: 12px; color: var(--brand-muted); background: transparent; cursor: default; }

/* KPI grid */
.mkt-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 12px; margin-bottom: 24px; }
.mkt-kpi { background: var(--brand-panel); border: 1px solid var(--brand-line); border-radius: 12px; padding: 14px; }
.mkt-kpi .k { font-size: 12px; color: var(--brand-muted); }
.mkt-kpi .v { font-family: var(--font-head); font-size: 22px; font-weight: 800; margin-top: 6px; }
.mkt-kpi .v.empty { color: var(--brand-muted); }

/* Panels */
.mkt-panel { background: var(--brand-panel); border: 1px solid var(--brand-line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.mkt-panel h3 { font-family: var(--font-head); font-size: 14px; margin: 0 0 12px; }
.mkt-funnel-step { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--brand-line); font-size: 13px; }
.mkt-funnel-step:last-child { border-bottom: 0; }
.mkt-funnel-step .n { color: var(--brand-muted); }
.mkt-empty { color: var(--brand-muted); font-size: 13px; }
.mkt-note { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--brand-orange-soft); }

/* Placeholder (non-dashboard sections in Sprint 1) */
.mkt-placeholder { background: var(--brand-panel); border: 1px dashed var(--brand-line);
  border-radius: 12px; padding: 32px; text-align: center; color: var(--brand-muted); }
.mkt-placeholder b { color: var(--brand-text); font-family: var(--font-head); }

/* Access denied / login */
.mkt-gate { max-width: 460px; margin: 12vh auto; padding: 28px; text-align: center;
  background: var(--brand-panel); border: 1px solid var(--brand-line); border-radius: 14px; }
.mkt-gate h2 { font-family: var(--font-head); margin: 0 0 8px; }
.mkt-gate p { color: var(--brand-muted); font-size: 14px; }
.mkt-btn { display: inline-block; margin-top: 14px; background: var(--brand-orange); color: #fff;
  border: 1px solid var(--brand-orange); border-radius: 10px; padding: 10px 18px; font-weight: 600; cursor: pointer; }
.mkt-btn:hover { background: var(--brand-orange-deep); }

/* ---------- Mobile bottom nav (5 primary areas) ---------- */
.mkt-bottomnav { display: none; }
@media (max-width: 860px) {
  .mkt-shell { grid-template-columns: 1fr; }
  .mkt-sidebar { display: none; }
  .mkt-main { grid-column: 1; }
  .mkt-content { padding: 14px 14px 84px; }
  .mkt-bottomnav {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 20;
    background: var(--brand-panel); border-top: 1px solid var(--brand-line);
  }
  .mkt-bottomnav a {
    flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font-size: 11px; color: var(--brand-muted); padding: 6px 2px;
  }
  .mkt-bottomnav a.active { color: var(--brand-orange); }
  .mkt-kpis { grid-template-columns: repeat(2,1fr); }
}
