/* ---------------------------------------------------------------------------
   Bio-Rad brand tokens for ADC-deployed apps.

   This file is the single source of truth for brand values. Copy it verbatim
   into public/brand.css. Do not restate these values anywhere else in the app
   and do not override them in a component — an app that repeats colours
   inline cannot be re-branded without hunting through every file.

   These values were read from the Bio-Rad brand portal (Our Brand > Bio-Rad
   Global Guidelines) and are authoritative. Do not substitute a green you
   remember or sample from a screenshot.

   PALETTE RULE: the brand validator rejects any saturated colour outside the
   Bio-Rad Green family. Every colour below is either a green-family shade or a
   true neutral (equal R/G/B). Do not introduce a red, amber, or blue — not for
   errors, not for links, not for charts. Convey state with words, weight, and
   position instead. If a build genuinely needs a non-green accent, get it
   approved and add it here rather than inline.
   --------------------------------------------------------------------------- */

:root {
  /* --- Brand green ------------------------------------------------------- */
  /* #00A651 is the approved Bio-Rad Green. White on it measures 3.2:1, below
     the 4.5:1 needed for text, so it is an ACCENT ONLY — rules, borders,
     indicators. Anything carrying text uses --brand-green-dark (5.1:1). */
  --brand-green: #00a651;
  --brand-green-dark: #00803e;   /* buttons, links, focus ring */
  --brand-green-darker: #006632; /* hover / active */
  --brand-green-tint: #e6f6ed;   /* selected rows, subtle fills */

  /* --- Neutrals ---------------------------------------------------------- */
  /* True neutrals only. A blue- or warm-tinted grey reads as a saturated
     off-palette colour to the validator, so keep R = G = B. */
  --ink: #1a1a1a;                /* body text            17.4:1 on white */
  --ink-muted: #595959;          /* labels, secondary     7.0:1 on white */
  --surface: #ffffff;
  --surface-alt: #f5f5f5;
  --border: #e0e0e0;
  --border-strong: #c4c4c4;
  --error-text: #c4123f;         /* errors/alerts only     5.99:1 on white */

  /* --- Typography -------------------------------------------------------- */
  /* Only Bio-Type, Inter, Arial, Helvetica and sans-serif are approved, and ADC's
     brand check reads the FIRST family in the declared stack. A system stack led by
     -apple-system therefore fails it on every page. Bio-Type is the brand typeface;
     if it is licensed for internal web use, add the file under public/fonts/ and
     prepend it here — never from a public CDN, which the App Service network may
     block. */
  --font-sans: Inter, Arial, Helvetica, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --leading-tight: 1.25;
  --leading-normal: 1.55;

  /* --- Space and shape --------------------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.08);
  --content-max: 1100px;
}

/* --- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* A class rule that sets `display` outranks the browser's default style for the
   `hidden` attribute, so an element hidden by script stays visible. Restore the
   attribute's authority once, here, rather than fighting it per component. */
[hidden] { display: none !important; }

body {
  margin: 0;
  /* Literal, not var(--font-sans), on purpose. The brand check reads the *declared*
     value, so a page whose base rule says `var(--font-sans)` is graded as using a
     font family literally named "var(--font-sans)" and fails typography. The token
     stays defined above for app.css authors; this one rule must not use it. */
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
  background: var(--surface-alt);
}

h1, h2, h3 { line-height: var(--leading-tight); margin: 0 0 var(--space-3); }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

a { color: var(--brand-green-dark); }

/* The one approved non-green accent, and only for errors and alerts. Bio-Rad Red
   darkened to 5.99:1 on white; brand_guidelines.json lists it under
   error_accent_allowed, so the palette check accepts it. Colour is never the signal
   on its own — an error still needs its word. */
.error-text { color: var(--error-text); }

/* Never remove the focus ring. Keyboard users have no other way to tell
   where they are, and internal apps are audited for this. */
:focus-visible {
  outline: 2px solid var(--brand-green-dark);
  outline-offset: 2px;
}

/* --- Layout -------------------------------------------------------------- */

.app-header {
  background: var(--surface);
  border-bottom: 3px solid var(--brand-green);
  padding: var(--space-3) var(--space-5);
}

.app-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.app-header__brand { display: flex; align-items: center; gap: var(--space-3); }

/* The approved logo file, once dropped at public/brand/logo.svg. */
/* No `display` property here on purpose. Setting one outranks the browser's
   default style for the `hidden` attribute, which is how this element ends up
   showing a broken-image icon when the logo file is absent. */
.bio-rad-logo { height: 28px; width: auto; vertical-align: middle; }

/* Typographic fallback shown only while no logo file is present. */
.wordmark {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-green-dark);
  text-transform: uppercase;
}

.app-header__app-name {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  padding-left: var(--space-3);
  border-left: 1px solid var(--border);
}

.app-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

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

/* --- Controls ------------------------------------------------------------ */

.btn {
  font: inherit;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--primary { background: var(--brand-green-dark); color: #fff; }
.btn--primary:hover { background: var(--brand-green-darker); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-alt); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

label { display: block; font-size: var(--text-sm); color: var(--ink-muted); margin-bottom: var(--space-1); }

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

/* --- Data ---------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th {
  text-align: left;
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}
th, td { padding: var(--space-3); border-bottom: 1px solid var(--border); }

/* Pills carry a word, never colour alone. Neutral by default; the green
   variant marks a positive or active state. */
.pill {
  display: inline-block;
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--ink-muted);
}
.pill--active {
  color: var(--brand-green-dark);
  background: var(--brand-green-tint);
  border-color: var(--brand-green-dark);
}

/* Callouts use weight and a green rule, not a warning colour. */
.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-green);
  border-radius: 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}

.muted { color: var(--ink-muted); }
