/* ==========================================================================
   SP Machines — global foundation
   Design tokens (colours, type, shape), reset and typography only.
   Shared components live in components.css; module styles in each module.
   ========================================================================== */

:root {
  /* Backgrounds */
  --bg-main: #F4F5F7;             /* page / content background */
  --bg-secondary: #FAFAFA;        /* table headers, read-only fields */
  --bg-mint: #BDDFC8;             /* header, sidebar, brand areas */

  /* Surfaces */
  --surface: #FFFFFF;             /* cards, forms, tables, modals */
  --surface-hover: #F1F7F3;
  --surface-selected: #E1F0E6;

  /* Text */
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #666666;          /* placeholders, hints */

  /* Mint accents */
  --primary: #BDDFC8;
  --primary-hover: #A8CFB5;       /* sidebar hover / active, mint button hover */
  --primary-dark: #6FA982;        /* input focus */

  /* Borders */
  --border: #E1E5E8;              /* cards, tables, dividers */
  --border-dark: #B8C0C4;         /* inputs */
  --border-mint: #8FC5A5;         /* header / sidebar edges */

  /* Buttons */
  --button-primary: #000000;
  --button-primary-text: #FFFFFF;
  --button-primary-hover: #333333;

  /* Status — only when the colour carries meaning */
  --success: #159447;
  --success-bg: #E7F5EC;
  --warning: #D97706;
  --warning-bg: #FEF3E2;
  --warning-text: #8A4B04;        /* readable text on warning-bg */
  --danger: #D92D20;
  --danger-hover: #B42318;
  --danger-bg: #FDECEA;
  --info: #3157D5;
  --info-bg: #ECF0FC;

  /* Typography */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: "Montserrat", "Inter", system-ui, "Segoe UI", Arial, sans-serif;

  /* Shape & depth */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 16px -10px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -20px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.06);
  --focus-ring: 0 0 0 3px rgba(111, 169, 130, 0.18);

  --control-height: 50px;
  --transition: 180ms ease;
}

/* --- Reset --------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--text-secondary);
}

:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* The hidden attribute always wins over component display rules. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* White version of a logo image, for dark backgrounds. */
.logo-on-dark {
  filter: brightness(0) invert(1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
