@charset "UTF-8";
:root {
  color-scheme: light;
  /* signal — action fill + active module, always with --on-signal text */
  --signal: #FFD21F;
  --signal-hover: #F5C400;
  --on-signal: #1E2229;
  --signal-soft: #FFF4BF; /* callouts, first menu item, "just changed" tint */
  --signal-row: #FFFAE0; /* selected table row */
  /* "fill": filled segments, selected chips, bulk bar, toast surface */
  --fill: #2B3038;
  --on-fill: #FFFFFF;
  --stripe: #2B3038;
  /* selected control (open ⋯, selected chip, active segment count): the mock's "fill" */
  --sel: #2B3038;
  --on-sel: #FFFFFF;
  /* tick / dash / dot drawn on the selected-control fill: white on dark ink, dark ink on the
     light dark-mode fill (Bootstrap's white tick vanishes on #DADDE2) */
  --check-tick: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
  --check-dash: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23FFFFFF' stroke-linecap='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
  --check-dot: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23FFFFFF'/%3e%3c/svg%3e");
  /* interactive ink (was brand blue) */
  --app-accent: #1E2229;
  --app-accent-dark: #000000; /* link hover */
  --app-accent-ink: #1E2229; /* headline on signal-soft */
  --app-accent-tint: var(--signal-soft);
  --app-accent-tint-2: #F0E2A0; /* border of the tint */
  --app-accent-row: var(--signal-row);
  --app-navy: var(--fill);
  /* neutral ramp — cool grey */
  --app-ink: #1E2229;
  --app-ink-2: #2B3038;
  --app-ink-3: #3A404A;
  --app-ink-4: #474D57;
  --app-muted: #5E646E;
  --app-muted-2: #6B717B; /* placeholders, icons — still ≥ 4.5:1 on white */
  --app-line-strong: #CBD0D7; /* secondary button border */
  --app-field-line: #7B818B; /* input / checkbox boundary: ≥ 3:1 on white (WCAG 1.4.11) */
  --app-line: #E4E7EB; /* card border, dividers */
  --app-line-soft: #EDEFF2;
  --app-line-softest: #F1F3F5; /* ghost hover */
  --app-panel: #FFFFFF;
  --app-bg: #F6F7F9; /* canvas */
  --app-bg-2: #F7F8FA; /* panel-2: table head, row hover, inset blocks */
  --app-sunk: #ECEEF1; /* segmented control track, counters, chips */
  /* sidebar — floating light panel */
  --sidebar-bg: var(--app-panel);
  --sidebar-ink: #2B3038;
  --sidebar-muted: #5E646E;
  /* semantic (fg on bg) */
  --app-info-fg: #1E2229;
  --app-info-bg: #ECEEF1;
  --app-warn-fg: #1E2229;
  --app-warn-bg: #FFF4BF;
  --app-ok-fg: #1D6B3A;
  --app-ok-bg: #E3F3E8;
  --app-ok-solid-fg:#FFFFFF;
  --app-ok-solid-bg:#1D6B3A;
  --app-danger-fg: #B3261E;
  --app-danger-bg: #FCEAE8;
  --app-danger-line:#F2C4BF;
  --app-danger-field:#B3261E;
  --app-neutral-fg: #474D57;
  --app-neutral-bg: #ECEEF1;
  /* elevation — soft two-layer pairs, alpha ≤ .04 */
  --shadow-card: 0 1px 2px rgba(20, 24, 31, .04), 0 8px 24px rgba(20, 24, 31, .04);
  --shadow-accent:none;
  --shadow-float: 0 16px 40px rgba(20, 24, 31, .12), 0 2px 6px rgba(20, 24, 31, .06);
  --shadow-pop: 0 16px 40px rgba(20, 24, 31, .07), 0 2px 6px rgba(20, 24, 31, .05);
  /* keyboard focus: ink ring (outline) + signal halo, both always on */
  --focus-ring: 0 0 0 5px var(--signal);
  --focus-ring-field: 0 0 0 1px var(--app-ink), 0 0 0 4px var(--signal-soft);
  /* radii + control heights (44 px targets) */
  --r-card: 22px;
  --r-panel: 18px;
  --r-control: 13px;
  --r-control-sm: 11px;
  --r-badge: 9px;
  --h-control: 44px;
  --h-control-sm: 40px;
  --h-control-xs: 36px;
  --h-icon-btn: 44px;
  --gap-grid: 20px;
  /* on-colour text — white on a permanently-dark surface (bulk bar, toast).
     Stays the same in both themes: those surfaces stay dark too. */
  --app-on-accent: #FFFFFF;
  --app-on-accent-dim: #E4E7EB;
  /* colour-chip (tag / status) — readable over any stored hex in BOTH themes. */
  --chip-tint-amt: 16%;
  --chip-fg-amt: 68%;
  --chip-fg-toward: #0B1220;
  /* toast surfaces (white text >= 6.5:1 in both themes) */
  --toast-danger: #B3261E;
  /* chart series: the dataviz reference palette (blue, orange, aqua, yellow), validated with
     validate_palette.js on the card surface: every colour is >= 3:1 against it in both themes
     (light 4.2 to 4.95, dark 4.9 to 6.1); bars are separated by a surface-coloured gap. Fixed order, never cycled. */
  --chart-1: #1f6fd0;
  --chart-2: #d4500f;
  --chart-3: #00826a;
  --chart-4: #a86e00;
  --chart-grid: #e7e7e7;
  --chart-axis: #c2c2c2;
  /* compatibility alias */
  --shadow-soft: var(--shadow-card);
}

/* ---- Dark theme -----------------------------------------------------------
   Three-mode guard: "system" mode (or anonymous) follows the OS unless the user pinned
   light; explicit dark is always dark. Light is the default :root above;
   :root[data-theme="light"] needs no block because it is the unguarded default. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --signal: #FFD21F;
    --signal-hover: #FFDD55;
    --on-signal: #16181C;
    --signal-soft: #3A3314;
    --signal-row: #2A2612;
    --fill: #272B32;
    --on-fill: #EDEEF0;
    --stripe: #121418;
    --sel: #DADDE2;
    --on-sel: #16181C;
    --check-tick: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2316181C' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    --check-dash: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2316181C' stroke-linecap='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
    --check-dot: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%2316181C'/%3e%3c/svg%3e");
    --chart-1: #338ced;
    --chart-2: #e76624;
    --chart-3: #00a888;
    --chart-4: #d28e05;
    --chart-grid: #303030;
    --chart-axis: #474747;
    --app-accent: #EDEEF0;
    --app-accent-dark: #FFFFFF;
    --app-accent-ink: #EDEEF0;
    --app-accent-tint-2: #5A4E1E;
    --app-ink: #EDEEF0;
    --app-ink-2: #DADDE2;
    --app-ink-3: #C4C8CF;
    --app-ink-4: #B3B8C0;
    --app-muted: #9AA0AA;
    --app-muted-2: #8A909B;
    --app-line-strong: #424852;
    --app-field-line: #747B86;
    --app-line: #2C3138;
    --app-line-soft: #262A31;
    --app-line-softest: #23272D;
    --app-panel: #1A1D22;
    --app-bg: #121418;
    --app-bg-2: #20242A;
    --app-sunk: #272B32;
    --sidebar-ink: #DADDE2;
    --sidebar-muted: #9AA0AA;
    --app-info-fg: #EDEEF0;
    --app-info-bg: #272B32;
    --app-warn-fg: #FFD21F;
    --app-warn-bg: #3A3314;
    --app-ok-fg: #82D9A1;
    --app-ok-bg: #15301F;
    --app-ok-solid-fg:#0E2417;
    --app-ok-solid-bg:#82D9A1;
    --app-danger-fg: #FF8F86;
    --app-danger-bg: #3A1816;
    --app-danger-line:#6B2B27;
    --app-danger-field:#FF8F86;
    --app-neutral-fg: #C4C8CF;
    --app-neutral-bg: #272B32;
    --shadow-card: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 24px rgba(0, 0, 0, .28);
    --shadow-float: inset 0 1px 0 rgba(255, 255, 255, .06), 0 16px 40px rgba(0, 0, 0, .5);
    --shadow-pop: inset 0 1px 0 rgba(255, 255, 255, .06), 0 16px 40px rgba(0, 0, 0, .5);
    --chip-tint-amt: 24%;
    --chip-fg-toward: #F1F5F9;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --signal: #FFD21F;
  --signal-hover: #FFDD55;
  --on-signal: #16181C;
  --signal-soft: #3A3314;
  --signal-row: #2A2612;
  --fill: #272B32;
  --on-fill: #EDEEF0;
  --stripe: #121418;
  --sel: #DADDE2;
  --on-sel: #16181C;
  --check-tick: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2316181C' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
  --check-dash: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2316181C' stroke-linecap='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
  --check-dot: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%2316181C'/%3e%3c/svg%3e");
  --chart-1: #338ced;
  --chart-2: #e76624;
  --chart-3: #00a888;
  --chart-4: #d28e05;
  --chart-grid: #303030;
  --chart-axis: #474747;
  --app-accent: #EDEEF0;
  --app-accent-dark: #FFFFFF;
  --app-accent-ink: #EDEEF0;
  --app-accent-tint-2: #5A4E1E;
  --app-ink: #EDEEF0;
  --app-ink-2: #DADDE2;
  --app-ink-3: #C4C8CF;
  --app-ink-4: #B3B8C0;
  --app-muted: #9AA0AA;
  --app-muted-2: #8A909B;
  --app-line-strong: #424852;
  --app-field-line: #747B86;
  --app-line: #2C3138;
  --app-line-soft: #262A31;
  --app-line-softest: #23272D;
  --app-panel: #1A1D22;
  --app-bg: #121418;
  --app-bg-2: #20242A;
  --app-sunk: #272B32;
  --sidebar-ink: #DADDE2;
  --sidebar-muted: #9AA0AA;
  --app-info-fg: #EDEEF0;
  --app-info-bg: #272B32;
  --app-warn-fg: #FFD21F;
  --app-warn-bg: #3A3314;
  --app-ok-fg: #82D9A1;
  --app-ok-bg: #15301F;
  --app-ok-solid-fg:#0E2417;
  --app-ok-solid-bg:#82D9A1;
  --app-danger-fg: #FF8F86;
  --app-danger-bg: #3A1816;
  --app-danger-line:#6B2B27;
  --app-danger-field:#FF8F86;
  --app-neutral-fg: #C4C8CF;
  --app-neutral-bg: #272B32;
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-float: inset 0 1px 0 rgba(255, 255, 255, .06), 0 16px 40px rgba(0, 0, 0, .5);
  --shadow-pop: inset 0 1px 0 rgba(255, 255, 255, .06), 0 16px 40px rgba(0, 0, 0, .5);
  --chip-tint-amt: 24%;
  --chip-fg-toward: #F1F5F9;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/archivo-latin-400-normal.9246d621d7f0.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/archivo-latin-ext-400-normal.77c73f42ed88.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/archivo-latin-500-normal.562c73adab45.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/archivo-latin-ext-500-normal.687d6bfb93fc.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/archivo-latin-600-normal.7ab89eedd1b0.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/archivo-latin-ext-600-normal.e6bddacfff06.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.77bc02670657.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-ext-400-normal.1bc0d8e41d21.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.f7016cd446d2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-ext-500-normal.93a0df997e00.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-ext-600-normal.8fccbdf5bf67.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.79936b18df9f.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-ext-400-normal.8450d5944de2.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-500-normal.b1c8a895f5fd.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-ext-500-normal.fa8d8838b94a.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --bs-font-sans-serif: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-font-monospace: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-font-size: .9375rem;
  --bs-body-line-height: 1.5;
  --bs-body-color: var(--app-ink);
  --bs-body-bg: var(--app-bg);
  --bs-secondary-color: var(--app-muted);
  --bs-border-color: var(--app-line);
  --bs-border-radius: .8125rem;
  --bs-border-radius-sm: .6875rem;
  --bs-border-radius-lg: 1.375rem;
  --bs-box-shadow: var(--shadow-card);
  --bs-box-shadow-sm: var(--shadow-card);
  --bs-primary: var(--app-ink);
  --bs-primary-rgb: 30, 34, 41;
  --bs-warning: var(--signal);
  --bs-warning-rgb: 255, 210, 31;
  --bs-link-color: var(--app-ink);
  --bs-link-hover-color: var(--app-accent-dark);
  --bs-link-color-rgb: 30, 34, 41;
  --bs-emphasis-color: var(--app-ink);
  --bs-tertiary-bg: var(--app-bg-2);
  --bs-secondary-bg: var(--app-sunk);
  --bs-heading-color: var(--app-ink);
}

:root[data-theme=dark] {
  --bs-primary-rgb: 237, 238, 240;
  --bs-link-color-rgb: 237, 238, 240;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bs-primary-rgb: 237, 238, 240;
    --bs-link-color-rgb: 237, 238, 240;
  }
}
body {
  background: var(--app-bg);
  color: var(--app-ink);
  min-height: 100vh;
  font-feature-settings: "kern", "liga";
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-layout {
  min-height: 100vh;
}

.text-muted {
  color: var(--app-muted) !important;
}

.num,
.badge,
.nav-cnt,
.page-tab__count,
.table td.text-end {
  font-variant-numeric: tabular-nums;
}

.num {
  font-feature-settings: "tnum";
}

:focus-visible,
.nav-link:focus-visible,
.form-check-input:focus-visible,
.btn-close:focus-visible,
.page-link:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--app-ink);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body.sidebar-lock-scroll {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: var(--r-control-sm);
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

#main:focus {
  outline: none;
}

.app-sidebar {
  position: fixed;
  top: 12px;
  bottom: 12px;
  left: 12px;
  width: 264px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  border: 1px solid var(--app-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 12px 10px 10px;
  z-index: 1030;
  overscroll-behavior: contain;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 8px 6px;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: var(--r-control-sm);
}

.sidebar-brand-tile {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--signal);
  color: var(--on-signal);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.sidebar-brand-logo {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: contain;
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-title {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin: 0;
}

[data-brand] .sidebar-brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-brand] .sidebar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-title-sub {
  font-weight: 400;
  color: var(--app-muted);
}

.sidebar-collapse-btn,
.topbar-icon-btn {
  flex: 0 0 auto;
  width: var(--h-icon-btn);
  height: var(--h-icon-btn);
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--app-ink-4);
  font-size: 1.125rem;
  padding: 0;
  cursor: pointer;
}
.sidebar-collapse-btn:hover,
.topbar-icon-btn:hover {
  background: var(--app-sunk);
  color: var(--app-ink);
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px;
  overflow-y: auto;
}

.sidebar-nav :focus-visible {
  outline-offset: -2px;
  box-shadow: inset 0 0 0 5px var(--signal);
}

.sidebar-group-label {
  font-size: 0.8125rem;
  color: var(--app-muted);
  padding: 8px 12px 4px;
}

.sidebar-group-label--admin {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--app-line);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-control);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--sidebar-ink);
  text-decoration: none;
}
.sidebar-link i {
  flex: 0 0 20px;
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
}
.sidebar-link:hover {
  background: var(--app-sunk);
  color: var(--app-ink);
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--signal);
  color: var(--on-signal);
}

.lbl-short {
  display: none;
}

.sidebar-footer {
  margin-top: 8px;
  position: relative;
}

.sidebar-account-toggle {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 16px;
  background: var(--app-bg-2);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.sidebar-account-toggle:hover {
  background: var(--app-sunk);
}

.sidebar-account-toggle__dots {
  margin-left: auto;
  color: var(--app-muted);
  font-size: 1rem;
}

.sidebar-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--app-sunk);
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--app-ink);
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--sidebar-muted);
}

.sidebar-footer .dropdown-menu.dropdown-menu-end {
  left: 0;
  right: auto;
  min-width: 240px;
  box-shadow: var(--shadow-pop);
}

:root.sidebar-collapsed .app-sidebar {
  width: 100px;
  padding: 12px 8px 10px;
}
:root.sidebar-collapsed .sidebar-brand {
  flex-direction: column;
  padding: 0 0 8px;
}
:root.sidebar-collapsed .sidebar-brand-text,
:root.sidebar-collapsed .sidebar-group-label:not(.sidebar-group-label--admin),
:root.sidebar-collapsed .sidebar-user,
:root.sidebar-collapsed .sidebar-account-toggle__dots {
  display: none;
}
:root.sidebar-collapsed .sidebar-group-label--admin {
  font-size: 0;
  padding: 0;
  margin: 8px 14px;
  height: 1px;
  background: var(--app-line);
  border: 0;
}
:root.sidebar-collapsed .sidebar-link {
  flex-direction: column;
  min-height: 58px;
  padding: 6px 2px;
  gap: 2px;
  justify-content: center;
  font-size: 0.75rem;
  text-align: center;
}
:root.sidebar-collapsed .lbl-long {
  display: none;
}
:root.sidebar-collapsed .lbl-short {
  display: inline;
}
:root.sidebar-collapsed .sidebar-link-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:root.sidebar-collapsed .sidebar-account-toggle {
  justify-content: center;
  padding: 8px 0;
}

@media (min-width: 768px) and (max-width: 1099.98px) {
  .app-sidebar {
    width: 100px;
    padding: 12px 8px 10px;
  }
  .sidebar-brand {
    flex-direction: column;
    padding: 0 0 8px;
  }
  .sidebar-brand-text,
  .sidebar-group-label:not(.sidebar-group-label--admin),
  .sidebar-user,
  .sidebar-account-toggle__dots {
    display: none;
  }
  .sidebar-group-label--admin {
    font-size: 0;
    padding: 0;
    margin: 8px 14px;
    height: 1px;
    background: var(--app-line);
    border: 0;
  }
  .sidebar-link {
    flex-direction: column;
    min-height: 58px;
    padding: 6px 2px;
    gap: 2px;
    justify-content: center;
    font-size: 0.75rem;
    text-align: center;
  }
  .lbl-long {
    display: none;
  }
  .lbl-short {
    display: inline;
  }
  .sidebar-link-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-account-toggle {
    justify-content: center;
    padding: 8px 0;
  }
  .sidebar-collapse-btn {
    display: none;
  }
}
.mobile-tabbar {
  display: none;
}

@media (max-width: 767.98px) {
  html {
    scroll-padding-bottom: 6.5rem;
  }
  .app-sidebar {
    display: none;
  }
  .mobile-tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 1040;
    background: var(--app-panel);
    border: 1px solid var(--app-line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-pop);
    padding: 4px;
  }
  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    min-width: 0;
    border: 0;
    border-radius: 17px;
    background: transparent;
    color: var(--app-ink-2);
    font-size: 0.75rem;
    text-decoration: none;
    padding: 0 2px;
  }
  .mobile-tab i {
    font-size: 1.25rem;
    line-height: 1;
  }
  .mobile-tab.active {
    background: var(--signal);
    color: var(--on-signal);
  }
  .mobile-tab-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 359.98px) {
  .mobile-tabbar {
    left: 4px;
    right: 4px;
    padding: 4px 2px;
  }
  .mobile-tab {
    padding: 0;
    font-size: 0.6875rem;
    letter-spacing: -0.01em;
  }
}
.more-sheet {
  --bs-offcanvas-bg: var(--app-panel);
  --bs-offcanvas-color: var(--app-ink);
  --bs-offcanvas-height: auto;
  max-height: 85vh;
  border: 1px solid var(--app-line);
  border-radius: var(--r-card) var(--r-card) 0 0;
  box-shadow: var(--shadow-float);
}
.more-sheet .offcanvas-title {
  font-size: 1.125rem;
}

.more-sheet-group {
  font-size: 0.8125rem;
  color: var(--app-muted);
  padding: 12px 12px 4px;
}

.more-sheet-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--app-ink);
  font-size: 1rem;
  text-align: left;
  text-decoration: none;
}
.more-sheet-link i {
  font-size: 1.25rem;
  color: var(--app-muted);
}
.more-sheet-link:hover {
  background: var(--app-sunk);
}
.more-sheet-link.active {
  background: var(--signal);
  color: var(--on-signal);
}
.more-sheet-link.active i {
  color: inherit;
}

@media (min-width: 768px) {
  .more-sheet {
    display: none;
  }
}
:root {
  --shell-offset: 288px;
}

:root.sidebar-collapsed {
  --shell-offset: 124px;
}

@media (min-width: 768px) and (max-width: 1099.98px) {
  :root {
    --shell-offset: 124px;
  }
}
@media (max-width: 767.98px) {
  :root,
  :root.sidebar-collapsed {
    --shell-offset: 0px;
  }
}
.app-main {
  min-width: 0;
  margin-left: var(--shell-offset);
}

body.no-shell .app-main {
  margin-left: 0 !important;
}

.app-topbar {
  position: relative;
  z-index: 1020;
  padding: 16px 32px 0;
}

.app-topbar-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  min-height: var(--h-icon-btn);
}

/* Both topbar groups must be allowed to shrink below their content width,
   otherwise the default `min-width: auto` of a flex child turns a long page
   title into horizontal page overflow on narrow phones. */
.app-topbar-inner > * {
  min-width: 0;
}

.topbar-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--app-muted);
}

.topbar-crumbs a {
  color: inherit;
  text-decoration: none;
}

.topbar-crumbs a:hover {
  color: var(--app-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topbar-crumb-sep {
  font-size: 0.8125rem;
  line-height: 1;
  flex: 0 0 auto;
}

.topbar-crumb-current {
  /* Rendered as the page <h1> on screens that have not adopted
     components/page_header.html, and as a plain <span> on those that have (see
     base.html). Reset the heading defaults either way so it reads as the last
     breadcrumb segment, not as a visible page title. */
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--app-ink-2);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-icon-dark {
  display: none;
}

:root[data-theme=dark] .theme-icon-light {
  display: none;
}

:root[data-theme=dark] .theme-icon-dark {
  display: inline;
}

.app-content {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 80px;
}

@media (max-width: 1099.98px) {
  .app-topbar {
    padding: 16px 24px 0;
  }
  .app-content {
    padding: 20px 24px 64px;
  }
}
@media (max-width: 767.98px) {
  .app-topbar {
    padding: 10px 8px 0 16px;
  }
  .app-content {
    padding: 16px 16px 24px;
  }
  body.has-tabbar .app-content {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  /* Keep only the current page segment; the root crumb and its chevron are pure
     decoration at this width. */
  .topbar-crumb-root,
  .topbar-crumb-link,
  .topbar-crumb-sep {
    display: none;
  }
}
body.no-shell .app-topbar-inner {
  justify-content: center;
}

body.no-shell .topbar-crumb-root,
body.no-shell .topbar-crumb-sep {
  display: none;
}

body.no-shell .topbar-crumb-current {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--app-ink);
}

.topbar-crumb-current--wrap {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.surface-card {
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.surface-card .card-header {
  background: var(--app-panel);
  border-bottom: 1px solid var(--app-line-soft);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--r-card) var(--r-card) 0 0;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--r-badge);
  padding: 0.2rem 0.65rem;
  min-height: 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  background: var(--app-neutral-bg);
  color: var(--app-neutral-fg);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

.badge-soft--info {
  background: var(--app-info-bg);
  color: var(--app-info-fg);
}

.badge-soft--warn {
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
}

.badge-soft--ok {
  background: var(--app-ok-bg);
  color: var(--app-ok-fg);
}

.badge-soft--danger {
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
}

.badge-soft--neutral {
  background: var(--app-neutral-bg);
  color: var(--app-neutral-fg);
}

.badge-soft--color {
  --chip: var(--app-neutral-fg);
  background: color-mix(in srgb, var(--chip) var(--chip-tint-amt), var(--app-panel));
  color: color-mix(in srgb, var(--chip) var(--chip-fg-amt), var(--chip-fg-toward));
  border: 1px solid color-mix(in srgb, var(--chip) 45%, var(--app-line));
}

.dot-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.dot-status__dot {
  width: 9px;
  height: 9px;
  min-width: 9px;
  border-radius: 3px;
  display: inline-block;
  background: var(--app-line-strong);
}

.dot-status--ok {
  color: var(--app-ok-fg);
}

.dot-status--ok .dot-status__dot {
  background: var(--app-ok-fg);
}

.dot-status--neutral {
  color: var(--app-muted);
}

/* Overview tiles on the home page: one number, one link. */
.home-tile {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  height: 100%;
  min-height: 44px;
  padding: 1.25rem;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  color: var(--app-ink-2);
  text-decoration: none;
}
.home-tile:hover {
  border-color: var(--app-line-strong);
  box-shadow: var(--shadow-pop);
  color: var(--app-ink-2);
}

.home-tile__label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--app-ink-2);
}

.home-tile__value {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--app-ink);
}

.home-tile__hint {
  font-size: 0.875rem;
  color: var(--app-muted);
}

.home-recent li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--app-line-softest);
  min-width: 0;
  overflow-wrap: anywhere;
}
.home-recent li:last-child {
  border-bottom: 0;
}

/* Bootstrap badges / alerts that templates still use directly: same language as the chips. */
.badge {
  --bs-badge-padding-x: 0.65rem;
  --bs-badge-padding-y: 0.25rem;
  --bs-badge-font-size: 0.8125rem;
  --bs-badge-font-weight: 500;
  --bs-badge-border-radius: var(--r-badge);
}

.badge.text-bg-light {
  background-color: var(--app-sunk) !important;
  color: var(--app-ink-2) !important;
}

.badge.text-bg-secondary {
  background-color: var(--sel) !important;
  color: var(--on-sel) !important;
}

.badge.border {
  border-color: transparent !important;
}

.alert {
  --bs-alert-border-radius: var(--r-panel);
  --bs-alert-padding-x: 1rem;
  --bs-alert-padding-y: 0.75rem;
  border-width: 1px;
}

.alert-danger {
  --bs-alert-color: var(--app-danger-fg);
  --bs-alert-bg: var(--app-danger-bg);
  --bs-alert-border-color: var(--app-danger-line);
}

.alert-warning {
  --bs-alert-color: var(--app-ink);
  --bs-alert-bg: var(--signal-soft);
  --bs-alert-border-color: var(--app-accent-tint-2);
}

.alert-info,
.alert-success {
  --bs-alert-color: var(--app-ink);
  --bs-alert-bg: var(--app-bg-2);
  --bs-alert-border-color: var(--app-line);
}

.home-recent__name {
  font-weight: 600;
  color: var(--app-ink);
  text-decoration: none;
}
.home-recent__name:hover, .home-recent__name:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-recent__when {
  flex: none;
  font-size: 0.875rem;
  color: var(--app-muted);
}

.contact-card {
  min-width: 0;
  overflow-wrap: anywhere;
}
.contact-card a {
  max-width: 100%;
  min-width: 0;
}

.btn {
  /* D2: 44 px targets, 13 px radius, Archivo 500. min-height, not height: a two-line label must be able to grow instead of clipping.
     The size goes through --bs-btn-font-size rather than a literal font-size so a
     variant (or a one-off override) can still redefine it. This sheet loads after
     Bootstrap, so the size variants below have to restate their own value — otherwise
     this default would override Bootstrap's .btn-sm / .btn-lg on equal specificity. */
  min-height: var(--h-control);
  border-radius: var(--r-control);
  --bs-btn-font-size: 0.9375rem;
  --bs-btn-padding-x: 1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-sm {
  min-height: var(--h-control-xs);
  --bs-btn-font-size: 0.875rem;
  --bs-btn-padding-x: 0.75rem;
  border-radius: var(--r-control-sm);
}

.btn-lg {
  min-height: 3rem;
  --bs-btn-font-size: 1rem;
}

/* in-card controls are one step taller than a bare .btn-sm (handoff §6.3: 32px) */
.surface-card .btn-sm {
  min-height: var(--h-control-sm);
}

.btn:focus-visible {
  outline: 2px solid var(--app-ink);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* Primary action: signal fill + ink text, in both themes (yellow is never text). */
.btn-accent {
  --bs-btn-color: var(--on-signal);
  --bs-btn-bg: var(--signal);
  --bs-btn-border-color: var(--signal);
  --bs-btn-hover-color: var(--on-signal);
  --bs-btn-hover-bg: var(--signal-hover);
  --bs-btn-hover-border-color: var(--signal-hover);
  --bs-btn-focus-shadow-rgb: 255, 210, 31;
  --bs-btn-active-color: var(--on-signal);
  --bs-btn-active-bg: var(--signal-hover);
  --bs-btn-active-border-color: var(--signal-hover);
  --bs-btn-disabled-color: var(--on-signal);
  --bs-btn-disabled-bg: var(--signal);
  --bs-btn-disabled-border-color: var(--signal);
  font-weight: 600;
}

.btn-accent.btn-lg,
.page-header__actions .btn-accent {
  min-height: 48px;
  border-radius: 15px;
  padding-inline: 1.25rem;
}

.btn-outline-ink {
  /* secondary action: outlined (1.5 px line-2), panel fill, ink text */
  --bs-btn-color: var(--app-ink);
  --bs-btn-bg: var(--app-panel);
  --bs-btn-border-color: var(--app-line-strong);
  --bs-btn-hover-color: var(--app-ink);
  --bs-btn-hover-bg: var(--app-sunk);
  --bs-btn-hover-border-color: var(--app-line-strong);
  --bs-btn-active-color: var(--app-ink);
  --bs-btn-active-bg: var(--app-sunk);
  --bs-btn-active-border-color: var(--app-line-strong);
  --bs-btn-disabled-color: var(--app-muted);
  --bs-btn-disabled-bg: var(--app-panel);
  --bs-btn-disabled-border-color: var(--app-line);
}

.btn-outline-secondary {
  --bs-btn-color: var(--app-ink);
  --bs-btn-bg: var(--app-panel);
  --bs-btn-border-color: var(--app-line-strong);
  --bs-btn-hover-color: var(--app-ink);
  --bs-btn-hover-bg: var(--app-sunk);
  --bs-btn-hover-border-color: var(--app-line-strong);
  --bs-btn-active-color: var(--app-ink);
  --bs-btn-active-bg: var(--app-sunk);
  --bs-btn-active-border-color: var(--app-line-strong);
}

.btn-quiet {
  /* quiet action, menu inside a card */
  --bs-btn-color: var(--app-ink-4);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--app-sunk);
  --bs-btn-hover-color: var(--app-ink);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--app-sunk);
  --bs-btn-active-color: var(--app-ink);
  --bs-btn-active-border-color: transparent;
}

/* Bootstrap's outline danger is #dc3545 (4.2:1 on the canvas): use the AA danger ink in both themes. */
.btn-outline-danger {
  --bs-btn-color: var(--app-danger-fg);
  --bs-btn-border-color: var(--app-danger-fg);
  --bs-btn-hover-bg: var(--app-danger-bg);
  --bs-btn-hover-color: var(--app-danger-fg);
  --bs-btn-hover-border-color: var(--app-danger-fg);
  --bs-btn-active-bg: var(--app-danger-bg);
  --bs-btn-active-color: var(--app-danger-fg);
  --bs-btn-active-border-color: var(--app-danger-fg);
}

.text-danger {
  color: var(--app-danger-fg) !important;
}

.btn-outline-danger-soft {
  /* destructive, not shouty */
  --bs-btn-color: var(--app-danger-fg);
  --bs-btn-bg: var(--app-panel);
  --bs-btn-border-color: var(--app-danger-line);
  --bs-btn-hover-bg: var(--app-danger-bg);
  --bs-btn-hover-color: var(--app-danger-fg);
  --bs-btn-hover-border-color: var(--app-danger-field);
  --bs-btn-active-bg: var(--app-danger-bg);
  --bs-btn-active-color: var(--app-danger-fg);
  --bs-btn-active-border-color: var(--app-danger-field);
}

/* A visible frequent action (Upravit) next to the "⋯" menu in a list row. */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.btn-row-icon {
  /* row-level icon button only, always paired with aria-label */
  width: var(--h-icon-btn);
  height: var(--h-icon-btn);
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-control-sm);
  background: transparent;
  color: var(--app-ink-4);
}
.btn-row-icon:hover {
  background: var(--app-sunk);
  color: var(--app-ink);
  border-color: transparent;
}

.btn.btn-icon-square {
  /* square icon-only control in a page header — the "⋯" overflow (§8.3).
     Always carries an aria-label; a bare icon is only allowed for overflow menus. */
  width: var(--h-control);
  padding: 0;
  display: inline-grid;
  place-items: center;
}

@media (max-width: 767.98px) {
  .btn.btn-sm {
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.48rem 0.72rem;
  }
  .btn.btn-sm > i:only-child {
    font-size: 1.1rem;
  }
  .card-header .btn.btn-sm,
  .list-group-item .btn.btn-sm,
  .table .btn.btn-sm {
    min-height: 2.75rem;
    min-width: 2.75rem;
  }
  .d-flex.gap-2:has(> .btn),
  .d-inline-flex.gap-2:has(> .btn) {
    gap: 0.6rem !important;
  }
}
.btn-row-icon[aria-expanded=true] {
  background: var(--sel);
  color: var(--on-sel);
}

/* Row / ⋯ menus mix <a> and <button> items: both must look identical (same weight, colour,
   no underline), whichever tag a template uses. The `> li >` path out-ranks the list-wide link
   rules (`.table a:not(.btn)`, `.surface-card a[href^="tel:"]`) that used to win for <a> items. */
.dropdown-menu > li > a.dropdown-item,
.dropdown-menu > li > button.dropdown-item {
  font-weight: 400;
  color: var(--bs-dropdown-link-color);
  text-decoration: none;
  /* A named item ("Zavolat – Hana Procházková (+420 …)") may be wider than a phone: it wraps. */
  white-space: normal;
  overflow-wrap: anywhere;
}
.dropdown-menu > li > a.dropdown-item:hover, .dropdown-menu > li > a.dropdown-item:focus,
.dropdown-menu > li > button.dropdown-item:hover,
.dropdown-menu > li > button.dropdown-item:focus {
  color: var(--bs-dropdown-link-hover-color);
  text-decoration: none;
}
.dropdown-menu > li > a.dropdown-item.text-danger,
.dropdown-menu > li > button.dropdown-item.text-danger {
  color: var(--bs-danger);
}

/* ⋯ and account menus (mock .menu): 6 px padding, 18 px radius, 44 px rounded items. The
   host never clips them (rule 13): no overflow rule here, max-width keeps them in view. */
.dropdown-menu {
  --bs-dropdown-padding-x: 6px;
  --bs-dropdown-padding-y: 6px;
  --bs-dropdown-border-radius: 18px;
  --bs-dropdown-inner-border-radius: 12px;
  --bs-dropdown-border-color: var(--app-line);
  --bs-dropdown-bg: var(--app-panel);
  --bs-dropdown-color: var(--app-ink);
  --bs-dropdown-link-color: var(--app-ink);
  --bs-dropdown-link-hover-color: var(--app-ink);
  --bs-dropdown-link-hover-bg: var(--app-bg-2);
  --bs-dropdown-link-active-color: var(--app-ink);
  --bs-dropdown-link-active-bg: var(--signal-soft);
  --bs-dropdown-divider-bg: var(--app-line);
  --bs-dropdown-divider-margin-y: 4px;
  --bs-dropdown-box-shadow: var(--shadow-pop);
  --bs-dropdown-font-size: 0.9375rem;
  --bs-dropdown-min-width: 14rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
}

.dropdown-item > .bi {
  color: var(--app-muted);
  flex: none;
}

.dropdown-item.text-danger,
.dropdown-item.text-danger > .bi {
  color: var(--app-danger-fg) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--app-bg-2);
}

/* No menu is ever wider than the viewport (a 390 px phone clipped the named call items). */
.dropdown-menu {
  max-width: calc(100vw - 2rem);
}

/* Tom Select lists inside a modal are attached to <body> (see tom_select_init.html), so the
   scrolling modal body cannot clip them; they must sit above the modal (1055). */
body > .ts-dropdown {
  z-index: 1080;
}

.table a.tag-chip:not(.btn),
a.tag-chip {
  color: var(--app-ink);
  text-decoration: none;
  font-weight: 500;
}
.table a.tag-chip:not(.btn):hover, .table a.tag-chip:not(.btn):focus-visible,
a.tag-chip:hover,
a.tag-chip:focus-visible {
  color: var(--app-ink);
  text-decoration: underline;
  background: color-mix(in srgb, var(--chip) 24%, var(--app-panel));
}

/* F7: a menu taller than the space around its button scrolls inside instead of running below
   the viewport (Popper's flip then picks top-end when the space above is larger). */
.dropdown-menu {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.table {
  --bs-table-bg: var(--app-panel);
  --bs-table-border-color: var(--app-line-softest);
  /* zebra striping is retired — keep the variable equal to the row bg so
     .table-striped stays visually neutral without touching templates */
  --bs-table-striped-bg: var(--app-panel);
  --bs-table-hover-bg: var(--app-bg-2);
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 0.75rem 0.875rem;
  vertical-align: middle;
}

.table > :not(caption) > * > *:first-child {
  padding-left: 1.125rem;
}

.table > tbody > tr.is-selected > * {
  --bs-table-accent-bg: var(--app-accent-row);
  background-color: var(--app-accent-row);
}

/* Bootstrap paints every cell with `background-color: var(--bs-table-bg)`, so a
   `background` on <thead> is covered up. Redefine the variable at thead scope instead —
   the head cells then inherit the tinted value while tbody keeps the white default. */
.table > thead {
  --bs-table-bg: var(--app-bg-2);
}

.table > tbody {
  font-size: 0.9375rem;
}

.table thead th {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--app-muted);
  border-top: 1px solid var(--app-line);
  border-bottom: 1px solid var(--app-line);
  white-space: nowrap;
}

.table thead th a:not(.btn) {
  color: inherit;
  font-weight: 500;
}

.table thead th.is-sorted,
.table thead th[aria-sort] {
  color: var(--app-ink);
}

.table thead th[aria-sort] a {
  font-weight: 600;
}

.table thead th .sort-arrow {
  font-size: 1rem;
  line-height: 1;
  vertical-align: -2px;
}

.table a:not(.btn) {
  color: var(--app-ink);
  font-weight: 600;
  text-decoration: none;
}

.table a:not(.btn):hover {
  color: var(--app-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Bootstrap's lg breakpoint, not md: seven-column lists (Zákazníci) squish unreadably
   through the 769–991px band, where a tablet in portrait is far better served by the
   card layout. Below this width every .table-mobile-cards table becomes stacked cards. */
@media (max-width: 991.98px) {
  /* Only the wrappers whose table actually turns into cards give up their scroller.
     A card table is a stack of full-width blocks, so it has nothing to scroll, while
     `overflow-x: auto` would clip the dropdowns and popovers that open out of a card.
     Tables that stay tabular (worker rentals, performance reports, the duplicate
     finder) keep Bootstrap's scroller — dropping it there would push their ten columns
     off-screen with no way to reach them. `:has` is the only way to key the wrapper on
     its own child; where it is unsupported the wrapper simply keeps scrolling, which
     costs a clipped dropdown rather than unreachable content. */
  .table-responsive:has(> .table-mobile-cards) {
    overflow: visible;
  }
  .table-mobile-cards {
    border-collapse: separate;
    border-spacing: 0;
  }
  .table-mobile-cards thead {
    display: none;
  }
  .table-mobile-cards tbody,
  .table-mobile-cards tr,
  .table-mobile-cards td {
    display: block;
    width: 100%;
  }
  .table-mobile-cards tr {
    margin-bottom: 0.7rem;
    padding: 0.82rem 0.95rem;
    border: 1px solid var(--app-line);
    border-radius: var(--r-panel);
    background: var(--app-panel);
    box-shadow: var(--shadow-card);
  }
  .table-mobile-cards.table-striped > tbody > tr:nth-of-type(odd) {
    background: var(--app-bg-2);
  }
  .table-mobile-cards td {
    border: 0;
    padding: 0.5rem 0.2rem;
    text-align: left !important;
    display: grid;
    grid-template-columns: minmax(5.8rem, 7.2rem) minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
  }
  .table-mobile-cards td::before {
    content: attr(data-label);
    color: var(--app-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    flex-shrink: 0;
    min-width: 6.5rem;
  }
  .table-mobile-cards td[data-label=""]::before {
    display: none;
  }
  .table-mobile-cards td[data-label=""] {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.65rem;
  }
  .table-mobile-cards.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: transparent;
    background-color: transparent;
  }
  /* The desktop ":first-child" rule above (`.table > :not(caption) > * > *:first-child`)
     out-specificities the plain `.table-mobile-cards td` padding shorthand and bleeds an
     extra 1.125rem indent onto whichever cell happens to render first in the card. That
     is invisible while the (label-less) select column leads every row, but a table that
     hides it for a subset of rows (e.g. the archived worker list, which drops bulk
     selection) exposes the next cell's label with a stray left indent. Reset it here with
     matching specificity so every card-mode label lines up regardless of which column
     leads. */
  .table.table-mobile-cards td:first-child {
    padding-left: 0.2rem;
  }
}
/* The name cell is the row's identity: semibold in every list (users included). */
.table td.cell-title {
  font-weight: 600;
}

/* Identity cell of a list row (§8.2): link on the first line, IČO (Mono, muted) below. */
.cell-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  /* A long unbroken name (no spaces) must wrap inside a 320px card, not push the page
     sideways. */
  overflow-wrap: anywhere;
}

.cell-identity__title {
  display: flex;
  align-items: center;
  /* Wrap, don't clip: a status badge (e.g. "Archivovaný") next to a short name still
     overflows a 320px card without this — the link and badge are flex items with no
     natural shrink point, so they push past the card's right edge instead of dropping
     to a second line. */
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.cell-identity__meta {
  font-size: 0.8125rem;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
}

/* A long e-mail on a phone card ends in an ellipsis instead of being cut at the card edge. */
.cell-identity {
  min-width: 0;
}

.cell-identity__meta--email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Readable list of changes in the history table (apps/audit/labels.py). */
.audit-changes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Phone card (Zákazníci): identity + the main action + one menu; everything else is hidden.
   Checkbox, name and "⋯" form the header (44 px hit areas); the call link is a full-width
   button; secondary cells and empty "–" cells are dropped. initMobileTableCards (app.js)
   marks empty cells with .cell-empty. */
.cell-select__hit {
  display: inline-grid;
  place-items: center;
  margin: 0;
}

@media (max-width: 991.98px) {
  .table-mobile-cards tr {
    position: relative;
  }
  .table-mobile-cards td.cell-empty {
    display: none !important;
  }
  /* Chips are self-explanatory: no label column, they wrap in a row. */
  .table-mobile-cards td.cell-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .table-mobile-cards td.cell-tags::before {
    display: none;
  }
  .table-mobile-cards td.cell-title {
    display: block;
    padding: 0.25rem 3rem 0.25rem 0.2rem;
    min-height: 44px;
  }
  .table-mobile-cards td.cell-title::before,
  .table-mobile-cards td.cell-select::before,
  .table-mobile-cards td.cell-contact::before {
    display: none;
  }
  /* The contact person and the call button fill the card width (no label column). */
  .table-mobile-cards td.cell-contact {
    display: block;
    padding-top: 0.15rem;
  }
  .table-mobile-cards td.cell-select {
    position: absolute;
    top: 0.5rem;
    left: 0.4rem;
    width: auto;
    padding: 0;
  }
  .table-mobile-cards td.cell-select + td.cell-title {
    padding-left: 3rem;
  }
  .table-mobile-cards td.cell-select .cell-select__hit {
    width: 44px;
    height: 44px;
  }
  .table-mobile-cards td.cell-select .form-check-input {
    width: 1.375rem;
    height: 1.375rem;
    margin: 0;
  }
  .table-mobile-cards td.cell-actions::before {
    display: none;
  }
  .table-mobile-cards td.cell-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.4rem;
    width: auto;
    padding: 0;
    display: block;
  }
  .contact-call {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--app-line);
    border-radius: var(--r-control);
    text-align: center;
  }
}
@media (max-width: 767.98px) {
  .table-mobile-cards td.cell-secondary {
    display: none;
  }
  .btn-row-icon {
    min-width: 44px;
    min-height: 44px;
  }
}
/* Desktop list rows scan as one line: names get room, short values (IČO, city, owner) never
   wrap mid-value. (Card layout below 992 px is untouched.) */
@media (min-width: 992px) {
  .table-mobile-cards td.cell-title {
    min-width: 15rem;
  }
  .table-mobile-cards td.cell-secondary {
    white-space: nowrap;
  }
  /* Chips wrap inside their cell: a nowrap secondary cell with three tags is 400 px wide. */
  .table-mobile-cards td.cell-tags {
    min-width: 12rem;
    white-space: normal;
  }
}
/* Code-list rows (Číselníky) as phone cards: the name (plus a small meta line on a phone) takes
   the free width and wraps, the row actions sit in their own column and never overlay the name,
   and a one-line row centres its text instead of leaving a gap under it. */
.cell-meta-phone {
  margin-top: 0.15rem;
}

@media (min-width: 768px) {
  .cell-meta-phone {
    display: none;
  }
}
@media (max-width: 991.98px) {
  .table-mobile-cards.table-catalog tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.5rem;
  }
  .table-mobile-cards.table-catalog td {
    grid-column: 1;
  }
  .table-mobile-cards.table-catalog td.cell-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.25rem 0.2rem;
    overflow-wrap: anywhere;
  }
  .table-mobile-cards.table-catalog td.cell-actions {
    position: static;
    grid-column: 2;
    grid-row: 1/span 3;
    align-self: center;
    display: flex;
    width: auto;
    padding: 0;
  }
}
/* Status chips and document numbers never break mid-word in a table cell (P13). */
.table-expiry .badge-soft,
.table-expiry .cell-wrap .num {
  white-space: nowrap;
}

/* "Vzdálenost" of a list around a centre ("V okolí"): the number never breaks, the nearest place
   under it wraps, so the column adds little to the table's minimum width (R64). */
.cell-distance .num {
  white-space: nowrap;
  font-weight: 600;
}

/* Users list (UX gate I3): badges never split, the e-mail stays on one line and is cut with an
   ellipsis (full address in the title), the role cell keeps room for the lock badge. */
.table-users .badge-soft {
  white-space: nowrap;
}

@media (min-width: 992px) {
  .table-users td.cell-state {
    min-width: 7rem;
    white-space: nowrap;
  }
  .table-users td.cell-role {
    min-width: 9rem;
  }
  .table-users td.cell-title {
    min-width: 13rem;
  }
  .table-users td.cell-email {
    max-width: 9rem;
  }
  .table-users .cell-email__text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.surface-card a[href^="mailto:"],
.surface-card a[href^="tel:"] {
  color: var(--app-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--app-line-strong);
  text-underline-offset: 3px;
}

.surface-card a[href^="mailto:"]:hover,
.surface-card a[href^="tel:"]:hover {
  color: var(--app-accent-dark);
  text-decoration-color: currentColor;
}

a[href^="tel:"] {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.table a[href^="tel:"],
.table a[href^="mailto:"] {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--app-line-strong);
  text-underline-offset: 3px;
}

.table a:not(.btn):focus-visible {
  text-decoration: underline;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  padding-left: 0;
  margin-top: 1rem;
  margin-bottom: 0;
}

.pagination .page-link,
.pagination > li > a,
.pagination > li > span {
  display: inline-block;
  border-radius: var(--r-control-sm);
  border: 1px solid var(--app-line);
  color: var(--app-ink-2);
  background: var(--app-panel);
  min-width: 2.75rem;
  height: var(--h-control);
  line-height: calc(var(--h-control) - 2px);
  text-align: center;
  text-decoration: none;
  padding: 0 0.7rem;
  font-variant-numeric: tabular-nums;
}

.pagination .page-link:hover,
.pagination > li > a:hover {
  color: var(--app-ink);
  background: var(--app-bg-2);
  border-color: var(--app-line);
  text-decoration: none;
}

.pagination .page-item.active .page-link,
.pagination > li.active > a,
.pagination > li.active > span {
  color: var(--on-signal);
  background: var(--signal);
  border-color: var(--signal);
  font-weight: 600;
}

.pagination .page-item.disabled .page-link {
  color: var(--app-muted);
  background: var(--app-bg-2);
  border-color: var(--app-line);
}

/* Card footer strip of a list table (§8.2): page size left, pager right.
   Rendered by templates/django_tables2/jericho_table.html on every list. */
.table-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--app-line-soft);
  background: var(--app-bg-2);
}

.table-footer__label {
  font-size: 0.875rem;
  color: var(--app-muted);
}

.table-footer__page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.table-footer__size-btn {
  height: var(--h-control-sm);
  padding: 0 0.75rem;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--r-control-sm);
  background: var(--app-panel);
  color: var(--app-ink-2);
  font-size: 0.875rem;
  font-weight: 500;
}

.table-footer__pager {
  margin-left: auto;
  min-width: 0;
}

.table-footer .pagination {
  margin-top: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.table-footer .page-link--word {
  font-size: 0.875rem;
  font-weight: 500;
}

.table-footer .page-item.disabled .page-link--gap {
  border-color: transparent;
  background: transparent;
}

.app-form p {
  margin-bottom: 1rem;
}

.app-form label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  display: block;
}

.form-control,
.form-select {
  border-color: var(--app-field-line);
  border-radius: var(--r-control);
  min-height: var(--h-control);
  background-color: var(--app-panel);
  color: var(--app-ink);
}

.form-control::placeholder {
  color: var(--app-muted);
  opacity: 1;
}

/* Field focus: ink border + signal-soft halo (mock .search:focus-within). The global
   :focus-visible ink outline would double the border, so fields turn it off. */
.form-control:focus,
.form-select:focus {
  border-color: var(--app-ink);
  box-shadow: var(--focus-ring-field);
  outline: 2px solid transparent;
  outline-offset: 0;
  background-color: var(--app-panel);
  color: var(--app-ink);
}

.form-check-input {
  border-color: var(--app-field-line);
  background-color: var(--app-panel);
}

.form-check-input:checked,
.form-check-input[type=checkbox]:indeterminate {
  background-color: var(--sel);
  border-color: var(--sel);
}

.form-check-input:checked[type=checkbox] {
  --bs-form-check-bg-image: var(--check-tick);
  background-image: var(--check-tick);
}

.form-check-input[type=checkbox]:indeterminate {
  --bs-form-check-bg-image: var(--check-dash);
  background-image: var(--check-dash);
}

.form-check-input:checked[type=radio] {
  --bs-form-check-bg-image: var(--check-dot);
  background-image: var(--check-dot);
}

.form-check-input:focus {
  border-color: var(--app-ink);
}

.app-form .form-text {
  font-size: 0.8125rem;
  color: var(--app-muted);
}

/* Filtering: toolbar (always visible) + collapsible panel in the page flow.
   Filter chips live here too — they are part of the same toolbar row. */
.filter-wrap {
  position: relative;
}

.filter-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--app-line-soft);
}

.filter-search {
  position: relative;
  width: 360px;
  max-width: 100%;
}

@media (max-width: 575.98px) {
  /* A phone: the search field takes the full row so a long placeholder is not cut off. */
  .filter-search {
    width: 100%;
    flex: 1 1 100%;
  }
}
.filter-search__icon {
  position: absolute;
  top: 50%;
  left: 0.875rem;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--app-muted);
  pointer-events: none;
}

.filter-search-input.form-control {
  height: var(--h-control);
  min-height: var(--h-control);
  padding-left: 2.5rem;
  border-radius: var(--r-control);
  background: var(--app-bg-2);
  font-size: 0.9375rem;
}

.filter-toggle.btn {
  height: var(--h-control);
  min-height: var(--h-control);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--r-control);
}

.filter-count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 10px;
  background: var(--sel);
  color: var(--on-sel);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: var(--h-control-xs);
  padding: 0 0.375rem 0 0.75rem;
  border: 1px solid var(--app-accent-tint-2);
  border-radius: var(--r-control-sm);
  background: var(--app-accent-tint);
  color: var(--app-ink);
  font-size: 0.875rem;
}

.filter-chip-remove {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  line-height: 1;
}

.filter-chip-remove:hover {
  background: var(--app-accent-tint-2);
  color: var(--app-ink);
}

.filter-toolbar__count {
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--app-muted);
}

.filter-toolbar__unfiltered {
  color: var(--app-muted);
}

/* The panel sits in the page flow: opening it pushes the table down instead of covering the
   first rows (and their checkboxes / row menus). */
.filter-panel-wrap {
  margin-top: 0.75rem;
}

.filter-panel {
  border-radius: var(--r-panel);
  border: 1px solid var(--app-line);
  background: var(--app-panel);
}

.filter-group + .filter-group {
  margin-top: 1rem;
}

.filter-group__label {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--app-muted);
}

.filter-label {
  margin-bottom: 0.3rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--app-ink-2);
}

.filter-panel .form-control,
.filter-panel .form-select {
  min-height: var(--h-control);
  border-radius: var(--r-control);
  font-size: 0.9375rem;
}

/* "V okolí": while a record is the centre its name is a removable pill in front of the place
   field (typing a place replaces the record). */
.near-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.near-field .form-control {
  flex: 1 1 8rem;
  min-width: 0;
}

.near-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 0.25rem;
  min-width: 0;
  max-width: 70%;
  height: var(--h-control);
  padding: 0 0.25rem 0 0.75rem;
  border: 1px solid var(--app-accent-tint-2);
  border-radius: var(--r-control);
  background: var(--app-accent-tint);
  color: var(--app-ink);
  font-size: 0.875rem;
}

.near-pill__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The count line under the toolbar of a list around a centre. */
.near-note {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--app-muted);
  overflow-wrap: anywhere;
}

.filter-panel__footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
}

.filter-reset-link {
  color: var(--app-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  font-size: 0.875rem;
}

.filter-reset-link:hover {
  color: var(--app-accent-dark);
  text-decoration: underline;
}

.app-form .app-field-invalid .form-control,
.app-form .app-field-invalid .form-select,
.app-form .app-field-invalid .form-check-input {
  border-color: var(--app-danger-field);
  background-color: var(--app-danger-bg);
}

.app-form .app-field-invalid .form-control:focus,
.app-form .app-field-invalid .form-select:focus,
.app-form .app-field-invalid .form-check-input:focus {
  border-color: var(--app-danger-field);
  box-shadow: 0 0 0 3px var(--app-danger-bg);
}

.app-form .app-field-invalid .form-text,
.app-form .app-field-invalid .invalid-feedback {
  color: var(--app-danger-fg);
}

.app-form-errors {
  border-left: 0.25rem solid var(--app-danger-fg);
}

.login-brand__tile {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--signal);
  color: var(--on-signal);
  font-size: 1.5rem;
  font-weight: 600;
}

img.login-brand__tile {
  background: none;
  object-fit: contain;
}

.login-brand__name {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.password-toggle {
  min-width: 44px;
}

.ts-wrapper.form-control,
.ts-wrapper.form-select,
.ts-control {
  border-radius: var(--r-control);
}

.ts-control {
  min-height: var(--h-control);
  border-color: var(--app-field-line);
  background: var(--app-panel);
  color: var(--app-ink);
  font-size: 0.9375rem;
}

.ts-wrapper.focus .ts-control {
  border-color: var(--app-ink);
  box-shadow: var(--focus-ring-field);
}

.ts-dropdown {
  border-radius: var(--r-panel);
  border: 1px solid var(--app-line);
  box-shadow: var(--shadow-pop);
  background: var(--app-panel);
  color: var(--app-ink);
}

.ts-dropdown .active {
  background: var(--signal-soft);
  color: var(--app-ink);
}

.ts-wrapper.multi .ts-control > div {
  border-radius: var(--r-badge);
  background: var(--app-sunk);
  color: var(--app-ink);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  max-width: 100%;
  border-radius: 17px;
  background: var(--app-sunk);
}

.segmented__option {
  position: relative;
}

.segmented__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented__label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border-radius: 13px;
  color: var(--app-ink-2);
  font-weight: 500;
  cursor: pointer;
}

.segmented__input:checked + .segmented__label {
  background: var(--app-panel);
  color: var(--app-ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 24, 31, 0.08), inset 0 0 0 1.5px var(--app-ink-4);
}

.segmented__input:focus-visible + .segmented__label {
  outline: 2px solid var(--app-ink);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 5px var(--signal);
}

/* Czech file picker (core.widgets.CzechFileInput): the native input is visually hidden but keeps
   focus; its focus ring is drawn on the visible button. */
.app-file {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.app-file__name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.875rem;
  color: var(--app-muted);
}

.app-file__input:focus-visible ~ .app-file__button {
  outline: 2px solid var(--app-ink);
  outline-offset: 2px;
}

/* Required fields: a star after the label (decorative: the input carries `required`) and a legend. */
.form-label.is-required::after {
  content: " *"/"";
  color: var(--app-danger-fg);
}

.form-legend {
  margin: 0 0 1rem;
  color: var(--app-muted);
  font-size: 0.875rem;
}
.form-legend span {
  color: var(--app-danger-fg);
}

.mobile-action-bar {
  position: fixed;
  right: 0.75rem;
  left: 0.75rem;
  bottom: max(0.65rem, env(safe-area-inset-bottom));
  z-index: 1090;
}

.mobile-action-bar__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  border: 1px solid var(--app-line);
  border-radius: 0.88rem;
  background: color-mix(in srgb, var(--app-panel) 97%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-soft);
  padding: 0.55rem;
}

.mobile-action-bar .btn {
  min-height: 2.75rem;
  width: 100%;
}

.mobile-action-bar form {
  margin: 0;
}

/* Breakpoint note: this bar stays on Bootstrap's lg boundary (992px) because its visibility is
   driven by `d-lg-none` in the templates. Below 768 px the floating tab bar owns the bottom
   edge, so the bar sits above it. No template renders it today. */
@media (max-width: 991.98px) {
  body.has-mobile-action-bar .app-content {
    padding-bottom: calc(7rem + env(safe-area-inset-bottom));
  }
}
@media (max-width: 767.98px) {
  .mobile-action-bar {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  body.has-mobile-action-bar .app-content {
    padding-bottom: calc(11rem + env(safe-area-inset-bottom));
  }
}
/* Bulk actions (§7.3, rule 6) — a slim always-visible select strip above the table
   plus the floating dark bar that appears only while the selection is non-empty.

   z-index note: `.mobile-action-bar` (1090) lives on DETAIL pages, this bar on LIST
   pages, so the two never co-occur; the bulk bar deliberately stays at 1030 (above
   page content, below the topbar layer). */
.bulk-select-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.15rem 0.6rem;
  font-size: 0.875rem;
  color: var(--app-muted);
}

.bulk-select-strip .form-check-label {
  color: var(--app-muted);
}

.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: calc(var(--shell-offset) + (100% - var(--shell-offset)) / 2);
  transform: translateX(-50%);
  z-index: 1030;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* A fixed box with `left` set and no width shrink-wraps against the space between
     `left` and the viewport's right edge, which squeezed the controls and wrapped the
     action button. `max-content` lifts that ceiling; max-width keeps the bar clear of
     the 236px sidebar and the viewport edge. */
  width: max-content;
  /* 100% = the viewport without its scrollbar (the containing block of a fixed box); 100vw
     counted the scrollbar in and let the bar's right edge run under it. */
  max-width: calc(100% - var(--shell-offset) - 2rem);
  padding: 10px 12px 10px 16px;
  border-radius: var(--r-panel);
  background: var(--fill);
  border: 1px solid var(--app-line-strong);
  box-shadow: var(--shadow-float);
  /* 120ms fade is the only transition on this component (§9). */
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
}

.bulk-bar--visible {
  opacity: 1;
  visibility: visible;
}

/* While the bar is up, reserve room under the content so it never covers the
   last table row or the pagination — same body-class trick as `.mobile-action-bar`.
   `has-bulk-bar` is toggled by `initBulkActionForms` alongside `bulk-bar--visible`. */
body.has-bulk-bar .app-content {
  padding-bottom: 6rem;
}

/* B1 (WCAG 1.4.10): from 768 to ~1280 px the full set of actions is wider than the space next to
   the sidebar. The bar keeps its max-content width where it fits and otherwise wraps the actions
   onto a second row inside its max-width, so no button ever leaves the viewport. */
.bulk-bar__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) and (max-width: 1279.98px) {
  /* Two rows of bar (about 7 rem with its 24 px offset) must not cover the last rows. */
  body.has-bulk-bar .app-content {
    padding-bottom: 9rem;
  }
}
.bulk-bar__count {
  color: var(--app-on-accent);
  font-size: 0.9375rem;
  white-space: nowrap;
}

.bulk-bar__count strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.bulk-bar__divider {
  flex-shrink: 0;
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.25);
}

.bulk-bar__control {
  height: var(--h-control-sm);
  padding: 0 0.75rem;
  border-radius: var(--r-control-sm);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--app-on-accent);
  font-size: 0.9375rem;
  white-space: nowrap;
  /* Selects are the elastic items: they shrink (ellipsis) before the action button
     or the count do, so the bar never pushes past the viewport. */
  flex-shrink: 1;
  min-width: 0;
  /* A select sizes to its widest <option>; a long tag name must not stretch the bar. */
  max-width: 18rem;
  text-overflow: ellipsis;
}

.bulk-bar__control option {
  color: var(--app-ink);
  background: var(--app-panel);
}

.bulk-bar__btn {
  height: var(--h-control-sm);
  padding: 0 0.9rem;
  border-radius: var(--r-control-sm);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--app-on-accent);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* The destructive action is an outline, never the loudest control in the bar, and sits last. */
.bulk-bar__btn--danger {
  border-color: var(--bs-danger);
  background: transparent;
  color: #ff8a95;
}

.bulk-bar__btn--danger:hover:not(:disabled) {
  background: var(--bs-danger);
  color: #fff;
}

/* "Další" holds export + archive on phones (< 576 px); from there up they are bar buttons. */
.bulk-bar__more {
  display: none;
}

@media (max-width: 575.98px) {
  .bulk-bar__wide {
    display: none !important;
  }
  .bulk-bar__more {
    display: block;
  }
}
/* Inline picker (Tom Select) that replaces its button while it is open. The list opens upward:
   the bar is docked at the bottom edge, so a downward list would run off the screen. */
.bulk-bar__picker {
  display: flex;
  align-items: center;
}

.bulk-bar__picker-field {
  width: 14rem;
  max-width: 100%;
}

.bulk-bar__picker-field[hidden] {
  display: none;
}

.bulk-bar__picker-field .ts-wrapper {
  min-width: 0;
}

.bulk-bar__picker-field .ts-control {
  min-height: var(--h-control-xs);
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  font-size: 0.8125rem;
}

.bulk-bar__picker-field .ts-dropdown {
  top: auto;
  bottom: 100%;
  margin: 0 0 4px;
  color: var(--app-ink);
}

.bulk-bar__control:hover,
.bulk-bar__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.bulk-bar__btn:disabled {
  opacity: 0.5;
}

.bulk-bar__close {
  flex-shrink: 0;
  width: var(--h-icon-btn);
  height: var(--h-icon-btn);
  border: 0;
  border-radius: var(--r-control-sm);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  line-height: 1;
}

.bulk-bar__close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--app-on-accent);
}

.bulk-bar__banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8125rem;
}

.bulk-bar__banner-action {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--app-on-accent);
  font-size: 0.75rem;
  text-decoration: underline;
}

.bulk-bar :focus-visible {
  outline: 2px solid var(--app-on-accent);
  outline-offset: 1px;
}

/* Phones: docked above the floating tab bar (56 px bar + 4 px padding + 8 px gaps). */
@media (max-width: 767.98px) {
  .bulk-bar {
    left: 8px;
    right: 8px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-width: none;
    padding: 0.7rem 0.75rem;
  }
  /* Docked full-width: controls wrap onto their own rows instead of shrinking. */
  .bulk-bar__main {
    flex-wrap: wrap;
  }
  .bulk-bar__control,
  .bulk-bar__btn {
    min-height: 2.75rem;
    padding: 0 0.6rem;
    font-size: 0.875rem;
  }
  .bulk-bar__count {
    font-size: 0.875rem;
  }
  .bulk-bar {
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  }
  .bulk-bar__close {
    width: 2.75rem;
    height: 2.75rem;
  }
  /* Count and × share the first row; the actions follow: the bar stays a thin strip. */
  .bulk-bar__main {
    gap: 0.4rem;
  }
  .bulk-bar__control {
    max-width: 100%;
  }
  .bulk-bar__divider {
    display: none;
  }
  /* Bar + tab bar both float over the bottom edge: reserve room for the pair. */
  body.has-bulk-bar .app-content {
    padding-bottom: calc(15rem + env(safe-area-inset-bottom));
  }
}
/* Phone: the 22 px selection checkboxes get a 44 px hit area (UX gate m6/d) without growing. */
@media (max-width: 767.98px) {
  .js-bulk-select-row,
  .js-bulk-select-all {
    position: relative;
  }
  .js-bulk-select-row::after,
  .js-bulk-select-all::after {
    content: "";
    position: absolute;
    inset: -0.7rem;
  }
}
/* Shared page header (§7.1) — title, subtitle or richer identity lead, right-aligned
   actions. */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 24px;
}

/* The lead must be allowed to shrink, or a long title pushes the actions off-screen
   instead of wrapping (flex items default to min-width: auto). */
.page-header__lead {
  flex: 1 1 24rem;
  min-width: 0;
  /* A long unbroken word in a title must wrap instead of widening the page. */
  overflow-wrap: anywhere;
}

/* Detail headers that keep their own h2 + badge and an outer mb-3 (lead, project, ...):
   no extra bottom padding, and a tighter gap when the actions wrap under the title. */
/* Utility: lets a flex child shrink below its content (flex items default to
   min-width: auto). Used by row text blocks that sit next to a button group. */
.min-w-0 {
  min-width: 0;
}

.page-header--compact {
  padding-bottom: 0;
  gap: 0.75rem;
  align-items: center;
}

.page-header__back {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--app-muted);
  text-decoration: none;
}

/* The topbar breadcrumb already links back on tablets and desktops; the link is the phone's
   way back (the breadcrumb collapses to the current segment there). */
@media (min-width: 768px) {
  .page-header__back {
    display: none;
  }
}
.page-header__back:hover {
  color: var(--app-ink);
  text-decoration: underline;
}

.page-header__title {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--app-ink);
}

@media (max-width: 767.98px) {
  .page-header__title {
    font-size: 2.25rem;
  }
}
.page-header__subtitle {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 400;
  color: var(--app-muted);
}

/* Richer lead (§8.3, `meta_template`): the title shares a row with badges and a status
   dot, and a one-line meta sits under it. Used by detail screens. */
.page-header__identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.page-header__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--app-muted);
  min-width: 0;
}

.page-header__meta-sep {
  color: var(--app-line-strong);
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* An actions template whose every button is permission-gated renders an empty wrapper;
   it must not claim the flex gap. page_header.html wraps the include in {% spaceless %}
   so that the div really is :empty (whitespace would defeat the selector).

   !important is required here: a screen that also renders a mobile action bar (see mobile_action_bar) passes actions_class="d-none d-lg-flex" so the header copy
   is hidden below the breakpoint the mobile bar owns. Bootstrap's .d-lg-flex itself
   carries !important at >=lg, which would otherwise beat this plain `display: none` and
   force an empty, but visible, flex wrapper back open for a view-only user (no action
   perms at all -> nothing to show in either place). Matching !important here restores
   correct precedence: :empty (specificity 0,0,2,0) then wins over .d-lg-flex
   (0,0,1,0) regardless of source order, so the wrapper stays collapsed at every
   breakpoint whenever it truly has no content. */
.page-header__actions:empty {
  display: none !important;
}

/* Shared empty state (§7.4, rule 8) — icon tile, one sentence, one action. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.75rem 1rem;
}

.empty-state__tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
  border-radius: 14px;
  background: var(--app-accent-tint);
  color: var(--app-ink);
  font-size: 1.25rem;
}

.empty-state--neutral .empty-state__tile {
  background: var(--app-sunk);
  color: var(--app-muted);
}

.empty-state__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--app-ink);
}

.empty-state__text {
  margin: 0;
  max-width: 340px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--app-muted);
}

.empty-state__action {
  margin-top: 0.5rem;
}

/* Same reasoning as .page-header__actions:empty — a fully permission-gated action
   template leaves an empty wrapper that would still contribute margin and flex gap.
   empty_state.html wraps the include in {% spaceless %} to keep the div truly empty. */
.empty-state__action:empty {
  display: none;
}

.empty-state__action .btn {
  min-height: 44px;
}

.modal-content {
  border-radius: var(--r-card);
  border: 1px solid var(--app-line);
  box-shadow: var(--shadow-float);
  background: var(--app-panel);
}

/* Our forms wrap header, body and footer in a <form> inside .modal-content. Bootstrap's scrollable
   layout expects those three as direct children of the flex column, so the form takes over that
   role: the body scrolls, the header and the footer (buttons, errors) stay in view. */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}

.modal-dirty-guard {
  flex: 0 0 100%;
}

.modal-header {
  border-bottom: 1px solid var(--app-line-soft);
}

.modal-header,
.modal-footer {
  padding: 1rem 1.5rem;
}

.modal-body {
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--app-line-soft);
  gap: 0.5rem;
}

.modal-title {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .modal .modal-dialog.modal-fullscreen-sm-down .modal-content {
    height: 100dvh;
    border-radius: 0;
  }
  .modal .modal-dialog.modal-fullscreen-sm-down .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--app-panel);
  }
  .modal .modal-dialog.modal-fullscreen-sm-down .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
  }
  .modal .modal-dialog.modal-fullscreen-sm-down .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--app-panel);
    border-top: 1px solid var(--app-line);
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
}
.nav-tabs,
.screen-tabs {
  --bs-nav-tabs-border-width: 0;
  --bs-nav-tabs-border-radius: 13px;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: 17px;
  background: var(--app-sunk);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 16px;
}

.nav-tabs .nav-item {
  flex: 0 0 auto;
  margin: 0;
}

.nav-tabs .nav-link,
.screen-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--app-ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}

.nav-tabs .nav-link:hover,
.screen-tab:hover {
  background: color-mix(in srgb, var(--app-panel) 55%, transparent);
  color: var(--app-ink);
  text-decoration: none;
}

/* The active segment is a raised panel on the sunk track (only ~1.2:1), so it also carries an
   ink hairline and a heavier weight: the state never relies on that tint alone. */
.nav-tabs .nav-link.active,
.screen-tab.is-active {
  background: var(--app-panel);
  color: var(--app-ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 24, 31, 0.08), inset 0 0 0 1.5px var(--app-ink-4);
}

/* Keyboard focus lives INSIDE the segment: the track scrolls (overflow-x: auto), which would
   clip an outer outline and halo. */
.nav-tabs .nav-link:focus-visible,
.nav-tabs .nav-link.active:focus-visible,
.screen-tab:focus-visible {
  outline: 2px solid var(--app-ink);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 5px var(--signal);
}

/* A strip that scrolls fades its right edge (set by app.js) so a cut label reads as "more". */
.nav-tabs.has-overflow:not(.at-end),
.screen-tabs.has-overflow:not(.at-end) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}

/* Counts, in every tab strip: a small tabular pill, signal-filled on the active segment. */
.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin: 0;
  border-radius: 10px;
  background: var(--app-panel);
  color: var(--app-ink-2);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.nav-tabs .nav-link.active .tab-count,
.screen-tab.is-active .tab-count {
  background: var(--signal);
  color: var(--on-signal);
}

.detail-tabs {
  display: flex;
  width: fit-content;
}

@media (max-width: 767.98px) {
  .nav-tabs,
  .screen-tabs {
    display: flex;
    width: 100%;
  }
  .nav-tabs .nav-link,
  .screen-tab {
    padding: 0 12px;
    font-size: 0.875rem;
  }
}
.toast--success {
  background-color: var(--fill);
  color: var(--app-on-accent);
}

.toast--success .toast-body::before {
  content: "\f26a";
  font-family: "bootstrap-icons";
  margin-right: 0.5rem;
  color: #82D9A1;
  vertical-align: -0.1em;
}

.toast--error {
  background-color: var(--toast-danger);
  color: var(--app-on-accent);
}

.toast--warning {
  background-color: var(--signal);
  color: var(--on-signal);
}

.toast--warning .btn-close {
  filter: none;
}

.toast--info {
  background-color: var(--fill);
  color: var(--app-on-accent);
}

.toast .toast-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.toast {
  --bs-toast-border-radius: var(--r-panel);
  --bs-toast-box-shadow: var(--shadow-float);
  --bs-toast-font-size: 0.9375rem;
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-float);
}

.toast .toast-body {
  padding: 0.875rem 1rem;
}

.toast .toast-action {
  align-self: center;
  margin-right: 0.25rem;
  min-height: 40px;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--r-control-sm);
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 600;
}
.toast .toast-action:hover {
  background: var(--signal-hover);
  color: var(--on-signal);
}

.toast .btn-close {
  min-width: 44px;
  min-height: 44px;
  margin: 0 !important;
}

.toast-container.app-toasts {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 1080;
  padding: 1rem;
}

body.modal-open .toast-container.app-toasts:not(:has(.toast--error, .toast--warning)) {
  z-index: 1040;
}

@media (max-width: 575.98px) {
  .toast-container.app-toasts {
    left: 0;
    padding: 0.5rem;
  }
  .toast-container.app-toasts .toast {
    width: 100%;
  }
}
.demo-banner {
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  padding: 8px 16px;
  margin: 12px 12px 0;
  border-radius: var(--r-control);
}

.tag-chip {
  --chip: var(--app-neutral-fg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 10px 2px 8px;
  border-radius: var(--r-badge);
  background: color-mix(in srgb, var(--chip) 14%, var(--app-panel));
  color: var(--app-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.tag-chip::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--chip);
}

.tag-usage {
  display: inline-block;
  margin-right: 12px;
  white-space: nowrap;
}

.tag-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-swatches > .tag-swatch {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  cursor: pointer;
}

.tag-swatch .tag-swatch__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.tag-swatch .tag-swatch__dot {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.tag-swatch__input:checked + .tag-swatch__dot {
  border-color: var(--app-surface, #fff);
  box-shadow: 0 0 0 3px var(--swatch);
}

.tag-swatch__input:focus-visible + .tag-swatch__dot {
  outline: 2px solid var(--app-ink);
  outline-offset: 3px;
}

.tag-swatches__preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* In-page help panels ({% page_help %}) and the "Průvodce" guide page. */
.help-topic {
  margin-bottom: 1rem;
  min-width: 0;
  /* display on .btn-row-icon / .help-panel would otherwise win over the hidden attribute */
}
.help-topic [hidden] {
  display: none !important;
}

.help-topic > .help-reopen {
  display: flex;
  align-items: center;
  gap: 0.4rem; /* the icon must not touch the word */
  margin-left: auto;
}

/* Collapsed: the re-open button leaves the content flow and sits in the topbar row, left of the
   theme toggle (it used to float alone under the primary action). `.app-content` is the
   positioning context; 44 px is the topbar row height, 52 px the toggle plus a gap. */
.help-topic[data-help-state=collapsed] {
  margin: 0;
}

.help-topic[data-help-state=collapsed] > .help-reopen {
  position: absolute;
  z-index: 1021; /* above the topbar strip it overlaps (1020) */
  top: -44px;
  right: 84px;
  margin: 0;
}

@media (max-width: 1099.98px) {
  .help-topic[data-help-state=collapsed] > .help-reopen {
    right: 76px;
  }
}
/* Phones: icon only (the label stays as aria-label). */
@media (max-width: 767.98px) {
  .help-topic[data-help-state=collapsed] > .help-reopen {
    right: 60px;
    font-size: 0;
    width: 44px;
    padding: 0;
  }
  .help-topic[data-help-state=collapsed] > .help-reopen > .bi {
    font-size: 1.25rem;
  }
}
.help-panel {
  background: var(--app-bg-2);
  border: 1px solid var(--app-line);
  border-radius: var(--r-panel);
  padding: 1rem 1.25rem 1.125rem;
  color: var(--app-ink-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.help-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.help-panel__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--app-ink);
}
.help-panel__title .bi {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--signal-soft);
  color: var(--app-ink);
}

.help-panel__lead {
  margin: 0 0 0.75rem;
}

.help-panel__more > summary {
  cursor: pointer;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--app-ink);
}

.help-panel__more[open] > summary {
  margin-bottom: 0.5rem;
}

.help-panel__subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--app-ink);
}

.help-panel__hint {
  margin: 0 0 0.25rem;
  color: var(--app-muted);
}

.help-panel__list {
  margin: 0;
  padding-left: 1.1rem;
}
.help-panel__list li + li {
  margin-top: 0.25rem;
}

.help-panel__list--examples {
  font-style: italic;
  color: var(--app-ink-4);
}

.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.guide-step__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.guide-step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 600;
  font-size: 0.875rem;
}

.guide-step__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.guide-step__text {
  margin: 0 0 0.4rem;
  color: var(--app-ink-2);
}

.guide-step__mcp {
  margin: 0;
  font-size: 0.875rem;
  color: var(--app-muted);
}

/* Glossary triggers ({% help_term %}): a real button with the info icon, next to a label or in
   a legend above a table (a card table hides its <thead> on phones). 24 px minimum target. */
.help-term {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0 0.2rem;
  border: 0;
  border-radius: var(--r-control, 0.375rem);
  background: transparent;
  color: var(--app-muted);
  font: inherit;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}
.help-term:hover {
  color: var(--app-ink, inherit);
}
.help-term:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

/* A phone or tablet: the tap target is 44 px (viewports), the legend wraps around it. */
@media (pointer: coarse) {
  .help-term {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}
.help-term--label {
  padding: 0 0.4rem;
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.help-terms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  min-width: 0;
}

.help-details {
  font-size: 0.875rem;
  color: var(--app-muted);
}
.help-details > summary {
  cursor: pointer;
}

.help-details__body {
  margin-top: 0.4rem;
}

.table-container {
  container: list-card/inline-size;
}

@media (min-width: 992px) {
  .col-w-880 {
    display: none;
  }
  .col-w-1060 {
    display: none;
  }
  .col-w-1160 {
    display: none;
  }
  .col-w-1310 {
    display: none;
  }
  @container list-card (min-width: 880px) {
    .col-w-880 {
      display: table-cell;
    }
  }
  @container list-card (min-width: 1060px) {
    .col-w-1060 {
      display: table-cell;
    }
  }
  @container list-card (min-width: 1160px) {
    .col-w-1160 {
      display: table-cell;
    }
  }
  @container list-card (min-width: 1310px) {
    .col-w-1310 {
      display: table-cell;
    }
  }
}
@media (min-width: 992px) {
  .table-near .col-nw-880 {
    display: none;
  }
  @container list-card (min-width: 1000px) {
    .table-near .col-nw-880 {
      display: table-cell;
    }
  }
  .table-near .col-w-880 {
    display: none;
  }
  .table-near .col-w-1060 {
    display: none;
  }
  .table-near .col-w-1160 {
    display: none;
  }
  .table-near .col-w-1310 {
    display: none;
  }
  @container list-card (min-width: 1000px) {
    .table-near .col-w-880 {
      display: table-cell;
    }
  }
  @container list-card (min-width: 1180px) {
    .table-near .col-w-1060 {
      display: table-cell;
    }
  }
  @container list-card (min-width: 1280px) {
    .table-near .col-w-1160 {
      display: table-cell;
    }
  }
  @container list-card (min-width: 1430px) {
    .table-near .col-w-1310 {
      display: table-cell;
    }
  }
}
.person-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.avatar-initials {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--app-accent-tint);
  border: 1px solid var(--app-accent-tint-2);
  color: var(--app-accent-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.prof-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-badge);
  background: var(--app-sunk);
  color: var(--app-ink-3);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
}

.prof-chip--primary {
  color: var(--app-ink);
  font-weight: 600;
}

.dot-status--off {
  color: var(--app-danger-fg);
}

.dot-status--off .dot-status__dot {
  background: var(--app-danger-fg);
}

.contact-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.contact-whatsapp {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  border-radius: var(--r-control-sm);
  color: var(--app-ok-fg);
}
.contact-whatsapp:hover {
  background: var(--app-ok-bg);
}

@media (max-width: 991.98px) {
  .table-mobile-cards td.cell-availability,
  .table-mobile-cards td.cell-contact {
    display: block;
  }
  .table-mobile-cards td.cell-availability::before {
    display: none;
  }
  .table-mobile-cards td.cell-title .person-cell {
    min-height: 44px;
  }
  .contact-line .contact-call {
    flex: 1 1 auto;
  }
}
@media (max-width: 991.98px), (pointer: coarse) {
  .contact-whatsapp {
    min-width: 44px;
    min-height: 44px;
  }
}
@media (min-width: 992px) {
  .table-mobile-cards td.cell-availability {
    white-space: normal;
    min-width: 7.5rem;
  }
  .cell-availability .cell-identity__meta {
    max-width: 13rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
}
@media (min-width: 992px) {
  .table-mobile-cards td.cell-title.cell-person {
    min-width: 10rem;
  }
  .table-mobile-cards td.cell-tags.cell-narrow {
    min-width: 8rem;
  }
  .table-mobile-cards td.cell-tags.cell-profs {
    min-width: 8rem;
  }
  .table-container:has(.col-sticky-end) {
    overflow-x: auto;
  }
  .table-mobile-cards td.cell-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 8rem;
  }
  .table-mobile-cards .col-sticky-end {
    position: sticky;
    right: 0;
    background: var(--bs-table-bg, var(--app-panel));
    z-index: 1;
  }
  .table-mobile-cards .col-sticky-end:has(.dropdown-menu.show) {
    z-index: 1035;
  }
}
.doc-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

@media (max-width: 991.98px) {
  .table-mobile-cards td.cell-docs--empty {
    display: none;
  }
}
@media (min-width: 992px) {
  .table-mobile-cards td.cell-docs {
    white-space: normal;
    min-width: 8rem;
  }
  .doc-alert {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-width: min(100%, 14rem);
    border-radius: 0.875rem;
  }
}
.contact-whatsapp {
  position: relative;
}

.contact-consent {
  position: absolute;
  right: -2px;
  bottom: -2px;
  font-size: 0.75rem;
  line-height: 1;
  border-radius: 50%;
  background: var(--app-panel);
}

.contact-consent--yes {
  color: var(--app-ok-fg);
}

.contact-consent--no {
  color: var(--app-muted);
}

.contact-whatsapp--unconsented {
  color: var(--app-muted);
}

@media (max-width: 991.98px), (pointer: coarse) {
  .contact-consent {
    right: 9px;
    bottom: 9px;
  }
}
.contact-call__icon {
  display: none;
}

.prof-more {
  display: none;
}

@media (max-width: 991.98px) {
  .table-workers tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.6rem;
    padding-bottom: 0.55rem;
  }
  .table-workers td {
    width: auto;
    padding: 0 0.2rem;
  }
  .table-workers td.cell-title {
    flex: 1 1 100%;
    padding-bottom: 0;
  }
  .table-workers td.cell-profs {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }
  .table-workers td.cell-profs .prof-chip:not(:first-of-type) {
    display: none;
  }
  .table-workers td.cell-profs .prof-more {
    display: inline;
    color: var(--app-muted);
    font-size: 0.8125rem;
  }
  .table-workers td.cell-availability {
    flex: 0 1 auto;
    padding-top: 0;
  }
  .table-workers td.cell-availability .availability-note {
    display: none;
  }
  .table-workers td.cell-worker-contact {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.1rem;
  }
  .table-workers .contact-call {
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .table-workers .contact-call__icon {
    display: inline;
    font-size: 1.15rem;
  }
  .table-workers .contact-call__number {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .table-workers td.cell-docs {
    flex: 1 1 100%;
    padding-top: 0.15rem;
  }
}
/* The document a recruiter arrived for (from Hlídání platnosti): outlined, never colour alone
   (aria-current="true" and the page's back link say where it came from). */
.doc-row--marked > * {
  background-color: var(--app-accent-tint) !important;
}

.doc-row--marked {
  outline: 2px solid var(--app-ink);
  outline-offset: -2px;
}

@media (pointer: coarse) {
  .btn,
  .btn-sm,
  .btn-row-icon,
  .table-footer__size-btn,
  .bulk-bar__btn,
  .bulk-bar__control,
  .bulk-bar__close,
  .toast .toast-action,
  .filter-toggle.btn,
  .sidebar-collapse-btn,
  .help-reopen {
    min-height: 44px;
    min-width: 44px;
  }
  .pagination .page-link,
  .pagination > li > a,
  .pagination > li > span {
    min-height: 44px;
    min-width: 44px;
  }
  .modal-header .btn-close {
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
    background-origin: content-box;
    padding: 14px;
  }
  .filter-chip {
    min-height: 44px;
  }
  .filter-chip-remove {
    width: 44px;
    height: 44px;
  }
  a.tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
  }
  .tag-list,
  td.cell-tags {
    gap: 6px;
  }
  .table td.cell-title a:not(.btn) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .js-bulk-select-all {
    width: 1.375rem;
    height: 1.375rem;
  }
  .contact-card a[href^="tel:"],
  .contact-card a[href^="mailto:"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .bulk-select-strip {
    min-height: 44px;
  }
  .bulk-select-strip .form-check-label {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-left: 0.25rem;
  }
}
@media (max-width: 991.98px) {
  .btn,
  .btn-sm,
  .btn-row-icon,
  .table-footer__size-btn,
  .bulk-bar__btn,
  .bulk-bar__control,
  .bulk-bar__close,
  .toast .toast-action,
  .filter-toggle.btn,
  .sidebar-collapse-btn,
  .help-reopen {
    min-height: 44px;
    min-width: 44px;
  }
  .pagination .page-link,
  .pagination > li > a,
  .pagination > li > span {
    min-height: 44px;
    min-width: 44px;
  }
  .modal-header .btn-close {
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
    background-origin: content-box;
    padding: 14px;
  }
  .filter-chip {
    min-height: 44px;
  }
  .filter-chip-remove {
    width: 44px;
    height: 44px;
  }
  a.tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
  }
  .tag-list,
  td.cell-tags {
    gap: 6px;
  }
  .table td.cell-title a:not(.btn) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .js-bulk-select-all {
    width: 1.375rem;
    height: 1.375rem;
  }
  .contact-card a[href^="tel:"],
  .contact-card a[href^="mailto:"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .bulk-select-strip {
    min-height: 44px;
  }
  .bulk-select-strip .form-check-label {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-left: 0.25rem;
  }
}
.sidebar-brand-link {
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
}

.modal-header .btn-close.btn-close--touch {
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
  background-origin: content-box;
  padding: 14px;
}

/* Nástěnka: widget cards, chips, states. Count tiles reuse .home-tile (cards.scss). */
/* A widget card is tighter than a content card: its box is fixed, so every pixel counts. */
.dash-card > .card-body {
  padding: 0.75rem 1rem;
}

.dash-card__title {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--app-ink-2);
}
.dash-card__title a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}
.dash-card__title a:hover, .dash-card__title a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dash-card__big {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.5rem;
}

.dash-card__unit,
.dash-note {
  font-size: 0.875rem;
  color: var(--app-muted);
}

.dash-note {
  margin: 0.5rem 0 0;
  overflow-wrap: anywhere;
}

.dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: var(--r-badge);
  background: var(--app-sunk);
  color: var(--app-ink-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.dash-chip:hover, .dash-chip:focus-visible {
  color: var(--app-ink);
  box-shadow: inset 0 0 0 1px var(--app-line-strong);
}
.dash-chip {
  /* Alerts are caution colours AND carry text (never colour alone). */
}
.dash-chip--caution {
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
}
.dash-chip--danger {
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
}

.dash-nearest {
  margin-top: 0.75rem !important;
}
.dash-nearest li {
  align-items: center;
}

.dash-nearest__what {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-nearest__renew {
  flex: none;
}

.dash-error {
  align-items: flex-start;
  border-color: var(--app-danger-line);
  background: var(--app-danger-bg);
}

.dash-error__text {
  font-size: 0.875rem;
  color: var(--app-danger-fg);
}

.dash-skeleton {
  gap: 0.75rem;
}

.dash-skeleton__bar {
  display: block;
  height: 0.9rem;
  border-radius: var(--r-badge);
  background: var(--app-sunk);
}
.dash-skeleton__bar--label {
  width: 55%;
}
.dash-skeleton__bar--value {
  width: 30%;
  height: 2rem;
}

@media (prefers-reduced-motion: no-preference) {
  .dash-skeleton__bar {
    animation: dash-pulse 1.4s ease-in-out infinite;
  }
}
@keyframes dash-pulse {
  50% {
    opacity: 0.55;
  }
}
/* Name links in a widget (a worker, a client) are real 44 px targets. */
.dash-nearest .home-recent__name,
.home-recent .home-recent__name {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.dash-error__retry {
  min-height: 44px;
}

/* ---- The board: a grid where widgets of different width x height pack together (R51) --------
   Presets (width x height in cells): s 1x1, m 2x1, l 2x2, w 4x1 (full width), t 1x2 (tall).
   4 columns from 1200 px, 2 from 576 px, 1 below: there every widget spans the full width and the
   height preset only sets a minimum height. Rows have a fixed height token. No dense packing: the
   role default boards are built to tile the grid, a user's own board may have holes. */
.dash-board {
  --dash-row: 14rem;
  --dash-gap: 1rem;
  --dash-cols: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* sparse (the default): what you see is the order you tab through and the list shows (R52) */
  grid-auto-flow: row;
  gap: var(--dash-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-cell {
  --w2: 1;
  --w4: 1;
  --h: 1;
  grid-column: 1/-1;
  min-width: 0;
  min-height: calc(var(--dash-row) * var(--h) + var(--dash-gap) * (var(--h) - 1));
  /* the cell's box is its widget's box */
}
.dash-cell > .card,
.dash-cell > .home-tile,
.dash-cell > .dash-tile {
  height: 100%;
}
.dash-cell--m {
  --w2: 2;
  --w4: 2;
}
.dash-cell--l {
  --w2: 2;
  --w4: 2;
  --h: 2;
}
.dash-cell--w {
  --w2: 2;
  --w4: 4;
}
.dash-cell--t {
  --h: 2;
}

@media (min-width: 576px) {
  .dash-board {
    --dash-cols: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: var(--dash-row);
  }
  .dash-cell {
    grid-column: span var(--w2);
    grid-row: span var(--h);
    min-height: 0;
    /* a widget shows what its size fits ("a další N →" for the rest), so it never scrolls */
  }
  .dash-cell > .dash-card {
    min-height: 0;
  }
}
@media (min-width: 1200px) {
  .dash-board {
    --dash-cols: 4;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .dash-cell {
    grid-column: span var(--w4);
  }
}
.dash-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}
.dash-toolbar .btn {
  min-height: 44px;
}

/* ---- Edit mode ("Upravit nástěnku") -------------------------------------------------------- */
.dash-edit__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dash-edit__head .btn {
  min-height: 44px;
}

.dash-edit__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}
.dash-edit__title:focus-visible {
  outline: 2px solid var(--app-ink);
  outline-offset: 4px;
}

.dash-edit__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.dash-edit__tools .btn {
  min-height: 44px;
}

.dash-edit__error {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--r-badge);
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
  font-size: 0.9375rem;
}

.dash-edit__catalog {
  margin: 0 0 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--app-line);
  border-radius: var(--r-card);
  background: var(--app-panel);
}

.dash-edit__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--app-line-softest);
}
.dash-edit__item:last-child {
  border-bottom: 0;
}
.dash-edit__item .btn {
  min-height: 44px;
}

.dash-edit__what {
  flex: 1 1 14rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dash-sizechip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.35rem;
}

/* The drag handle: a 44 px target; only it starts a drag, so the page still scrolls by touch. */
.dash-edit__grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--app-muted);
  font-size: 1.25rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.dash-edit__select {
  flex: 1 1 8rem;
  min-width: 0;
  min-height: 44px;
}

.dash-edit__icon {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}
.dash-edit__icon[aria-disabled=true] {
  opacity: 0.45;
  cursor: default;
}

.dash-edit__remove {
  flex: none;
  min-height: 44px;
}

/* The shape of a preset, drawn: 1 cell = 0.6 rem. */
.dash-shape {
  display: inline-block;
  flex: none;
  box-sizing: border-box;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid currentColor;
  border-radius: 3px;
}
.dash-shape--m {
  width: 1.8rem;
}
.dash-shape--l {
  width: 1.8rem;
  height: 1.8rem;
}
.dash-shape--w {
  width: 3.2rem;
}
.dash-shape--t {
  height: 1.8rem;
}

/* The "a další N →" line under a list that shows only what its box fits. */
.dash-more {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}
.dash-more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--app-ink-2);
  text-underline-offset: 3px;
}

/* Edit mode: the real widget, dimmed and inert, with a control bar over its bottom edge. */
/* The tile itself never clips (a select or menu inside must open freely, UI checklist 13): the
   preview strip and the bar round their own corners instead. */
.dash-tile {
  position: relative;
  height: 100%;
  border: 2px dashed var(--app-line-strong);
  border-radius: var(--r-card);
  background: var(--app-panel);
}

.dash-tile__body {
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--r-card) - 2px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}
.dash-tile__body > .card,
.dash-tile__body > .home-tile,
.dash-tile__body > .dash-error,
.dash-tile__body > .dash-skeleton {
  height: 100%;
}

.dash-tile__bar {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  background: var(--app-panel);
  border-top: 1px solid var(--app-line);
  border-radius: 0 0 calc(var(--r-card) - 2px) calc(var(--r-card) - 2px);
}

.dash-tile__bar .dash-edit__select {
  flex: 1 1 0;
  padding-left: 0.6rem;
  padding-right: 1.75rem;
  font-size: 0.875rem;
  background-position: right 0.5rem center;
}

.dash-tile__name {
  display: none;
  flex: 1 1 0;
  min-width: 0;
  font-weight: 600;
  color: var(--app-ink);
  overflow-wrap: anywhere;
}

/* Empty cells of the grid show as dots, so a user can see where a widget would fit. */
.dash-board--edit {
  background-image: radial-gradient(circle at 50% 50%, var(--app-line-strong) 2px, transparent 2.5px);
  background-size: calc((100% + var(--dash-gap)) / var(--dash-cols)) calc(var(--dash-row) + var(--dash-gap));
  background-position: calc(var(--dash-gap) / -2) calc(var(--dash-gap) / -2);
}

.dash-flash {
  outline: 3px solid var(--app-accent, #f5c400);
  outline-offset: 2px;
  border-radius: var(--r-card);
}

.dash-edit__add {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 0.5rem;
}
.dash-edit__add .dash-edit__select {
  flex: 0 1 11rem;
}

.dash-edit__phone-note {
  display: none;
}

@media (max-width: 575.98px) {
  .dash-edit__phone-note {
    display: inline;
  }
  /* one column, auto heights: the presets show nothing here, so the edit tile is a compact row */
  .dash-tile__body,
  .dash-tile [data-edit-size],
  .dash-edit__row [data-edit-size] {
    display: none;
  }
  .dash-board--edit {
    background-image: none;
  }
  .dash-board--edit .dash-cell {
    min-height: 0;
  }
  .dash-tile {
    height: auto;
  }
  .dash-tile__bar {
    position: static;
    border-top: 0;
  }
  .dash-tile__name {
    display: block;
  }
}
.dash-edit__empty {
  margin-top: 1rem;
}

.dash-edit__listbox {
  margin: 0 0 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--app-line);
  border-radius: var(--r-card);
  background: var(--app-panel);
}

.dash-edit__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-edit__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--app-line-softest);
}

.dash-edit__name {
  flex: 1 1 8rem;
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.dash-edit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* SortableJS states. */
.sortable-ghost {
  opacity: 0.4;
}

.sortable-drag,
.sortable-fallback {
  box-shadow: var(--shadow-pop);
  opacity: 0.95;
}

/* ---- Statistics widgets (Chart.js canvas + the same numbers as a table) ---------------------
   The chart box has a fixed height per size preset, so a widget never scrolls: the size decides
   how many bars (limits in stats.py) and the rest is the "a další N ..." link. */
.dash-chart {
  position: relative;
  min-width: 0;
  height: 7rem;
}
.dash-chart canvas {
  display: block;
  max-width: 100%;
}

.dash-cell--m .dash-chart {
  height: 5.5rem;
}

.dash-cell--w .dash-chart {
  height: 6.5rem;
}

.dash-cell--l .dash-chart {
  height: 17rem;
}

.dash-cell--t .dash-chart {
  height: 12.5rem;
}

.dash-cell--l .dash-chart--share,
.dash-cell--w .dash-chart--share {
  height: 3.5rem;
}

.dash-chart__caption {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
}

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.dash-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  color: var(--app-ink-2);
  font-size: 0.875rem;
  text-decoration: none;
}
.dash-legend__item:hover, .dash-legend__item:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dash-legend__swatch {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}
.dash-legend__swatch--1 {
  background: var(--chart-1);
}
.dash-legend__swatch--2 {
  background: var(--chart-2);
}
.dash-legend__swatch--3 {
  background: var(--chart-3);
}
.dash-legend__swatch--4 {
  background: var(--chart-4);
}

/* Chart head: title and the one "Zobrazit jako tabulku" control share a row. */
.dash-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 0.75rem;
  min-width: 0;
}
.dash-chart-head .dash-card__title {
  flex: 1 1 auto;
  min-width: 0;
}

.dash-chart-head__table {
  flex: none;
  min-height: 44px;
}

.dash-chart-table th,
.dash-chart-table td {
  font-variant-numeric: tabular-nums;
}
.dash-chart-table td a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.dash-chart__asof {
  white-space: nowrap;
}

.dash-cell--m .dash-chart--share {
  height: 2rem;
}

.geo-hint {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--r-badge);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.geo-hint--failed {
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
}
.geo-hint--pending {
  background: var(--app-sunk);
  color: var(--app-muted);
}

@media (max-width: 991.98px) {
  .cell-identity__meta .geo-hint__text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.geo-map {
  position: relative;
  z-index: 0;
  width: 100%;
  min-width: 0;
  height: min(52vh, 380px);
  min-height: 260px;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--r-control);
  overflow: hidden;
  background: var(--app-sunk);
}
.geo-map .leaflet-bar a {
  width: 44px;
  height: 44px;
  line-height: 44px;
}
.geo-map .leaflet-control-attribution {
  font-size: 0.75rem;
}

.geo-map-note {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  z-index: 1000;
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--r-control-sm);
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
  font-size: 0.875rem;
}

.geo-pin-icon {
  background: transparent;
  border: 0;
}

.geo-pin {
  display: block;
  width: 32px;
  height: 32px;
  overflow: visible;
}
.geo-pin path {
  fill: #1e2229;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.geo-pin .geo-pin-dot {
  fill: #ffffff;
}

.leaflet-marker-icon.leaflet-interactive:focus-visible {
  outline: 3px solid var(--app-ink);
  outline-offset: 2px;
  border-radius: 6px;
}

.geo-pin--circle path {
  fill: #1e2229;
}

.geo-pin--square path {
  fill: #1d6b3a;
}

.geo-pin--diamond path {
  fill: #5a606a;
}

.geo-legend-shape {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -4px;
}
.geo-legend-shape .geo-pin {
  width: 18px;
  height: 18px;
}

.geo-screen {
  min-width: 0;
}

.geo-skip {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.geo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  min-width: 0;
  margin-bottom: 0.5rem;
}

.geo-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.geo-layer {
  margin: 0;
}

.geo-notes {
  min-width: 0;
}

.geo-note {
  margin: 0 0 0.5rem;
  padding: 4px 0;
  color: var(--app-muted);
  font-size: 0.875rem;
}
.geo-note--error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 12px;
  border-radius: var(--r-control-sm);
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
}
.geo-note--error[hidden] {
  display: none;
}
.geo-note--warn {
  padding: 6px 10px;
  border-radius: var(--r-control-sm);
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
}

.geo-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.geo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}
@media (min-width: 992px) {
  .geo-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }
}

.geo-map-wrap {
  min-width: 0;
}

.geo-map--screen {
  height: clamp(420px, 100vh - 22rem, 640px);
  height: clamp(420px, 100dvh - 22rem, 640px);
}
@media (max-width: 575.98px) {
  .geo-map--screen {
    height: clamp(280px, 100vh - 33rem, 560px);
    height: clamp(280px, 100dvh - 33rem, 560px);
  }
}
@media (min-width: 992px) {
  .geo-map--screen {
    height: clamp(480px, 100vh - 320px, 780px);
  }
}

.geo-panel {
  min-width: 0;
}
@media (min-width: 992px) {
  .geo-panel {
    max-height: clamp(480px, 100vh - 320px, 780px);
    overflow-y: auto;
    border: 1px solid var(--app-line);
    border-radius: var(--r-card, 8px);
    background: var(--app-panel);
  }
}

.geo-panel .geo-panel__body {
  min-width: 0;
}
@media (min-width: 992px) {
  .geo-panel .geo-panel__body {
    display: block;
    padding: 1rem;
    overflow-y: visible;
  }
}

.geo-panel__title,
.geo-panel__subtitle {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.geo-panel__subtitle {
  margin-top: 1rem;
}

.geo-filters .filter-group {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.geo-field {
  margin-bottom: 0.5rem;
  min-width: 0;
}

.geo-filters__footer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.near-pill-row {
  margin: 0 0 0.5rem;
}

button.near-pill__remove {
  border: 0;
  background: transparent;
}

.geo-card-region {
  min-width: 0;
  margin-top: 0.75rem;
}

.geo-card-hint {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.875rem;
}

.geo-card {
  padding: 0.75rem;
  border: 1px solid var(--app-line);
  border-radius: var(--r-control);
  background: var(--app-bg-2);
}

.geo-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.geo-card__text {
  min-width: 0;
}

.geo-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.geo-card__sub,
.geo-card__link {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--app-muted);
  overflow-wrap: anywhere;
}

.geo-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.geo-list-note {
  margin: 0 0 0.5rem;
  color: var(--app-muted);
  font-size: 0.8125rem;
}

.geo-list__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: var(--r-control-sm);
  cursor: pointer;
}
.geo-list__item:hover {
  background: var(--app-line-softest);
}
.geo-list__item:focus-visible {
  outline: 3px solid var(--app-ink);
  outline-offset: -2px;
}
.geo-list__item[aria-current=true] {
  background: var(--app-sunk);
}

.geo-list__shape .geo-pin {
  width: 20px;
  height: 20px;
}

.geo-list__text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.geo-list__name {
  overflow-wrap: anywhere;
  font-weight: 500;
}

.geo-list__sub {
  color: var(--app-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.geo-cluster-icon {
  background: transparent;
  border: 0;
}

.geo-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 3px solid #ffffff;
  background: #1e2229;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.geo-cluster--circle {
  border-radius: 50%;
}
.geo-cluster--square {
  border-radius: 6px;
  background: #1d6b3a;
  color: #ffffff;
}
.geo-cluster--diamond {
  border-radius: 6px;
  background: #5a606a;
  color: #ffffff;
  transform: rotate(45deg);
}
.geo-cluster--diamond .geo-cluster__count {
  transform: rotate(-45deg);
}

.geo-popup {
  min-width: 160px;
  max-width: 240px;
}
.geo-popup__name {
  display: block;
  overflow-wrap: anywhere;
}
.geo-popup__sub {
  margin: 2px 0 8px;
  color: var(--app-muted);
  overflow-wrap: anywhere;
}
.geo-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .leaflet-marker-icon,
  .leaflet-marker-shadow,
  .leaflet-cluster-anim .leaflet-marker-icon {
    transition: none !important;
  }
}
.dash-minimap .card-body {
  display: flex;
  flex-direction: column;
}
.dash-minimap__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  min-width: 0;
}
.dash-minimap__filter {
  flex: 1 1 9rem;
  max-width: 14rem;
  min-width: 0;
}
.dash-minimap__map.geo-map {
  flex: 1 1 120px;
  height: auto;
  min-height: 120px;
  margin: 0.5rem 0;
}
.dash-minimap__table {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
}
.dash-minimap__table th,
.dash-minimap__table td {
  padding: 2px 4px;
}

.dash-cell--t .dash-minimap__map.geo-map {
  flex: 0 0 160px;
  height: 160px;
  min-height: 160px;
}
@media (max-width: 575.98px) {
  .dash-cell--t .dash-minimap__map.geo-map {
    flex-basis: 200px;
    height: 200px;
    min-height: 200px;
  }
}

.filter-toggle.filter-toggle--sheet,
.filter-sheet-header,
.filter-sheet-footer {
  display: none;
}

@media (max-width: 767.98px) {
  .filter-toggle.filter-toggle--inline {
    display: none;
  }
  .filter-toggle.filter-toggle--sheet {
    display: inline-flex;
  }
  .filter-panel-wrap.offcanvas-md {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 1045;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    margin: 0;
    background: var(--app-panel);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.3s ease-in-out;
  }
  .filter-panel-wrap.offcanvas-md.show:not(.hiding), .filter-panel-wrap.offcanvas-md.showing {
    transform: none;
  }
  .filter-panel-wrap.offcanvas-md.show, .filter-panel-wrap.offcanvas-md.showing {
    visibility: visible;
  }
  .filter-panel-wrap.offcanvas-md:not(.show):not(.showing):not(.hiding) {
    transform: translateY(100%);
  }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .filter-panel-wrap.offcanvas-md {
    transition: none;
  }
}
@media (max-width: 767.98px) {
  .filter-panel-wrap.offcanvas-md .filter-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .filter-sheet-header,
  .filter-sheet-footer {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.75rem 1rem;
  }
  .filter-sheet-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--app-line-soft);
  }
  .filter-sheet-header .btn-close {
    box-sizing: border-box;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    margin: -0.5rem -0.75rem -0.5rem 0;
    padding: 0;
    background-position: center;
  }
  .filter-sheet-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
  }
  .filter-sheet-footer {
    border-top: 1px solid var(--app-line-soft);
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .filter-sheet-footer .btn {
    min-height: 2.75rem;
  }
  .filter-panel-wrap .col-md-6 {
    min-width: 0;
  }
}
@media (min-width: 768px) {
  .filter-panel-wrap--static.collapse:not(.show) {
    display: block;
  }
}

@media (min-width: 768px) {
  .ts-filter-toolbar {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .filter-panel--plain {
    padding: 1rem;
  }
}
.inq-status {
  font-weight: 600;
  background: var(--app-sunk);
  color: var(--app-ink);
}

.inq-status--new {
  background: var(--app-info-bg);
  color: var(--app-info-fg);
}

.inq-status--offered {
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
}

.inq-status--won {
  background: var(--app-ok-bg);
  color: var(--app-ok-fg);
}

.inq-status--lost {
  background: var(--app-neutral-bg);
  color: var(--app-neutral-fg);
}

.inq-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: var(--r-panel);
}

.inq-summary__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0;
  min-width: 0;
}
.inq-summary__stats dt {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--app-muted);
}
.inq-summary__stats dd {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}
.inq-summary__stats .is-warn {
  color: var(--app-danger-fg);
}

.inq-summary__hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--app-muted);
}

.inq-staffing-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: var(--app-sunk);
  border-radius: var(--r-control);
}

.inq-staffing-tab {
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-control-sm);
  color: var(--app-ink);
  font-size: 0.875rem;
  text-decoration: none;
}
.inq-staffing-tab:hover {
  background: var(--app-line-softest);
}
.inq-staffing-tab.is-current {
  background: var(--app-panel);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.inq-view-toggle .btn.active {
  background: var(--app-sunk);
  font-weight: 600;
}

.inq-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--gap-grid);
  align-items: start;
}

.inq-tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 1rem;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.inq-tile.is-archived {
  opacity: 0.75;
}
.inq-tile p, .inq-tile ul {
  margin: 0;
}

.inq-tile__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.inq-tile__menu {
  margin-left: auto;
}

.inq-tile__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.inq-tile__title a {
  color: var(--app-ink);
  text-decoration: none;
}
.inq-tile__title a:hover {
  text-decoration: underline;
}

.inq-tile__client,
.inq-tile__period,
.inq-tile__contact,
.inq-tile__billing,
.inq-tile__scope {
  font-size: 0.875rem;
  color: var(--app-ink-3, var(--app-muted));
  overflow-wrap: anywhere;
}

.inq-tile__client {
  color: var(--app-ink);
}

.inq-urgency {
  margin-left: 0.25rem;
  padding: 1px 8px;
  border-radius: var(--r-badge);
  background: var(--app-sunk);
  font-size: 0.8125rem;
  font-weight: 600;
}
.inq-urgency.is-soon {
  background: var(--signal-soft);
  color: var(--app-accent-ink);
}

.inq-tile__time {
  margin-left: 0.25rem;
}

.inq-positions {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.inq-positions__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.5rem;
  min-width: 0;
  padding: 0.375rem 0.5rem;
  background: var(--app-bg);
  border-radius: var(--r-control-sm);
  font-size: 0.875rem;
}
.inq-positions__row.is-short .inq-positions__count {
  color: var(--app-danger-fg);
}

.inq-positions__count {
  font-weight: 600;
}

.inq-positions__name {
  font-weight: 500;
}

.inq-positions__rates {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin-left: auto;
  color: var(--app-muted);
  font-size: 0.8125rem;
}

.inq-positions__names {
  flex-basis: 100%;
  color: var(--app-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.inq-chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.inq-chip {
  padding: 2px 10px;
  border-radius: var(--r-badge);
  background: var(--app-sunk);
  font-size: 0.8125rem;
}

.inq-chip__label {
  color: var(--app-muted);
}

.inq-fill {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  white-space: nowrap;
}

.inq-pill {
  padding: 1px 9px;
  border-radius: var(--r-badge);
  background: var(--app-sunk);
  font-size: 0.8125rem;
  font-weight: 700;
}

.inq-fill--full .inq-pill {
  background: var(--app-ok-bg);
  color: var(--app-ok-fg);
}

.inq-fill--empty .inq-pill {
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
}

.inq-fill--partial .inq-pill {
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
}

.inq-seg {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.inq-seg__cell {
  flex: none;
  width: 0.5rem;
  height: 0.75rem;
  border-radius: 2px;
  background: var(--app-line);
}
.inq-seg__cell.is-lit {
  background: var(--app-ok-fg);
}

.inq-tile__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--app-line-soft);
}

.inq-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.inq-terms__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  cursor: pointer;
}

.inq-position-row {
  margin: 0 0 0.75rem;
  padding: 0.75rem;
  background: var(--app-bg);
  border-radius: var(--r-control);
  border: 0;
}

.cell-staffing {
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .inq-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .inq-summary {
    padding: 0.75rem;
  }
}
.inq-status--preparing {
  background: var(--app-info-bg);
  color: var(--app-info-fg);
}

.inq-status--running {
  background: var(--app-ok-bg);
  color: var(--app-ok-fg);
}

.inq-status--finished {
  background: var(--app-neutral-bg);
  color: var(--app-neutral-fg);
}

.inq-status--cancelled {
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
}

.stf-status {
  font-weight: 600;
  background: var(--app-sunk);
  color: var(--app-ink);
}

.stf-status--planned {
  background: var(--app-info-bg);
  color: var(--app-info-fg);
}

.stf-status--active {
  background: var(--app-ok-bg);
  color: var(--app-ok-fg);
}

.stf-status--ended {
  background: var(--app-neutral-bg);
  color: var(--app-neutral-fg);
}

.stf-placements,
.stf-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stf-placement,
.stf-suggestion {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  background: var(--app-bg);
  border-radius: var(--r-control);
}

.stf-placement.is-ended {
  opacity: 0.7;
}

.stf-placement__main,
.stf-suggestion__main {
  flex: 1 1 auto;
  min-width: 0;
}

.stf-placement__who {
  font-weight: 600;
}

.stf-suggestion__who {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: baseline;
}

.stf-suggestion__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--app-muted);
}

.stf-warnings {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
}

.stf-warning {
  display: flex;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--app-warn-fg);
}
.stf-warning .bi {
  flex: 0 0 auto;
  margin-top: 0.125rem;
}

@media (max-width: 575.98px) {
  .stf-placement,
  .stf-suggestion {
    flex-wrap: wrap;
  }
}
.stf-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.stf-summary {
  margin: 0;
  font-weight: 600;
  color: var(--app-ink);
}

.stf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.stf-board {
  min-width: 0;
}

.stf-board__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.stf-board__filters .form-control, .stf-board__filters .form-select {
  flex: 1 1 10rem;
  min-width: 0;
  width: auto;
}

.stf-tiles {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1440px) {
  .stf-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.inq-tile[data-focused=true] {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}

.stf-positions {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stf-position {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.stf-filled, .stf-slot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stf-slot {
  min-width: 0;
}

.stf-slot__line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.stf-slot__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.stf-slot__more {
  font-size: 0.8125rem;
}

.stf-slot-list {
  padding: 0.25rem;
  border: 1px dashed var(--app-line);
  border-radius: var(--r-control);
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.stf-slot-list.is-drop-target {
  border-color: var(--app-accent);
  background: var(--app-info-bg);
}
.stf-slot-list.is-drop-refused {
  border-style: dashed;
  cursor: not-allowed;
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--app-border-subtle, rgba(0, 0, 0, 0.06)) 6px 7px);
}

.stf-add {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  width: 100%;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 0;
  border-radius: var(--r-control);
  color: var(--app-accent);
  font-weight: 600;
  text-align: left;
}
.stf-add:hover {
  background: var(--app-sunk);
}

.stf-panel {
  min-width: 0;
}

.stf-panel__toggle {
  width: 100%;
  min-height: 44px;
}

.stf-panel__inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  margin-top: 0.5rem;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: var(--r-card);
}

.stf-panel__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.stf-panel__form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  border: 0;
  padding: 0;
  margin: 0;
}
.stf-chips legend {
  flex: 0 0 100%;
  float: none;
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
}
.stf-chips .btn {
  min-height: 36px;
}

.stf-panel__hint, .stf-panel__foot {
  font-size: 0.8125rem;
  margin: 0;
}

.stf-panel__nopoint {
  margin-left: 0.5rem;
}

.stf-panel__error {
  padding: 0.75rem;
  border-radius: var(--r-control);
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
}
.stf-panel__error p {
  margin: 0 0 0.5rem;
}

.stf-workers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stf-worker {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.5rem;
  background: var(--app-bg);
  border: 1px solid var(--app-line);
  border-radius: var(--r-control);
}
.stf-worker.is-dragging, .stf-worker.sortable-ghost {
  opacity: 0.6;
}

.staffing-grip {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  min-height: 1.5rem;
  color: var(--app-muted);
  cursor: grab;
  touch-action: none;
}
@media (pointer: coarse) {
  .staffing-grip {
    min-width: 2.75rem;
  }
}

.stf-worker__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  font-size: 0.8125rem;
  color: var(--app-muted);
}

.stf-worker__name {
  color: var(--app-ink);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.stf-doc-alert {
  align-self: flex-start;
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
}
.stf-doc-alert--expired {
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
}

.stf-pick {
  flex: 0 0 auto;
}

.stf-pick-menu {
  max-width: min(22rem, 90vw);
}
.stf-pick-menu .dropdown-item {
  white-space: normal;
}

.stf-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stf-skeleton span {
  display: block;
  height: 3.5rem;
  border-radius: var(--r-control);
  background: var(--app-sunk);
  animation: stf-pulse 1.2s ease-in-out infinite;
}

@keyframes stf-pulse {
  50% {
    opacity: 0.5;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stf-skeleton span {
    animation: none;
  }
  .stf-slot-list {
    transition: none;
  }
}
.stf-sheet {
  height: min(80vh, 40rem);
  max-width: 48rem;
  margin-inline: auto;
  border-radius: var(--r-card) var(--r-card) 0 0;
}

@media (min-width: 1024px) {
  .stf-layout {
    grid-template-columns: minmax(0, 1fr) 22rem;
  }
  .stf-panel {
    position: sticky;
    top: 1rem;
  }
  .stf-panel__inner {
    margin-top: 0;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
}
@media (max-width: 767.98px) {
  .staffing-grip {
    display: none;
  }
  .stf-board__filters .btn {
    flex: 1 1 100%;
    min-height: 44px;
  }
  .stf-board__filters .form-select, .stf-board__filters .form-control {
    min-height: 44px;
  }
}
@media (max-width: 767.98px) {
  .stf-pick .btn,
  .stf-slot__menu .btn,
  .stf-suggestion .btn,
  .stf-sheet .btn-close {
    min-height: 44px;
    min-width: 44px;
  }
  .stf-pick .dropdown-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}
.ts-state--open {
  background: var(--app-info-bg);
  color: var(--app-info-fg);
}

.ts-state--submitted {
  background: var(--app-warn-bg);
  color: var(--app-warn-fg);
}

.ts-state--approved {
  background: var(--app-ok-bg);
  color: var(--app-ok-fg);
}

.ts-state--invoiced {
  background: var(--app-ok-solid-bg);
  color: var(--app-ok-solid-fg);
}

.ts-invoice {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--app-ink);
  overflow-wrap: anywhere;
}

.ts-invoice-file {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.ts-sub {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  font-size: 0.875rem;
}

.ts-sub__item {
  white-space: nowrap;
}

.ts-sub__label {
  margin-right: 0.25rem;
  font-size: 0.8125rem;
  color: var(--app-muted);
}

.ts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.ts-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.ts-table {
  margin-bottom: 0;
}

.ts-table > :not(caption) > * > * {
  padding: 0.5rem 0.4rem;
}

.ts-table > :not(caption) > * > *:first-child {
  padding-left: 0.75rem;
}

.ts-table td.num {
  white-space: normal;
}

.ts-table td.cell-title {
  min-width: 6rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ts-table td.ts-hours-cell {
  min-width: 5.75rem;
}

.ts-table .ts-cell {
  min-width: 0;
  width: 100%;
}

.ts-table .ts-cell--hours {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.ts-table {
  table-layout: fixed;
  width: 100%;
}

.ts-col--hours {
  width: 6rem;
}

.ts-col--calc {
  width: 7.5rem;
}

.ts-col--amount {
  width: 7rem;
}

.ts-col--adjust {
  width: 9rem;
}

.ts-col--payable {
  width: 7rem;
}

.ts-col--status {
  width: 6.5rem;
}

.ts-table--cols-5 .ts-col--status,
.ts-table--cols-6 .ts-col--status {
  width: 9rem;
}

.ts-table thead th {
  white-space: normal;
  background: var(--app-bg-2);
  box-shadow: inset 0 -1px 0 var(--app-line);
  font-weight: 600;
}

.ts-table thead th.ts-th--num {
  text-align: right;
}

.ts-table thead th.ts-th--text {
  text-align: left;
}

.ts-table thead th.ts-status-head {
  position: relative;
}

@media (min-width: 768px) and (max-width: 1239.98px) {
  .ts-table-wrap {
    overflow-x: auto;
  }
  .ts-table--cols-5 {
    min-width: 35rem;
  }
  .ts-table--cols-6 {
    min-width: 42rem;
  }
  .ts-table--cols-7 {
    min-width: 51.5rem;
  }
  .ts-table--cols-8 {
    min-width: 58.5rem;
  }
}
@media (min-width: 768px) and (max-width: 1239.98px) {
  .ts-table-wrap {
    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-width: auto;
    scroll-padding-inline: 8rem 0;
  }
  .ts-table-wrap::-webkit-scrollbar {
    height: 0.75rem;
  }
  .ts-table-wrap::-webkit-scrollbar-track {
    background: var(--app-bg-2);
  }
  .ts-table-wrap::-webkit-scrollbar-thumb {
    background: var(--app-field-line);
    border-radius: 0.375rem;
    border: 2px solid var(--app-bg-2);
  }
  .ts-table thead th:first-child,
  .ts-table tr.ts-row > td:first-child,
  .ts-table tr.ts-group-totals > :first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--app-panel);
    box-shadow: 6px 0 6px -6px rgba(0, 0, 0, 0.25);
  }
  .ts-table thead th:first-child {
    background: var(--app-bg-2);
    z-index: 3;
  }
  .ts-table tr.ts-group-totals > :first-child {
    background: var(--app-sunk);
  }
}
@media (min-width: 1240px) {
  .ts-table-wrap {
    overflow: visible;
  }
  .ts-table thead th,
  .ts-table thead th.ts-status-head {
    position: sticky;
    top: 0;
    z-index: 3;
  }
}
.ts-group {
  min-width: 0;
}

.ts-group-bar {
  padding: 0.6rem 1rem;
  background: var(--app-bg-2);
  border-top: 2px solid var(--app-line);
  border-bottom: 1px solid var(--app-line);
  scroll-margin-top: 4.5rem;
}

.ts-group-bar__inner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.ts-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.4rem 0 -0.4rem -0.6rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--app-ink-2);
}

.ts-toggle:hover {
  background: var(--app-line-soft);
}

.ts-toggle:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}

.ts-toggle .bi {
  transition: transform 0.15s ease;
}

.ts-toggle[aria-expanded=false] .bi {
  transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
  .ts-toggle .bi {
    transition: none;
  }
}
.ts-group-head {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  min-width: 0;
}

.ts-group-head__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  min-width: 0;
}

.ts-group-head__title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ts-group-head__month {
  font-weight: 600;
  white-space: nowrap;
}

.ts-group-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.ts-group-head__reason {
  flex: 1 0 100%;
  font-weight: 600;
}

.ts-group-head .btn.is-blocked {
  opacity: 0.55;
  cursor: not-allowed;
}

.ts-paid {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0;
}

.ts-paid .form-check-input {
  float: none;
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  cursor: pointer;
}

.ts-paid .form-check-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ts-status {
  display: block;
  min-height: 1.25rem;
  overflow-wrap: anywhere;
}

.ts-retry {
  padding: 0;
  vertical-align: baseline;
  min-height: 2.75rem;
}

.ts-table tr.ts-row--error > td:first-child {
  box-shadow: inset 4px 0 0 var(--bs-danger, #dc3545);
}

.ts-table .ts-group-body > tr:last-child > td,
.ts-table .ts-group-body > tr:last-child > th {
  border-bottom: 0;
}

.ts-table tr.ts-group-totals > th,
.ts-table tr.ts-group-totals > td {
  font-weight: 600;
  background: var(--app-sunk);
  border-top: 1px solid var(--app-line);
}

.ts-group-alert > td {
  padding: 0.5rem 1rem;
}

.ts-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.ts-filter__field {
  flex: 0 1 14rem;
  min-width: 0;
}

.ts-filter__field .form-label {
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  color: var(--app-muted);
}

.ts-filter__check {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding-left: 0;
}

.ts-filter__check .form-check-input {
  float: none;
  margin: 0;
}

@media (max-width: 767.98px) {
  .ts-table .ts-cell,
  .ts-group-head .btn,
  .ts-toolbar .btn,
  .ts-retry,
  .ts-filter .form-control,
  .ts-filter .form-select,
  .ts-filter__apply {
    min-height: 2.75rem;
  }
  .ts-retry {
    min-width: 2.75rem;
  }
  .ts-paid {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding-left: 0;
  }
  .ts-paid .form-check-input {
    float: none;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
  }
  .ts-paid .form-check-label {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }
  .ts-table thead,
  .ts-table colgroup,
  .ts-table caption {
    display: none;
  }
  .ts-table,
  .ts-table > tbody,
  .ts-table > tbody > tr,
  .ts-table > tbody > tr > td {
    display: block;
    width: 100%;
  }
  .ts-group-bar {
    padding: 0.6rem 0.75rem;
  }
  .ts-table {
    table-layout: auto;
  }
  .ts-group-head__main {
    flex-direction: column;
    align-items: flex-start;
  }
  .ts-table tr.ts-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.4rem 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--app-line);
  }
  .ts-table tr.ts-row > td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left !important;
  }
  .ts-table tr.ts-row > td:first-child {
    padding-left: 0;
  }
  .ts-table > tbody > tr.ts-group-totals {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.4rem 0.75rem;
    padding: 0.75rem;
  }
  .ts-table tr.ts-group-totals > th,
  .ts-table tr.ts-group-totals > td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left !important;
  }
  .ts-table tr.ts-group-totals > th {
    grid-column: 1/-1;
  }
  .ts-table tr.ts-group-totals > td:empty {
    display: none;
  }
  .ts-table tr.ts-group-totals > td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    color: var(--app-muted);
    font-size: 0.8125rem;
    font-weight: 400;
  }
  .ts-table tr.ts-row > td.cell-title,
  .ts-table tr.ts-row > td.ts-status-cell {
    grid-column: 1/-1;
    min-width: 0;
  }
  .ts-table tr.ts-row > td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    color: var(--app-muted);
    font-size: 0.8125rem;
  }
  .ts-table td.ts-hours-cell,
  .ts-table .ts-cell--hours,
  .ts-table .ts-cell--note {
    min-width: 0;
    max-width: none;
  }
  .ts-status-cell {
    min-width: 0;
  }
  .ts-table tr.ts-row--error > td:first-child {
    box-shadow: none;
  }
  .ts-table tr.ts-row--error {
    box-shadow: inset 4px 0 0 var(--bs-danger, #dc3545);
  }
  .ts-filter__check .form-check-input {
    width: 1.5rem;
    height: 1.5rem;
  }
  .ts-filter__check .form-check-label {
    flex: 1 1 auto;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }
}
@media (max-width: 575.98px) {
  .ts-filter__field {
    flex: 1 1 100%;
  }
  .ts-group-head__actions .btn {
    flex: 1 1 100%;
  }
}
.carry-lines {
  min-width: 0;
}

.carry-tools {
  min-width: 0;
}

.carry-summary {
  flex: 1 1 8rem;
  min-width: 0;
}

.carry-line {
  min-width: 0;
  padding: 0.375rem 0;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}
.carry-line:first-child {
  border-top: 0;
}
.carry-line .form-check {
  min-width: 0;
  margin-bottom: 0;
}
.carry-line .form-check-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (pointer: coarse), (max-width: 575.98px) {
  .carry-line .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding-left: 0;
  }
  .carry-line .form-check-input {
    float: none;
    flex: 0 0 auto;
    margin: 0;
    width: 1.5rem;
    height: 1.5rem;
  }
  .carry-line .form-check-label {
    flex: 1 1 auto;
    min-height: 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .carry-tools .btn {
    min-height: 2.75rem;
  }
  .carry-exists > summary {
    padding-block: 0.5rem;
  }
  .toast .toast-link {
    display: inline-block;
    padding-block: 0.375rem;
  }
}
.ts-table td.ts-payable-cell {
  min-width: 7.5rem;
}

.ts-payable {
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.ts-payable__paid {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--app-muted);
}

@media (max-width: 767.98px) {
  .ts-table tr.ts-row > td.ts-payable-cell {
    grid-column: 1/-1;
  }
}
.ts-table .ts-worker__name {
  display: block;
  font-weight: 600;
}

.ts-table .ts-worker__position {
  display: block;
  font-size: 0.75rem;
}

.ts-table .ts-rate-line {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
}

.ts-table td.ts-adjust-cell {
  min-width: 8rem;
  max-width: 14rem;
}

.ts-table thead th.ts-th--adjust,
.ts-table td.ts-adjust-cell,
.ts-table tr.ts-group-totals > td.ts-adjust-cell {
  padding-left: 1rem;
}

.ts-adjust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}

.ts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ts-chip {
  padding: 0.0625rem 0.5rem;
  border: 1px solid var(--app-border, #dee2e6);
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ts-adjust__note {
  flex: 1 1 100%;
  min-width: 0;
  overflow: hidden;
  font-size: 0.75rem;
  color: var(--app-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-adjust__add {
  padding: 0;
  white-space: nowrap;
}

.ts-adjust [data-ts-adjust].is-blocked {
  opacity: 0.55;
  cursor: not-allowed;
}

.bill-tags {
  flex: 1 1 18rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.bill-tags .form-label {
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  color: var(--app-muted);
}

.bill-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  max-height: 9rem;
  overflow-y: auto;
}

.bill-tags .form-check {
  margin: 0;
}

.bill-tags__hint {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  color: var(--app-muted);
}

.bill-month {
  flex: 0 1 18rem;
}

.bill-month__row {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.bill-month__row .form-control {
  min-width: 0;
}

.bill-month__step {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
}

.bill-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.bill-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.bill-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  margin: 0 0 0.5rem;
}

.bill-sum__item {
  min-width: 0;
}

.bill-sum dt {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--app-muted);
}

.bill-sum dd {
  margin: 0;
  font-weight: 500;
}

.bill-sum__item--all dd {
  font-weight: 600;
}

.bill-table {
  --bill-indent: 1.5rem;
  --bill-guide: var(--app-line);
  margin-bottom: 0;
  font-size: 0.875rem;
}

.bill-table > :not(caption) > * > * {
  padding: 0.5rem 0.4rem;
}

.bill-table > :not(caption) > * > *:first-child {
  padding-left: 0.75rem;
}

.bill-table td.num {
  white-space: nowrap;
}

.bill-table .bill-head th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--app-bg-2);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: normal;
}

.bill-row[hidden] {
  display: none !important;
}

.bill-name {
  min-width: 0;
  font-weight: inherit;
  text-align: left;
}

.bill-name__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}

.bill-name__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  margin-top: 0.15rem;
}

.bill-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bill-count {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--app-muted);
}

.bill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  max-width: 100%;
  padding: 0 0.25rem;
  border: 0;
  border-radius: var(--r-control-sm, 0.375rem);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bill-toggle:hover {
  background: var(--app-sunk);
}

.bill-chevron {
  flex: 0 0 auto;
  font-size: 0.75rem;
  transition: transform 0.15s;
}

.bill-toggle[aria-expanded=false] .bill-chevron {
  transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
  .bill-chevron {
    transition: none;
  }
}
.bill-paid {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding-left: 0;
}

.bill-paid .form-check-input {
  float: none;
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
}

.bill-paid .form-check-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.75rem;
}

.bill-actions-col {
  width: 3rem;
  text-align: right;
}

.bill-table .bill-row--client > * {
  background: var(--app-bg-2);
  border-top: 2px solid var(--app-line);
  font-size: 0.9375rem;
  font-weight: 600;
}

.bill-table .bill-row--order > * {
  background: var(--app-sunk);
  font-weight: 600;
}

.bill-table .bill-row--position > * {
  font-weight: 500;
}

.bill-table .bill-row--worker > * {
  font-weight: 400;
}

.bill-table .bill-row--worker .bill-title,
.bill-table .bill-row--worker .num {
  color: var(--app-ink);
}

.bill-table .bill-row--order > .bill-name,
.bill-table .bill-row--position > .bill-name,
.bill-table .bill-row--worker > .bill-name {
  background-repeat: no-repeat;
  background-size: 3px 100%;
}

.bill-table .bill-row--order > .bill-name {
  padding-left: calc(0.75rem + var(--bill-indent));
  background-image: linear-gradient(var(--bill-guide), var(--bill-guide));
  background-position: 0 0;
}

.bill-table .bill-row--position > .bill-name {
  padding-left: calc(0.75rem + 2 * var(--bill-indent));
  background-image: linear-gradient(var(--bill-guide), var(--bill-guide)), linear-gradient(var(--bill-guide), var(--bill-guide));
  background-position: 0 0, var(--bill-indent) 0;
}

.bill-table .bill-row--worker > .bill-name {
  padding-left: calc(0.75rem + 3 * var(--bill-indent));
  background-image: linear-gradient(var(--bill-guide), var(--bill-guide)), linear-gradient(var(--bill-guide), var(--bill-guide)), linear-gradient(var(--bill-guide), var(--bill-guide));
  background-position: 0 0, var(--bill-indent) 0, calc(2 * var(--bill-indent)) 0;
}

.bill-table .bill-total > * {
  border-top: 2px solid var(--app-line);
  background: var(--app-bg-2);
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .bill-table td.cell-empty {
    display: none;
  }
}
@media (max-width: 767.98px) {
  .bill-table {
    --bill-indent: 0.75rem;
  }
  .bill-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .bill-table,
  .bill-table tbody,
  .bill-table tfoot {
    display: block;
  }
  .bill-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 0.75rem;
    padding: 0.15rem 0.75rem 0.4rem 0;
    border-top: 1px solid var(--app-line);
  }
  .bill-table tr > * {
    padding: 0;
    border: 0;
    background-color: transparent;
  }
  .bill-table tr > .bill-name {
    flex: 1 1 calc(100% - 3.5rem);
    max-width: calc(100% - 3.5rem);
    padding-top: 0.15rem;
  }
  .bill-table tr > .bill-actions-col {
    order: 2;
    flex: 0 0 2.75rem;
    width: 2.75rem;
  }
  .bill-table tr > .bill-actions-col:empty {
    display: none;
  }
  .bill-table tr > .bill-num {
    order: 3;
    flex: 0 0 auto;
    width: auto;
  }
  .bill-table .bill-row--client > .bill-name {
    padding-left: 0.5rem;
  }
  .bill-table .bill-row--order > .bill-name {
    padding-left: calc(0.5rem + var(--bill-indent));
  }
  .bill-table .bill-row--position > .bill-name {
    padding-left: calc(0.5rem + 2 * var(--bill-indent));
  }
  .bill-table .bill-row--worker > .bill-name {
    padding-left: calc(0.5rem + 3 * var(--bill-indent) - 0.5rem);
  }
  .bill-row--client > *,
  .bill-row--order > * {
    border-top: 0;
  }
  .bill-row--client {
    background: var(--app-bg-2);
  }
  .bill-row--order {
    background: var(--app-sunk);
  }
  .bill-row--client > .bill-num--hours {
    margin-left: 0.5rem;
  }
  .bill-row--order > .bill-num--hours {
    margin-left: calc(0.5rem + var(--bill-indent));
  }
  .bill-row--position > .bill-num--hours {
    margin-left: calc(0.5rem + 2 * var(--bill-indent));
  }
  .bill-row--worker > .bill-num--hours {
    margin-left: calc(0.5rem + 3 * var(--bill-indent) - 0.5rem);
  }
  .bill-num[data-label]::before {
    content: attr(data-label) " ";
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--app-muted);
  }
  .bill-row--client .bill-toggle {
    border: 1px solid var(--app-line);
    background: var(--app-bg);
  }
  .bill-row--client .bill-chevron {
    font-size: 1rem;
  }
  .bill-pct-label {
    color: var(--app-muted);
    font-weight: 400;
  }
  .bill-total {
    padding-left: 0.75rem;
  }
}
@media (min-width: 768px) {
  .bill-pct-label {
    display: none;
  }
}
@media (max-width: 767.98px) {
  .bill-tags__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 0.75rem;
  }
  .bill-tags .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding-left: 0;
  }
  .bill-tags .form-check-input {
    float: none;
    flex: 0 0 auto;
    margin: 0;
    width: 1.5rem;
    height: 1.5rem;
  }
  .bill-tags .form-check-label {
    flex: 1 1 auto;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
  }
  .bill-month__row .btn,
  .bill-month__row .form-control,
  .bill-toolbar .btn,
  #bill-filter-client,
  #bill-filter-paid {
    min-height: 2.75rem;
  }
}
.rcv-table .rcv-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

@media (max-width: 575.98px) {
  .rcv-table > :not(caption) > * > * {
    padding-inline: 0.5rem;
  }
  .rcv-table th[scope=row] {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .rcv-table .rcv-actions {
    flex-direction: column;
  }
}
@media (pointer: coarse) {
  .bill-paid .form-check-input {
    width: 2.75rem;
    height: 2.75rem;
  }
}
.payout-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.payout-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
}

.payout-tile {
  min-width: 0;
  padding: 0.625rem 0.875rem;
}

.payout-tile__label {
  display: block;
  font-size: 0.8125rem;
  color: var(--app-muted);
}

.payout-tile__value {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.payout-tile--remaining {
  border-color: var(--app-line-strong);
}

.payout-negative {
  background: var(--app-danger-bg);
  color: var(--app-danger-fg);
}

.payout-negative__text {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
}

.payout-table th,
.payout-table td {
  padding-inline: 0.5rem;
  white-space: nowrap;
}
.payout-table .payout-worker {
  min-width: 12rem;
  white-space: normal;
}
.payout-table .payout-note {
  max-width: 20rem;
}
.payout-table .payout-group-row > th {
  background: var(--app-bg-2);
  border-top: 1px solid var(--app-line-strong);
  white-space: normal;
}
.payout-table .payout-subtotal > * {
  background: var(--app-sunk);
  font-weight: 600;
}

.payout-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.payout-tick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.payout-cards {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.payout-card {
  min-width: 0;
}

.payout-card__figures {
  display: grid;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
}
.payout-card__figures > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  min-width: 0;
}
.payout-card__figures dt {
  font-weight: 400;
  color: var(--app-muted);
}
.payout-card__figures dd {
  margin: 0;
  text-align: right;
}

.payout-card__payable {
  padding: 0.25rem 0.5rem;
  margin-inline: -0.5rem;
  font-weight: 600;
}

.payout-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.payout-card__foot > * {
  min-width: 0;
}

@media (pointer: coarse) {
  .payout-tick .form-check-input {
    width: 2.75rem;
    height: 2.75rem;
  }
}
@media (max-width: 767.98px) {
  .payout-toolbar .btn,
  #payout-filter-order,
  #payout-filter-employment,
  #payout-filter-status,
  #payout-filter-q {
    min-height: 2.75rem;
  }
  .payout-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 359.98px) {
  .payout-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (min-width: 768px) {
  .payout-table-wrap {
    scroll-padding-inline-end: 11rem;
  }
  .payout-table .payout-actions-cell {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--app-panel);
    box-shadow: -1px 0 0 var(--app-line);
  }
  .payout-table thead .payout-actions-cell {
    background: var(--app-bg-2);
  }
  .payout-table .payout-subtotal > .payout-actions-cell {
    background: var(--app-sunk);
  }
  .payout-table .payout-actions-cell:has(.dropdown-menu.show) {
    z-index: 1035;
  }
}
@media (pointer: coarse), (max-width: 767.98px) {
  .payout-dialog-paid {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
    min-height: 2.75rem;
  }
  .payout-dialog-paid .form-check-input {
    float: none;
    flex: none;
    margin: 0;
    width: 1.5rem;
    height: 1.5rem;
  }
  .payout-dialog-paid .form-check-label {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}
@media (max-width: 767.98px) {
  .modal-body:has(.payout-dialog-strip) {
    scroll-padding-bottom: 8rem;
  }
  .payout-dialog-strip {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-bottom: 0.75rem;
  }
}
.twofactor-qr {
  display: inline-block;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
}
.twofactor-qr svg {
  display: block;
  width: 12rem;
  max-width: 100%;
  height: auto;
}

.twofactor-secret {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  user-select: all;
  letter-spacing: 0.05em;
}

.twofactor-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.5rem 1rem;
  font-size: 1.05rem;
}
.twofactor-codes code {
  user-select: all;
  white-space: nowrap;
  overflow-wrap: normal;
}

.twofactor-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
  .twofactor-roles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 0.75rem;
  }
  .twofactor-roles .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    margin: 0;
    padding-left: 0;
  }
  .twofactor-roles .form-check-input {
    float: none;
    flex: 0 0 auto;
    margin: 0;
    width: 1.5rem;
    height: 1.5rem;
  }
  .twofactor-roles .form-check-label {
    flex: 1 1 auto;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
  }
}
:root[data-brand=jericho] {
  --signal: #1D4ED8;
  --signal-hover: #1E40AF;
  --on-signal: #FFFFFF;
  --signal-soft: #EFF6FF;
  --signal-row: #EFF6FF;
  --fill: #0F172A;
  --stripe: #0F172A;
  --sel: #0F172A;
  --app-accent: #1D4ED8;
  --app-accent-dark: #1E40AF;
  --app-accent-ink: #1E40AF;
  --app-accent-tint-2: #BFDBFE;
  --app-navy: #0F172A;
  --app-ink: #0F172A;
  --app-ink-2: #1E293B;
  --app-ink-3: #334155;
  --app-ink-4: #475569;
  --app-muted: #59697F;
  --app-muted-2: #59697F;
  --app-line-strong: #CBD5E1;
  --app-field-line: #7A8AA0;
  --app-line: #E2E8F0;
  --app-line-soft: #EEF2F7;
  --app-line-softest: #F1F5F9;
  --app-panel: #FFFFFF;
  --app-bg: #F8FAFC;
  --app-bg-2: #F1F5F9;
  --app-sunk: #EEF2F7;
  --sidebar-bg: #FFFFFF;
  --sidebar-ink: #0F172A;
  --sidebar-muted: #59697F;
  --app-info-fg: #1E40AF;
  --app-info-bg: #EFF6FF;
  --app-warn-fg: #B45309;
  --app-warn-bg: #FEF3C7;
  --app-ok-fg: #15803D;
  --app-ok-bg: #DCFCE7;
  --app-ok-solid-fg:#FFFFFF;
  --app-ok-solid-bg:#15803D;
  --app-danger-fg: #B91C1C;
  --app-danger-bg: #FEE2E2;
  --app-danger-line:#FECACA;
  --app-danger-field:#B91C1C;
  --app-neutral-fg: #475569;
  --app-neutral-bg: #F1F5F9;
  --toast-danger: #B91C1C;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-pop: 0 8px 24px rgba(15, 23, 42, .12);
  --shadow-float: 0 10px 30px rgba(15, 23, 42, .28);
  --shadow-accent: 0 1px 2px rgba(29, 78, 216, .22);
  --focus-ring: 0 0 0 3px rgba(29, 78, 216, .35);
  --focus-ring-field: 0 0 0 1px #1D4ED8, 0 0 0 4px rgba(29, 78, 216, .14);
  --r-card: 12px;
  --r-panel: 12px;
  --r-control: 8px;
  --r-control-sm: 7px;
  --r-badge: 6px;
  --bs-font-sans-serif: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-font-monospace: 'IBM Plex Mono', ui-monospace, monospace;
  --bs-body-font-size: .875rem;
}

@media (hover: hover) and (pointer: fine) {
  :root[data-brand=jericho] {
    --h-control: 36px;
    --h-control-sm: 32px;
    --h-control-xs: 30px;
    --h-icon-btn: 36px;
  }
}
[data-brand=jericho] .sidebar-group-label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 600;
}
