/* SHN Platform design system — current Shopify Polaris (2026) tokens.
   Values sourced from polaris-react.shopify.com/tokens/color.
   Shared tokens + components for the admin app; the public site mirrors these. */
:root {
  --shn-brand: #303030;         /* primary action / brand fill (color-bg-fill-brand) */
  --shn-brand-hover: #1a1a1a;   /* color-bg-fill-brand-hover/active */
  --ink: #303030;               /* color-text */
  --ink-subdued: #616161;       /* color-text-secondary */
  --interactive: #005bd3;       /* color-text-link / focus */
  --bg: #f1f1f1;                /* color-bg (page) */
  --surface: #ffffff;           /* color-bg-surface (card) */
  --border: #e3e3e3;            /* color-border */
  --border-secondary: #ebebeb;  /* color-border-secondary */
  --critical: #c70a24;          /* color-bg-fill-critical */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.08);
  --shadow-card: 0 0 0 1px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--interactive); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.muted { color: var(--ink-subdued); font-size: 13px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.container { max-width: 1040px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.btn-primary { background: var(--shn-brand); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--shn-brand-hover); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); box-shadow: var(--shadow); }
.btn-secondary:hover { background: #fafafa; text-decoration: none; }
.btn-danger { background: var(--surface); color: var(--critical); border-color: var(--border); box-shadow: var(--shadow); }
.btn-danger:hover { background: #fde7ea; text-decoration: none; }

/* Forms (also styles allauth's default markup) */
label { display: block; font-weight: 500; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input:not([type]) {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px;
}
input:focus { outline: none; border-color: var(--interactive); box-shadow: 0 0 0 2px rgba(0,91,211,.25); }
button[type=submit], input[type=submit] {
  background: var(--shn-brand); color: #fff; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 10px 16px; font-family: inherit;
  font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow);
}
button[type=submit]:hover, input[type=submit]:hover { background: var(--shn-brand-hover); }
.form-row { margin-bottom: 14px; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }

/* ============================================================
   App shell — authenticated area (left sidebar, Shopify-admin style)
   ============================================================ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); padding: 14px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar-brand { font-weight: 600; font-size: 16px; letter-spacing: -.01em; padding: 6px 10px 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.nav-item.nav-foot { margin-top: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 500; font-size: 14px;
}
.nav-item:hover { background: #f6f6f6; text-decoration: none; }
.nav-item.is-active { background: #f1f1f1; color: var(--ink); }
.nav-item.is-active .nav-icon { color: var(--interactive); }
.nav-item.is-disabled { color: #9c9c9c; cursor: default; }
.nav-item.is-disabled:hover { background: transparent; }
.nav-item em { margin-left: auto; font-style: normal; font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: #9c9c9c; border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; }
.nav-icon { flex-shrink: 0; color: var(--ink-subdued); }

/* Expandable nav group (e.g. B2B) */
.nav-group { display: contents; }
.nav-group-summary { list-style: none; cursor: pointer; }
.nav-group-summary::-webkit-details-marker { display: none; }
.nav-caret { margin-left: auto; width: 8px; height: 8px; border-right: 1.6px solid #9c9c9c;
  border-bottom: 1.6px solid #9c9c9c; transform: rotate(-45deg); transition: transform .15s; }
.nav-group[open] .nav-caret { transform: rotate(45deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 14px;
  padding-left: 10px; border-left: 1px solid var(--border-secondary); }
.nav-sub .nav-item { font-size: 13px; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
}
.app-topbar-title { font-weight: 600; font-size: 15px; }
.app-content { padding: 24px 28px; max-width: 1180px; width: 100%; }

/* Analytics header: tabs + range picker */
.an-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.an-sub { margin: 6px 0 20px; }
.tabs { display: flex; gap: 4px; background: #eaeaea; padding: 3px; border-radius: var(--radius-sm); }
.tab { padding: 6px 14px; border-radius: 6px; font-weight: 500; font-size: 13px; color: var(--ink-subdued); }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.an-range select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 8px 34px 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23616161' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}

/* Analytics section sub-nav */
.an-secnav { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.secnav-item { padding: 8px 2px 12px; font-size: 14px; font-weight: 500; color: var(--ink-subdued);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.secnav-item:hover { text-decoration: none; color: var(--ink); }
.secnav-item.is-active { color: var(--ink); border-bottom-color: var(--interactive); }

/* Flash messages */
.msgs { list-style: none; margin: 0 0 16px; padding: 0; }
.msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 8px; }
.msg.success { background: #e3f3ea; color: #0a6b3b; }
.msg.error { background: #fde7ea; color: var(--critical); }

/* Settings tab */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 16px; }
.settings-card h2 { margin-bottom: 14px; }
.settings-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; margin-bottom: 16px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }

/* Per-order simulation panel */
.sim { background: var(--surface-subdued, #f7f7f7); border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm); padding: 14px 16px; align-self: start; }
.sim h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-subdued);
  margin: 0 0 10px; }
.sim-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 4px 0; white-space: nowrap; }
.sim-row span { color: var(--ink-subdued); }
.sim-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sim-row b i { font-style: normal; font-weight: 400; font-size: 10px; color: var(--ink-subdued); margin-left: 2px; }
.sim-row.hl { border-top: 1px solid var(--border-secondary); border-bottom: 1px solid var(--border-secondary);
  margin: 4px 0; padding: 7px 0; }
.sim-row.hl b { font-size: 13px; }

@media (max-width: 620px) { .settings-body { grid-template-columns: 1fr; } }
.field { font-weight: 500; }
.field > span { display: block; font-size: 12px; color: var(--ink-subdued); margin-bottom: 4px; }
.field .hint { display: block; font-weight: 400; font-size: 11px; color: var(--ink-subdued); margin-top: 3px; font-style: normal; }
.field .err { display: block; font-weight: 500; font-size: 11px; color: var(--critical); margin-top: 3px; font-style: normal; }
.inp { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; }
.inp:focus { outline: none; border-color: var(--interactive); box-shadow: 0 0 0 2px rgba(0,91,211,.25); }
.inp-sm { max-width: 90px; }

/* Goals grid */
.goals-tbl .inp { text-align: right; }
.goals-tbl td.num { padding: 6px 8px; }
.goals-tbl th, .goals-tbl td:first-child { white-space: nowrap; }
.goals-tbl .js-adspend { max-width: 150px; display: inline-block; margin-left: auto; }
.goals-tbl .roas-cell { white-space: nowrap; color: var(--ink-subdued); }
.goals-tbl .js-roas { max-width: 80px; display: inline-block; }
.goals-tbl .goal-ns { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* KPI cards (overview) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 18px; color: var(--ink); display: block;
  transition: box-shadow .15s, border-color .15s;
}
.kpi-card:hover { text-decoration: none; border-color: #d0d0d0; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.kpi-card-head { display: flex; align-items: center; justify-content: space-between; }
.kpi-seg { font-weight: 600; font-size: 14px; }
.kpi-hero { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 10px; }
.kpi-hero .cur { font-size: 14px; font-weight: 500; color: var(--ink-subdued); }
.kpi-hero-label { font-size: 12px; color: var(--ink-subdued); text-transform: uppercase; letter-spacing: .04em; }
.kpi-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 14px;
  border-top: 1px solid var(--border-secondary); padding-top: 12px; }
.kpi-mini > div { display: flex; justify-content: space-between; font-size: 13px; }
.kpi-mini span { color: var(--ink-subdued); }
.kpi-mini b { font-weight: 600; }

/* Comparison indicator — Shopify admin style: a small coloured triangle + a
   plain percentage. No background pill, no italics. The triangle carries the
   direction, so the number is the absolute value. */
.cmp { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; line-height: 1.2; }
.cmp::before { font-size: 8px; line-height: 1; }
/* Tone = colour (follows sign: positive good/green). Arrow = direction, set
   independently so a "lower is better" metric can be green pointing down. */
.cmp.tone-up { color: #047b5d; }
.cmp.tone-down { color: #e22c38; }
.cmp.tone-flat { color: var(--ink-subdued); }
.cmp.arrow-up::before { content: "\25B2"; }     /* ▲ */
.cmp.arrow-down::before { content: "\25BC"; }   /* ▼ */
.cmp.arrow-flat::before { content: "\2013"; }   /* – */
.cmp-lbl { color: var(--ink-subdued); font-weight: 400; margin-left: 1px; }

/* Comparison rows */
.kpi-cmprow { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; min-height: 16px; }
.stat-cmp { margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.stat-cmp.muted { font-size: 12px; color: var(--ink-subdued); }

/* Contribution margin block on the overview card. */
.kpi-cm { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-secondary); }
.kpi-cm span { color: var(--ink-subdued); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-cm b { font-size: 18px; font-weight: 600; }

/* Target-CAC annotation. */
.kpi-mini .tgt { color: var(--ink-subdued); font-weight: 500; font-style: normal; margin-left: 3px; }

/* Sparkline */
.spark-wrap { position: relative; margin: 14px 0 2px; }
.spark { width: 100%; height: 42px; display: block; }
.spark-line { fill: none; stroke: var(--interactive); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark-area { fill: rgba(0,91,211,.08); stroke: none; }
.spark-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--interactive); transform: translate(-50%, -50%); }
/* Sparkline hover: vertical guide + point marker + reused tip styling */
.spark-vline { position: absolute; top: 0; height: 42px; width: 1px;
  background: var(--border); transform: translateX(-0.5px); pointer-events: none; }
.spark-hover-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--interactive); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px var(--surface); pointer-events: none; z-index: 4; }
/* On hover the moving dot represents the cursor point, so hide the static
   end-of-series dot to avoid two blue dots at once. */
.spark-wrap:hover .spark-dot { opacity: 0; }
.spark-tip { top: 0; }

/* Country flag on KPI cards — flat SVG, crisp and OS-independent */
.flag { display: inline-block; height: 14px; width: auto; border-radius: 2px;
  vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.10); }

/* Analytics head controls (range + refresh) */
.an-controls { display: flex; align-items: flex-start; gap: 8px; }
.an-refresh { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.an-refresh .btn { padding: 8px 14px; font-size: 13px; }
.refresh-time { font-size: 11px; color: var(--ink-subdued); }
.msg.refreshing { background: #eef4ff; color: #1f4fbf; display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 14px 0; padding: 12px 16px; }

/* ROAS slider (goals) */
.roas-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.js-roas { flex: 1; accent-color: #005bd3; cursor: pointer; }
.roas-val { min-width: 34px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Daily table (segment detail) — compact, profitsheet-like */
.tbl-scroll { max-height: 640px; overflow-y: auto; }
.daily-legend { margin: 0 0 12px; font-size: 12px; }
.daily-tbl { font-size: 13px; }
.daily-tbl thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.daily-tbl td, .daily-tbl th { padding: 6px 10px; }
.daily-tbl .key { font-weight: 600; }
.daily-tbl th i { font-style: normal; font-weight: 400; color: var(--ink-subdued); font-size: 11px; }
.daily-tbl .dev { font-style: normal; font-weight: 500; font-size: 11px; margin-left: 3px; }
.daily-tbl .dev.pos { color: #047b5d; }
.daily-tbl .dev.neg { color: #e22c38; }
.pos { color: #047b5d; }
.neg { color: #e22c38; }
.daily-tbl tfoot td { border-top: 2px solid var(--border); font-weight: 600; background: var(--surface); position: sticky; bottom: 0; }
.nowrap { white-space: nowrap; }

/* Single-segment detail */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 14px 16px; }
.stat span { display: block; font-size: 11px; color: var(--ink-subdued); text-transform: uppercase; letter-spacing: .03em; }
.stat b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-top: 4px; white-space: nowrap; }

.chart-card { margin-bottom: 16px; }
.chart-card h2 { margin-bottom: 14px; }
.chart { display: flex; gap: 10px; }
.chart-plot { flex: 1; position: relative; }
.chart-plot svg { display: block; height: 240px; width: 100%; }
.chart-line { fill: none; stroke: var(--interactive); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-area { fill: rgba(0,91,211,.07); stroke: none; }
.grid { stroke: var(--border-secondary); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* Chart hover cursor + tooltip */
.chart-cursor { position: absolute; inset: 0; pointer-events: none; }
.chart-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); transform: translateX(-0.5px); }
.chart-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: var(--interactive); border: 2px solid var(--surface);
  transform: translate(-50%, -50%); box-shadow: 0 0 0 1px var(--interactive); }
.chart-tip { position: absolute; pointer-events: none; z-index: 5;
  background: var(--ink); color: #fff; border-radius: 6px; padding: 6px 9px;
  font-size: 12px; line-height: 1.35; white-space: nowrap; box-shadow: var(--shadow); }
.chart-tip b { display: block; font-weight: 600; }
.chart-tip span { color: rgba(255,255,255,.8); }
.chart-yaxis { display: flex; flex-direction: column; justify-content: space-between; width: 46px;
  font-size: 11px; color: var(--ink-subdued); text-align: right; padding: 4px 0; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-subdued); padding: 8px 10px;
  border-bottom: 1px solid var(--border); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border-secondary); }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Campaigns ------------------------------------------------------- */
.camp-secnav { justify-content: space-between; align-items: center; }
.camp-secnav .btn { margin-bottom: 8px; }
.secnav-tabs { display: flex; gap: 20px; }

.camp-section { margin-bottom: 26px; }
.camp-section-title { font-size: 12px; font-weight: 600; margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-subdued); }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.camp-card { display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 16px;
  color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.camp-card:hover { border-color: var(--interactive); box-shadow: var(--shadow); text-decoration: none; }
.camp-name { color: var(--ink); }
.camp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.camp-name { font-size: 15px; font-weight: 600; margin: 0; }
.camp-status { font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.camp-status.is-active { background: #e3f3ea; color: #0a6b3b; }
.camp-status.is-upcoming { background: #eaf0fd; color: #005bd3; }
.camp-status.is-previous { background: #f1f1f1; color: #616161; }
.camp-emc { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px;
  border-radius: 20px; white-space: nowrap; background: #f4ecd8; color: #8a6d1f;
  border: 1px solid #e7d9b0; }
.camp-dates { font-size: 13px; color: var(--ink); margin-bottom: 8px; }
.camp-offer { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.camp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 3px 9px; border: 1px solid var(--border); border-radius: 20px;
  color: var(--ink); background: var(--surface); }
.chip-scope { background: #f7f7f7; }

.camp-prev > summary { display: inline-flex; cursor: pointer; list-style: none; margin-bottom: 14px; }
.camp-prev > summary::-webkit-details-marker { display: none; }

/* Month calendar (Mac Calendar-style) */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-title { font-size: 18px; font-weight: 600; margin: 0; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-arrow { width: 32px; height: 32px; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 18px; line-height: 1; color: var(--ink); background: var(--surface); }
.cal-arrow:hover { background: #fafafa; text-decoration: none; }
.cal-today-btn { padding: 7px 14px; }

.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.cal-wd { padding: 8px 8px; font-size: 12px; font-weight: 500; color: var(--ink-subdued); }
.cal-grid { --daynum-h: 26px; --bar-h: 20px; border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); overflow: hidden; }
.cal-week { position: relative;
  min-height: max(92px, calc(var(--daynum-h) + var(--lanes) * (var(--bar-h) + 2px) + 10px));
  border-top: 1px solid var(--border-secondary); }
.cal-week:first-child { border-top: none; }
.cal-days { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { border-right: 1px solid var(--border-secondary); padding: 4px 8px; }
.cal-day:last-child { border-right: none; }
.cal-day.is-out { background: #fafafa; }
.cal-daynum { font-size: 12px; color: var(--ink-subdued); font-variant-numeric: tabular-nums; }
.cal-day.is-out .cal-daynum { color: #c9c9c9; }
.cal-day.is-today .cal-daynum { background: var(--interactive); color: #fff; border-radius: 50%;
  width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.cal-bars { position: absolute; inset: 0; pointer-events: none; }
.cal-bar { position: absolute; height: var(--bar-h); box-sizing: border-box;
  display: flex; align-items: center; padding: 0 7px; font-size: 11px; font-weight: 500;
  color: #fff; overflow: hidden; pointer-events: auto; }
.cal-bar { cursor: pointer; text-decoration: none; transition: filter .15s; }
.cal-bar:hover { filter: brightness(.9); text-decoration: none; }
.cal-bar.r-start { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.cal-bar.r-end { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.cal-bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: middle; }

.ch-NO { background: #005bd3; }
.ch-EU { background: #00857a; }
.ch-NO_B2B { background: #6941c6; }
.ch-multi { background: #616161; }

/* Campaign form */
.camp-form { max-width: 640px; }
.camp-form h2 { margin-bottom: 18px; }
.camp-form .field { margin-bottom: 16px; }
.camp-form .field > label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.camp-form input[type=text], .camp-form input[type=date] { width: 100%; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
.check-group ul { list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 18px; }
.check-group label { display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 400; margin: 0; }
.check-inline { display: inline-flex !important; align-items: center; gap: 8px;
  font-weight: 400 !important; font-size: 14px; }
.field.is-disabled { opacity: .5; }
.field-err { color: var(--critical); font-size: 12px; margin: 5px 0 0; }
.form-errors { background: #fde7ea; color: var(--critical); padding: 10px 14px;
  border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form-actions .camp-delete { margin-right: auto; }
.field-hint { margin-top: 6px; }

/* Members */
.members-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.members-head .muted { margin: 0; }
.members-table td { vertical-align: middle; }
.m-email { font-weight: 500; }
.m-name { font-size: 12px; }
.m-status { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.m-status.is-active { background: #e3f3ea; color: #0a6b3b; }
.m-status.is-invited { background: #fdf3e0; color: #8a6d1f; }
.m-status.is-suspended { background: #f1f1f1; color: #616161; }
.chip-owner { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px;
  border-radius: 20px; background: #f4ecd8; color: #8a6d1f; border: 1px solid #e7d9b0; }
.m-actions { white-space: nowrap; }
.m-actions a { margin-left: 12px; }
.m-actions a:first-child { margin-left: 0; }
.link-danger { color: var(--critical); }
.invite-link { display: flex; gap: 8px; margin: 14px 0; }
.invite-link input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fafafa; color: var(--ink); }

/* Settings → Profile */
.acct-dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0 0 20px; font-size: 14px; }
.acct-dl dt { color: var(--ink-subdued); }
.acct-dl dd { margin: 0; }

/* B2B — Stores */
.b2b-head { margin-bottom: 16px; }
.b2b-head .muted { margin: 4px 0 0; }
.b2b-tbl { font-size: 11.5px; }
.b2b-tbl th, .b2b-tbl td { padding: 5px 7px; }
.b2b-tbl th.num, .b2b-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.b2b-tbl .b2b-store { font-weight: 500; white-space: nowrap; }
.b2b-tbl tfoot td { border-top: 2px solid var(--border); font-weight: 500; }
.b2b-foot { margin-top: 12px; }
.tier { display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 5px; font-size: 11px; font-weight: 700; }
.tier-A { background: #e3f3ea; color: #0a6b3b; }
.tier-B { background: #eaf0fd; color: #005bd3; }
.tier-C { background: #f1f1f1; color: #616161; }

/* B2B — Finances */
.b2b-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.b2b-kpi { padding: 16px 18px; }
.b2b-kpi-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-subdued); }
.b2b-kpi-value { font-size: 26px; font-weight: 600; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.b2b-kpi.is-neg .b2b-kpi-value { color: var(--critical); }
.b2b-kpi-sub { font-size: 12px; color: var(--ink-subdued); }
.b2b-fin-tbl th.num, .b2b-fin-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.b2b-fin-tbl td.neg { color: var(--critical); }
.settings-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.settings-cols .camp-form { max-width: none; }
.target-input { width: 130px; text-align: right; font-variant-numeric: tabular-nums; }

/* Roles dashboard — View/Edit grid */
.perm-grid { border-collapse: collapse; margin: 2px 0 0; font-size: 14px; }
.perm-grid thead th { font-weight: 500; color: var(--ink-subdued); font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; padding: 0 0 8px; }
.perm-grid th, .perm-grid td { text-align: left; padding: 7px 0; }
.perm-grid th:not(:first-child), .perm-grid td:not(:first-child) { text-align: center; width: 72px; }
.perm-grid tbody tr { border-top: 1px solid var(--border-secondary); }

/* Non-clickable campaign card / calendar bar (view-only members) */
.camp-card-static { cursor: default; }
.camp-card-static:hover { border-color: var(--border); box-shadow: var(--shadow-card); }
.cal-bar-static { cursor: default; }
.cal-bar-static:hover { filter: none; }

@media (max-width: 720px) {
  .sidebar { width: 60px; }
  .sidebar-brand, .nav-item span, .nav-item em { display: none; }
  .nav-item { justify-content: center; }
}
