/*!
 * hub-ui 1.0.2 — Hub Systems shared look, framework-free.
 * Source of truth: hub_dev_kit, templates/ui/hub.css. Visual reference: the hubauth front end
 * (Mantine theme in web_hubauth_frontend/hubauth/src/lib/theme.ts).
 *
 * VENDORED FILE: do not edit in a project. Put customer colours in brand.css and project tweaks
 * in the project's own stylesheet, loaded after this one. Update by copying a newer version over.
 *
 * Use: <body class="hub"> turns on base element styling; components are .hub-* classes.
 * Colour scheme follows the OS; force it with <html data-theme="light|dark">.
 */

/* ---------------------------------------------------------------------------------------------
 * 1. Brand inputs. A customer brand overrides these (see brand.example.css). Everything else is
 *    derived, so one colour is enough.
 *    --brand-primary          filled buttons, focus rings, selection (light mode)
 *    --brand-on-primary       text on filled primary
 *    --brand-primary-fg       primary-coloured text on the page (titles, active nav, links)
 *    Optional dark-mode overrides: --brand-primary-dark, --brand-primary-fg-dark
 * ------------------------------------------------------------------------------------------- */
:root {
  --brand-primary: #367936;
  --brand-on-primary: #fff;
}

/* ---------------------------------------------------------------------------------------------
 * 2. Tokens
 * ------------------------------------------------------------------------------------------- */
:root {
  --hub-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hub-font-mono: "JetBrains Mono", "Fira Code", Consolas, Monaco, "Courier New", monospace;

  --hub-fs-xs: 0.75rem;
  --hub-fs-sm: 0.875rem;
  --hub-fs-md: 1rem;
  --hub-fs-lg: 1.125rem;

  --hub-space-xs: 0.5rem;
  --hub-space-sm: 0.75rem;
  --hub-space-md: 1rem;
  --hub-space-lg: 1.5rem;
  --hub-space-xl: 2rem;

  --hub-radius-xs: 4px;
  --hub-radius-sm: 6px;
  --hub-radius-md: 8px;
  --hub-radius-lg: 12px;
  --hub-radius-xl: 16px;

  --hub-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --hub-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --hub-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --hub-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --hub-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --hub-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --hub-header-h: 70px;
  --hub-nav-w: 280px;
  --hub-footer-h: 60px;
  --hub-control-h: 36px;

  /* Status colours (Mantine palette). Text shades are picked per scheme below. */
  --hub-blue: #228be6;
  --hub-green: #40c057;
  --hub-red: #fa5252;
  --hub-orange: #fd7e14;
  --hub-yellow: #fab005;
  --hub-grape: #be4bdb;
  --hub-violet: #7950f2;
  --hub-indigo: #4c6ef5;
  --hub-cyan: #15aabf;
  --hub-teal: #12b886;
  --hub-pink: #e64980;
  --hub-gray: #868e96;
}

/* Light scheme (default) */
:root {
  color-scheme: light;
  --hub-primary: var(--brand-primary);
  --hub-primary-hover: var(--hub-primary-hover-derived);
  --hub-primary-fg: var(--brand-primary-fg, var(--brand-primary));

  --hub-bg: #f8f9fa;           /* page behind content */
  --hub-surface: #fff;         /* header, nav, cards, inputs */
  --hub-surface-hover: #f1f3f5;
  --hub-surface-inset: #f8f9fa;
  --hub-border: #dee2e6;       /* cards, tables */
  --hub-divider: #e9ecef;      /* header/nav/footer lines */
  --hub-input-border: #ced4da;
  --hub-text: #000;
  --hub-text-dimmed: #868e96;
  --hub-text-link: var(--hub-primary-fg);
  --hub-overlay: rgba(0, 0, 0, 0.45);

  --hub-tint: 10%;             /* strength of "light" variant backgrounds */
  --hub-blue-fg: #1c7ed6;
  --hub-green-fg: #2f9e44;
  --hub-red-fg: #e03131;
  --hub-orange-fg: #e8590c;
  --hub-yellow-fg: #e67700;
  --hub-grape-fg: #ae3ec9;
  --hub-violet-fg: #7048e8;
  --hub-indigo-fg: #4263eb;
  --hub-cyan-fg: #1098ad;
  --hub-teal-fg: #0ca678;
  --hub-pink-fg: #d6336c;
  --hub-gray-fg: #495057;
}

/* Dark scheme. Kept in two identical blocks: OS preference, and forced via data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --hub-primary: var(--brand-primary-dark, var(--hub-primary-dark-derived));
    --hub-primary-hover: color-mix(in srgb, var(--hub-primary) 80%, black);
    --hub-primary-fg: var(--brand-primary-fg-dark, var(--hub-primary-fg-dark-derived));

    --hub-bg: #131313;
    --hub-surface: #2e2d2d;
    --hub-surface-hover: #2d3339;
    --hub-surface-inset: #252525;
    --hub-border: #425e42;
    --hub-divider: #2d3339;
    --hub-input-border: #425e42;
    --hub-text: #f8f9fa;
    --hub-text-dimmed: #b4bcc4;
    --hub-overlay: rgba(0, 0, 0, 0.6);

    --hub-tint: 15%;
    --hub-blue-fg: #4dabf7;
    --hub-green-fg: #69db7c;
    --hub-red-fg: #ff8787;
    --hub-orange-fg: #ffa94d;
    --hub-yellow-fg: #ffd43b;
    --hub-grape-fg: #da77f2;
    --hub-violet-fg: #9775fa;
    --hub-indigo-fg: #748ffc;
    --hub-cyan-fg: #3bc9db;
    --hub-teal-fg: #38d9a9;
    --hub-pink-fg: #f783ac;
    --hub-gray-fg: #ced4da;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --hub-primary: var(--brand-primary-dark, var(--hub-primary-dark-derived));
  --hub-primary-hover: color-mix(in srgb, var(--hub-primary) 80%, black);
  --hub-primary-fg: var(--brand-primary-fg-dark, var(--hub-primary-fg-dark-derived));

  --hub-bg: #131313;
  --hub-surface: #2e2d2d;
  --hub-surface-hover: #2d3339;
  --hub-surface-inset: #252525;
  --hub-border: #425e42;
  --hub-divider: #2d3339;
  --hub-input-border: #425e42;
  --hub-text: #f8f9fa;
  --hub-text-dimmed: #b4bcc4;
  --hub-overlay: rgba(0, 0, 0, 0.6);

  --hub-tint: 15%;
  --hub-blue-fg: #4dabf7;
  --hub-green-fg: #69db7c;
  --hub-red-fg: #ff8787;
  --hub-orange-fg: #ffa94d;
  --hub-yellow-fg: #ffd43b;
  --hub-grape-fg: #da77f2;
  --hub-violet-fg: #9775fa;
  --hub-indigo-fg: #748ffc;
  --hub-cyan-fg: #3bc9db;
  --hub-teal-fg: #38d9a9;
  --hub-pink-fg: #f783ac;
  --hub-gray-fg: #ced4da;
}

/* Derived brand shades. Fallback chain: plain colour, then color-mix, then OKLCH relative colour
   (keeps the customer's hue but sets lightness for the scheme). */
:root {
  --hub-primary-hover-derived: var(--brand-primary);
  --hub-primary-dark-derived: var(--brand-primary);
  --hub-primary-fg-dark-derived: var(--brand-primary);
}
@supports (color: color-mix(in srgb, red 50%, black)) {
  :root {
    --hub-primary-hover-derived: color-mix(in srgb, var(--brand-primary) 85%, black);
    --hub-primary-dark-derived: color-mix(in srgb, var(--brand-primary) 70%, black);
    --hub-primary-fg-dark-derived: color-mix(in srgb, var(--brand-primary) 50%, white);
  }
}
@supports (color: oklch(from red l c h)) {
  :root {
    --hub-primary-hover-derived: oklch(from var(--brand-primary) calc(l - 0.05) c h);
    --hub-primary-dark-derived: oklch(from var(--brand-primary) min(l, 0.42) calc(c * 0.75) h);
    --hub-primary-fg-dark-derived: oklch(from var(--brand-primary) max(l, 0.8) c h);
  }
}

/* ---------------------------------------------------------------------------------------------
 * 3. Base elements, only inside .hub. :where() keeps specificity at zero so project CSS wins.
 * ------------------------------------------------------------------------------------------- */
:where(.hub) {
  margin: 0;
  font-family: var(--hub-font);
  font-size: var(--hub-fs-md);
  line-height: 1.55;
  color: var(--hub-text);
  background: var(--hub-bg);
  -webkit-font-smoothing: antialiased;
}
:where(.hub) *, :where(.hub) *::before, :where(.hub) *::after { box-sizing: border-box; }

:where(.hub) :where(h1, h2, h3, h4, h5, h6) { margin: 0 0 var(--hub-space-sm); font-weight: 600; }
:where(.hub) :where(h1) { font-size: 2rem; line-height: 1.2; font-weight: 700; }
:where(.hub) :where(h2) { font-size: 1.625rem; line-height: 1.3; }
:where(.hub) :where(h3) { font-size: 1.375rem; line-height: 1.35; }
:where(.hub) :where(h4) { font-size: 1.125rem; line-height: 1.4; }
:where(.hub) :where(h5) { font-size: 1rem; line-height: 1.45; }
:where(.hub) :where(h6) { font-size: 0.875rem; line-height: 1.5; }
:where(.hub) :where(p) { margin: 0 0 var(--hub-space-sm); }

:where(.hub) :where(a) { color: var(--hub-text-link); text-decoration: none; }
:where(.hub) :where(a:hover) { text-decoration: underline; }
:where(.hub) :where(code, kbd, samp, pre) { font-family: var(--hub-font-mono); font-size: 0.85em; }
:where(.hub) :where(:not(pre) > code) {
  padding: 1px 5px; border-radius: var(--hub-radius-xs); background: var(--hub-surface-hover);
}
:where(.hub) :where(pre) {
  margin: 0; padding: var(--hub-space-sm) var(--hub-space-md); overflow: auto;
  border-radius: var(--hub-radius-md); background: var(--hub-surface-inset); border: 1px solid var(--hub-border);
}
:where(.hub) :where(hr) { border: 0; border-top: 1px solid var(--hub-divider); margin: var(--hub-space-md) 0; }
:where(.hub) ::selection { background: var(--hub-primary); color: var(--brand-on-primary); }
:where(.hub) :focus-visible { outline: 2px solid var(--hub-primary); outline-offset: 2px; }

/* Form controls */
:where(.hub) :where(label) { display: block; font-size: var(--hub-fs-sm); font-weight: 500; margin-bottom: 4px; }
:where(.hub) :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="submit"], [type="button"], [type="reset"]), select, textarea) {
  width: 100%;
  min-height: var(--hub-control-h);
  padding: 0 var(--hub-space-sm);
  font: inherit;
  font-size: var(--hub-fs-sm);
  color: var(--hub-text);
  background: var(--hub-surface);
  border: 1px solid var(--hub-input-border);
  border-radius: var(--hub-radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
:where(.hub) :where(textarea) { padding: var(--hub-space-xs) var(--hub-space-sm); min-height: 5rem; resize: vertical; }
:where(.hub) :where(input, select, textarea):focus {
  outline: none;
  border-color: var(--hub-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hub-primary) 18%, transparent);
}
:where(.hub) :where(input, select, textarea)::placeholder { color: var(--hub-text-dimmed); }
:where(.hub) :where(input, select, textarea, button):disabled { opacity: 0.6; cursor: not-allowed; }
:where(.hub) :where([aria-invalid="true"]) { border-color: var(--hub-red-fg); }
:where(.hub) :where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--hub-primary); width: 1rem; height: 1rem; }

/* Plain buttons look like the default Mantine button; add .hub-btn--primary for the filled one. */
:where(.hub) :where(button, input[type="submit"], input[type="button"], input[type="reset"]),
.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hub-space-xs);
  min-height: var(--hub-control-h);
  padding: 0 1.125rem;
  font: inherit;
  font-size: var(--hub-fs-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--hub-text);
  background: var(--hub-surface);
  border: 1px solid var(--hub-input-border);
  border-radius: var(--hub-radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--hub-ease);
}
:where(.hub) :where(button, input[type="submit"], input[type="button"], input[type="reset"]):hover:not(:disabled),
.hub-btn:hover { background: var(--hub-surface-hover); text-decoration: none; }
.hub-btn:active, :where(.hub) :where(button):active:not(:disabled) { transform: translateY(1px); }

.hub-btn--primary {
  color: var(--brand-on-primary); background: var(--hub-primary); border-color: transparent;
}
.hub-btn--primary:hover:not(:disabled) { background: var(--hub-primary-hover); }
.hub-btn--light {
  color: var(--hub-primary-fg); border-color: transparent;
  background: color-mix(in srgb, var(--hub-primary) var(--hub-tint), transparent);
}
.hub-btn--light:hover:not(:disabled) { background: color-mix(in srgb, var(--hub-primary) calc(var(--hub-tint) + 7%), transparent); }
.hub-btn--danger { color: #fff; background: #e03131; border-color: transparent; }
.hub-btn--danger:hover:not(:disabled) { background: #c92a2a; }
.hub-btn--subtle { background: transparent; border-color: transparent; color: var(--hub-primary-fg); }
.hub-btn--subtle:hover:not(:disabled) { background: color-mix(in srgb, var(--hub-primary) var(--hub-tint), transparent); }
.hub-btn--sm { min-height: 30px; padding: 0 0.875rem; font-size: var(--hub-fs-xs); }
.hub-btn--block { display: flex; width: 100%; }
.hub-btn--icon { padding: 0; width: var(--hub-control-h); }
.hub-btn--icon:hover:not(:disabled) { transform: scale(1.1); }

/* ---------------------------------------------------------------------------------------------
 * 4. App shell: header, side nav, main, footer.
 *    <body class="hub"><div class="hub-app"> header.hub-header, nav.hub-nav, main.hub-main,
 *    footer.hub-footer. Use .hub-app--no-nav for single-page tools without a side nav.
 * ------------------------------------------------------------------------------------------- */
.hub-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--hub-nav-w) minmax(0, 1fr);
  grid-template-rows: var(--hub-header-h) 1fr auto;
  grid-template-areas: "header header" "nav main" "nav footer";
}
.hub-app--no-nav { grid-template-columns: minmax(0, 1fr); grid-template-areas: "header" "main" "footer"; }

.hub-header {
  grid-area: header;
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--hub-space-md);
  padding: 0 var(--hub-space-md);
  background: var(--hub-surface);
  border-bottom: 1px solid var(--hub-divider);
}
.hub-header > * { display: flex; align-items: center; flex-wrap: nowrap; gap: var(--hub-space-sm); min-width: 0; }
.hub-header-actions { flex-shrink: 0; }

.hub-brand {
  display: inline-flex; align-items: center; gap: var(--hub-space-sm);
  padding: 4px 8px; border-radius: var(--hub-radius-md);
  color: var(--hub-primary-fg); text-decoration: none; user-select: none;
  transition: transform 0.2s var(--hub-ease);
}
.hub-brand:hover { transform: scale(1.02); text-decoration: none; }
.hub-brand img { height: 40px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); }
.hub-brand { min-width: 0; }
.hub-brand-title { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hub-nav {
  grid-area: nav;
  position: sticky; top: var(--hub-header-h);
  height: calc(100vh - var(--hub-header-h));
  display: flex; flex-direction: column;
  padding: var(--hub-space-md);
  overflow-y: auto;
  background: var(--hub-surface);
  border-right: 1px solid var(--hub-divider);
}
.hub-nav-section { margin-bottom: var(--hub-space-md); display: flex; flex-direction: column; gap: 4px; }
.hub-nav-title {
  padding: 0 var(--hub-space-md); margin-bottom: 4px;
  font-size: var(--hub-fs-xs); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--hub-text-dimmed);
}
.hub-nav-link {
  display: flex; align-items: center; gap: var(--hub-space-sm);
  padding: 8px 12px; border-radius: var(--hub-radius-md);
  color: var(--hub-text); text-decoration: none; font-size: var(--hub-fs-sm);
  transition: all 0.2s var(--hub-ease);
}
.hub-nav-link:hover { background: var(--hub-surface-hover); transform: translateX(4px); text-decoration: none; }
.hub-nav-link[aria-current="page"], .hub-nav-link.is-active {
  font-weight: 600; color: var(--hub-primary-fg);
  background: color-mix(in srgb, var(--hub-primary) var(--hub-tint), transparent);
}
.hub-nav-link small { display: block; font-size: var(--hub-fs-xs); font-weight: 400; color: var(--hub-text-dimmed); }
.hub-nav-spacer { flex: 1; }
.hub-nav-bottom { padding-top: var(--hub-space-sm); border-top: 1px solid var(--hub-divider); }

/* Small coloured icon tile, like Mantine ThemeIcon variant="light". Set --icon to any colour
   token, e.g. style="--icon: var(--hub-grape)". Put an inline 14px SVG or a character inside. */
.hub-icon {
  --icon: var(--hub-primary);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: var(--hub-radius-sm);
  color: var(--icon); background: color-mix(in srgb, var(--icon) var(--hub-tint), transparent);
  font-size: 13px; line-height: 1;
}
.hub-icon svg { width: 14px; height: 14px; }

.hub-signout {
  display: flex; align-items: center; justify-content: center; gap: var(--hub-space-xs); width: 100%;
  padding: 12px 16px; border: 0; border-radius: var(--hub-radius-md);
  font: inherit; font-weight: 600; font-size: var(--hub-fs-sm); color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
  transition: all 0.2s var(--hub-ease);
}
.hub-signout:hover { transform: translateY(-2px); background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35); }

.hub-main { grid-area: main; min-width: 0; padding: var(--hub-space-md) var(--hub-space-lg) var(--hub-space-xl); }
.hub-container { max-width: 1200px; margin: 0 auto; }

/* Mobile nav: a checkbox + label pair, no JS.
   <input type="checkbox" id="hub-nav-toggle" class="hub-nav-toggle"> before .hub-app, and
   <label for="hub-nav-toggle" class="hub-burger" aria-label="Menu"><span></span></label> in the header. */
.hub-nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.hub-burger { display: none; width: 34px; height: 34px; margin: 0; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--hub-radius-md); }
.hub-burger span, .hub-burger span::before, .hub-burger span::after {
  display: block; width: 18px; height: 2px; background: var(--hub-text); border-radius: 2px; position: relative; transition: transform 0.2s ease;
}
.hub-burger span::before, .hub-burger span::after { content: ""; position: absolute; left: 0; }
.hub-burger span::before { top: -6px; }
.hub-burger span::after { top: 6px; }
.hub-nav-toggle:focus-visible ~ .hub-app .hub-burger { outline: 2px solid var(--hub-primary); }

@media (max-width: 48em) {
  .hub-app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "header" "main" "footer"; }
  .hub-burger { display: inline-flex; }
  .hub-nav {
    position: fixed; top: var(--hub-header-h); left: 0; z-index: 15;
    width: min(var(--hub-nav-w), 85vw); transform: translateX(-100%); transition: transform 0.25s var(--hub-ease);
    box-shadow: var(--hub-shadow-xl);
  }
  .hub-nav-toggle:checked ~ .hub-app .hub-nav { transform: none; }
  .hub-nav-toggle:checked ~ .hub-app .hub-burger span { background: transparent; }
  .hub-nav-toggle:checked ~ .hub-app .hub-burger span::before { transform: translateY(6px) rotate(45deg); }
  .hub-nav-toggle:checked ~ .hub-app .hub-burger span::after { transform: translateY(-6px) rotate(-45deg); }
  .hub-main { padding: var(--hub-space-md); }
  .hub-brand img { height: 32px; }
  .hub-brand-title { font-size: 1.125rem; }
  .hub-footer { padding: var(--hub-space-sm) var(--hub-space-md); }
  .hub-hide-mobile { display: none !important; }
}

/* Footer: company link, Support / Privacy, rotating hub wheel and copyright. */
.hub-footer {
  grid-area: footer;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--hub-space-sm) var(--hub-space-lg);
  min-height: var(--hub-footer-h); padding: var(--hub-space-xs) var(--hub-space-xl);
  font-size: var(--hub-fs-sm);
  border-top: 1px solid var(--hub-divider);
  background: linear-gradient(180deg, var(--hub-surface) 0%, var(--hub-bg) 100%);
}
.hub-footer-links { display: flex; align-items: center; gap: var(--hub-space-md); }
.hub-footer-links a { color: var(--hub-text-dimmed); }
.hub-footer-links a.hub-footer-company { color: var(--hub-text); font-weight: 600; }
.hub-footer-links a.hub-footer-company:not(:last-child) { padding-right: var(--hub-space-md); border-right: 1px solid var(--hub-divider); }
.hub-footer-mark { display: flex; align-items: center; gap: 12px; color: var(--hub-text-dimmed); text-decoration: none; line-height: 1.1; }
.hub-footer-mark:hover { text-decoration: none; }
.hub-footer-mark img { width: 34px; height: 34px; flex-shrink: 0; }
.hub-footer-mark:hover img { animation: hub-spin 2s linear infinite; }
.hub-footer-mark small { display: block; font-size: var(--hub-fs-xs); }
@keyframes hub-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------------------------
 * 5. Auth pages (login, forgot password, magic link, 2FA).
 *    <body class="hub"><div class="hub-auth"> header.hub-auth-header > a.hub-brand,
 *    main.hub-auth-body > div.hub-auth-card, footer.hub-footer
 * ------------------------------------------------------------------------------------------- */
.hub-auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--hub-surface); }
.hub-auth-header { padding: var(--hub-space-xl) 3rem; animation: hub-slide-down 0.4s ease-out; }
.hub-auth-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: var(--hub-space-xl) 3rem; animation: hub-fade-up 0.5s ease-out 0.1s both;
}
.hub-auth-card { width: 100%; max-width: 400px; }
.hub-auth-card h1 { font-size: 1.625rem; margin-bottom: 4px; }
.hub-auth-card > p:first-of-type { color: var(--hub-text-dimmed); margin-bottom: var(--hub-space-lg); }
.hub-auth .hub-footer { background: transparent; }
@media (max-width: 60em) { .hub-auth-header, .hub-auth-body { padding: var(--hub-space-lg); } }
@media (max-width: 30em) { .hub-auth-header, .hub-auth-body { padding: var(--hub-space-md); } }
@keyframes hub-slide-down { from { opacity: 0; transform: translateY(-20px); } }
@keyframes hub-fade-up { from { opacity: 0; transform: translateY(20px); } }

/* ---------------------------------------------------------------------------------------------
 * 6. Content components
 * ------------------------------------------------------------------------------------------- */
.hub-page-header {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--hub-space-md);
  margin-bottom: var(--hub-space-lg);
}
.hub-page-header h1 { margin: 0; font-size: 1.625rem; line-height: 1.3; }
.hub-page-header p { margin: 4px 0 0; color: var(--hub-text-dimmed); font-size: var(--hub-fs-sm); }

.hub-card {
  padding: var(--hub-space-lg);
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-lg);
  box-shadow: var(--hub-shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.hub-container > .hub-card + .hub-card { margin-top: var(--hub-space-md); }
.hub-card--hover:hover { box-shadow: var(--hub-shadow-md); transform: translateY(-2px); }
.hub-card--flush { padding: 0; overflow: hidden; }
.hub-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--hub-space-md);
  margin-bottom: var(--hub-space-md);
}
.hub-card-header h2, .hub-card-header h3 { margin: 0; font-size: var(--hub-fs-lg); }
.hub-card--flush > .hub-card-header { margin: 0; padding: var(--hub-space-md) var(--hub-space-lg); border-bottom: 1px solid var(--hub-border); }

.hub-grid { display: grid; gap: var(--hub-space-md); grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.hub-grid--stats { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.hub-stat { display: flex; flex-direction: column; gap: 2px; }
.hub-stat-label { font-size: var(--hub-fs-xs); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--hub-text-dimmed); }
.hub-stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hub-stat-note { font-size: var(--hub-fs-xs); color: var(--hub-text-dimmed); }

/* Tables: wrap in .hub-table-wrap for the bordered, scrollable box. */
.hub-table-wrap { overflow-x: auto; border: 1px solid var(--hub-border); border-radius: var(--hub-radius-lg); background: var(--hub-surface); }
.hub-card--flush .hub-table-wrap, .hub-table-wrap--bare { border: 0; border-radius: 0; }
.hub-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--hub-fs-sm); }
.hub-table th, .hub-table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--hub-border); }
.hub-table th {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
  color: var(--hub-text-dimmed); background: var(--hub-surface-inset);
}
.hub-table tbody tr { transition: background-color 0.15s ease; }
.hub-table tbody tr:hover { background: var(--hub-surface-hover); }
.hub-table tbody tr:last-child td { border-bottom: 0; }
.hub-table td.num, .hub-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.hub-table .nowrap { white-space: nowrap; }
.hub-table .break { overflow-wrap: anywhere; }
.hub-table th[aria-sort] { cursor: pointer; user-select: none; }
.hub-table th[aria-sort="ascending"]::after { content: " \25B2"; }
.hub-table th[aria-sort="descending"]::after { content: " \25BC"; }

/* Forms */
.hub-form { display: flex; flex-direction: column; gap: var(--hub-space-md); }
.hub-form-row { display: grid; gap: var(--hub-space-md); grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.hub-field { display: flex; flex-direction: column; }
.hub-field .hub-hint { margin-top: 4px; font-size: var(--hub-fs-xs); color: var(--hub-text-dimmed); }
.hub-field .hub-error { margin-top: 4px; font-size: var(--hub-fs-xs); color: var(--hub-red-fg); }
.hub-check { display: inline-flex; align-items: center; gap: var(--hub-space-xs); font-weight: 400; margin: 0; cursor: pointer; }
.hub-actions { display: flex; flex-wrap: wrap; gap: var(--hub-space-sm); justify-content: flex-end; }
.hub-actions--start { justify-content: flex-start; }

/* Badges: light variant by default. Colours: --blue --green --red --orange --yellow --grape
   --violet --indigo --cyan --teal --pink --gray, or --primary. Add .hub-badge--filled for solid. */
.hub-badge {
  --badge: var(--hub-primary); --badge-fg: var(--hub-primary-fg);
  display: inline-flex; align-items: center; gap: 4px; width: max-content;
  height: 20px; padding: 0 8px; border-radius: var(--hub-radius-sm);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1; white-space: nowrap;
  color: var(--badge-fg); background: color-mix(in srgb, var(--badge) var(--hub-tint), transparent);
  transition: transform 0.15s ease;
}
.hub-badge:hover { transform: translateY(-1px); }
.hub-badge--filled { color: #fff; background: var(--badge); }
.hub-badge--blue { --badge: var(--hub-blue); --badge-fg: var(--hub-blue-fg); }
.hub-badge--green { --badge: var(--hub-green); --badge-fg: var(--hub-green-fg); }
.hub-badge--red { --badge: var(--hub-red); --badge-fg: var(--hub-red-fg); }
.hub-badge--orange { --badge: var(--hub-orange); --badge-fg: var(--hub-orange-fg); }
.hub-badge--yellow { --badge: var(--hub-yellow); --badge-fg: var(--hub-yellow-fg); }
.hub-badge--grape { --badge: var(--hub-grape); --badge-fg: var(--hub-grape-fg); }
.hub-badge--violet { --badge: var(--hub-violet); --badge-fg: var(--hub-violet-fg); }
.hub-badge--indigo { --badge: var(--hub-indigo); --badge-fg: var(--hub-indigo-fg); }
.hub-badge--cyan { --badge: var(--hub-cyan); --badge-fg: var(--hub-cyan-fg); }
.hub-badge--teal { --badge: var(--hub-teal); --badge-fg: var(--hub-teal-fg); }
.hub-badge--pink { --badge: var(--hub-pink); --badge-fg: var(--hub-pink-fg); }
.hub-badge--gray { --badge: var(--hub-gray); --badge-fg: var(--hub-gray-fg); }

/* Alerts: --info --success --warning --error. Optional <strong> first line as the title. */
.hub-alert {
  --alert: var(--hub-blue); --alert-fg: var(--hub-blue-fg);
  padding: var(--hub-space-sm) var(--hub-space-md);
  border-radius: var(--hub-radius-md);
  border-left: 4px solid var(--alert);
  background: color-mix(in srgb, var(--alert) var(--hub-tint), transparent);
  font-size: var(--hub-fs-sm);
}
.hub-alert > strong:first-child { display: block; color: var(--alert-fg); margin-bottom: 2px; }
.hub-alert--success { --alert: var(--hub-green); --alert-fg: var(--hub-green-fg); }
.hub-alert--warning { --alert: var(--hub-orange); --alert-fg: var(--hub-orange-fg); }
.hub-alert--error { --alert: var(--hub-red); --alert-fg: var(--hub-red-fg); }

/* Full-width strip above page content, e.g. "Impersonating x — Stop". */
.hub-banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--hub-space-md); flex-wrap: wrap;
  margin-bottom: var(--hub-space-md); padding: var(--hub-space-xs) var(--hub-space-md);
  border-radius: var(--hub-radius-md); font-size: var(--hub-fs-sm); font-weight: 500;
  color: var(--hub-orange-fg); background: color-mix(in srgb, var(--hub-orange) var(--hub-tint), transparent);
  border: 1px solid color-mix(in srgb, var(--hub-orange) 40%, transparent);
}

/* Modal: use a native <dialog class="hub-modal"> and dialog.showModal(). */
.hub-modal {
  width: min(520px, calc(100vw - 2rem)); padding: var(--hub-space-lg);
  color: var(--hub-text); background: var(--hub-surface);
  border: 1px solid var(--hub-border); border-radius: var(--hub-radius-lg); box-shadow: var(--hub-shadow-xl);
}
.hub-modal::backdrop { background: var(--hub-overlay); backdrop-filter: blur(4px); }
.hub-modal h2 { font-size: var(--hub-fs-lg); }
.hub-modal--wide { width: min(860px, calc(100vw - 2rem)); }

/* Tabs: <div class="hub-tabs" role="tablist"><button role="tab" aria-selected="true">…</button></div> */
.hub-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hub-border); margin-bottom: var(--hub-space-md); overflow-x: auto; }
.hub-tabs > :is(button, a) {
  min-height: 0; padding: 10px 16px; border: 0; border-bottom: 2px solid transparent; border-radius: var(--hub-radius-md) var(--hub-radius-md) 0 0;
  background: transparent; color: var(--hub-text); font-weight: 500; font-size: var(--hub-fs-sm); text-decoration: none;
}
.hub-tabs > :is(button, a):hover { background: var(--hub-surface-hover); }
.hub-tabs > :is([aria-selected="true"], [aria-current="page"]) { border-bottom-color: var(--hub-primary); font-weight: 600; }

/* Dropdown menu: <details class="hub-menu"><summary>…</summary><div class="hub-menu-list">links</div></details> */
.hub-menu { position: relative; }
.hub-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--hub-space-xs); padding: 6px 10px; border-radius: var(--hub-radius-md); font-size: var(--hub-fs-sm); }
.hub-menu > summary::-webkit-details-marker { display: none; }
.hub-menu > summary:hover { background: var(--hub-surface-hover); }
.hub-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 4px;
  display: flex; flex-direction: column;
  background: var(--hub-surface); border: 1px solid var(--hub-border); border-radius: var(--hub-radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.hub-menu-list > :is(a, button) {
  justify-content: flex-start; min-height: 0; padding: 8px 12px; border: 0; border-radius: var(--hub-radius-sm);
  background: transparent; color: var(--hub-text); font-weight: 400; font-size: var(--hub-fs-sm); text-decoration: none;
}
.hub-menu-list > :is(a, button):hover { background: var(--hub-surface-hover); text-decoration: none; }
.hub-menu-label { padding: 6px 12px 2px; font-size: var(--hub-fs-xs); color: var(--hub-text-dimmed); }

/* Avatar circle with initials */
.hub-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: var(--hub-fs-xs); font-weight: 700; text-transform: uppercase;
  color: var(--hub-primary-fg); background: color-mix(in srgb, var(--hub-primary) var(--hub-tint), transparent);
}

/* Loader: three dots */
.hub-loader { display: inline-flex; gap: 5px; }
.hub-loader::before, .hub-loader::after, .hub-loader > span {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hub-primary);
  animation: hub-dots 1s ease-in-out infinite;
}
.hub-loader > span { animation-delay: 0.15s; }
.hub-loader::after { animation-delay: 0.3s; }
@keyframes hub-dots { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: none; } }

.hub-empty { padding: var(--hub-space-xl) var(--hub-space-md); text-align: center; color: var(--hub-text-dimmed); font-size: var(--hub-fs-sm); }

/* ---------------------------------------------------------------------------------------------
 * 7. Utilities
 * ------------------------------------------------------------------------------------------- */
.hub-stack { display: flex; flex-direction: column; gap: var(--hub-space-md); }
.hub-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--hub-space-sm); }
.hub-row--between { justify-content: space-between; }
.hub-header .hub-row { flex-wrap: nowrap; min-width: 0; }
.hub-grow { flex: 1; }
.hub-dimmed { color: var(--hub-text-dimmed); }
.hub-small { font-size: var(--hub-fs-sm); }
.hub-xs { font-size: var(--hub-fs-xs); }
.hub-mono { font-family: var(--hub-font-mono); font-size: 0.85em; }
.hub-right { text-align: right; }
.hub-center { text-align: center; }
.hub-mt { margin-top: var(--hub-space-md); }
.hub-mb { margin-bottom: var(--hub-space-md); }
.hub-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .hub *, .hub *::before, .hub *::after { animation: none !important; transition: none !important; }
}
@media print {
  .hub-nav, .hub-header, .hub-footer, .hub-burger { display: none !important; }
  .hub-app { display: block; }
  .hub-card { box-shadow: none; }
}
