/* ==========================================================================
   Baler design tokens (issue #98)
   --------------------------------------------------------------------------
   The single source of truth for colors, radii, shadows and spacing. Every
   component .razor.css consumes these via var(--...) and must NEVER redeclare
   them locally (see .claude/skills/razor-page-design-system/SKILL.md). This
   file is linked from App.razor before Baler.styles.css (the scoped-CSS
   bundle), so every scoped rule can read them.

   Brand accent #115fb1 is a user decision (2026-09-30, issue #98); it
   replaced the earlier #1b6ec2 and the legacy navy #0e2a47.

   Breakpoints (CSS custom properties can't be used inside @media, so these
   are documented here and written literally in each media query):
     1400px  - list/detail "compact view" switch (table -> cards, 2 cols -> 1)
     1150px / 780px / 480px - filter-toolbar wrapping tiers
     1024px  - Absence weekly timetable -> agenda cards
     640.98px / 641px - MainLayout/NavMenu mobile nav switch
     349px   - foldable cover screens (~280-344px wide)
   ========================================================================== */
:root {
    /* Brand / accent */
    --accent: #115fb1;
    --accent-rgb: 17, 95, 177;
    --accent-strong: #0d4d90; /* hover / pressed shade, dark text on --accent-soft */
    --accent-soft: #e8f0f9;
    --accent-ring: rgba(17, 95, 177, 0.16);
    --on-color: #ffffff; /* text/icons on a saturated fill (accent, pin colors, dark tooltip) */
    --white: #ffffff; /* literal white for SVG strokes/highlights that aren't a surface */

    /* Ink (text) scale */
    --ink: #16202b;
    --ink-soft: #55636f;
    --ink-faint: #656e76; /* issue #101: was #8996a1 (3.0:1); now >= 4.5:1 on every neutral surface down to --line-soft */

    /* Line (border) scale */
    --line-strong: #c7d2da;
    --line: #e4e8ec;
    --line-soft: #eef1f3; /* also the neutral badge/chip background */

    /* Surfaces */
    --surface: #ffffff;
    --surface-muted: #fafbfc; /* table headers, interactive .value-box */
    --surface-hover: #f8fafc; /* table row hover */
    --canvas: #f4f6f8;
    --tooltip-bg: #1f2933;
    --modal-backdrop: rgba(0, 0, 0, 0.5); /* the dim layer behind a JS-less Bootstrap .modal (issue #101) */
    --modal-backdrop-strong: rgba(0, 0, 0, 0.6); /* photo/file lightboxes */

    /* Semantic tones (soft background / border line / ink) */
    --info-soft: #e9f6fa;
    --info-ink: #196c85;
    --success-soft: #e8f6ee;
    --success-line: #bfe6cd;
    --success-ink: #18703f; /* 5.1:1 on the Absence "today" cell (#cbf2f9), was #1c7a45 at 4.49:1 (issue #112 A6) */
    --warning-soft: #fef3e6;
    --warning-line: #f3dcb0;
    --warning-ink: #93590c;
    --danger-soft: #fbeaea;
    --danger-line: #f3c9cb;
    --danger-ink: #a3262b;

    /* Complaint / Service Plan state badges */
    --status-new-bg: var(--accent-soft);
    --status-new-ink: var(--accent-strong);
    --status-progress-bg: var(--warning-soft);
    --status-progress-ink: var(--warning-ink);
    --status-done-bg: var(--success-soft);
    --status-done-ink: var(--success-ink);
    --status-confirm-bg: var(--info-soft);
    --status-confirm-ink: var(--info-ink);
    --status-rejected-bg: var(--danger-soft);
    --status-rejected-ink: var(--danger-ink);

    /* Priority badges (low -> critical) */
    --priority-low-bg: var(--success-soft);
    --priority-low-ink: var(--success-ink);
    --priority-medium-bg: var(--accent-soft);
    --priority-medium-ink: var(--accent-strong);
    --priority-high-bg: var(--warning-soft);
    --priority-high-ink: var(--warning-ink);
    --priority-critical-bg: var(--danger-soft);
    --priority-critical-ink: var(--danger-ink);

    /* Map dashboard: status pin palette, shared by map pins, pincushion
       mini-pins, legend swatches and KPI filter badges so they stay identical */
    --pin-red: #ef4444;
    --pin-orange: #f97316;
    --pin-yellow: #eab308;
    --pin-green: #22c55e;
    --pin-slate: #64748b;
    --pin-teal: #14b8a6;
    --pin-sky: #0ea5e9;
    --pin-violet: #8b5cf6;
    /* Text-safe shades of the pin palette (issue #101): the pin fills above are non-text marks and stay as they
       are, but as text on white (KPI filter chips) or under white text (an active chip) they fall to 1.9-4.2:1.
       These darker shades of the same hues meet WCAG AA (>= 4.9:1 both ways). */
    --pin-red-ink: #b91c1c;
    --pin-orange-ink: #c2410c;
    --pin-yellow-ink: #a16207;
    --pin-green-ink: #15803d;
    --pin-slate-ink: #475569;
    --pin-teal-ink: #0f766e;
    --pin-sky-ink: #0369a1;
    --pin-violet-ink: #6d28d9;
    --pin-installation: var(--accent);
    --pin-installation-ink: var(--accent-strong); /* outline of the installation pin head (issue #112 A6) */
    --pin-needle: #1e293b;
    --pin-needle-tip: #94a3b8;

    /* Map dashboard: canvas, outlines and place layers */
    --map-bg: #eef2f5;
    --map-border: #dee2e6;
    --map-context-fill: #e8edf1;
    --map-context-stroke: #d3dade;
    --map-country-fill: #dde5ea;
    --map-country-stroke: #c3ccd1;
    --map-city: #94a3b8;
    /* Capitals are reference context; a slate tone keeps them apart from the accent-coloured installation pin. */
    --map-capital: #334155;
    --map-city-label: #475569;
    --map-town: #b7c3cd;
    --map-town-label: #64748b;
    --map-village: #cdd5db;
    --map-village-label: #7c8a97;
    --pincushion-body: #c83d3a;
    --pincushion-stroke: #7a1f1d;
    --pincushion-seam: #8f2622;

    /* Layout chrome (MainLayout / NavMenu / ReconnectModal) */
    --sidebar-bg: #f8f9fa;
    --sidebar-border: #e0e0e0;
    --nav-ink: #444444;
    --nav-ink-strong: #000000;
    --nav-ink-muted: #656e76; /* issue #101: Bootstrap grey #6c757d was 4.44:1 on --sidebar-bg */
    --nav-active-bg: var(--accent-soft);
    --nav-active-ink: var(--accent);
    --reconnect-button: #6b9ed2;
    --reconnect-button-hover: #3b6ea2;
    --reconnect-spinner: #0087ff;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-pill: 999px;

    /* Shadow */
    --shadow-sm: 0 4px 14px rgba(15, 23, 32, 0.06);
    --shadow-md: 0 10px 28px rgba(15, 23, 32, 0.28);
    --shadow-lg: 0 24px 60px rgba(15, 23, 32, 0.28);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;

    /* Bootstrap 5.3 overrides so .btn-primary, links and *-primary utilities
       follow the brand accent */
    --bs-primary: #115fb1;
    --bs-primary-rgb: 17, 95, 177;
    --bs-primary-text-emphasis: #072647;
    --bs-primary-bg-subtle: #cfdfef;
    --bs-primary-border-subtle: #a0bfe0;
    --bs-link-color: #115fb1;
    --bs-link-color-rgb: 17, 95, 177;
    --bs-link-hover-color: #0d4d90;
    --bs-link-hover-color-rgb: 13, 77, 144;
    --bs-focus-ring-color: rgba(17, 95, 177, 0.25);

    /* Bootstrap's secondary grey (#6c757d) is 4.44:1 on its own light surfaces (.bg-light, #f8f9fa); darken it
       just enough for WCAG AA wherever .text-secondary / .btn-outline-secondary sit on them (issue #101). */
    --bs-secondary: #656e76;
    --bs-secondary-rgb: 101, 110, 118;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: var(--accent);
}

.btn-primary {
    --bs-btn-color: var(--on-color);
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: var(--on-color);
    --bs-btn-hover-bg: var(--accent-strong);
    --bs-btn-hover-border-color: var(--accent-strong);
    --bs-btn-focus-shadow-rgb: var(--accent-rgb);
    --bs-btn-active-color: var(--on-color);
    --bs-btn-active-bg: var(--accent-strong);
    --bs-btn-active-border-color: var(--accent-strong);
    --bs-btn-disabled-color: var(--on-color);
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: var(--on-color);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-focus-shadow-rgb: var(--accent-rgb);
    --bs-btn-active-color: var(--on-color);
    --bs-btn-active-bg: var(--accent);
    --bs-btn-active-border-color: var(--accent);
    --bs-btn-disabled-color: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
}

.btn-outline-secondary {
    --bs-btn-color: var(--bs-secondary);
    --bs-btn-border-color: var(--bs-secondary);
    --bs-btn-hover-bg: var(--bs-secondary);
    --bs-btn-hover-border-color: var(--bs-secondary);
    --bs-btn-active-bg: var(--bs-secondary);
    --bs-btn-active-border-color: var(--bs-secondary);
    --bs-btn-disabled-color: var(--bs-secondary);
    --bs-btn-disabled-border-color: var(--bs-secondary);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--surface), 0 0 0 0.25rem var(--accent);
}

/* Bootstrap 5.3 compiles these to its own blue (#86b7fe / #0d6efd) instead of reading --bs-primary. */
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.dropdown-menu {
  --bs-dropdown-link-active-bg: var(--accent);
}

/* Bootstrap Icons glyph atoms (Components/Shared/Atoms/Icons/Icon{Name}, GlyphIconBase; issue 103, ADR-003).
   They replaced the Bootstrap Icons web font and keep its metrics: 1em square, so font-size (fs-*) sizes
   them; sat on the baseline the way the font glyph's ::before was; filled with currentColor, so color
   (text-*, or the inherited color) colours them. Size or colour one from a component's scoped CSS with
   ::deep, since the svg is rendered by the atom, not by the host component. */
.glyph-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -.125em;
  fill: currentColor;
  overflow: visible;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRo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ODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}