/* Boundly look for analytics (BOU-983): the CMS / Brain design language
   (BOU-984): Inter Tight, warm neutrals, one brand blue #1219ab, hairline
   borders instead of shadows. Custom properties and stable test ids only, so
   an upstream upgrade can at worst lose the look, never break the app.
   Colours apply to the light scheme; the dark scheme keeps its own. */
@font-face {
  font-family: "Inter Tight";
  src: url("inter-tight.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root, body.mb-wrapper {
  --mb-default-font-family: "Inter Tight", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  --mantine-font-family: var(--mb-default-font-family) !important;
}
body.mb-wrapper {
  font-family: var(--mb-default-font-family);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

:root[data-mantine-color-scheme="light"],
:root[data-mantine-color-scheme="light"] body.mb-wrapper {
  /* Brand */
  --mb-color-brand: #1219ab !important;
  --mb-color-core-brand: #1219ab !important;
  --mb-color-metabase-brand: #1219ab !important;
  --mb-color-core-metabase_brand: #1219ab !important;
  --mb-color-core-blue-saturated: #1219ab !important;
  --mb-color-saturated-blue: #1219ab !important;
  --mb-color-brand-hover: #0f1592 !important;
  --mb-color-core-brand-hover: #0f1592 !important;
  --mb-color-text-brand: #1219ab !important;
  --mb-color-text-brand-hover: #0f1592 !important;
  --mb-color-text-brand-strong: #1219ab !important;
  --mb-color-text-brand-strong-hover: #0f1592 !important;
  --mb-color-text-hover: #1219ab !important;
  --mb-color-icon-brand: #1219ab !important;
  --mb-color-border-highlight: #1219ab !important;
  --mb-color-switch-checked: #1219ab !important;
  --mb-color-background-brand: #eceefb !important;
  --mb-color-background-highlight: #eceefb !important;
  --mb-color-background-hover: #f7f7f5 !important;
  --mb-color-background_surface-hover: #f7f7f5 !important;
  --mb-color-background_surface-brand-strong: #1219ab !important;
  --mb-color-background_surface-brand-strong-hover: #0f1592 !important;
  --mb-color-background_surface-brand-strong-pressed: #0d1279 !important;
  --mb-color-background_surface-brand-subtle: #eceefb !important;
  --mb-color-background_surface-brand-subtle-hover: #dee1f8 !important;
  --mb-color-button-filled-brand-default: #1219ab !important;
  --mb-color-button-filled-brand-hover: #0f1592 !important;
  --mb-color-button-filled-brand-pressed: #0d1279 !important;
  --mb-color-button-light-brand-default: #eceefb !important;
  --mb-color-button-light-brand-hover: #dee1f8 !important;
  --mb-color-button_label-light-brand-default: #1219ab !important;
  --mb-color-button_label-light-brand-hover: #0f1592 !important;
  --mb-color-button_label-subtle-brand-default: #1219ab !important;
  --mb-color-button_label-subtle-brand-hover: #0f1592 !important;
  --mb-color-focus: #c2c7f1 !important;
  --mb-color-input-focus: #c2c7f1 !important;
  --mb-color-border-brand: #dee1f8 !important;
  --mantine-color-brand-filled: #1219ab !important;
  --mantine-color-brand-filled-hover: #0f1592 !important;
  --mantine-primary-color-filled: #1219ab !important;
  --mantine-primary-color-filled-hover: #0f1592 !important;
  --mantine-primary-color-light: #eceefb !important;
  --mantine-primary-color-light-color: #1219ab !important;

  /* Warm neutrals */
  --mb-color-text-primary: #1a1a18 !important;
  --mb-color-text-selected: #1a1a18 !important;
  --mb-color-text-secondary: #73736d !important;
  --mb-color-text-secondary-opaque: #73736d !important;
  --mb-color-text-tertiary: #a3a39c !important;
  --mb-color-icon-primary: #1a1a18 !important;
  --mb-color-icon-secondary: #73736d !important;
  --mb-color-background-secondary: #f7f7f5 !important;
  --mb-color-background_page-secondary: #ffffff !important;
  --mb-color-background-tertiary: #efefec !important;
  --mb-color-background_page-tertiary: #efefec !important;
  --mb-color-bg-dashboard: #ffffff !important;
  --mb-color-border: #e6e6e1 !important;
  --mb-color-border-neutral: #e6e6e1 !important;
  --mb-color-border-subtle: #efefec !important;
  --mb-color-border-strong: #e0e0da !important;
  --mb-color-cartesian-grid-line: #efefec !important;
  --mb-color-table-border: #efefec !important;
  --mb-color-shadow: transparent !important;
}

/* Chip + "Boundly Analytics", as "Boundly CMS" in the CMS sidebar. */
[data-testid="main-logo"] > * { display: none !important; }
[data-testid="main-logo"] {
  background: url("favicon.png") center / contain no-repeat !important;
  min-width: 24px;
}
[data-testid="main-logo-link"] { text-decoration: none; width: auto !important; }
/* Two pseudo-elements: "Boundly" in ink, "Analytics" muted, as in the CMS. */
[data-testid="main-logo-link"]::before,
[data-testid="main-logo-link"]::after {
  font: 600 15px "Inter Tight", system-ui, sans-serif;
  white-space: nowrap;
  order: 2;
}
[data-testid="main-logo-link"]::before { content: "Boundly"; margin-left: 8px; color: var(--mb-color-text-primary); }
[data-testid="main-logo-link"]::after { content: "Analytics"; margin-left: 5px; font-weight: 400; color: #a3a39c; order: 3; }

/* Sidebar, as the CMS: quiet section labels, medium-weight items, grey
   icons, a soft grey row for the current page. */
[data-testid="main-navbar-root"] h4 {
  text-transform: none !important; letter-spacing: 0 !important;
  font-size: 13px !important; font-weight: 500 !important; color: #73736d !important;
}
[data-testid="main-navbar-root"] li a { font-weight: 500; }
[data-testid="main-navbar-root"] li .Icon { color: #73736d; }
[data-testid="main-navbar-root"] li[aria-selected="true"] { background: #efefec !important; }
[data-testid="main-navbar-root"] li[aria-selected="true"] .Icon { color: #1a1a18; }

/* Not for us: "Getting started" (add data, how to use Metabase, examples)
   and the greeting robot on the home page. */
[data-testid="main-navbar-root"] [role="tab"]:has(li[aria-label="How to use Metabase"]) { display: none !important; }
[data-testid="home-page"] > div > div > svg:not(.Icon) { display: none !important; }
[data-testid="home-page"] { background: #ffffff !important; }

/* Plain pages, no illustrations (as the CMS sign-in). */
[data-testid="login-page-illustration"],
[data-testid="landing-page-illustration"],
[data-testid="unsubscribe-page-illustration"],
svg[viewBox="0 0 3333 640"] { display: none !important; }

#boundly-source {
  position: fixed; right: 10px; bottom: 6px; z-index: 1;
  font: 400 11px "Inter Tight", system-ui, sans-serif;
  color: #73736d; text-decoration: none;
  background: rgba(255, 255, 255, 0.9); padding: 1px 6px; border-radius: 4px;
}
#boundly-source:hover { text-decoration: underline; }

/* Dark scheme: the brand blue is too dark to read on dark, so a light step. */
:root[data-mantine-color-scheme="dark"], :root[data-mantine-color-scheme="dark"] body.mb-wrapper {
  --mb-color-brand: #99a0e5 !important;
  --mb-color-core-brand: #99a0e5 !important;
  --mb-color-text-brand: #99a0e5 !important;
}

/* The built-in AI assistant button: we drive analytics from Claude (MCP). */
[data-testid="app-bar"] button[aria-label^="Chat with Metabot"] { display: none !important; }

/* Admin bar: ink, not purple; white mark on it. */
nav[aria-label="Navigation bar"] { background-color: #1a1a18 !important; }
nav[aria-label="Navigation bar"] [data-testid="main-logo"] { filter: brightness(0) invert(1); }
