/* =============================================================================
   DogWatchFSM design tokens
   =============================================================================

   Single source of truth for colour, type and spacing. Components consume these
   and never hard-code a colour — forking a value here is how two screens end up
   almost matching, which looks worse than not matching at all.

   PLACEHOLDER PALETTE. These are chosen to suit the work rather than sampled
   from DogWatch branding, because nobody has handed me the logo yet. When the
   real brand colours arrive, they get swapped here and the whole app follows —
   same approach that worked on RvParkManagement.

   Two constraints drove the choices:

   1. This app is read outdoors, in direct sun, on a phone, sometimes through
      safety glasses. Contrast is a functional requirement, not taste. Body text
      and every status colour clear WCAG AA against their backgrounds.

   2. Status colour carries real consequence here. "Overdue" on this screen can
      mean a dog is behind a fence that has stopped working, so overdue is the
      loudest thing in the palette and nothing decorative is allowed to compete
      with it.
   ========================================================================== */

:root {
  /* ---- Brand ------------------------------------------------------------ */
  --dw-blue-900: #0b2a45;
  --dw-blue-800: #10395c;
  --dw-blue-700: #154b78;
  --dw-blue-600: #1b5f96;
  --dw-blue-500: #2477b8;
  --dw-blue-300: #7fb5db;
  --dw-blue-100: #dbeaf5;
  --dw-blue-050: #f0f6fb;

  --primary: var(--dw-blue-700);
  --primary-hover: var(--dw-blue-800);
  --primary-active: var(--dw-blue-900);
  --primary-subtle: var(--dw-blue-050);
  --primary-border: var(--dw-blue-300);
  --on-primary: #ffffff;

  /* ---- Status -----------------------------------------------------------
     Deliberately ordered by loudness: overdue must win any visual contest on
     a screen, because it is the state with a dog on the wrong side of a fence. */
  --overdue: #b3261e;
  --overdue-bg: #fdeceb;
  --overdue-border: #f2b8b5;

  --due-soon: #9a5b00;
  --due-soon-bg: #fff4e5;
  --due-soon-border: #ffd8a8;

  --scheduled: #1b5f96;
  --scheduled-bg: var(--dw-blue-050);
  --scheduled-border: var(--dw-blue-300);

  --healthy: #1b6b3a;
  --healthy-bg: #e9f5ee;
  --healthy-border: #a8d5ba;

  /* Unknown is its own state, never a blank. A collar whose battery date
     nobody recorded is actionable work, not missing data to be hidden. */
  --unknown: #5b5f66;
  --unknown-bg: #f2f3f5;
  --unknown-border: #d3d6db;

  /* ---- Time clock punches (TC-5; Chris, 2026-11-08) ----------------------
     Green in, red out, blue-green for a break, red to end one. Tokens here
     rather than colours in Time.razor.css, per this file's own rule. The
     words on the buttons carry the meaning; the colour is reinforcement. */
  --punch-in: #1b6b3a;
  --punch-in-hover: #14562e;
  --punch-out: #b3261e;
  --punch-out-hover: #8f1d17;
  --punch-break: #0f766e;
  --punch-break-hover: #0b5d57;
  --on-punch: #ffffff;

  /* ---- Hazard -----------------------------------------------------------
     Reserved exclusively for property hazard warnings — loose aggressive dog,
     electric gate. Never used decoratively, so that when a technician sees it
     they know it means their physical safety and not a form validation error. */
  --hazard: #7a1d12;
  --hazard-bg: #fff1ee;
  --hazard-border: #e8a599;

  /* ---- Neutrals --------------------------------------------------------- */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-sunken: #eef0f3;
  --border: #d9dde2;
  --border-strong: #b6bcc4;

  --text: #16191d;
  --text-muted: #565c65;
  --text-subtle: #767d87;
  --text-inverse: #ffffff;

  /* ---- Type -------------------------------------------------------------
     System stack: renders instantly, matches the device, and avoids a webfont
     round trip on a truck with one bar of signal. */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.25;
  --leading-normal: 1.5;

  /* ---- Space ------------------------------------------------------------ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  /* ---- Shape ------------------------------------------------------------ */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(11, 42, 69, 0.08);
  --shadow: 0 2px 8px rgba(11, 42, 69, 0.10);
  --shadow-lg: 0 8px 24px rgba(11, 42, 69, 0.14);

  /* ---- Touch ------------------------------------------------------------
     44px is the minimum a gloved thumb reliably hits. Field controls use the
     comfortable size; only dense office tables fall back to the minimum. */
  --touch-min: 44px;
  --touch-comfortable: 52px;

  /* ---- Layout ----------------------------------------------------------- */
  --sidebar-width: 260px;
  --header-height: 60px;
  /* The cap exists only to stop a table sprawling across an ultrawide, not to keep the app
     narrow. On an ordinary 1920 monitor the content now fills the space beside the sidebar
     rather than leaving a dead strip down the right. */
  --content-max: 1920px;

  --focus-ring: 0 0 0 3px rgba(36, 119, 184, 0.45);
  --transition: 140ms ease;
}

/* =============================================================================
   Dark theme
   -----------------------------------------------------------------------------
   Opt-in only. Deliberately NOT tied to prefers-color-scheme: a phone that has
   flipped itself to dark at dusk is the same phone a technician is holding in
   a floodlit driveway, and a surprise theme change mid-job helps nobody.
   ========================================================================== */
:root[data-theme="dark"] {
  --bg: #11151a;
  --surface: #181d24;
  --surface-sunken: #0d1116;
  --border: #2a313a;
  --border-strong: #3d4651;

  --text: #eef1f5;
  --text-muted: #a8b1bd;
  --text-subtle: #7f8998;
  --text-inverse: #11151a;

  --primary: var(--dw-blue-500);
  --primary-hover: var(--dw-blue-300);
  --primary-subtle: #14293b;
  --primary-border: var(--dw-blue-600);

  --overdue: #ff8a80;
  --overdue-bg: #3b1512;
  --overdue-border: #7a2a22;

  --due-soon: #ffc078;
  --due-soon-bg: #3a2a10;
  --due-soon-border: #7a5a20;

  --scheduled: var(--dw-blue-300);
  --scheduled-bg: #14293b;
  --scheduled-border: var(--dw-blue-600);

  --healthy: #7ddc9f;
  --healthy-bg: #10281a;
  --healthy-border: #2a5a3c;

  --unknown: #9aa3ae;
  --unknown-bg: #1c2128;
  --unknown-border: #333b45;

  --hazard: #ff9c8a;
  --hazard-bg: #3d1611;
  --hazard-border: #7d2f22;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* Respect a user who has asked the OS to reduce motion. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition: 0ms;
  }
}
