/* 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: #424242;         /* primary action / brand fill — dark grey (nudged lighter) */
  --shn-brand-hover: #2b2b2b;   /* 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 */
  /* Aliases some components reference (previously undefined → fell back to black). */
  --surface-subdued: #f6f6f7;
  --surface-secondary: #f1f1f1;
  --text-primary: #303030;
  --text-secondary: #616161;
  --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;
}

/* ---- Dark mode (per-user, set via <html data-theme="dark">) ------------ */
html[data-theme="dark"] {
  --shn-brand: #e6e6e6;         /* light button in dark (text flipped below) */
  --shn-brand-hover: #ffffff;
  --ink: #e7e7e7;
  --ink-subdued: #a6a6a6;
  --interactive: #5aa2ff;       /* lighter link for contrast on dark */
  --bg: #171717;
  --surface: #232323;
  --surface-subdued: #2b2b2b;
  --surface-secondary: #2b2b2b;
  --text-primary: #e7e7e7;
  --text-secondary: #a6a6a6;
  --border: #3a3a3a;
  --border-secondary: #333333;
  --critical: #ff5a6a;
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.55);
  --shadow-card: 0 0 0 1px rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.5);
  color-scheme: dark;           /* native controls (scrollbars, date picker) go dark */
}
html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
/* Primary button = light chip with dark text in dark mode. */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] button[type=submit]:not([class]) { color: #1a1a1a; }
/* Chrome bits with hardcoded light greys → dark equivalents. */
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .app-notif-item:hover,
html[data-theme="dark"] .cal-arrow:hover,
html[data-theme="dark"] .yr-month:hover,
html[data-theme="dark"] .portal-row:hover,
html[data-theme="dark"] .tm-tab:hover,
html[data-theme="dark"] .cal-day.is-out { background: #2a2a2a; }
html[data-theme="dark"] .kb-col { background: #2a2a2a; }
html[data-theme="dark"] .kb-count { background: #3a3a3a; color: var(--ink-subdued); }
html[data-theme="dark"] .set-sim { background: #2b2b2b; }
html[data-theme="dark"] .tabs { background: #2b2b2b; }
html[data-theme="dark"] .btn-secondary { background: #2b2b2b; color: var(--ink); border-color: var(--border); }
html[data-theme="dark"] .btn-secondary:hover { background: #333; }
html[data-theme="dark"] .btn-danger { background: #3a2226; }
html[data-theme="dark"] .kb-card, html[data-theme="dark"] .cov-box,
html[data-theme="dark"] .fb-modal-card, html[data-theme="dark"] .cov-modal .cov-box { background: var(--surface); }
/* Light pastel status chips → tint for dark while keeping legible text. */
html[data-theme="dark"] .chip-success, html[data-theme="dark"] .chip.chip-success { background: #14351f; color: #7fe0a6; }
html[data-theme="dark"] .chip-critical, html[data-theme="dark"] .chip.chip-critical { background: #3a1f24; color: #ff8f9c; }
html[data-theme="dark"] .chip-warn { background: #3a3320; color: #ecd08a; }
html[data-theme="dark"] .chip-info, html[data-theme="dark"] .chip { background: #22303f; color: #9cc4ff; }
* { 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;
  margin-bottom: 16px;   /* default spacing so stacked cards never touch */
}
/* Grid layouts space their own cards via gap — drop the stacking margin there. */
.store-cols > .card, .b2b-kpis > .card, .settings-grid > .card,
.stock-intel > .card, .kpi-grid > .card { margin-bottom: 0; }

/* Buttons */
.btn[hidden] { display: none; }   /* class display: beats the UA [hidden] rule, so restore it */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  padding: 9px 15px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
/* Shopify Polaris buttons: dark primary with a subtle darker bottom edge,
   white secondary with a hairline border + soft drop shadow. */
.btn-primary { background: var(--shn-brand); color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 -1px 0 rgba(0,0,0,.25); }
.btn-primary:hover { background: var(--shn-brand-hover); text-decoration: none; }
.btn-secondary { background: #f6f6f7; color: var(--ink); border-color: transparent;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), inset 0 0 0 1px rgba(0,0,0,.08), inset 0 -1px 0 rgba(0,0,0,.06); }
.btn-secondary:hover { background: #ececed; text-decoration: none; }
.btn-danger { background: var(--surface); color: var(--critical);
  border-color: var(--border); box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.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[type=number], input[type=url], input[type=tel], input[type=search],
input[type=time], input:not([type]), textarea, select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; }
input[type=file] { font-family: inherit; font-size: 13px; color: var(--ink-subdued); }
input[type=file]::file-selector-button {
  font-family: inherit; font-size: 13px; font-weight: 600; margin-right: 12px;
  padding: 8px 14px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: #f6f6f7; color: var(--ink); cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), inset 0 0 0 1px rgba(0,0,0,.08), inset 0 -1px 0 rgba(0,0,0,.06); }
input[type=file]::file-selector-button:hover { background: #ececed; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--interactive); box-shadow: 0 0 0 2px rgba(0,91,211,.25); }
input:hover:not(:focus), textarea:hover:not(:focus), select:hover:not(:focus) { border-color: #c9c9c9; }

/* Date/time fields: replace the browser's dated grey picker icon with a clean
   branded calendar, give the indicator a proper hit area + hover. */
input[type=date], input[type=time] { min-height: 40px; }
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator {
  width: 18px; height: 18px; padding: 3px; margin-left: 4px; opacity: .75;
  border-radius: 6px; cursor: pointer; transition: opacity .12s, background .12s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23005bd3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='17' rx='2.5'/%3E%3Cpath d='M16 2.5v4M8 2.5v4M3 9.5h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
input[type=date]::-webkit-calendar-picker-indicator:hover,
input[type=time]::-webkit-calendar-picker-indicator:hover {
  opacity: 1; background-color: rgba(0,91,211,.10);
}
input[type=date] { cursor: pointer; }   /* whole field opens the picker (see app_base JS) */

/* Shopify Polaris-style checkboxes + radios (custom-drawn, not the OS default). */
input[type=checkbox], input[type=radio] {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  width: 18px; height: 18px; margin: 0; flex: none; position: relative;
  background: var(--surface); border: 1.5px solid #8c9196; cursor: pointer;
  vertical-align: middle; transition: background .12s, border-color .12s, box-shadow .12s;
}
input[type=checkbox] { border-radius: 6px; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: #5c5f62; }
input[type=checkbox]:checked, input[type=radio]:checked { border-color: var(--interactive); }
input[type=checkbox]:checked { background: var(--interactive); }
input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
input[type=radio]:checked::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--interactive);
}
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(0,91,211,.30);
}
input[type=checkbox]:disabled, input[type=radio]:disabled {
  opacity: .45; cursor: not-allowed; }
/* Bare submit buttons only — anything with a class (.btn*, .chip*, .linklike)
   keeps its own styling (this element+attr selector would otherwise outrank
   those single-class rules). */
button[type=submit]:not([class]), input[type=submit]:not([class]) {
  background: var(--shn-brand); color: #fff; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 9px 15px; font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 -1px 0 rgba(0,0,0,.25);
}
button[type=submit]:not([class]):hover, input[type=submit]:not([class]):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 { display: inline-flex; align-items: baseline; gap: 5px; font-size: 17px;
  letter-spacing: -.02em; padding: 6px 10px 14px; text-decoration: none; }
.sidebar-brand:hover { text-decoration: none; }
.brand-shn { font-weight: 700; color: var(--ink); }
.brand-hub { font-weight: 600; color: var(--interactive); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.nav-item.nav-foot { margin-top: auto; }
.sidebar-user { padding: 8px 12px 2px; font-size: 12px; color: var(--ink-subdued);
  display: flex; flex-direction: column; gap: 2px; }
.sidebar-user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-subdued);
  font-weight: 500; width: fit-content; }
.sidebar-logout:hover { color: var(--critical); text-decoration: none; }
.sidebar-logout .nav-icon { width: 15px; height: 15px; }
.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); }
/* Red count badge (e.g. open fraud cases) pinned to the right of a nav item */
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--critical); color: #fff; font-size: 11px;
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge-info { background: var(--interactive); }   /* informational (e.g. restocks) */

/* 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-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-hamburger { display: none; background: none; border: none; cursor: pointer;
  color: var(--ink); padding: 2px; margin: -2px 0; }
.app-topbar-right { display: flex; align-items: center; gap: 18px; }
.app-backdrop { display: none; }
.app-notif { position: relative; display: inline-flex; }
.app-bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--ink-subdued); padding: 4px; }
.app-bell:hover, .app-bell.has-alerts { color: var(--ink); }
.app-bell .nav-icon { width: 20px; height: 20px; }
.app-bell-badge { position: absolute; top: -2px; right: -3px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--critical); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.app-notif-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 320px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,.12); overflow: hidden; }
.app-notif-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border-secondary); }
.app-notif-readall { border: none; background: none; color: var(--interactive); font-size: 12px;
  font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; }
.app-notif-readall:hover { text-decoration: underline; }
/* Read items stay listed but lose the red/colour emphasis. */
.app-notif-item.is-read .app-notif-dot { background: var(--border) !important; }
.app-notif-item.is-read .app-notif-label { color: var(--ink-subdued); }
.app-notif-item { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--border-secondary); color: var(--ink); font-size: 13px; }
.app-notif-item:last-child { border-bottom: none; }
.app-notif-item:hover { background: #fafafa; }
.app-notif-link { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0;
  color: var(--ink); text-decoration: none; }
.app-notif-link:hover { text-decoration: none; }
.app-notif-btn, .app-notif-x { flex: none; border: none; background: transparent; color: var(--ink-subdued);
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0 6px; border-radius: 4px; }
.app-notif-x { font-size: 18px; }
.app-notif-btn:hover, .app-notif-x:hover { background: #ececec; color: var(--ink); }
.app-notif-read { color: #1a9d5a; }
/* Read items keep showing but lose the ✓ (nothing to mark) + the colour emphasis. */
.is-read .app-notif-read { display: none; }
.app-notif-readall { text-transform: none; }
.app-notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--ink-subdued); }
.app-notif-item.lvl-warn .app-notif-dot { background: #b7791f; }
.app-notif-item.lvl-critical .app-notif-dot { background: var(--critical); }
.app-notif-item.lvl-info .app-notif-dot { background: var(--interactive); }
.app-notif-empty { padding: 18px 16px; font-size: 13px; }
.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; margin-bottom: 16px; }
.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);
  border: 0; background: transparent; cursor: pointer; font-family: inherit; line-height: 1.4; }
.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); }
/* Right-aligned action CTA inside a secnav row (e.g. B2B "+ Log activity"). */
.secnav-cta { margin-left: auto; align-self: center; margin-bottom: 6px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm);
  background: var(--interactive); color: #fff; white-space: nowrap; }
.secnav-cta:hover { text-decoration: none; filter: brightness(1.05); color: #fff; }
.secnav-cta.is-active { box-shadow: 0 0 0 2px rgba(0,91,211,.3); }

/* Fraud hold banner — always visible to CS/Admin/owner when holds await review */
.app-fraud-banner { display: block; background: var(--critical); color: #fff;
  padding: 10px 20px; font-size: 14px; font-weight: 600; text-decoration: none;
  text-align: center; }
.app-fraud-banner:hover { text-decoration: underline; color: #fff; }

/* Flash messages */
/* Flash messages — floating toasts (top-right); capped + auto-dismissed by base.html JS. */
.msgs { list-style: none; margin: 0; padding: 0; position: fixed; top: 68px; right: 20px;
  z-index: 1200; display: flex; flex-direction: column; gap: 10px;
  width: min(360px, calc(100% - 32px)); pointer-events: none; }
.msg { pointer-events: auto; cursor: pointer; padding: 12px 16px; border-radius: 10px; font-size: 14px;
  margin: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-left: 4px solid var(--border-secondary); box-shadow: 0 8px 28px rgba(0,0,0,.18);
  animation: msg-in .22s ease; }
@keyframes msg-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.msg.success { background: #e3f3ea; color: #0a6b3b; border-left-color: #0a6b3b; }
.msg.error { background: #fde7ea; color: var(--critical); border-left-color: var(--critical); }
.msg.warning { background: #fdf0d5; color: #8a5a00; border-left-color: #b26a00; }
.msg.info { background: #eaf0fd; color: #005bd3; border-left-color: #005bd3; }

/* 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-ro .ro-value { font-weight: 600; font-size: 14px; padding: 7px 0; font-variant-numeric: tabular-nums; }
.role-checks { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.role-checks label { font-weight: 400; display: inline-flex; align-items: center; gap: 8px; }
/* Keep the global 18px appearance:none checkbox size — `width:auto` collapses it to a line. */
.role-checks input { width: 18px; height: 18px; flex: none; }
.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 td { vertical-align: middle; }
.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) — flex lives on an inner wrap so the <td> stays a
   normal table cell that aligns with the sibling input cells. */
.roas-cell { min-width: 230px; }
.roas-wrap { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.roas-step { min-width: 30px; padding: 2px 8px; font-weight: 700; line-height: 1; }
.js-roas { flex: 1; accent-color: #005bd3; cursor: pointer; margin: 0; vertical-align: middle; }
.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: 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; }
/* Row highlight on hover — blue tint + blue left accent, consistent with the
   campaign list, so every list/table across the Hub scans the same way. */
.tbl tbody tr:hover td, .daily-tbl tbody tr:hover td { background: rgba(0,91,211,.07); }
.tbl tbody tr:hover td:first-child, .daily-tbl tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--interactive); }

/* ---- 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; }

/* Compact list — for Upcoming/Previous where there can be many campaigns. */
.camp-list { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.camp-row { display: grid; align-items: center; gap: 14px; padding: 11px 16px;
  grid-template-columns: minmax(160px, 1.8fr) minmax(140px, 1fr) minmax(90px, .9fr) auto;
  border-top: 1px solid var(--border); color: inherit; text-decoration: none;
  box-shadow: inset 3px 0 0 transparent; transition: background .12s, box-shadow .12s; }
.camp-row:first-child, .camp-row.is-first { border-top: none; }
.camp-row[hidden] { display: none; }   /* [hidden] must beat display:grid */
/* Shopify-style column header for the list */
.camp-row-head { padding-top: 9px; padding-bottom: 9px; background: var(--surface-subdued);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-subdued); cursor: default; box-shadow: none; }
.camp-row-head:hover { background: var(--surface-subdued); box-shadow: none; }
.camp-list .camp-row-head + .camp-row { border-top: none; }
@media (max-width: 760px) { .camp-row-head { display: none; } }
.camp-row:hover { background: rgba(0,91,211,.07); text-decoration: none;
  box-shadow: inset 3px 0 0 var(--interactive); }
.camp-row:hover .camp-name { color: var(--interactive); }
.camp-row-static { box-shadow: none; cursor: default; }
.camp-row-static:hover { background: var(--surface); box-shadow: none; }
.camp-row-static:hover .camp-name { color: inherit; }
.camp-row-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.camp-row .camp-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-row-dates { font-size: 13px; color: var(--ink); white-space: nowrap; }
.camp-row-when { font-size: 12px; white-space: nowrap; }
.camp-row-channels { display: flex; flex-wrap: wrap; gap: 6px; }
.camp-row-scope { font-size: 13px; color: var(--ink-subdued);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-row-offer { font-weight: 500; color: var(--ink); }
@media (max-width: 760px) {
  /* Stack each row into one readable column instead of a cramped 5-col grid. */
  .camp-row { grid-template-columns: 1fr; gap: 3px; padding: 12px 14px; }
  .camp-row-main { justify-content: space-between; }
  .camp-row .camp-name { white-space: normal; font-size: 15px; }
  .camp-row-when { display: none; }
  .camp-row-channels { margin-top: 2px; }
  .camp-row-scope { white-space: normal; }
}

.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-meta { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.camp-dates { font-size: 13px; color: var(--ink); }
.camp-countdown { display: inline-block; font-size: 12px; font-weight: 600;
  color: #8a5a00; background: #fdf0d5; padding: 2px 10px; border-radius: 20px; }
html[data-theme="dark"] .camp-countdown { background: #3a3320; color: #ecd08a; }
.camp-offer { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.camp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---- Campaign create wizard ------------------------------------------- */
.wiz-steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none;
  margin: 0 0 20px; padding: 0 0 16px; border-bottom: 1px solid var(--border); }
.wiz-step-tab { display: flex; align-items: center; gap: 8px; font-size: 13px;
  font-weight: 500; color: var(--text-subdued); padding: 6px 14px 6px 6px;
  cursor: pointer; user-select: none; white-space: nowrap; }
.wiz-step-tab .wiz-num { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 600;
  background: var(--surface-subdued); color: var(--text-subdued);
  border: 1px solid var(--border); }
.wiz-step-tab.is-active { color: var(--ink); }
.wiz-step-tab.is-active .wiz-num { background: var(--interactive); color: #fff; border-color: var(--interactive); }
.wiz-step-tab.is-done .wiz-num { background: #0a6b3b; color: #fff; border-color: #0a6b3b; }
.wiz-step-tab.is-done .wiz-num::after { content: "✓"; }
.wiz-step-tab.is-done .wiz-num { font-size: 0; }
.wiz-step-tab.is-done .wiz-num::after { font-size: 12px; }
.wiz-panel { display: none; }
.wiz-panel.is-active { display: block; animation: wizfade .18s ease; }
@keyframes wizfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.wiz-foot { display: flex; align-items: center; gap: 8px; }
.wiz-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wiz-choice { text-align: left; display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.wiz-choice:hover { border-color: var(--interactive); }
.wiz-choice.is-active { border-color: var(--interactive); box-shadow: 0 0 0 1px var(--interactive); }
.wiz-choice-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.wiz-choice-sub { font-size: 12px; color: var(--text-subdued); }
.shake { animation: shake .35s; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (max-width: 640px) { .wiz-choice-grid { grid-template-columns: 1fr; } }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  padding: 2px 7px; border: 1px solid var(--border); border-radius: 20px;
  color: var(--ink); background: var(--surface); }
.chip-scope { background: #f7f7f7; font-size: 10px; padding: 1px 7px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .03em; color: var(--ink-subdued); }
.chip-ok { background: #e6f4ea; border-color: #b7e0c4; color: #0a6b34; }
.chip-warn { background: #fdf2e0; border-color: #f4d9a8; color: #8a5a00; }
.chip-info { background: #eaf1fd; border-color: #c3d6f7; color: #1f4b99; }
.chip-new { background: #f1ecff; border-color: #d6c9f7; color: #5b2ec2; }
/* Role module-access: edit = solid, view = quiet. Compact grid, not a pill soup. */
.acc-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-acc { border-radius: 5px; padding: 1px 7px; font-size: 11px; font-weight: 500; }
.chip-acc-edit { background: var(--interactive); border-color: var(--interactive); color: #fff; }
.chip-acc-view { background: #eef1f5; border-color: #e0e4ea; color: var(--ink-subdued); }
.acc-legend { display: inline-flex; gap: 6px; align-items: center; margin-left: 12px; }
.acc-legend .chip-acc { cursor: default; }
.chip-muted { background: #f7f7f7; color: var(--ink-subdued); }
.chip-critical { background: #fde7ea; border-color: #f4b8c1; color: var(--critical); }
/* Shopify-style status pip inside a badge (replaces ad-hoc emoji). Inherits the
   chip's text colour so it matches the tone (amber for warn, red for critical…). */
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
/* System status page */
.sys-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.sys-summary { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.sys-summary-dot { width: 11px; height: 11px; border-radius: 50%; }
.sys-summary.is-ok .sys-summary-dot { background: #1a9c52; }
.sys-summary.is-down .sys-summary-dot { background: var(--critical); }
.sys-checked { font-weight: 400; font-size: 13px; }
.sys-group { margin-bottom: 16px; }
.sys-group h2 { margin-top: 0; }
.sys-name { font-weight: 500; }
.sys-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 9px; background: var(--ink-subdued); }
.sys-ok .sys-dot { background: #1a9c52; }
.sys-down .sys-dot { background: var(--critical); }
.sys-not_configured .sys-dot { background: #cfcfcf; }
.sys-detail { font-size: 12px; font-weight: 400; margin: 3px 0 0 17px; }
.sys-fix { font-size: 12px; color: #8a5a00; margin: 4px 0 0 17px; }
.sys-state { text-align: right; white-space: nowrap; }
.sys-latency { font-size: 12px; }
.chip-toggle { cursor: pointer; font: inherit; font-size: 12px; }
.chip-toggle:hover { border-color: var(--ink-subdued); }
.b2b-filters { display: inline-flex; gap: 12px; margin-top: 8px; }
.b2b-filters select { padding: 7px 34px 7px 12px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink); font-size: 13px; appearance: none; -webkit-appearance: none;
  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 fill='%23616161' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.b2b-filters select[name="status"] { min-width: 160px; }
.b2b-filters select[name="show"] { min-width: 175px; }
/* Reusable: any select with a long label (won't be shrunk below its text). */
.sel-lg { min-width: 12rem; }
.ma-am-btn { padding: 4px 9px; }
.ma-am-btn svg { width: 16px; height: 16px; }
.ma-jobs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ma-job { padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.ma-job span { flex: 1; }
.ma-job-x { border: 0; background: transparent; cursor: pointer; font-size: 18px;
  line-height: 1; color: var(--ink-subdued); padding: 0 2px; }
.ma-job-x:hover { color: var(--ink); }
.ma-job.is-pending { background: #fff8e6; border-color: #f2d98a; }
.ma-job.is-done { background: #e7f6ec; border-color: #a6d9b8; }
.ma-job.is-failed { background: #fde7ea; border-color: #f2a6b0; }
.check-now { display: inline-flex; align-items: center; gap: 10px; }
.check-stamp { font-size: 12px; color: var(--ink-subdued); white-space: nowrap; }

.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; }

/* Year view — Apple-Calendar-style: 12 mini month grids. */
.cal-viewtabs { margin-right: 8px; }
.cal-viewtabs .tab.is-active { background: var(--surface); }
.yr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.yr-month { display: block; color: inherit; text-decoration: none; padding: 6px;
  border-radius: 10px; border: 1px solid transparent; }
.yr-month:hover { border-color: var(--border); background: #fafafa; text-decoration: none; }
.yr-month-label { font-size: 14px; font-weight: 600; color: var(--interactive); margin-bottom: 6px; }
.yr-wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 2px; }
.yr-wd span { text-align: center; font-size: 10px; color: var(--ink-subdued); }
.yr-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.yr-day { position: relative; aspect-ratio: 1; display: flex; align-items: center;
  justify-content: center; font-size: 11px; color: var(--ink); border-radius: 50%; }
.yr-day.yr-out { color: transparent; }
.yr-day.yr-today { background: var(--interactive); color: #fff; font-weight: 600; }
.yr-dot { position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; }
.yr-day.yr-today .yr-dot { display: none; }

/* 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; }

/* Campaign → collections picker (many collections, so cap height + scroll). */
#collections-group { max-height: 220px; overflow-y: auto; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); }
#collections-group ul { flex-direction: column; gap: 8px; }

/* Covered-products popup. */
.cov-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.cov-modal[hidden] { display: none; }   /* the [hidden] attr must win over display:flex */
.cov-box { background: var(--surface); border-radius: var(--radius); width: min(760px, 100%);
  max-height: 82vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.cov-head { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cov-close { background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer;
  color: var(--text-subdued); padding: 0 4px; }
.cov-body { padding: 16px 20px; overflow-y: auto; }
.cov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cov-item { display: flex; flex-direction: column; gap: 6px; }
.cov-item img, .cov-noimg { width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-subdued); }
.cov-name { font-size: 13px; line-height: 1.3; }

/* 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 */
/* Meta Ads media browser */
.b2b-head .tabs { display: inline-flex; margin-top: 10px; }
.ma-createbar { display: flex; align-items: flex-end; gap: 24px; margin-top: 10px; flex-wrap: wrap; }
.ma-acct { display: flex; flex-direction: column; gap: 4px; }
.ma-acct-label { font-size: 11px; color: var(--ink-subdued); text-transform: uppercase; letter-spacing: .03em; }
.tab.is-disabled { color: #b5b5b5; cursor: not-allowed; }
.ma-preset-form fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
.ma-preset-section { margin-bottom: 22px; }
.ma-preset-section h3 { font-size: 14px; margin: 0 0 4px; }
.ma-preset-section .ma-hint { margin: 0 0 10px; font-size: 12px; }
.ma-preset-section textarea, .ma-preset-section input[type=text] { margin-bottom: 8px; }
.ma-editlink { float: right; font-size: 13px; font-weight: 400; }
.ma-grid-review { margin-bottom: 0; }
.ma-grid-review .ma-card { cursor: default; }
.ma-review-dl dd .ma-copy { white-space: pre-wrap; margin: 0 0 8px;
  padding: 8px 10px; background: #f7f7f7; border-radius: var(--radius-sm); }
.ma-settings-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.ma-features { margin-top: 18px; }
.ma-feat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ma-feat-head h2 { margin: 0; }
.ma-feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 6px 24px; margin: 14px 0 4px; }
.ma-feat { display: flex; align-items: flex-start; gap: 10px; padding: 8px; font-size: 13px; cursor: pointer; }
.ma-feat input { width: auto; margin-top: 2px; flex: none; }
.ma-feat-body { display: flex; flex-direction: column; gap: 2px; }
.ma-feat-label { font-weight: 500; }
.ma-feat-desc { font-size: 12px; color: var(--ink-subdued); line-height: 1.35; }
.ma-feat.is-new { background: #fff8e6; border-radius: 8px; }
.ma-newbadge { font-style: normal; font-size: 10px; font-weight: 700; color: #8a5a00;
  background: #fdf2e0; border: 1px solid #f4d9a8; border-radius: 8px; padding: 0 6px; margin-left: 4px; }
.ma-alert { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 16px;
  background: #fff8e6; border: 1px solid #f4d9a8; border-radius: var(--radius-sm); font-size: 14px; }
.ma-alert a { font-weight: 600; }
.ma-adname { font-size: 15px; font-weight: 500; }
.ma-status { display: flex; gap: 20px; margin-top: 12px; }
.ma-status label { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; margin: 0; }
.ma-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 80px; }
.ma-card { display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative;
  transition: border-color .12s, box-shadow .12s; }
.ma-card:hover { border-color: var(--ink-subdued); }
.ma-card.is-selected { border-color: var(--interactive); box-shadow: 0 0 0 2px var(--interactive); }
.ma-check { position: absolute; opacity: 0; pointer-events: none; }
.ma-media { position: relative; background: #f1f1f1; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center; }
.ma-media.is-portrait { aspect-ratio: 3 / 4; }
.ma-media img, .ma-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ma-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: 15px; padding-left: 3px;
  display: flex; align-items: center; justify-content: center; }
.ma-play:hover { background: rgba(0,0,0,.78); }
.ma-badge { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.65);
  color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.ma-tick { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  color: transparent; }
.ma-card.is-selected .ma-tick { background: var(--interactive); border-color: var(--interactive); color: #fff; }
.ma-foot { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.ma-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-dim { font-size: 11px; }
.ma-actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,.04); }
.ma-count { font-size: 13px; color: var(--ink-subdued); }
.ma-count b { color: var(--ink); font-size: 15px; }
.stock-intel { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stock-last { margin: -4px 0 12px; font-size: 12px; }
.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 — follow-up signals */
.followup-card { border-left: 3px solid var(--critical); margin-bottom: 16px; }
.followup-head { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.followup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.followup-list li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.fu-name { font-weight: 500; }
.trend-cell { text-align: center; }
.trend { font-weight: 700; }
.trend.up { color: #0a6b3b; }
.trend.down { color: var(--critical); }
.trend.dormant { color: #b06f00; }
.trend.new { color: #005bd3; }

/* Home */
.home { max-width: 720px; margin: 9vh auto 0; text-align: center; }
.home-greeting { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 24px; }
.home-section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-secondary); margin: 0 0 12px; }
.home-attention { margin-bottom: 28px; }
.home-attention-head { display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-secondary); margin-bottom: 10px; }
.home-attention-list { list-style: none; margin: 0; padding: 0; }
.home-attention-list li { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--border-secondary); }
.home-attention-list li:first-child { border-top: none; }
.home-attention-list li > a { flex: 1; min-width: 0; }
.home-attention-list li.is-read .home-attention-dot { background: var(--border); }
.home-attention-list li.is-read .home-attention-label { color: var(--ink-subdued); }
.home-attention-list a { display: flex; align-items: center; gap: 10px; padding: 10px 2px; color: var(--ink); }
.home-attention-list a:hover { text-decoration: none; color: var(--interactive); }
.home-attention-go { margin-left: auto; color: var(--text-secondary); }
.home-attention-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--interactive); flex: none; }
.home-attention-list li.lvl-warn .home-attention-dot { background: #e6a100; }
.home-attention-list li.lvl-critical .home-attention-dot { background: var(--critical, #e22c38); }
.home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.home-card { display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 26px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card); color: var(--ink);
  font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.home-card:hover { border-color: var(--interactive); box-shadow: var(--shadow); text-decoration: none; }
.home-card .nav-icon { width: 26px; height: 26px; color: var(--interactive); }

/* B2B — store detail */
.store-detail-head .store-back { display: inline-block; font-size: 13px; margin-bottom: 4px; }
.ord-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.ord-head h2 { margin: 0; }
.ord-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.ord-photo { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #f7f7f7; }
.ord-photo img { width: 100%; height: 160px; object-fit: cover; display: block; }
.ord-photo-foot { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-size: 12px; }
.ord-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.store-stack { display: flex; flex-direction: column; gap: 18px; margin-bottom: 16px; }
.store-stack .stock-intel { margin-bottom: 0; }
.store-cols { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.4fr); gap: 18px; align-items: start; }
.store-side { display: flex; flex-direction: column; gap: 18px; }
.contactlog-form { margin-bottom: 18px; }
.contactlog-form .field, .contactlog-form .field-row { margin-bottom: 12px; }
.contactlog-form label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.contactlog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.contactlog li.muted { padding: 6px 0; }
.cl-item { padding: 10px 12px; border: 1px solid var(--border); border-left-width: 3px;
  border-radius: 8px; background: var(--surface); }
.cl-item.k-call { border-left-color: #005bd3; }
.cl-item.k-email { border-left-color: #8a5cf6; }
.cl-item.k-visit { border-left-color: #0a6b34; }
.cl-item.k-note { border-left-color: #9a9a9a; }
.cl-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cl-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.k-call .cl-kind { color: #005bd3; }
.k-email .cl-kind { color: #8a5cf6; }
.k-visit .cl-kind { color: #0a6b34; }
.k-note .cl-kind { color: #6b6b6b; }
.cl-date { font-size: 12px; color: var(--ink-subdued); }
.cl-note { font-size: 14px; white-space: pre-wrap; color: var(--ink); }
.cl-actions { margin-left: auto; display: inline-flex; gap: 10px; font-size: 12px;
  opacity: 0; transition: opacity .1s; }
.cl-item:hover .cl-actions { opacity: 1; }
.cl-actions form { display: inline; margin: 0; }
.linklike { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.linklike.link-danger { color: var(--critical); }
@media (max-width: 800px) { .store-cols { grid-template-columns: 1fr; } }

/* 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.is-pos .b2b-kpi-value { color: #0a6b34; }
.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); }
.b2b-fin-tbl td.pos { color: #0a6b34; }
.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: 820px) {
  /* Off-canvas sidebar toggled by the topbar hamburger */
  .app-hamburger { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; width: 250px; z-index: 60;
    height: 100vh;            /* fallback for old browsers */
    height: 100dvh;           /* iOS Safari: excludes the address/tool bars so the
                                 bottom items (Settings / Sign Out) stay reachable */
    /* keep the last items clear of Safari's bottom bar + the home indicator */
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.18);
    overscroll-behavior: contain;        /* don't scroll the page behind the menu */
    -webkit-overflow-scrolling: touch;   /* momentum scroll on iOS */
  }
  .app.nav-open .sidebar { transform: none; }
  /* Freeze the page behind the open drawer so menu-scroll doesn't move it. */
  body.nav-locked { overflow: hidden; }
  .app-backdrop { display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .22s; }
  .app.nav-open .app-backdrop { opacity: 1; pointer-events: auto; }
  .app-topbar { padding: 12px 16px; }
  .app-content { padding: 16px 16px 40px; }
  .app-user { display: none; }              /* save space; logout still in menu areas */
  .app-notif-panel { width: min(320px, calc(100vw - 32px)); }
  /* Tighten dense grids / heads on small screens */
  .b2b-head, .sys-head, .ma-feat-head, .ma-createbar { gap: 10px; }
  .kpi-row, .b2b-kpis { grid-template-columns: 1fr 1fr; }
  .ma-actionbar { padding: 12px 16px; }
}
@media (max-width: 480px) {
  .kpi-row, .b2b-kpis { grid-template-columns: 1fr; }
  .app-content { padding: 14px 12px 36px; }
}
/* Wide tables scroll horizontally within their card on small screens */
@media (max-width: 820px) {
  .card { overflow-x: auto; }
  .b2b-head { flex-wrap: wrap; }
  /* Filter bars (Fraud, B2B, Held orders): stack the row so the selects don't
     squish / overflow. Status full-width on top; other selects 2-up; the
     Re-check / action button gets its own full-width row. */
  .b2b-filters { flex-wrap: wrap; width: 100%; gap: 8px; margin-top: 4px; }
  .b2b-filters form { flex-wrap: wrap; width: 100%; gap: 8px; }
  .b2b-filters select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .b2b-filters select[name="status"] { flex-basis: 100%; min-width: 0; }
  .b2b-filters form[method="post"] .btn { width: 100%; }
}

/* ============================================================
   Store claims portal (claims.shngroup.no) — standalone, no Hub shell
   ============================================================ */
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.rs-threshold { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.rs-rename { display: flex; gap: 6px; align-items: center; margin: 0; }
.rs-rename input { font-size: 13px; padding: 4px 8px; }
.rs-actions { display: flex; gap: 6px; }
.rs-sortable { list-style: none; margin: 0; padding: 0; }
.rs-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-bottom: 1px solid var(--border-secondary); }
.rs-item:last-child { border-bottom: 0; }
.rs-item .rs-rename { flex: 1; }
.rs-item .rs-rename input { flex: 1; }
.rs-handle { cursor: grab; color: var(--ink-subdued); font-size: 16px; line-height: 1;
  user-select: none; padding: 0 2px; }
.rs-handle:active { cursor: grabbing; }
.rs-dragging { opacity: .5; background: #f2f7ff; }
.risk-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.risk-explain { border-left: 3px solid #c3d6f7; background: #f7faff; position: relative; }
.risk-explain p { margin: 0; font-size: 14px; line-height: 1.5; }
.risk-lang { position: absolute; top: 16px; right: 16px; font-size: 12px; padding: 4px 10px; }
.risk-subnav { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.risk-subnav a { padding: 8px 2px; font-size: 14px; color: var(--ink-subdued);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.risk-subnav a:hover { color: var(--ink); }
.risk-subnav a.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--interactive); }
.chip-danger-toggle { color: var(--critical); }
.chip-danger-toggle:hover { border-color: var(--critical); }
.rs-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; cursor: zoom-in; }
.rs-shopify { display: inline-flex; }
.rs-shopify img { width: 22px; height: 22px; display: block; }
/* Shopify-style status chip — reusable sitewide. Rounded pill, light tinted
   background, coloured text + a leading dot (inherits the text colour). Pick a
   semantic variant: -critical / -warn / -success / -info / -muted. */
.s-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 8px; white-space: nowrap; }
.s-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
a.s-chip { text-decoration: none; }
a.s-chip:hover { filter: brightness(0.96); text-decoration: none; }
.s-chip-critical { background: #fdeceb; color: #d82c0d; }
.s-chip-warn     { background: #fdf3e6; color: #b25c00; }
.s-chip-success  { background: #e6f4ea; color: #0a6b3d; }
.s-chip-info     { background: #eaf0fd; color: #1f5199; }
.s-chip-muted    { background: #f1f1f1; color: #616161; }
html[data-theme="dark"] .s-chip-critical { background: #3a1a17; color: #ff8a75; }
html[data-theme="dark"] .s-chip-warn     { background: #3a2c14; color: #ffc266; }
html[data-theme="dark"] .s-chip-success  { background: #143324; color: #6ee7a8; }
html[data-theme="dark"] .s-chip-info     { background: #16233d; color: #8ab4f8; }
html[data-theme="dark"] .s-chip-muted    { background: #2a2a2a; color: #b0b0b0; }
/* Modifier: drop the leading dot (e.g. name / carrier chips where a dot reads
   as a status light it isn't). */
.s-chip-plain::before { display: none; }

/* Sortable table header cell. */
.th-sort a { color: inherit; text-decoration: none; }
.th-sort a:hover { text-decoration: underline; }

/* Clickable table rows (whole row is a link; see app_base rowlink handler). */
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--bg-hover, #f6f6f7); }
html[data-theme="dark"] tr.rowlink:hover td { background: #2a2a2a; }

/* Purchase-order detail layout. */
.po-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.po-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.po-dl dt { color: var(--ink-subdued); font-size: 13px; }
.po-dl dd { margin: 0; font-weight: 500; }
.po-track-now { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.po-track-no { font-variant-numeric: tabular-nums; font-weight: 600; }
.po-track-form .field-row { margin-bottom: 10px; }
.po-ship { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border); }
.po-ship:last-of-type { border-bottom: none; }
.po-ship-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) { .po-grid { grid-template-columns: 1fr; } }
.ord-owed { border-left: 3px solid #f4d9a8; }
.ord-owed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
body.portal { background: var(--bg); }
.portal-topbar { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 22px; background: var(--surface);
  border-bottom: 1px solid var(--border); }
.portal-brand { font-weight: 600; font-size: 16px; letter-spacing: .04em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.portal-brand-logo { height: 22px; width: auto; display: block; }
.sidebar-brand-logo { height: 24px; width: auto; display: block; }
.sidebar-account { display: block; font-size: 12px; color: var(--ink-subdued);
  padding: 0 12px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-brand span { color: var(--ink-subdued); font-weight: 400; letter-spacing: 0; }
.portal-user { font-size: 13px; }
.portal-main { max-width: 860px; margin: 0 auto; padding: 28px 20px 60px; }
.portal-narrow { max-width: 420px; margin: 40px auto; }
.portal-head { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.portal-h1 { font-size: 22px; font-weight: 600; margin: 0; }
.portal-h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.portal-logo { display: block; max-width: 180px; height: auto; margin: 0 auto 18px; }
.portal-entrance-logo { max-width: 150px; height: auto; display: block; margin: 0 auto; }
.portal-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius, 12px); padding: 20px 22px; margin-bottom: 18px; }
.portal-form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.portal-form label { display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink); }
.portal-form input, .portal-form select, .portal-form textarea { font-size: 14px; }
.portal-form .btn { align-self: flex-start; margin-top: 4px; }
.portal-field-err { color: var(--critical); font-size: 12px; font-weight: 400; }
.portal-alert { background: #fde7ea; border: 1px solid #f4b8c1; color: var(--critical);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.portal-note { background: #e6f4ea; border: 1px solid #b7e0c4; color: #0a6b34;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.portal-owed { background: #fdf2e0; border: 1px solid #f4d9a8; color: #8a5a00;
  border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 18px; }
.portal-row { cursor: pointer; }
.portal-row:hover { background: #fafafa; }
.portal-dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; }
.portal-dl dt { color: var(--ink-subdued); font-size: 13px; }
.portal-dl dd { margin: 0; }
.portal-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.portal-photos img { width: 120px; height: 120px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); }
/* Product typeahead */
.ta-results { position: relative; }
.ta-list { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); max-height: 260px; overflow-y: auto; }
.ta-option { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.ta-option:hover { background: #f2f7ff; }
.ta-empty { padding: 8px 2px; font-size: 13px; }
.ta-picked { font-size: 13px; color: #0a6b34; font-weight: 500; }
@media (max-width: 560px) {
  .portal-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .portal-dl dt { margin-top: 8px; }
}

/* ---- Team Performance ---- */
.tm-tabs { display: flex; gap: 4px; }
.tm-tab { padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--ink-subdued); text-decoration: none; }
.tm-tab:hover { background: #f6f6f6; color: var(--ink); }
.tm-tab.is-active { background: var(--interactive); color: #fff; }
.tm-periods { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tm-pill { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; color: var(--ink-subdued); text-decoration: none; background: var(--surface); }
.tm-pill:hover { border-color: #d0d0d0; color: var(--ink); }
.tm-pill.is-active { background: var(--interactive); color: #fff; border-color: var(--interactive); }
.tm-datef { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 4px; white-space: nowrap; }
.tm-datef label { flex: none; white-space: nowrap; }
.tm-range { margin-left: auto; font-size: 13px; }
.tm-delta { font-weight: 600; }
.tm-delta.up { color: #0a6b34; }
.tm-delta.down { color: var(--critical); }
.tm-panel-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.tm-eff { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.tm-eff-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-subdued); }
.tm-eff-val { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tm-eff-val .tm-delta { font-size: 13px; }
.tm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.tm-two > .card { margin-bottom: 0; }
.tm-group-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-subdued); margin: 22px 0 10px; }
.tm-group-title:first-child { margin-top: 4px; }
.tm-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 4px; }
.tm-charts > .card { margin-bottom: 0; }
.tm-chart-head { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.tm-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.tm-bar { flex: 1 1 0; min-width: 2px; background: var(--interactive); border-radius: 2px 2px 0 0;
  min-height: 1px; transition: background .1s; }
.tm-bar:hover { background: var(--ink); }
.tm-weekday { display: flex; align-items: flex-end; gap: 10px; height: 140px; }
.tm-wk { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.tm-wk-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.tm-wk-bar { width: 100%; background: var(--interactive); border-radius: 3px 3px 0 0; min-height: 1px; }
.tm-wk-bar:hover { background: var(--ink); }
.tm-wk-label { font-size: 12px; color: var(--ink-subdued); margin-top: 6px; }
.tm-wk-val { font-size: 12px; font-weight: 600; }
.tm-tip { position: fixed; z-index: 60; background: var(--ink); color: #fff; font-size: 12px;
  font-weight: 500; padding: 5px 10px; border-radius: 6px; pointer-events: none; white-space: pre-line;
  text-align: left; line-height: 1.45; max-width: 260px;
  transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .08s; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.tm-tip.show { opacity: 1; }
@media (max-width: 720px) {
  .tm-two, .tm-charts { grid-template-columns: 1fr; }
  .tm-range { margin-left: 0; }
}

/* ---- Warehouse worker portal (Norwegian) ---- */
.wh-portal { min-height: 100vh; background: var(--bg); }
.wh-topbar { display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 18px; }
.wh-topbar .sidebar-brand { padding: 0; }
.wh-user { font-size: 13px; color: var(--ink-subdued); }
.wh-nav { display: flex; gap: 16px; margin: 0 auto 0 24px; }
.wh-nav a { font-size: 14px; font-weight: 500; color: var(--ink-subdued); text-decoration: none; }
.wh-nav a:hover { color: var(--ink); }
.wh-nav a.is-active { color: var(--ink); font-weight: 600; }
/* Uniform spacing between every top-level block, regardless of per-card margins. */
.wh-main { max-width: 960px; margin: 0 auto; padding: 20px 18px 48px;
  display: flex; flex-direction: column; gap: 16px; }
.wh-main > .card, .wh-main > .wh-cols { margin-bottom: 0; }
.wh-hours { text-align: center; }
.wh-hours-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-subdued); font-weight: 600; }
.wh-hours-value { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.wh-today h2 { font-size: 17px; margin: 0 0 12px; }
.wh-big { font-size: 16px; padding: 12px 28px; }
.wh-clockout .wh-check-title { font-weight: 600; margin: 4px 0 8px; }
.wh-check { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 15px; }
.wh-check input { width: 20px; height: 20px; }
.wh-check-other { display: block; font-size: 14px; color: var(--ink-subdued); margin: 8px 0 14px; }
.wh-check-other textarea { width: 100%; margin-top: 4px; }
.wh-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.wh-cols > .card, .wh-side > .card { margin-bottom: 0; }
.wh-side { display: flex; flex-direction: column; gap: 16px; }
.wh-cal-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 10px; }
.wh-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.wh-cal th { font-size: 11px; color: var(--ink-subdued); font-weight: 500; padding: 4px; text-align: center; }
.wh-cal td { height: 58px; border: 1px solid var(--border-secondary); vertical-align: top; padding: 3px; }
.wh-cal-out { background: #fafafa; color: var(--ink-subdued); }
.wh-cal-today { background: #eef4ff; }
.wh-cal-day { font-size: 12px; }
.wh-cal-shift { display: block; font-size: 10px; font-weight: 600; color: #fff; background: var(--interactive);
  border-radius: 4px; padding: 1px 3px; margin-top: 2px; text-align: center; }
.wh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wh-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.wh-list li > div:first-child { min-width: 0; }   /* let the label wrap, not the buttons */
.wh-list li form { margin: 0; }
.btn-sm { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
/* Warehouse manager */
.wh-post-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.wh-post-row .field { margin-bottom: 0; }
.wh-email-preview { white-space: pre-wrap; word-break: break-word; font-family: inherit;
  font-size: 13px; line-height: 1.55; color: var(--ink); background: #f6f6f7;
  border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin: 0; }
@media (max-width: 720px) { .wh-cols { grid-template-columns: 1fr !important; } }
.wh-post-note { flex: 1 1 200px; }
@media (max-width: 720px) { .wh-cols { grid-template-columns: 1fr; } }
.wh-list-actions { display: inline-flex; gap: 6px; align-items: center; flex: none; }
.wh-list-actions form { margin: 0; }
.wh-giveup { background: var(--surface); color: var(--critical); border: 1px solid var(--border); }
.wh-giveup:hover { border-color: var(--critical); text-decoration: none; }
.wh-weekdays { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; }
.wh-wd { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; }
.wh-head-actions { display: inline-flex; gap: 8px; }
.wh-h { font-weight: 600; font-variant-numeric: tabular-nums; }
.wh-salary { max-width: 640px; margin: 0 auto; }
.wh-row-actions { display: inline-flex; gap: 6px; }
.wh-row-actions form { margin: 0; }
.btn-secondary.btn-sm { background: var(--surface); }
.wh-repeat { margin-top: 12px; }
.wh-repeat summary { cursor: pointer; font-size: 13px; color: var(--interactive); font-weight: 500; width: fit-content; }
.wh-repeat-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-top: 12px; }
.wh-wd-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.wh-wd-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.wh-wd-pill span { display: inline-block; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; font-weight: 500; cursor: pointer; color: var(--ink-subdued); background: var(--surface); }
.wh-wd-pill input:checked + span { background: var(--interactive); border-color: var(--interactive); color: #fff; }
.wh-edit-tasks { margin-top: 14px; border-top: 1px solid var(--border-secondary); padding-top: 12px; }
.wh-edit-tasks .wh-check { max-width: 420px; }
.wh-edit-tasks textarea { width: 100%; max-width: 420px; }

/* Warehouse worker top-bar totals */
.wh-totals { display: flex; gap: 10px; align-items: center; }
.wh-tot { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
  padding: 4px 12px; border-radius: 10px; background: var(--surface-secondary); }
.wh-tot span { font-size: 11px; color: var(--text-secondary); text-transform: none; }
.wh-tot b { font-size: 17px; font-weight: 650; color: var(--text-primary); }
@media (max-width: 560px) { .wh-tot span { font-size: 10px; } .wh-tot b { font-size: 15px; } }

/* Salary page — prominent month banner */
.wh-salary-month { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wh-salary-month-mid { text-align: center; }
.wh-salary-month-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.wh-salary-month-name { font-size: 26px; font-weight: 700; color: var(--text-primary); }
.wh-salary-month .cal-arrow { font-size: 28px; }

/* Finances — yearly Goal-vs-Actual sheet */
.an-yr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.an-yr-head h2 { margin: 0; }
.yr-tbl th, .yr-tbl td { white-space: nowrap; }
.yr-tbl .yr-grouphead th { border-bottom: 1px solid var(--border-secondary); text-align: center; }
/* One continuous vertical rule per metric group — the group header (colspan),
   the sub-header Goal cell and the body Goal cells all share the same left
   border so the separators line up down the whole table. */
.yr-tbl .yr-grouphead th[colspan],
.yr-tbl .yr-subhead th.yr-gstart,
.yr-tbl td.yr-goal { border-left: 1px solid var(--border-secondary); }
/* Goal = quiet reference; Actual = the number that matters (bold, tinted by
   beat/miss); Δ = coloured. */
.yr-tbl td.yr-goal { color: var(--text-secondary); font-size: 12px; }
.yr-tbl td.yr-actual { font-weight: 600; }
.yr-tbl td.yr-actual.pos { background: rgba(10, 107, 59, 0.09); }
.yr-tbl td.yr-actual.mid { background: rgba(201, 123, 0, 0.12); }
.yr-tbl td.yr-actual.neg { background: rgba(216, 44, 13, 0.09); }
.yr-tbl td.yr-delta { font-weight: 600; color: var(--text-secondary); }
.yr-tbl td.yr-delta.pos { color: #0a6b3b; }
.yr-tbl td.yr-delta.mid { color: #b26a00; }
.yr-tbl td.yr-delta.neg { color: var(--critical); }
.yr-tbl .yr-month { font-weight: 600; }
.yr-tbl tr.yr-current { background: var(--surface-selected, #f3f7ff); }
.yr-tbl tr.yr-future td { color: var(--text-disabled, #9aa5b1); }
.yr-tbl tfoot .yr-ytd td { border-top: 2px solid var(--border-secondary); font-weight: 700; }
.pill { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px;
  background: var(--surface-secondary); color: var(--text-secondary); vertical-align: middle; }
/* Small red count circle — a smaller sibling of the header .nav-badge. */
.count-badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--critical); color: #fff; font-size: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }

/* Feedback — topbar button + modal */
.app-feedback-btn { display: inline-flex; align-items: center; gap: 6px; background: none;
  border: 1px solid var(--border-secondary); color: var(--text-secondary); cursor: pointer;
  font-size: 13px; font-weight: 500; padding: 5px 11px; border-radius: 8px; }
.app-feedback-btn:hover { background: var(--surface-secondary); color: var(--text-primary); text-decoration: none; }
.app-feedback-btn.is-active { border-color: var(--interactive); color: var(--interactive); }
@media (max-width: 620px) { .app-feedback-btn span { display: none; } .app-feedback-btn { padding: 6px; } }
.fb-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
.fb-modal[hidden] { display: none; }
.fb-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.fb-modal-card { position: relative; background: var(--surface); border-radius: 14px; width: min(460px, 92vw);
  padding: 20px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.fb-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fb-modal-head h2 { margin: 0; font-size: 18px; }
.fb-modal-x { background: none; border: none; font-size: 26px; line-height: 1; color: var(--text-secondary); cursor: pointer; }
.fb-modal-card .field { display: block; margin-bottom: 12px; }
.fb-modal-card .field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.fb-modal-card select, .fb-modal-card textarea { width: 100%; }
.fb-kind-choice { display: flex; gap: 18px; margin-bottom: 12px; }
.fb-radio { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
/* Feedback screenshot drop zone. */
.fb-drop { border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; font-size: 13px; color: var(--ink-subdued);
  transition: border-color .12s, background .12s; }
.fb-drop.is-drag { border-color: var(--interactive); background: rgba(0,91,211,.06); }
.fb-drop .linklike { color: var(--interactive); font-weight: 500; }
.fb-drop-preview { position: relative; display: inline-block; }
.fb-drop-preview[hidden] { display: none; }   /* [hidden] must beat display:inline-block */
.fb-drop-preview img { max-width: 100%; max-height: 200px; border-radius: var(--radius-sm); display: block; }
.fb-drop-remove { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 16px;
  line-height: 1; cursor: pointer; }

/* Feedback — review overview */
.fb-shot { max-height: 140px; width: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-top: 8px; cursor: zoom-in; }
.fb-list { display: flex; flex-direction: column; gap: 12px; }
.fb-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.fb-kind { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: .03em; }
.fb-kind-bug { background: #fde8ea; color: #c01c2c; }
.fb-kind-feature { background: #e6f0ff; color: #1857c4; }
.fb-module { font-weight: 600; }
.fb-meta { font-size: 12px; }
.fb-text { margin: 4px 0 10px; white-space: pre-line; }
.fb-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }

/* Feedback — outcome / status / discard control / mine */
.fb-outcome { margin: 4px 0 10px; font-size: 13px; }
.fb-discard { display: inline-block; }
.fb-discard > summary { list-style: none; cursor: pointer; }
.fb-discard > summary::-webkit-details-marker { display: none; }
.fb-discard-form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.fb-discard-form textarea { width: 100%; }
.fb-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: .03em; }
.fb-status-open { background: #e6f0ff; color: #1857c4; }
.fb-status-solved { background: #e3f5ec; color: #0a6b34; }
.fb-status-discarded { background: #eceef1; color: #5b6672; }
.fb-mine-link { margin-right: auto; font-size: 13px; align-self: center; }

/* Shipping — carrier/method report */
.ship-carriers { display: flex; flex-direction: column; gap: 14px; }
.ship-carrier-head { display: flex; align-items: baseline; justify-content: space-between; }
.ship-carrier-head h3 { margin: 0; }
.ship-carrier-total { font-size: 18px; font-weight: 700; }
.ship-bar { height: 6px; border-radius: 4px; background: var(--surface-secondary); margin: 8px 0 12px; overflow: hidden; }
.ship-bar span { display: block; height: 100%; background: var(--interactive, #2c6ecb); border-radius: 4px; }

/* Fraud — Gorgias support history */
.fraud-support-group { margin-top: 12px; }
.fraud-support-email { font-weight: 600; font-size: 13px; margin-bottom: 4px; }

/* Shipping — popular-methods dashboard */
.ship-carrier-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ship-chip { font-size: 13px; padding: 5px 12px; border-radius: 20px; background: var(--surface-secondary); }
.ship-methods { list-style: none; margin: 0; padding: 0; counter-reset: m; }
.ship-methods li { padding: 12px 0; border-top: 1px solid var(--border-secondary); }
.ship-methods li:first-child { border-top: none; }
.ship-method-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.ship-method-name { font-weight: 600; }
.ship-method-num { font-weight: 700; white-space: nowrap; }

/* Products — decision overview */
.pr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.pr-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-card); }
.pr-stat span { display: block; font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.pr-stat b { display: block; font-size: 24px; font-weight: 700; margin: 4px 0; }
.pr-stat em { font-style: normal; font-size: 12px; font-weight: 600; }
.pr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
@media (max-width: 820px) { .pr-cols { grid-template-columns: 1fr; } }
.pr-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pr-movers-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.pr-mover { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--border-secondary); font-size: 13px; }
.pr-mover span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-mover b { white-space: nowrap; }
.pr-watch { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border-secondary); }
.pr-watch:first-of-type { border-top: none; }
.pr-watch-flags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Notification settings */
.notif-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.notif-roles { display: flex; flex-direction: column; gap: 7px; }
.notif-role { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.notif-email { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Month switcher — segmented, Shopify-ish */
.monthnav { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-card); }
.monthnav-arrow { display: flex; align-items: center; justify-content: center; width: 36px; font-size: 18px; color: var(--text-secondary); text-decoration: none; }
.monthnav-arrow:hover { background: var(--surface-secondary); color: var(--text-primary); text-decoration: none; }
.monthnav-label { display: flex; align-items: center; padding: 7px 16px; font-weight: 600; min-width: 130px; justify-content: center; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

.home-allclear { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); }

/* Product issues — suggest description */
.pr-issue-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.pr-suggest-row td { background: var(--surface-secondary); }
.pr-suggest-head { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.pr-suggest-text { width: 100%; margin-bottom: 8px; }

/* Product thumbnails + description modal */
.pr-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; }
.pd-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
.pd-modal[hidden] { display: none; }
.pd-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.pd-card { position: relative; background: var(--surface); border-radius: 14px; width: min(640px, 94vw); max-height: 88vh; overflow: auto; padding: 20px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.pd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pd-head h2 { margin: 0; font-size: 17px; }
.pd-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pd-option { text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-secondary); cursor: pointer; font-size: 13px; line-height: 1.45; }
.pd-option:hover { border-color: var(--interactive); }
.pd-option.is-sel { border-color: var(--interactive); box-shadow: 0 0 0 2px rgba(44,110,203,.2); }
.pd-card .field textarea { width: 100%; }

/* Sortable table headers */
.sortable-tbl th.sortable { user-select: none; }
.sortable-tbl th.sortable:hover { color: var(--interactive); }
.sortable-tbl th.sortable[data-dir="asc"]::after { content: " ▲"; font-size: 9px; }
.sortable-tbl th.sortable[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }

.img-lightbox { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); cursor: zoom-out; }
.img-lightbox[hidden] { display: none; }
.img-lightbox img { max-width: 82vw; max-height: 82vh; border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,.4); background: #fff; }

/* Gold/Silver split bar */
.gs-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--surface-secondary); font-size: 11px; font-weight: 600; color: #fff; }
.gs-gold { background: #c8a200; display: flex; align-items: center; justify-content: center; }
.gs-silver { background: #9aa5b1; display: flex; align-items: center; justify-content: center; }

/* Freeze table headers when scrolling inside .tbl-scroll */
.tbl-scroll { position: relative; }
.tbl-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
/* When the card IS the scroll container, its top padding would show as a gap
   above the pinned header — zero it so the header hugs the top when scrolling. */
.card.tbl-scroll { padding-top: 0; }
.card.tbl-scroll thead th { padding-top: 14px; }

/* ---- Sign-in / entrance pages (Shopify-style, brand colours) ---------- */
.auth-body { min-height: 100vh; margin: 0; display: flex; align-items: center;
  justify-content: center; padding: 24px;
  background: linear-gradient(160deg, #f4f6fb 0%, #eceff5 100%); }
.auth-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column;
  align-items: center; gap: 20px; }
.auth-logo .auth-wordmark { font-size: 26px; }
.auth-card { width: 100%; box-sizing: border-box; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 30px 28px;
  box-shadow: 0 8px 30px rgba(0,0,0,.08); }
.auth-title { margin: 0 0 4px; font-size: 22px; font-weight: 600; color: var(--ink); }
.auth-sub { margin: 0 0 20px; font-size: 14px; color: var(--ink-subdued); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field > label { font-size: 13px; font-weight: 500; color: var(--ink); }
.auth-field input { width: 100%; box-sizing: border-box; padding: 11px 12px; }
.auth-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--ink-subdued); margin: -2px 0 2px; }
.auth-check input { width: 18px; height: 18px; flex: none; }
.auth-btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px;
  border-radius: 10px; margin-top: 4px; }
.auth-err { color: var(--critical); font-size: 12.5px; margin: 0;
  background: #fdf0f1; border-radius: 8px; padding: 8px 10px; }
.auth-link { display: inline-block; margin-top: 16px; font-size: 13.5px;
  color: var(--interactive); text-align: center; width: 100%; }
.auth-msgs { list-style: none; margin: 0 0 16px; padding: 0; display: flex;
  flex-direction: column; gap: 8px; }
.auth-foot { font-size: 12px; color: #9aa0a6; margin: 0; text-align: center; }

/* ---- Todo list module ------------------------------------------------- */
.td-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* Status colour cue on the select. */
.td-status.td-not_started { color: var(--ink-subdued); }
.td-status.td-in_progress { color: #005bd3; font-weight: 500; }
.td-status.td-completed { color: #0a6b3b; font-weight: 500; }
/* Priority colour cues (select text + completed-list chips). */
.prio-high { color: #b71d18; font-weight: 600; }
.prio-medium { color: #8a6d1f; }
.prio-low { color: var(--ink-subdued); }
.chip.prio-high { background: #fde8ea; }
.chip.prio-medium { background: #f4ecd8; }
.chip.prio-low { background: #f1f1f1; }

/* ---- Todo kanban board (Trello-style) --------------------------------- */
.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: #f1f2f4; border-radius: 12px; padding: 10px; width: 300px; flex: none; }
.kb-col-head { display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--ink-subdued); padding: 4px 6px 10px; }
.kb-count { background: #e1e3e5; color: var(--ink-subdued); border-radius: 10px;
  min-width: 20px; text-align: center; padding: 0 7px; font-size: 12px; }
.kb-cards { display: flex; flex-direction: column; gap: 8px; min-height: 160px;
  border-radius: 8px; transition: outline .1s; }
.kb-cards.kb-over { outline: 2px dashed var(--interactive); outline-offset: 2px; background: rgba(0,91,211,.05); }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid #c9c9c9;
  border-radius: 10px; padding: 9px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); cursor: grab; }
.kb-card:hover { border-color: var(--interactive); border-left-color: var(--interactive); }
.kb-card.dragging { opacity: .45; }
.kb-card-top { margin-bottom: 2px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kb-req { font-size: 11px; padding: 2px 8px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.kb-card-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.kb-card-desc { font-size: 12.5px; color: var(--ink-subdued); margin-top: 4px; line-height: 1.35;
  /* Board cards stay short — show a 2-line preview of a long description. */
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.kb-card.prio-high-card { border-left-color: #b71d18; }
.kb-card.prio-medium-card { border-left-color: #d4a017; }
.kb-card.prio-low-card { border-left-color: #9aa0a6; }
.kb-card[data-status="completed"] .kb-card-name { text-decoration: line-through; color: var(--ink-subdued); }

/* ---- Todo: toolbar, card-list view, hide-completed -------------------- */
.td-toolbar { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.td-hide-toggle { font-size: 13px; color: var(--ink-subdued); }
/* Board columns stretch to equal height so a card can be dropped anywhere. */
.kanban { align-items: stretch; }
.kb-col { display: flex; flex-direction: column; }
.kb-cards { flex: 1; }
/* Card-list view. */
.td-cardlist { display: flex; flex-direction: column; gap: 8px; max-width: 780px; }
.td-list { display: flex; flex-direction: column; gap: 8px; }
.td-lcard { display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid #c9c9c9; border-radius: 10px;
  padding: 11px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.05); cursor: pointer; }
.td-lcard:hover { border-color: var(--interactive); border-left-color: var(--interactive); }
.td-lcard-main { flex: 1; min-width: 0; }
.td-lcard-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.td-lcard-desc { font-size: 12.5px; color: var(--ink-subdued); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-lcard-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.td-lcard.prio-high-card { border-left-color: #b71d18; }
.td-lcard.prio-medium-card { border-left-color: #d4a017; }
.td-lcard.prio-low-card { border-left-color: #9aa0a6; }
.td-lcard[data-status="completed"] .td-lcard-name { text-decoration: line-through; color: var(--ink-subdued); }
/* Status chips (list view + requests). */
.chip.td-not_started { background: #f1f1f1; color: #616161; }
.chip.td-in_progress { background: #eaf0fd; color: #005bd3; }
.chip.td-completed { background: #e3f3ea; color: #0a6b3b; }
/* Hide-completed toggle. */
.td-hide-done .kb-col-completed,
.td-hide-done .td-completed-section,
.td-hide-done .td-lcard[data-status="completed"] { display: none; }

/* ---- Todo: task-requests ---------------------------------------------- */
.td-incoming { border-left: 4px solid var(--interactive); }
.td-inc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--border-secondary); }
.td-inc-row:first-of-type { border-top: none; }
.chip.td-requested { background: #eaf0fd; color: #005bd3; }
.chip.td-declined { background: #f1f1f1; color: #8a8a8a; text-decoration: line-through; }

/* ---- Fraud: full Gorgias conversation --------------------------------- */
.fraud-ticket { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.fraud-ticket-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fraud-ticket-subj { font-weight: 500; }
.fraud-ticket-excerpt { font-size: 12.5px; margin: 6px 0 8px; }
.fraud-convo { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.fraud-convo[hidden] { display: none; }   /* [hidden] must beat display:flex */
/* Breathing room around the flag-detail table cards. */
/* .card.tbl-scroll zeroes padding-top (for the sticky header); restore breathing
   room above a title with padding (margin would collapse through the 0 padding). */
.card.tbl-scroll .card-title { padding-top: 18px; margin-bottom: 14px; }
.fraud-msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 13px; }
.fraud-msg-meta { font-size: 11px; color: var(--ink-subdued); margin-bottom: 3px; }
.fraud-msg-text { white-space: normal; line-height: 1.4; }
.fraud-msg.is-customer { align-self: flex-start; background: #f1f1f1; border-bottom-left-radius: 3px; }
.fraud-msg.is-agent { align-self: flex-end; background: #eaf0fd; border-bottom-right-radius: 3px; }

/* ---- Finances Settings — grouped, two-column redesign ----------------- */
.settings-card { margin-bottom: 16px; }
.set-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.set-head h2 { margin: 0; }
.set-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.set-inputs { display: flex; flex-direction: column; gap: 20px; }
.set-group { font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-subdued); font-weight: 600; margin: 0 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border-secondary); }
.set-group .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.set-note { margin: 8px 0 0; font-size: 12px; }
.set-sim { background: #f7f7f8; border: 1px solid var(--border-secondary);
  border-radius: 10px; padding: 14px 16px; position: sticky; top: 72px; }
.set-sim h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-subdued); margin: 0 0 8px; }
.set-actions { margin-top: 20px; }
@media (max-width: 760px) { .set-layout { grid-template-columns: 1fr; } .set-sim { position: static; } }

/* ---- Campaign offers editor ------------------------------------------- */
.offer-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.offer-row .offer-kind { flex: 0 0 200px; }
.offer-row input { flex: 1; min-width: 120px; }
.offer-row .offer-del { flex: 0 0 auto; }

/* ---- Campaign offers editor: gift picker + discount method ------------ */
.offer-row [data-f] { flex: 1; min-width: 130px; }
.offer-row [data-f=method], .offer-row [data-f=giftkind] { flex: 0 0 170px; }
.offer-giftprod { position: relative; }
.offer-giftprod .offer-search { width: 100%; box-sizing: border-box; }
.offer-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  margin-top: 2px; max-height: 220px; overflow-y: auto; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.offer-result { padding: 8px 10px; font-size: 13px; cursor: pointer; }
.offer-result:hover { background: rgba(0,91,211,.08); }

/* Kanban columns read as distinct Trello-style panels. */
.kb-col { background: #e9ebef; }

/* Automatic tasks status dots. */
.td-dot-on { color: #0a8a4f; }
.td-dot-off { color: #d72c0d; }

/* ---- Mobile hardening (applies across all modules) -------------------- */
@media (max-width: 640px) {
  .card { padding: 16px; }
  /* Stacked date/side-by-side fields go vertical so inputs aren't squished. */
  .field-row { flex-direction: column; gap: 12px; }
  .field-row .field { width: 100%; }
  /* Action rows + section headers wrap instead of overflowing. */
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; }
  .b2b-head, .an-head, .td-toolbar, .set-head, .cal-header, .cal-nav { flex-wrap: wrap; row-gap: 10px; }
  /* Tab strips + sub-navs scroll horizontally rather than wrap awkwardly. */
  .an-secnav, .secnav-tabs, .tabs, .tm-tabs { overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; touch-action: pan-x;
    flex-wrap: nowrap; max-width: 100%; gap: 14px; }
  .an-secnav::-webkit-scrollbar, .tabs::-webkit-scrollbar { height: 0; }
  /* Smaller font + never wrap a single item onto 2 lines (e.g. "Log activity"). */
  .secnav-item, .secnav-tabs .secnav-item { font-size: 12.5px; white-space: nowrap; flex: none; padding-bottom: 10px; }
  .tm-tab, .tm-pill { white-space: nowrap; flex: none; }
  /* Modals: full-width comfortable padding on small screens. */
  .cov-box, .fb-modal-card { width: 100%; }
  h1 { font-size: 20px; } h2 { font-size: 18px; }
  /* Offer editor rows stack cleanly. */
  .offer-row [data-f], .offer-row .offer-kind { flex: 1 1 100%; min-width: 0; }
}
/* Any bare table not already in a scroller still scrolls instead of overflowing. */
@media (max-width: 760px) { .card > .tbl { display: block; overflow-x: auto; } }

/* Custom dropdown chevron + guaranteed width. Two recurring bugs, fixed once for
   all here so no page has to think about it:
   1) Arrow-over-text: a class like .inp resets `padding`, leaving the chevron on
      top of the label — `padding-right` is forced so the arrow always has room.
   2) Too-narrow / clipped label ("Currently sold" instead of "Currently sold
      out"): selects in a flex row (filter bars, forms) get SHRUNK below their
      content. `flex-shrink: 0` + `min-width: fit-content` means a select is never
      squeezed narrower than its selected text (+ the arrow gap). A specific rule
      (e.g. .b2b-filters on mobile) can still override to allow shrinking. */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  /* border-box by default (like every text input) so a width:100% block form
     select fills its field exactly — content-box + the 34px arrow gap made them
     overflow the container ("Module/Status dropdown far out of its box"). The few
     grow-to-fit TOOLBAR selects opt back into content-box below (.b2b-filters,
     .an-range) — content-box there lets the box grow to the full label + arrow
     instead of clipping it ("Currently sold" vs "Currently sold out"). */
  box-sizing: border-box;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none' stroke='%23616161' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none' stroke='%23a6a6a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}
/* Block form-field selects fill their container (label above, width:100%), so
   they must be border-box — otherwise the content-box + 34px arrow gap makes
   them overflow the field (the modal "Status/Priority out of view" bug).
   Toolbar/filter selects keep the grow-to-fit content-box above. */
/* Toolbar/inline-filter selects: grow to fit the full label (content-box), never
   shrink below it. Everything else stays border-box (the default above). */
.b2b-filters select, .an-range select { box-sizing: content-box; }
/* Dark: active nav item slightly lighter than the sidebar, not white. */
html[data-theme="dark"] .nav-item.is-active { background: #383838; }
html[data-theme="dark"] .secnav-item.is-active { color: var(--ink); }

/* Dark-mode: remaining hardcoded light backgrounds on hover/selected states. */
html[data-theme="dark"] .btn-danger:hover { background: #4a2930; }
html[data-theme="dark"] input[type=file]::file-selector-button {
  background: #333; color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); }
html[data-theme="dark"] input[type=file]::file-selector-button:hover { background: #3d3d3d; }
html[data-theme="dark"] .app-notif-x:hover { background: #333; }
html[data-theme="dark"] .ta-option:hover { background: #22303f; }
html[data-theme="dark"] .yr-tbl tr.yr-current { background: #24314a; }
html[data-theme="dark"] .tm-pill:hover { background: #2a2a2a; }
html[data-theme="dark"] .tm-bar:hover, html[data-theme="dark"] .tm-wk-bar:hover { background: var(--interactive); }
/* Chart tooltip: light-mode uses var(--ink) (dark) bg + white text; in dark that
   flips to a light-grey box with white text (unreadable). Force a dark chip. */
html[data-theme="dark"] .tm-tip,
html[data-theme="dark"] .chart-tip { background: #1e1e1e; color: #f1f1f1; border: 1px solid #3a3a3a; }
html[data-theme="dark"] .camp-status.is-active,
html[data-theme="dark"] .m-status.is-active { background: #14351f; color: #7fe0a6; }
html[data-theme="dark"] .offer-result:hover { background: #22303f; }

/* Emails settings page. */
.email-tpl-head h3 { display: flex; align-items: center; gap: 8px; }
.email-preview { border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-subdued); padding: 12px 14px; margin: 12px 0; }
.email-preview-label { font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-subdued); margin-bottom: 6px; }
.email-subj { font-size: 13px; margin-bottom: 8px; }
.email-body { white-space: pre-wrap; font-family: inherit; font-size: 13px;
  color: var(--ink); margin: 0; }
.email-edit summary { cursor: pointer; font-weight: 600; color: var(--interactive); }
.email-edit textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.email-vars code { background: var(--surface-subdued); padding: 1px 5px; border-radius: 4px; }
html[data-theme="dark"] .risk-explain { background: #1c2635; border-left-color: #38507d; }

/* Dark-mode: Meta Ads status cards, previews and fraud chat bubbles. */
html[data-theme="dark"] .ma-job.is-pending { background: #3a3320; border-color: #5a4d24; }
html[data-theme="dark"] .ma-job.is-done { background: #14351f; border-color: #2c5a3a; }
html[data-theme="dark"] .ma-job.is-failed { background: #3a2226; border-color: #5c2f37; }
html[data-theme="dark"] .ma-feat.is-new { background: #3a3320; }
html[data-theme="dark"] .ma-alert { background: #3a3320; border-color: #5a4d24; color: var(--ink); }
html[data-theme="dark"] .ma-review-dl dd .ma-copy { background: #2a2a2a; }
html[data-theme="dark"] .ma-media { background: #2a2a2a; }
html[data-theme="dark"] .wh-email-preview { background: #2a2a2a; color: var(--ink); }
html[data-theme="dark"] .fraud-msg.is-customer { background: #2a2a2a; }
html[data-theme="dark"] .fraud-msg.is-agent { background: #22303f; }
html[data-theme="dark"] .msg.refreshing { background: #22303f; color: #9cc4ff; }
html[data-theme="dark"] .tabs { background: #2b2b2b; }
html[data-theme="dark"] .rs-dragging { background: #22303f; }

/* Todo board — mobile touch drag (long-press to pick up). */
.kb-card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.kb-card-clone { position: fixed; z-index: 1000; margin: 0; pointer-events: none;
  box-shadow: 0 12px 32px rgba(0,0,0,.28); transform: rotate(1.5deg); opacity: .97; }
.kb-card-ghost { opacity: .35; }
@media (max-width: 640px) {
  /* Columns nearly fill the phone so a card has room; edge-drag auto-scrolls. */
  .kb-col { width: 82vw; max-width: 340px; }
}

/* Todo offline sync indicator */
.td-net { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.td-net.off { background: #fdf0d5; color: #8a5a00; border: 1px solid #f0d8a0; }
.td-net.sync { background: #eaf0fd; color: #1f4fbf; border: 1px solid #cfe0ff; }
.td-net.on { background: #e3f3ea; color: #0a6b3b; border: 1px solid #b7e0c4; }
html[data-theme="dark"] .td-net.off { background: #3a3320; color: #ecd08a; border-color: #5a4d24; }
html[data-theme="dark"] .td-net.sync { background: #22303f; color: #9cc4ff; border-color: #38507d; }
html[data-theme="dark"] .td-net.on { background: #14351f; color: #7fe0a6; border-color: #2c5a3a; }

/* Restocks table → stacked cards on mobile (8 cols don't fit a phone). */
@media (max-width: 640px) {
  .rs-tbl thead { display: none; }
  .rs-tbl, .rs-tbl tbody { display: block; }
  /* Compact card: small thumb in a left column, product + meta on the right. */
  .rs-tbl tr { display: grid; grid-template-columns: 38px 1fr; column-gap: 10px; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 9px 11px; margin-bottom: 8px; font-size: 12.5px; }
  .rs-tbl td.rs-img { grid-column: 1; padding: 0; }
  .rs-tbl td.rs-img:empty { display: none; }
  .rs-tbl .rs-thumb { width: 38px; height: 38px; display: block; }
  .rs-tbl td.rs-prod { grid-column: 2; text-align: left; font-weight: 600; font-size: 13.5px;
    padding: 0 0 4px; line-height: 1.25; }
  .rs-tbl td:not(.rs-img):not(.rs-prod) { grid-column: 1 / -1; display: flex;
    justify-content: space-between; align-items: center; gap: 10px; padding: 2px 0; border: none; text-align: right; }
  .rs-tbl td[data-label]::before { content: attr(data-label); color: var(--ink-subdued);
    font-weight: 600; text-align: left; }
  .rs-tbl td.rs-view { justify-content: flex-end; padding-top: 5px; margin-top: 3px;
    border-top: 1px solid var(--border-secondary); }
  .rs-tbl td.rs-view:empty { display: none; }
  .card > .rs-tbl { overflow-x: visible; }
}

/* Notification settings: stack the email + push channel toggles. */
.notif-channels { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }

/* Reusable: opt-in table → stacked cards on mobile (add class "mtbl").
   Use a data-label on each <td> for its row label; give the "header" cell no
   label and a block class. */
@media (max-width: 640px) {
  .mtbl thead { display: none; }
  .mtbl, .mtbl tbody { display: block; }
  .mtbl tr { display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
  .mtbl td { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 5px 0; border: none; text-align: right; }
  .mtbl td[data-label]::before { content: attr(data-label); color: var(--ink-subdued);
    font-weight: 600; text-align: left; white-space: nowrap; }
  .mtbl td.b2b-ord { display: block; text-align: left; font-weight: 600; font-size: 15px; padding: 0 0 8px; }
  .card > .mtbl { overflow-x: visible; }
}

/* Bigger, easier-to-tap top bar controls on mobile. */
@media (max-width: 640px) {
  .app-topbar { padding: 14px 16px; }
  .app-topbar-title { font-size: 17px; }
  .app-topbar-right { gap: 12px; }
  .app-hamburger svg { width: 27px; height: 27px; }
  .app-feedback-btn { padding: 9px; }
  .app-feedback-btn svg { width: 21px; height: 21px; }
  .app-bell { padding: 6px; }
  .app-bell .nav-icon { width: 24px; height: 24px; }
}

/* HR pay roster — fixed column widths so the NO DTC / EU DTC / NO B2B tables all
   line up (each table would otherwise auto-size its own columns). */
.hr-tbl { table-layout: fixed; width: 100%; min-width: 680px; }
.hr-tbl th:nth-child(1), .hr-tbl td:nth-child(1) { width: 24%; }
.hr-tbl th:nth-child(2), .hr-tbl td:nth-child(2) { width: 17%; }
.hr-tbl th:nth-child(3), .hr-tbl td:nth-child(3) { width: 7%; }
.hr-tbl th:nth-child(4), .hr-tbl td:nth-child(4) { width: 16%; }
.hr-tbl th:nth-child(5), .hr-tbl td:nth-child(5) { width: 16%; }
.hr-tbl th:nth-child(6), .hr-tbl td:nth-child(6) { width: 10%; }
.hr-tbl th:nth-child(7), .hr-tbl td:nth-child(7) { width: 10%; }
.hr-tbl td:nth-child(1), .hr-tbl td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Compress dense number tables on mobile (smaller type + hide low-value cols). */
@media (max-width: 640px) {
  .pr-tbl, .hr-tbl, .np-tbl { font-size: 12px; }
  .pr-tbl th, .pr-tbl td, .hr-tbl th, .hr-tbl td, .np-tbl th, .np-tbl td { padding: 6px 7px; }
  /* Products perf (Top + Underperformers): drop rank (#), thumbnail + Collection —
     keep Product / Units / Revenue. */
  .pr-tbl th:nth-child(1), .pr-tbl td:nth-child(1),
  .pr-tbl th:nth-child(2), .pr-tbl td:nth-child(2) { display: none; }
  /* New products: drop thumbnail (1), Collection (3), Units total (6) —
     keep Product / Launched / Units-per-week / Revenue. */
  .np-tbl th:nth-child(1), .np-tbl td:nth-child(1),
  .np-tbl th:nth-child(3), .np-tbl td:nth-child(3),
  .np-tbl th:nth-child(4), .np-tbl td:nth-child(4),
  .np-tbl th:nth-child(6), .np-tbl td:nth-child(6) { display: none; }
  /* HR pay roster: drop Fully-loaded + Vacation, keep Name/Role/%/Gross/Status */
  .hr-tbl th:nth-child(5), .hr-tbl td:nth-child(5),
  .hr-tbl th:nth-child(6), .hr-tbl td:nth-child(6) { display: none; }
}

/* ---- App-like feel (mobile / installed PWA) ---------------------------- */
* { -webkit-tap-highlight-color: transparent; }   /* no grey tap flash */
@media (max-width: 820px) {
  /* Don't let taps/long-press select UI-chrome text (feels native). */
  .sidebar, .app-topbar, .nav-item, .btn, .tab, .secnav-item, .kb-col-head,
  .app-feedback-btn, .app-bell, .app-hamburger, .kpi-row, .stat, .chip-toggle {
    -webkit-user-select: none; user-select: none;
  }
  /* Tactile press feedback. */
  .btn:active, .app-feedback-btn:active, .chip-toggle:active { transform: scale(.97); }
  .nav-item:active, .tab:active, .secnav-item:active, .kb-card:active,
  .td-lcard:active, .app-notif-item:active, .portal-row:active { opacity: .62; }
  .btn, .app-feedback-btn, .nav-item, .tab, .secnav-item, .chip-toggle { transition: transform .06s ease, opacity .06s ease; }
  /* Comfortable tap targets. */
  .nav-item { padding-top: 11px; padding-bottom: 11px; }
  /* Respect the notch / home indicator when installed. */
  .app-topbar { padding-top: calc(14px + env(safe-area-inset-top)); }
  .app-content { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  /* Contain scroll so the whole page doesn't rubber-band behind panels. */
  body { overscroll-behavior-y: contain; }
  .tbl-scroll, .kanban, .an-secnav, .secnav-tabs, .tabs { -webkit-overflow-scrolling: touch; }
}

/* CRM Flows dashboard */
.flow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.flow-card { border-left: 4px solid var(--border); margin-bottom: 0; }
.flow-card.flow-t-metric { border-left-color: #005bd3; }
.flow-card.flow-t-added-to-list { border-left-color: #0a6b3b; }
.flow-card.flow-t-date-based { border-left-color: #b26a00; }
.flow-card.flow-t-segment { border-left-color: #6c5ce7; }
.flow-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flow-name { font-size: 16px; font-weight: 600; }
.flow-blurb { margin: 6px 0 12px; color: var(--ink-subdued); font-size: 13.5px; line-height: 1.45; }
.flow-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-subdued);
  border-top: 1px solid var(--border-secondary); padding-top: 10px; }
.flow-meta-item { white-space: nowrap; }
@media (max-width: 640px) { .flow-grid { grid-template-columns: 1fr; } }

/* CRM content-plan editor pieces */
.cp-piece { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.cp-piece-toggle { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.cp-piece-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }

/* CRM flow card link + detail steps */
a.flow-card { text-decoration: none; color: inherit; display: block; transition: border-color .1s; }
a.flow-card:hover { border-color: var(--interactive); }
.flow-more { margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--interactive); }
.flow-steps { list-style: none; padding: 0; margin: 6px 0 0; }
.flow-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-secondary); font-size: 14px; }
.flow-steps li:last-child { border-bottom: none; }
.fs-badge { flex: none; min-width: 84px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-subdued); }
.fs-email .fs-badge { color: var(--interactive); }
.fs-trigger .fs-badge { color: #0a6b3b; }
.fs-delay .fs-badge { color: #b26a00; }

/* Flow detail — email step content */
.fs-emailrow { display: block; }
.fs-emailhead { display: flex; align-items: center; gap: 12px; }
.fs-subject { font-weight: 600; }
.fs-preview { color: var(--ink-subdued); font-size: 13px; margin: 4px 0 0 96px; }
.fs-bodywrap { margin: 6px 0 0 96px; }
.fs-bodywrap summary { cursor: pointer; color: var(--interactive); font-size: 13px; }
.fs-body { white-space: pre-wrap; font-size: 13px; color: var(--ink); margin-top: 8px;
  background: var(--surface-subdued); border-radius: 8px; padding: 10px 12px; line-height: 1.5; }
/* ---- Campaign email wizard (CRM content plan) ------------------------ */
.cp-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cp-banner-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-subdued); margin-top: 4px; }
.cp-seq { display: flex; flex-direction: column; }
.cp-seq-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-secondary); }
.cp-seq-row:first-child { border-top: none; }
.cp-seq-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-subdued);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--ink-subdued); }
.cp-seq-main { flex: 1; min-width: 0; }
.cp-seq-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.cp-seq-date { font-size: 13px; color: var(--ink-subdued); white-space: nowrap; }
.cp-add { display: flex; gap: 8px; margin-top: 14px; }
.cp-etabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.cp-etab { display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-size: 13px;
  font-weight: 500; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink-subdued); cursor: pointer; }
.cp-etab:hover { border-color: var(--interactive); }
.cp-etab.is-active { background: var(--interactive); color: #fff; border-color: var(--interactive); }
.cp-etab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.cp-etab-dot.on { background: #1a9d5a; }
.cp-etab.is-active .cp-etab-dot { background: rgba(255,255,255,.7); }
.cp-etab.is-active .cp-etab-dot.on { background: #9af0c0; }
.cp-etab-add { display: inline-flex; gap: 6px; margin-left: 6px; }
.cp-email { display: none; }
.cp-email.is-active { display: block; }
.cp-email-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cp-email-label { flex: 0 1 auto; min-width: 160px; font-weight: 600; }
.cp-section { padding: 16px 0; border-top: 1px solid var(--border-secondary); }
.cp-section:first-of-type { border-top: none; }
.cp-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-subdued); margin-bottom: 12px; }
.cp-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cp-section-head .cp-section-title { margin-bottom: 0; }
.cp-gen-status { font-size: 12px; }
.cp-field { margin-bottom: 14px; }
.cp-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-regen { background: none; border: none; color: var(--interactive); font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 0; font-family: inherit; }
.cp-regen:hover { text-decoration: underline; }
.cp-img-cur { margin-bottom: 8px; }
.cp-img-cur img { max-height: 120px; border-radius: 8px; border: 1px solid var(--border); }

/* ---- Product Development --------------------------------------------- */
.pd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .pd-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .pd-grid { grid-template-columns: 1fr; } }
.pd-card { display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-card);
  color: inherit; text-decoration: none; transition: transform .12s, border-color .12s, box-shadow .12s; }
.pd-card:hover { border-color: var(--interactive); box-shadow: var(--shadow);
  transform: translateY(-2px); text-decoration: none; }
.pd-card-img { position: relative; aspect-ratio: 1/1; background: var(--surface-subdued); overflow: hidden; }
.pd-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-card:hover .pd-card-img img { transform: scale(1.03); transition: transform .3s; }
.pd-card-noimg { display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--text-subdued); font-size: 12px; }
.pd-card-badge { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; }
.pd-card-badge.is-sample { background: #fdf0d5; color: #8a5a00; }
.pd-card-badge.is-bulk { background: #e3f3ea; color: #0a6b3b; }
.pd-card-coll { position: absolute; bottom: 8px; left: 8px; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(2px); }
.pd-card-body { padding: 12px 13px; }
.pd-card-name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.pd-card-sub { font-size: 12px; margin-top: 4px; }
.pd-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pd-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-form .field { margin-bottom: 16px; }
.pd-form .field:last-of-type { margin-bottom: 0; }
.pd-form .field-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pd-form .field-row .field { flex: 1; min-width: 160px; margin-bottom: 0; }
.pd-form input, .pd-form textarea, .pd-form select { width: 100%; }
.pd-form .form-actions { margin-top: 4px; }
.pd-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pd-img { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--surface-subdued); }
.pd-img.is-primary { border-color: var(--interactive); box-shadow: 0 0 0 1px var(--interactive); }
.pd-img img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.pd-img-tag { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 600;
  background: rgba(0,0,0,.6); color: #fff; padding: 1px 6px; border-radius: 10px; }
.pd-img-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px; }
.pd-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed var(--border); border-radius: 10px; padding: 24px; cursor: pointer;
  text-align: center; transition: border-color .12s, background .12s; }
.pd-dropzone:hover, .pd-dropzone.is-over { border-color: var(--interactive); background: rgba(0,91,211,.05); }
.pd-dropzone-text { font-size: 13px; font-weight: 500; color: var(--ink); }
.pd-dropzone-list { font-size: 12px; }
.pd-upload-url { display: flex; gap: 8px; margin-top: 10px; }
.pd-upload-url input { flex: 1; }
.pd-stats-tbl td, .pd-stats-tbl th { white-space: nowrap; }

/* Product Dev — pipeline board */
.pd-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.pd-bar-sel { font-size: 13px; }
.pd-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .pd-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .pd-board { grid-template-columns: 1fr; } }
.pd-col { background: var(--surface-subdued); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.pd-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 2px; }
.pd-col-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-subdued); }
.pd-col-count { font-size: 12px; font-weight: 600; color: var(--ink-subdued); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.pd-col-body { display: flex; flex-direction: column; gap: 8px; }
.pd-col-empty { text-align: center; font-size: 12px; padding: 8px 0; }
.pd-pcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pd-pcard:hover { border-color: var(--interactive); }
.pd-pcard-link { display: flex; gap: 10px; padding: 8px; color: inherit; text-decoration: none; align-items: center; }
.pd-pcard-thumb { flex: none; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--surface-subdued);
  display: flex; align-items: center; justify-content: center; }
.pd-pcard-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-pcard-info { min-width: 0; }
.pd-pcard-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.pd-pcard-sub { font-size: 11px; margin-top: 2px; }
.pd-pcheck { position: absolute; top: 6px; right: 6px; z-index: 2; }

/* Product Dev — detail stepper */
.pd-stepper { display: flex; align-items: flex-start; margin-top: 16px; }
.pd-step { flex: 1; text-align: center; position: relative; }
.pd-step:not(:first-child)::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%;
  height: 2px; background: var(--border); z-index: 0; }
.pd-step.is-done:not(:first-child)::before, .pd-step.is-current:not(:first-child)::before { background: #1a9d5a; }
.pd-step-dot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; margin: 0 auto 6px;
  background: var(--surface); border: 2px solid var(--border); }
.pd-step.is-done .pd-step-dot { background: #1a9d5a; border-color: #1a9d5a; }
.pd-step.is-current .pd-step-dot { background: var(--interactive); border-color: var(--interactive);
  box-shadow: 0 0 0 4px rgba(0,91,211,.15); }
.pd-step-label { font-size: 11.5px; color: var(--ink-subdued); }
.pd-step.is-current .pd-step-label { color: var(--ink); font-weight: 600; }
.pd-back-link { background: none; border: none; color: var(--interactive); font-size: 12px; cursor: pointer;
  padding: 0; font-family: inherit; }
.pd-back-link:hover { text-decoration: underline; }

/* Product Dev — stats page (revamped) */
.pd-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.pd-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 16px 18px; }
.pd-kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-subdued); }
.pd-kpi-val { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; color: var(--ink); }
@media (max-width: 720px) { .pd-kpis { grid-template-columns: 1fr; } }

.pd-headline { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 18px;
  border-radius: var(--radius); border: 1px solid #b7e3c8; background: #eafaf0; }
html[data-theme="dark"] .pd-headline { background: #12341f; border-color: #1f5a37; }
.pd-headline-tag { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #0a6b3b; background: #cdefd8; padding: 5px 10px; border-radius: 999px; }
html[data-theme="dark"] .pd-headline-tag { background: #1f5a37; color: #9af0c0; }
.pd-headline-body { font-size: 14px; color: var(--ink); line-height: 1.4; }

.pd-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 16px; font-size: 12.5px; color: var(--ink); }
.pd-leg { display: inline-flex; align-items: center; gap: 6px; }
.pd-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pd-dot-up { background: #1a9d5a; }
.pd-dot-ok { background: #005bd3; }
.pd-dot-cov { background: #9aa0a6; }
.pd-card-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.pd-rows { display: flex; flex-direction: column; gap: 16px; }
.pd-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.pd-row-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.pd-bar-track { height: 10px; border-radius: 999px; background: var(--surface-subdued); overflow: hidden; }
.pd-bar-fill { height: 100%; border-radius: 999px; background: var(--interactive); transition: width .3s; }
.pd-row-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; }
.pd-row-rps { font-size: 14px; font-weight: 600; color: var(--ink); }
.pd-tag { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pd-tag-up { background: #e3f3ea; color: #0a6b3b; }
.pd-tag-cov { background: #f1f1f1; color: #616161; }
.pd-tag-ok { background: #eaf0fd; color: #005bd3; }
.pd-tag-new { background: #fdf0d5; color: #8a5a00; }
html[data-theme="dark"] .pd-tag-new { background: #3a3320; color: #ecd08a; }
.pd-dot-new { background: #b26a00; }
.pd-sig-new .pd-bar-fill { background: #d9a441; }
html[data-theme="dark"] .pd-tag-up { background: #12341f; color: #7fd6a0; }
html[data-theme="dark"] .pd-tag-cov { background: #2a2a2a; color: #aaa; }
html[data-theme="dark"] .pd-tag-ok { background: #14243f; color: #7fb0f5; }
/* signal-coloured bars */
.pd-sig-make_more .pd-bar-fill { background: #1a9d5a; }
.pd-sig-over .pd-bar-fill { background: #9aa0a6; }
.pd-sig-ok .pd-bar-fill { background: #005bd3; }

/* Flow detail — vertical tree (Klaviyo-style flowchart) */
.flow-tree { display: flex; flex-direction: column; align-items: center; padding: 8px 0 4px; }
.ft-node { display: flex; align-items: flex-start; gap: 12px; width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow-card); }
.ft-icon { flex: none; width: 30px; height: 30px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-size: 15px; line-height: 1;
  background: var(--surface-subdued); color: var(--ink-subdued); }
.ft-body { min-width: 0; }
.ft-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-subdued); }
.ft-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 2px; word-break: break-word; }
.ft-sub { font-size: 12.5px; color: var(--ink-subdued); margin-top: 2px; }
.ft-node .fs-preview-btn { margin-top: 8px; }
.ft-conn { width: 2px; height: 22px; background: var(--border); }
.ft-trigger { border-color: #0a6b3b; }
.ft-trigger .ft-icon { background: #e3f3ea; color: #0a6b3b; }
.ft-email .ft-icon { background: #eaf0fd; color: #005bd3; }
.ft-delay .ft-icon { background: #fdf0d5; color: #8a5a00; }
.ft-split .ft-icon { background: #efeafe; color: #6c5ce7; }
.ft-end { max-width: 200px; justify-content: center; align-items: center; }
.ft-end .ft-icon { background: var(--surface-subdued); }
html[data-theme="dark"] .ft-trigger .ft-icon { background: #12341f; color: #7fd6a0; }
html[data-theme="dark"] .ft-email .ft-icon { background: #14243f; color: #7fb0f5; }
html[data-theme="dark"] .ft-delay .ft-icon { background: #3a3320; color: #ecd08a; }
html[data-theme="dark"] .ft-split .ft-icon { background: #241f3a; color: #b9a9f0; }
.camp-crm-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.ma-am-logo { width: 16px; height: 16px; display: block; }
.email-modal-box { max-width: 700px; width: 100%; }
.email-modal-body { padding: 0; }
#email-frame { width: 100%; height: 72vh; border: none; background: #fff; border-radius: 0 0 12px 12px; display: block; }
