/* Brumby skin for InvenTree (Mantine 7 UI) - v2, 29 Aug: white, modern, full palette.
   The brand thread is the type (TASA Orbiter headings, Rethink Sans body), the mark in the
   header and a warm-neutral grey ramp; colour is Mantine's own palette - indigo primary,
   green / yellow / red for status - so the app reads like a current SaaS tool, not a poster.
   Loaded after the bundle via the overridden web/index.html; ':root:root' outranks Mantine's
   own :root blocks. Re-run skin/apply.sh after an InvenTree upgrade. */

:root:root {
  --mantine-font-family: 'Rethink Sans', system-ui, -apple-system, sans-serif;
  --mantine-font-family-headings: 'TASA Orbiter', system-ui, sans-serif;
  --mantine-font-family-monospace: ui-monospace, 'SF Mono', Menlo, monospace;
  --mantine-heading-font-weight: 600;
  --mantine-radius-default: 8px;
  --mantine-radius-xs: 4px;
  --mantine-radius-sm: 6px;
  --mantine-radius-md: 8px;
  --mantine-radius-lg: 12px;
  --mantine-radius-xl: 16px;

  /* warm-neutral greys (a whisper of the Ironbark hue, nothing cream) */
  --mantine-color-gray-0: #f8f8f6;
  --mantine-color-gray-1: #f1f0ed;
  --mantine-color-gray-2: #e6e4df;
  --mantine-color-gray-3: #d3d0c9;
  --mantine-color-gray-4: #b7b3ab;
  --mantine-color-gray-5: #8f8a81;
  --mantine-color-gray-6: #6b665e;
  --mantine-color-gray-7: #4e4a43;
  --mantine-color-gray-8: #33302b;
  --mantine-color-gray-9: #1f1d1a;

  /* modern dark ramp */
  --mantine-color-dark-0: #d5d5d8;
  --mantine-color-dark-1: #b3b3b8;
  --mantine-color-dark-2: #8b8b92;
  --mantine-color-dark-3: #5f5f66;
  --mantine-color-dark-4: #3a3a41;
  --mantine-color-dark-5: #2b2b31;
  --mantine-color-dark-6: #212125;
  --mantine-color-dark-7: #18181b;
  --mantine-color-dark-8: #121214;
  --mantine-color-dark-9: #0b0b0d;

  --brumby-heading: #1f1d1a;
  --brumby-accent: #d9480f;                      /* the one Brumby-ish hot colour, used sparingly */
  --mantine-primary-color-contrast: #ffffff;
}

/* Mantine sets per-scheme surfaces in :root[data-mantine-color-scheme=...] - outrank them */
:root:root[data-mantine-color-scheme='light'] {
  --mantine-color-body: #ffffff;
  --mantine-color-white: #ffffff;
  --mantine-color-text: #1f1d1a;
  --mantine-color-bright: #000000;
  --mantine-color-dimmed: #6b665e;
  --mantine-color-placeholder: #8f8a81;
  --mantine-color-default: #ffffff;
  --mantine-color-default-hover: #f8f8f6;
  --mantine-color-default-color: #1f1d1a;
  --mantine-color-default-border: #e6e4df;
  --mantine-datatable-border-color: #ecebe7;
  --mantine-datatable-row-border-color: #efeeea;
  --mantine-shadow-xs: 0 1px 2px rgba(31, 29, 26, 0.05);
  --mantine-shadow-sm: 0 1px 2px rgba(31, 29, 26, 0.05), 0 4px 16px rgba(31, 29, 26, 0.06);
  --mantine-shadow-md: 0 4px 12px rgba(31, 29, 26, 0.08), 0 12px 32px rgba(31, 29, 26, 0.08);
  --brumby-chrome: #ffffff;
  --brumby-chrome-line: #e6e4df;
}
:root:root[data-mantine-color-scheme='dark'] {
  --mantine-color-body: #141416;
  --mantine-color-text: #ececee;
  --mantine-color-bright: #ffffff;
  --mantine-color-dimmed: #9a9aa2;
  --mantine-color-placeholder: #6f6f77;
  --mantine-color-default: #212125;
  --mantine-color-default-hover: #2b2b31;
  --mantine-color-default-color: #ececee;
  --mantine-color-default-border: rgba(255, 255, 255, 0.09);
  --mantine-datatable-border-color: rgba(255, 255, 255, 0.08);
  --mantine-datatable-row-border-color: rgba(255, 255, 255, 0.06);
  --mantine-shadow-xs: none;
  --mantine-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
  --brumby-heading: #f4f4f5;
  --brumby-chrome: #18181b;
  --brumby-chrome-line: rgba(255, 255, 255, 0.09);
}

/* ---- header: white, hairline, pill tabs (InvenTree's header is a hashed Layout div) ---- */
.mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) {
  background: var(--brumby-chrome);
  border-bottom: 1px solid var(--brumby-chrome-line);
  box-shadow: var(--mantine-shadow-xs);
}
.mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) .mantine-Tabs-list {
  border-bottom: 0;
  gap: 2px;
}
.mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) .mantine-Tabs-tab {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 500;
  color: var(--mantine-color-dimmed);
}
.mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) .mantine-Tabs-tab:hover {
  background: var(--mantine-color-default-hover);
  color: var(--mantine-color-text);
}
.mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) .mantine-Tabs-tab[data-active] {
  background: var(--mantine-primary-color-light);
  color: var(--mantine-primary-color-light-color);
  font-weight: 600;
}
.mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) .mantine-ActionIcon-root[data-variant='transparent'] {
  color: var(--mantine-color-dimmed);
}
.mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) .mantine-ActionIcon-root[data-variant='transparent']:hover {
  color: var(--mantine-color-text);
  background: var(--mantine-color-default-hover);
}
.mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) img[alt='InvenTree Logo'] {
  height: 30px;
  width: auto;
}

/* ---- surfaces ---- */
.mantine-Paper-root, .mantine-Card-root {
  border: 1px solid var(--mantine-color-default-border);
  box-shadow: var(--mantine-shadow-xs);
}
.mantine-Paper-root .mantine-Paper-root, .mantine-Modal-content, .mantine-Popover-dropdown, .mantine-Menu-dropdown {
  box-shadow: var(--mantine-shadow-sm);
}

/* ---- data tables ---- */
.mantine-datatable thead th, .mantine-Table-thead th {
  background: var(--mantine-color-gray-0);
  color: var(--mantine-color-dimmed);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
[data-mantine-color-scheme='dark'] .mantine-datatable thead th,
[data-mantine-color-scheme='dark'] .mantine-Table-thead th {
  background: var(--mantine-color-dark-6);
}
.mantine-datatable tbody tr:hover td {
  background: var(--mantine-color-gray-0);
}
[data-mantine-color-scheme='dark'] .mantine-datatable tbody tr:hover td {
  background: var(--mantine-color-dark-6);
}
.mantine-Table-table, .mantine-datatable {
  font-variant-numeric: tabular-nums;
}

/* ---- badges as pills; status colour comes from InvenTree's own semantics ---- */
.mantine-Badge-root {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* ---- side navigation ---- */
.mantine-NavLink-root {
  border-radius: 8px;
}
.mantine-NavLink-root[data-active] {
  background: var(--mantine-primary-color-light);
  color: var(--mantine-primary-color-light-color);
  font-weight: 600;
}

/* ---- type ---- */
h1, h2, h3, h4, .mantine-Title-root {
  font-family: var(--mantine-font-family-headings);
  letter-spacing: -0.01em;
}
/* InvenTree paints titles with a gradient Text variant whose stops are computed in JS - make
   them solid so the display face carries the hierarchy */
.mantine-Text-root[data-variant='gradient'], .mantine-Title-root[data-variant='gradient'] {
  --text-gradient: linear-gradient(90deg, var(--brumby-heading), var(--brumby-heading)) !important;
  background-image: linear-gradient(90deg, var(--brumby-heading), var(--brumby-heading)) !important;
  font-family: var(--mantine-font-family-headings);
  letter-spacing: -0.01em;
}

/* ---- inputs / buttons ---- */
.mantine-Input-input {
  border-color: var(--mantine-color-default-border);
}
.mantine-Input-input:focus, .mantine-Input-input:focus-within {
  border-color: var(--mantine-primary-color-filled);
  box-shadow: 0 0 0 3px var(--mantine-primary-color-light);
}
.mantine-Button-root {
  font-weight: 600;
}

/* count badges follow the primary */
.mantine-Indicator-indicator {
  background: var(--mantine-primary-color-filled) !important;
  color: #fff !important;
}

/* one logo file, both schemes: the Ironbark mark is inverted to off-white on the dark header */
[data-mantine-color-scheme='dark'] .mantine-Flex-root > div:first-child:has(.mantine-Tabs-list) img[alt='InvenTree Logo'] {
  filter: invert(0.92);
}
[data-mantine-color-scheme='dark'] .mantine-Alert-root[data-variant='filled'] {
  opacity: 0.92;
}

/* ---- Brumby: fewer menus. Sales is not a thing here; the Runs tab (plugin) is where a run starts. */
.mantine-Tabs-tab:has(a[href$="/sales"]), .mantine-Tabs-tab:has(a[href$="/sales/"]) { display: none !important; }
.mantine-Alert-root:has(a[href*="inve-w14" i]), [role="alert"]:has(a[href*="inve-w14" i]) { display: none !important; }   /* the superuser banner on every page */

/* ---- Brumby 24 Sep 2026: fewer buttons (Sam: "still so many buttons at the top").
   Header: Dashboard / Parts / Purchasing / Runs only; search, notifications and the user menu stay. */
.mantine-Tabs-tab[data-orientation="horizontal"]:has(a[href$="/web/stock"]),
.mantine-Tabs-tab[data-orientation="horizontal"]:has(a[href$="/web/manufacturing"]),
button[aria-label="open-spotlight"],
button[aria-label="barcode-scan-button-any"],
button[aria-label="open-alerts"] { display: none !important; }
/* page action row: keep the main button (Issue / Complete) and the item's own menu */
button[aria-label="action-button-open-in-admin-interface"],
button[aria-label="action-button-subscribe-to-notifications"],
button[aria-label="action-menu-barcode-actions"],
button[aria-label="action-menu-printing-actions"] { display: none !important; }
/* side panels nobody uses: build allocation/outputs, parameters, allocations, related parts */
.mantine-Tabs-tab[data-orientation="vertical"]:has(a[href$="/allocated-stock"]),
.mantine-Tabs-tab[data-orientation="vertical"]:has(a[href$="/consumed-stock"]),
.mantine-Tabs-tab[data-orientation="vertical"]:has(a[href$="/incomplete-outputs"]),
.mantine-Tabs-tab[data-orientation="vertical"]:has(a[href$="/complete-outputs"]),
.mantine-Tabs-tab[data-orientation="vertical"]:has(a[href$="/parameters"]),
.mantine-Tabs-tab[data-orientation="vertical"]:has(a[href$="/allocations"]),
.mantine-Tabs-tab[data-orientation="vertical"]:has(a[href$="/related_parts"]) { display: none !important; }
