/*
 * ==========================================================================
 * Design tokens
 * --------------------------------------------------------------------------
 * Every colour in this stylesheet is named here and referenced by name below.
 * After this block no rule in the file holds a literal colour, which is what
 * makes a second colour mode a matter of redefining these values rather than
 * rewriting the rules.
 *
 * The values began as exactly the ones the file already used, so introducing
 * this layer changed nothing that rendered. Since then the light surfaces, text,
 * muted text, border and spinner track have moved to a softer palette (#252);
 * src/test/js/token-contrast.test.mjs holds text and borders to WCAG AA against
 * the surfaces. Print keeps the old white palette -- see the Print section.
 *
 * The brand palette, recorded at the top of this file since it was written:
 *   saztrek 1 #4ca3da   saztrek 2 #3e84c5   saztrek 3 #3766b0   saztrek 4 #28589b
 *   accents  red #eb4339  yellow #eeb91d  green #5eac46  blue #15adb2  grey #86898c
 * ==========================================================================
 */
:root {
	/* Surfaces. A soft grey rather than white (#252): staff spend whole days here. */
	--mika-surface: #ddd;
	--mika-surface-raised: #ddd;
	--mika-surface-sunken: rgba(0,0,0,.03);
	--mika-surface-hover: rgba(0,0,0,.05);

	/* Text. Softer than near-black on the grey surface (#252): 8.1:1 on #ddd. */
	--mika-text: #3c3c3c;
	/* #676767 fell to 4.16:1 on the #ddd surface; this is 5.2:1 and still reads
	   lighter than body text. */
	--mika-text-muted: #595959;
	--mika-text-on-brand: #fff;
	--mika-icon-muted: rgba(0, 0, 0, 0.54);
	--mika-icon-disabled: rgba(0, 0, 0, 0.26);
	/* Bootstrap's .btn-close glyph: black here, white in dark via its filter. */
	--mika-icon-control: #000;
	--mika-icon-on-dark: rgba(255, 255, 255, 1);
	--mika-icon-on-dark-disabled: rgba(255, 255, 255, 0.3);

	/* Lines. Inputs share the page's fill, so their outline is the only thing that
	   marks a field: this clears WCAG's 3:1 non-text contrast against #ddd, where
	   the old #ced4da was 1.1:1. */
	--mika-border: #7a7a7a;
	--mika-border-subtle: rgba(0,0,0,.15);
	--mika-border-brand: #3e84c54d;

	/* Scrollbars on the containers that scroll inside a page -- a table's scroll
	   body, the nav panel, a Tom Select option list. Set, not left to the platform:
	   an unstyled scrollbar is the browser's choice, and some draw a white one on
	   the dark surface. The track takes the sunken surface, so it follows the mode
	   without the dark block restating it. */
	--mika-scrollbar-thumb: rgba(0,0,0,.3);
	--mika-scrollbar-track: var(--mika-surface-sunken);

	/* Brand */
	--mika-brand: #28589b;
	--mika-brand-light: #4ca3da;
	--mika-brand-mid: #3e84c5;
	--mika-brand-deep: #3766b0;
	--mika-brand-on-dark: #fff;

	/* Links */
	--mika-link: #28589b;
	--mika-link-hover: #0056b3;

	/* Accents */
	--mika-accent-red: #eb4339;
	--mika-accent-yellow: #eeb91d;
	--mika-accent-green: #5eac46;
	--mika-accent-blue: #15adb2;
	--mika-accent-blue-soft: #e7fcfc;
	--mika-neutral-grey: #86898c;

	/* Feedback and chrome */
	--mika-overlay: rgba(0,0,0,0.6);
	/* Was #ddd -- the surface itself, since #252. The spinner turns on the loading
	   overlay, so the ring has to read both there and on the bare grey. */
	--mika-spinner-track: #aaa;
	--mika-spinner-head: #2e93e6;

	/* The label on a filter row's date range -- `Fr`, `To`, `Added From`, `Paid To`.
	   Its own pair rather than a pointer at --mika-text-muted and
	   --mika-surface-sunken, which resolve to #676767 on #f7f7f7 here: this pair is
	   what those rows have looked like for years, the defect being fixed is a dark
	   mode one, and light mode is meant to come out of it unchanged (#153). Dark
	   points at the palette. */
	--mika-addon-surface: #eee;
	--mika-addon-text: #555;

	/* A collapsed .saz-tab heading. It borrowed --mika-spinner-track, which
	   happened to be #ddd; the track has since darkened (#252) and a tab is not a
	   spinner, so it keeps the value it has always rendered with. */
	--mika-tab-collapsed-surface: #ddd;

	/* The dropdown chevron, held here for the same reason every other colour is:
	   it is an inline SVG and carries a stroke colour, so a rule that spelled it
	   out would be the one rule in the file below this block holding a literal.
	   The value is Bootstrap 5.3.3's own, copied from what it sets on
	   .form-select -- see the Tom Select section for why copied and not
	   referenced. */
	--mika-select-caret: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/*
 * Dark mode.
 *
 * Only the token values are redefined; not one rule below is duplicated. That is
 * the whole return on the token layer -- a second colour mode costs a block of
 * values rather than a second copy of the stylesheet.
 *
 * Brand hues are lightened rather than swapped: the identity has to survive, but
 * #28589b on a near-black surface does not carry enough contrast to read.
 */
[data-bs-theme="dark"] {
	--mika-surface: #1c1f23;
	--mika-surface-raised: #24282d;
	--mika-surface-sunken: rgba(255,255,255,.04);
	--mika-surface-hover: rgba(255,255,255,.07);

	/* Softer than #e6e8ea, which glared (#252): 9.2:1 on the surface. */
	--mika-text: #c1c1c1;
	--mika-text-muted: #a4abb3;
	--mika-text-on-brand: #fff;
	--mika-icon-muted: rgba(255, 255, 255, 0.62);
	--mika-icon-disabled: rgba(255, 255, 255, 0.32);
	--mika-icon-control: #fff;

	--mika-border: #3a4048;
	--mika-border-subtle: rgba(255,255,255,.16);
	--mika-border-brand: #5a90d066;
	--mika-scrollbar-thumb: rgba(255,255,255,.3);

	--mika-brand: #7cb3e8;
	--mika-brand-light: #8fc6ef;
	--mika-brand-mid: #6aa3dd;
	--mika-brand-deep: #5a90d0;

	--mika-link: #8fc6ef;
	--mika-link-hover: #b3dbf7;

	--mika-accent-red: #f2695f;
	--mika-accent-yellow: #f0c64a;
	--mika-accent-green: #7cc464;
	--mika-accent-blue: #35c6cb;
	--mika-accent-blue-soft: #10312f;
	--mika-neutral-grey: #9aa0a6;

	--mika-overlay: rgba(0,0,0,0.72);
	--mika-spinner-track: #3a4048;
	--mika-spinner-head: #7cb3e8;

	/* The filter-row addon labels. Here they are ordinary secondary chrome and take
	   the palette directly -- muted text on a sunken surface, the same relationship
	   every other caption in the application has with its background. */
	--mika-addon-surface: var(--mika-surface-sunken);
	--mika-addon-text: var(--mika-text-muted);

	/* The spinner track's dark value, which is what a collapsed tab rendered with. */
	--mika-tab-collapsed-surface: #3a4048;

	/* Rows a table highlights to say what state a record is in. Bootstrap 5.3 gives
	   .table-warning and its siblings a fixed light background and black text and
	   ships no dark variant, so on a near-black page they render as a light-mode
	   panel dropped into a dark one (#81).

	   Each is that state's own accent from above, laid over --mika-surface at 16%,
	   resolved to hex: a highlighted row is the same hue as everything else in the
	   application that means the same thing. .table-light is the odd one -- it means
	   "neutral, lifted", not a colour -- so it is a raised surface. */
	--mika-row-neutral: #2a2e34;   /* surface-raised, lifted again */
	--mika-row-primary: #2b3743;   /* brand        #7cb3e8 @ 16% */
	--mika-row-info:    #203a3e;   /* accent-blue  #35c6cb @ 16% */
	--mika-row-success: #2b392d;   /* accent-green #7cc464 @ 16% */
	--mika-row-warning: #3e3a29;   /* accent-yellow #f0c64a @ 16% */
	--mika-row-danger:  #3e2b2d;   /* accent-red   #f2695f @ 16% */

	/* Bootstrap's dark chevron, from [data-bs-theme=dark] .form-select. A near-black
	   stroke on a near-black surface is not a caret. */
	--mika-select-caret: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/*
 * White mode (#284).
 *
 * Light with a white page. Bootstrap draws it as light -- theme.js stamps
 * data-bs-theme="light" alongside data-mika-theme="white" -- so only the surfaces
 * change, and every other token is Light's: text is 11:1 on #fff, muted text
 * 7:1, and the border 4.3:1, still clearing the 3:1 that marks an input
 * outline. Light stays the soft grey of #252; White is offered beside it, not
 * instead of it.
 *
 * Declared after :root at the same specificity, so it wins by source order, and
 * before the Print section, whose :root restatement wins over it on paper.
 */
[data-mika-theme="white"] {
	--mika-surface: #fff;
	--mika-surface-raised: #fff;
}

/*
 * Bootstrap, bridged to the tokens (#252).
 *
 * Cards, the offcanvas nav panel, the accordion, form controls, modals, dropdown
 * menus, pagination and tables all paint from --bs-body-bg, --bs-body-color and
 * --bs-border-color, which Bootstrap declares per colour mode on these same
 * selectors. Pointing those three at the tokens is what carries the page surface
 * to every one of them: changing --mika-surface alone left them all white. In
 * dark mode it moves them from Bootstrap's #212529 onto the page's own surface,
 * so dark has one surface too.
 *
 * --bs-emphasis-color goes with them. Bootstrap 5.3 colours table text, the
 * active nav tab and list-group hover from it rather than from --bs-body-color,
 * so without it every data table kept pure black text in light mode and pure
 * white in dark while the page around it took the softer text colour. Nothing in
 * the application asks for emphasis on its own account. (--bs-emphasis-color-rgb
 * is left alone: Bootstrap uses it only as the base of translucent overlays.)
 *
 * Declared on the selectors Bootstrap uses, later in the cascade, so it wins by
 * source order at equal specificity. A component that needs a different colour
 * gets a token, not a per-component override of these.
 */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
	--bs-body-bg: var(--mika-surface);
	--bs-body-color: var(--mika-text);
	--bs-emphasis-color: var(--mika-text);
	--bs-border-color: var(--mika-border);
}

/*
 * The page surface itself. Bootstrap paints body from its own colour-mode
 * variables; these tie it to the tokens so both modes come from one place.
 */
body {
	background-color: var(--mika-surface);
	color: var(--mika-text);
}


.navbar {
	border-bottom: 1px solid var(--mika-border-subtle);
	padding-bottom: 0px;
}

.bg-white {
	background: var(--mika-surface);
}

.mika-navbar {
	background-color: var(--mika-surface);
}
/*
 * The mark's height is set here and overridden at two breakpoints below; `width: auto`
 * is what keeps those the only rules that decide its size. The <img> carries width and
 * height attributes so the browser reserves the right box before the file arrives, and
 * a width attribute is a presentational hint -- without `auto` it would pin the mark at
 * its desktop 53px while the height dropped to 32px, and the artwork would stretch on
 * every phone.
 */
.home-logo {
	height: 50px;
	width: auto;
	/*
	 * The separation between the mark and the wordmark, at every breakpoint. It was
	 * a literal space in the markup, which renders as nothing at all here: the anchor
	 * is inline-flex, so the text beside the mark is an anonymous flex item and its
	 * leading whitespace is stripped. The two were touching.
	 */
	margin-right: 0.5rem;
}
.home-font {
	font-style: normal;
	font-weight: 700;
}

.link-home-logo,
.link-home-logo:hover {
    color: var(--mika-brand) !important;
  	text-decoration: none;
}

/*
 * The nav panel's Home item takes the text colour, not the brand (#252), so it
 * matches the rest of the panel. Named by its own class rather than by .link-home,
 * because the error page's "Go Home" is a .link-home too, and it is a primary
 * button.
 */
a.link-home.nav-panel-static-item {
    color: var(--mika-text) !important;
  	text-decoration: none;
}

/*
 * Bootstrap 4 shipped .breadcrumb with a background and `padding: 0.75rem 1rem`.
 * Bootstrap 5 dropped both from the component; this rule restored the background
 * and not the padding, so the band still read as a filled strip with its text
 * flush against the left edge -- 0.4px of inset where prod has 16px (#61).
 *
 * The horizontal padding is restored at Bootstrap 4's value. The vertical is
 * deliberately not: prod needs it because its breadcrumb links are 24px tall,
 * while ours are 44px for the tap-target minimum, and that already puts 13px
 * above and below the text -- close to the 15/16px prod gets from padding.
 * Adding 0.75rem on top of it took the band to 68px, half again as tall as
 * prod's 48px, on all 135 pages. So: the inset the issue is about, without the
 * height nobody asked for.
 */
.breadcrumb {
    background-color: var(--mika-surface-sunken);
    padding-left: 1rem;
    padding-right: 1rem;
}
a {
    color: var(--mika-brand);
}
.bg-primary {
	background-color: var(--mika-brand) !important;
}
.text-primary {
	color: var(--mika-brand) !important;
}
.border-primary {
	border-color: var(--mika-brand) !important;
}
.h3, h3 {
    font-size: 1.35rem;
}
.btn-primary, .btn-primary:hover,
.btn-primary:not(:disabled):not(.disabled).active, .btn-primary:not(:disabled):not(.disabled):active, .show > .btn-primary.dropdown-toggle {
	background-color: var(--mika-brand);
	border-color: var(--mika-brand);
}
.btn-danger, .btn-danger:hover,
.btn-danger:not(:disabled):not(.disabled).active, .btn-danger:not(:disabled):not(.disabled):active, .show > .btn-danger.dropdown-toggle {
	background-color: var(--mika-accent-red);
	border-color: var(--mika-accent-red);
}
.btn-success, .btn-success:hover,
.btn-success:not(:disabled):not(.disabled).active, .btn-success:not(:disabled):not(.disabled):active, .show > .btn-success.dropdown-toggle {
	background-color: var(--mika-accent-green);
	border-color: var(--mika-accent-green);
}
.btn-warning, .btn-warning:hover,
.btn-warning:not(:disabled):not(.disabled).active, .btn-warning:not(:disabled):not(.disabled):active, .show > .btn-warning.dropdown-toggle {
    background-color: var(--mika-accent-yellow);
    border-color: var(--mika-accent-yellow);
}
.btn-secondary, .btn-secondary:hover,
.btn-secondary:not(:disabled):not(.disabled).active, .btn-secondary:not(:disabled):not(.disabled):active, .show > .btn-secondary.dropdown-toggle {
	background-color: var(--mika-neutral-grey);
	border-color: var(--mika-neutral-grey);
}
.page-item.active .page-link {
    background-color: var(--mika-brand);
    border-color: var(--mika-brand);
}
.page-link {
    color: var(--mika-brand);
}
.border-success {
    border-color: var(--mika-accent-green) !important;
}
/* End Override Bootstrap colors */

/*
 * Container width.
 *
 * These were both `max-width: 80% !important`. On a 375px phone that threw away a
 * fifth of the screen before a single element was laid out, and the !important
 * meant no page could opt out. Width is now progressive: full bleed with gutters
 * on a phone, and constrained only once there is width to spare. The 80% feel is
 * preserved from large screens up, which is where it was designed for.
 */
.saz-max-width,
.container.body-container {
	width: 100%;
	max-width: 100%;
	padding-left: 12px;
	padding-right: 12px;
	margin-left: auto;
	margin-right: auto;
}

.container.body-container {
	padding-top: 15px;
}

@media (min-width: 768px) {
	.saz-max-width,
	.container.body-container {
		max-width: 94%;
	}
}

@media (min-width: 1200px) {
	.saz-max-width,
	.container.body-container {
		max-width: 80%;
	}
}

.container img {
	max-height: 6rem;
}

.form-signin {
    max-width: 330px;
    padding: 15px;
    margin: 0 auto;
}

.form-signin .form-signin-heading,
.form-signin .checkbox {
    margin-bottom: 10px;
}

.form-signin .checkbox {
    font-weight: normal;
}

.form-signin .form-control {
    position: relative;
    height: auto;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    padding: 10px;
    font-size: 16px;
}

.form-signin .form-control:focus {
    z-index: 2;
}

.form-signin input {
    margin-top: 10px;
}

.form-signin button {
    margin-top: 10px;
}

/*
 * Reset Password is a link at body size under the button. It used to be an <h4>, which
 * announced a link as a heading and was sized like one; the size was also all that gave
 * it a tap target. The target is kept here instead, the way the other text links get
 * theirs, so the words can be the size of the words around them.
 */
.form-signin .form-signin-reset {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.has-error {
    color: red
}

.form-warning {
	display: none;
	margin-top: 1rem;
}

.dropdown-item.active {
    background-color: var(--mika-brand);
}

.dropdown-item:hover:not(:focus) {
    color: var(--mika-text-on-brand);
    background-color: var(--mika-accent-blue);
}

/*
 * An open menu paints above the sticky navbar.
 *
 * Bootstrap's scale puts .dropdown-menu at 1000 and .sticky-top at 1020. That order
 * is right for a menu *inside* the navbar, which shares its stacking context; it is
 * wrong for one in page content underneath it, and #89 is what that costs.
 *
 * The row actions menu is 416px tall. On a 1280x800 viewport the first row's toggle
 * sits at y=446 with only ~310px below it, so Popper flips the menu upward -- and
 * flipped, it spans y=28 to y=444. Its first item, View Details, lands at y=37,
 * inside the navbar's 0-86 band. At 1020 against 1000 the navbar wins: it paints over
 * the item and takes its pointer events, so the item is visible and unclickable.
 * `document.elementFromPoint` at its centre returns the navbar's container, not the
 * item. Rows below the first are unaffected only because their flipped menus start
 * lower than 86px.
 *
 * Reproducible with a mouse at any scroll position -- this is not an artifact of a
 * test harness scrolling the page. 1030 puts an open menu above the sticky header and
 * still below the modal backdrop at 1050, so nothing that should cover a menu stops
 * doing so.
 */
.dropdown-menu {
	z-index: 1030;
}

.saz-action-dropdown .dropdown-item {
	cursor: pointer;
	color: var(--mika-brand);
}

/*
 * Menu entries are <div>s driven by click handlers, except where one actually
 * navigates -- and that one is a real anchor. Bootstrap 5's Reboot underlines
 * links (Bootstrap 4 did not), so that single entry rendered underlined while its
 * siblings did not (#56). The menu should read as one list, so the anchor is
 * stripped back to match the divs around it rather than the other six being
 * underlined to match it.
 */
/*
 * An anchor that wraps a control is not a text link (#76).
 *
 * Bootstrap 4 set `a { text-decoration: none }`; Bootstrap 5's Reboot underlines
 * links instead, so every bit of whitespace inside an anchor became a visible
 * underlined space. #54 fixed that at its largest source by ending
 * iconButton.tag at its `</button>` with no trailing newline, which covers the
 * sites that wrap the tag on one line.
 *
 * It does not cover an anchor written across several lines, where the newlines are
 * the JSP's own indentation rather than the tag's -- 11 files and about 25 call
 * sites, first seen between the pencil and trash icons on /hr/position, where the
 * anchor measures 54px around a 44px button and the 9.6px difference renders as a
 * stray underscore on every row.
 *
 * Handled here rather than by reindenting those 25 sites, because the indentation
 * is not wrong and anyone reformatting a JSP would put it straight back. The
 * affordance in these anchors is the button; the underline belongs to text links,
 * which these are not. Same reasoning as the dropdown rule below, which strips the
 * one menu entry that is a real anchor back to match the divs beside it (#56).
 */
a:has(> .icon-btn) {
	text-decoration: none;
	/*
	 * And the anchor takes the button's box rather than a line box of its own.
	 *
	 * An inline anchor around an inline-flex button is 44px wide and about 18px
	 * tall -- the anchor's own line-height, because the button contributes its
	 * width to the line and not its height. The anchor is what carries the href,
	 * so the anchor is what a finger has to land on and what the audit measures:
	 * a 44x18 target against a 44px minimum, on every row of every table that
	 * wraps a row action in a link.
	 *
	 * It went unmeasured for a long time because the pages that show it need a
	 * populated results table to render a row at all. It surfaced on
	 * /deductions/cload-credit-score/batch when #180 gave that page an upload
	 * fixture whose employees actually resolve; the same markup sits in about
	 * twenty-five other places.
	 *
	 * `inline-flex` rather than `inline-block` so there is no line box inside the
	 * anchor either -- an inline-block would take the button's height plus the
	 * descender space below it, which is the same class of bug one level up.
	 */
	display: inline-flex;
	vertical-align: middle;
}

.saz-action-dropdown .dropdown-item a {
	color: var(--mika-brand) !important;
	text-decoration: none;
}

.saz-action-dropdown .dropdown-item:hover a {
	color: var(--mika-text-on-brand) !important;
}

.saz-action-dropdown .dropdown-item * {
	vertical-align: top;
}

/*
 * ...except the icon. `i.material-icons` sets line-height 44px and
 * `vertical-align: middle` together -- with a 44px line box, middle is what keeps
 * the glyph centred against the text beside it. The blanket rule above outranks it,
 * (0,2,0) against (0,1,1), so every icon was top-aligned instead: a 44px icon box
 * against an 18px label on a 24px line, leaving each label sitting a consistent
 * 10px above its icon's centre (#55).
 *
 * Only the icon is exempted. The rule above is left doing its job for everything
 * else in the item.
 */
.saz-action-dropdown .dropdown-item i.material-icons {
	vertical-align: middle;
}

.table-borderless > tbody > tr > td,
.table-borderless > tbody > tr > th,
.table-borderless > tfoot > tr > td,
.table-borderless > tfoot > tr > th,
.table-borderless > thead > tr > td,
.table-borderless > thead > tr > th {
    border: none;
}

.display-inline-block {
	display: inline-block;
}

.display-inline {
	display: inline;
}

.inner-addon { 
    position: relative; 
}

.inner-addon .glyphicon {
  position: absolute;
  padding: 10px;
  pointer-events: none;
}

.left-addon .glyphicon  { 
	left:  0px;
}
.right-addon .glyphicon { 
	right: 0px;
}

.left-addon input  { 
	padding-left:  30px; 
}

.right-addon input { 
	padding-right: 30px; 
}

/* Rules for sizing the icon. */
.material-icons.md-18 { font-size: 18px; }
.material-icons.md-24 { font-size: 24px; }
.material-icons.md-36 { font-size: 36px; }
.material-icons.md-48 { font-size: 48px; }

/* Rules for using icons as black on a light background. */
.material-icons.md-dark { color: var(--mika-icon-muted); }
.material-icons.md-dark.md-inactive { color: var(--mika-icon-disabled); }

/* Rules for using icons as white on a dark background. */
.material-icons.md-light { color: var(--mika-icon-on-dark); }
.material-icons.md-light.md-inactive { color: var(--mika-icon-on-dark-disabled); }

.input-group input{
  	border:none;
  	background-color: transparent;
}
.input-group input:focus {
    outline: none;
}
.input-group {
  	border: 1px solid var(--mika-border);
	border-radius: .25rem;
    padding-right: 0;
    padding-left: 0;
}
/*
 * The label on a filter row's date range.
 *
 * Written for two major versions as `input-group-addon` -- Bootstrap 3's name for
 * the element -- with `color`, `background-color` and `padding` in a style
 * attribute on all twenty-nine of them across thirteen views. Bootstrap 4 renamed
 * the class and Bootstrap 5 gives the old name no styling whatever, so those
 * inline declarations were the only thing making the element look like an addon
 * at all. And an inline declaration outranks every selector a stylesheet can
 * write, so the theme's tokens were not merely unused on these spans, they were
 * unusable: in dark mode the label computed rgb(238, 238, 238) on a body of
 * rgb(28, 31, 35) and was the brightest thing on the screen (#153).
 *
 * `border: 0` because this application's input group draws a single border around
 * the whole group and its children are borderless -- see `.input-group input`
 * above. Bootstrap's own .input-group-text brings a second, internal one.
 *
 * The padding is the pair the style attribute carried. Being inline it beat the
 * `padding-top: 5px` this file used to set, so 6px 8px is what these labels have
 * actually had, and keeping it is what makes this a colour change and not a
 * spacing one.
 */
.input-group .input-group-text {
	padding: 6px 8px;
	border: 0;
	background-color: var(--mika-addon-surface);
	color: var(--mika-addon-text);
}

/*
 * A file input's "Choose File" button. Bootstrap paints it from its own
 * --bs-tertiary-bg, and --bs-secondary-bg on hover, which the token bridge does not
 * cover: #f8f9fa, a near-white block on the grey light surface. Tokens instead, so it
 * sits in the field it belongs to in both modes. The hover selector is Bootstrap's own,
 * restated so it is outranked by position rather than by weight.
 */
.form-control::file-selector-button {
	background-color: var(--mika-surface-sunken);
	color: var(--mika-text);
}

.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
	background-color: var(--mika-surface-hover);
}

/*
 * The same button on a bare file input, which has no field around it to borrow an
 * outline from. The employee form keeps its two bare: in its table a full-width
 * .form-control file input widens the column and squeezes the name-extension field
 * beside it below the width its placeholder needs.
 */
input[type="file"]:not(.form-control)::file-selector-button {
	margin-inline-end: 0.5rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--mika-border);
	border-radius: var(--bs-border-radius);
	background-color: var(--mika-surface-sunken);
	color: var(--mika-text);
}

input[type="file"]:not(.form-control):not(:disabled):hover::file-selector-button {
	background-color: var(--mika-surface-hover);
}

.font-gray {
	color: var(--mika-neutral-grey);
}

.card-row .card {
    margin-bottom: 15px;
    font-size: 14px;
}

.card-row {
	padding-bottom: 15px;
}

.hover-card:hover {
	background: var(--mika-surface-sunken);
	cursor: pointer;
	text-decoration: none;
}

.navbar-brand {
	cursor: pointer;
}

.errorpage-icon {
    font-size: 60px;
}

.alert.alert-dismissible {
    margin-bottom: 0;
    margin-top: 1rem;
}

.msgalert, .msgsuccess, .msgconfirm, .msgwarning {
	display: none;
}

/*
 * The confirm dialog's message and its Cancel/Confirm controls used to rely on
 * .msgconfirm-confirm { float: right } and a hand-tuned .msgconfirm-cancel { right: 40px }
 * to sit at the alert's right edge -- rules written for a single absolutely-positioned
 * .close control (Bootstrap 4) and never revisited when this became two ordinary buttons.
 * A flex row with the actions grouped in their own wrapper puts both at the right edge
 * together, however long the message runs, without magic-number offsets between them.
 */
.msgconfirm .alert {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.msgconfirm-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

tr.no-bottom-padding td {
	padding-bottom: 0px !important;
}

td.no-bottom-padding {
	padding-bottom: 0px !important;
}

/* DataTables Format */
table.dataTable thead .sorting:after, 
table.dataTable thead .sorting_asc:after, 
table.dataTable thead .sorting_desc:after, 
table.dataTable thead .sorting_asc_disabled:after, 
table.dataTable thead .sorting_desc_disabled:after,
table.dataTable thead .sorting:before, 
table.dataTable thead .sorting_asc:before, 
table.dataTable thead .sorting_desc:before, 
table.dataTable thead .sorting_asc_disabled:before, 
table.dataTable thead .sorting_desc_disabled:before {
    visibility: hidden;
}
.dataTables_wrapper .bootstrap-datatable {
	border-collapse: collapse !important;
}
/*
 * The footer's two lines come from the builder's `dom` string (see FOOTER_DOM in
 * table-config.js, and the reversal of #32 and #91 recorded there); how each line is
 * laid out is further down, with the pager rules.
 *
 * What used to be here before #32 -- `display: inline` and `float: right` on the
 * info block, `text-align: right` on the length control -- was the flat
 * pre-Bootstrap-5 layout's way of getting this same arrangement out of floats. The
 * arrangement is back; the floats are not. It is flex now, which is what lets the
 * two halves of line 1 share a baseline rather than a float's line box.
 */
/*
 * `div` qualifiers, and they are load-bearing rather than decoration (#46).
 *
 * DataTables sets `padding-top: 0.85em` on the info text through a selector
 * carrying its own element qualifiers, which outranks a bare two-class selector.
 * So this `padding-top: 0` -- declared here since long before -- never applied:
 * 11.05px of padding pushed the info line down inside a box the grid then centred,
 * leaving "Showing 1 to 10 of N entries" 4.8px below the baseline of the
 * `Show [10] entries` control beside it. The boxes were centred on each other all
 * along; the words were not, which is what the reader sees.
 *
 * Matching the qualifier count was the whole fix *for that defect*. It left the two
 * halves 0.75px apart, later 1.75px once the length control's select took the 44px
 * floor (#238) -- centred boxes around a 44px control and a 19.5px line never quite
 * put their words on one line.
 *
 * So line 1 now aligns its two halves on their baselines, which is exact rather
 * than close. This comment used to reject that, and the reason is worth keeping:
 * with the pager on the same row, the info text was the column a long pager
 * squeezed, and its words wrapped to four lines (#91) -- aligned on the first of
 * them, the last rested further from the control than centring left it. With the
 * pager on a line of its own nothing squeezes the info text but a phone, and there
 * it is the text's first line that sits beside the control.
 */
div.dataTables_wrapper div.dataTables_info {
    padding-top: 0;
    font-size: 13px;
}
.dataTables_wrapper .dataTables_length {
    font-size: 13px;
}
.dataTables_wrapper .dataTables_paginate a {
    font-size: 13px;
    /*
     * `padding-right: 5px` used to sit here, against Bootstrap's .75rem on the left.
     * It is half of the horizontal off-centring in #46, and it also outranks the
     * centring rule further down on specificity (0,2,1 against 0,2,0), so leaving it
     * would have quietly kept the label 3px off centre. Type size is all this rule
     * is for; the button's padding is set once, symmetrically, with the centring.
     */
}
/*
 * The footer's two lines, the same at every width (#239, #246).
 *
 * Line 1 is `dt-footer-summary`: the length control against the left edge, the info
 * text against the right, resting on one baseline (#238). `align-items: baseline`
 * lines up the first line of each -- the words around the 44px select and the
 * info text -- which is the line a reader reads across. The control never shrinks,
 * because `Show [10] entries` on three lines is #32's other defect. The info text
 * may: on the narrowest phone the two do not fit side by side, and the info text
 * wraps inside what the control leaves it, right-aligned, rather than the line
 * becoming two.
 *
 * Line 2 is `dt-footer-pager`, right-aligned. Below `md` the bs5 DataTables
 * stylesheet centres the info text and the pager -- the pager with `!important`,
 * through a selector of (0,3,3) -- which is the stacked phone layout this footer no
 * longer has, so both are answered here, the pager in kind.
 *
 * The pager wraps its own buttons, at every width: a table with enough pages has
 * more numbered buttons than a phone has room for at #84's 44px, and /admin/logs
 * once overflowed a 375px screen by 11px, pushing Previous past the left edge and
 * Next past the right. `justify-content` keeps a wrapped last row against the right
 * edge like the first.
 */
.dataTables_paginate .pagination {
	flex-wrap: wrap;
	row-gap: 4px;
	margin-bottom: 0;
}

.dataTables_wrapper .dt-footer-summary {
	display: flex;
	align-items: baseline;
	column-gap: 1rem;
	margin-top: .5rem;
}

.dataTables_wrapper .dt-footer-summary > .dataTables_length {
	flex: 0 0 auto;
}

div.dataTables_wrapper .dt-footer-summary > div.dataTables_info {
	flex: 0 1 auto;
	min-width: 0;
	margin-left: auto;
	text-align: right;
}

.dataTables_wrapper .dt-footer-pager {
	margin-top: .25rem;
}

div.dataTables_wrapper .dt-footer-pager div.dataTables_paginate ul.pagination {
	justify-content: flex-end !important;
}

.dataTables_length select[name='clearanceTable_length'] {
  	border: 1px solid var(--mika-border);
	border-radius: .25rem;
}

.dt-buttons .btn-secondary {
    background-color: var(--mika-brand);
    border-color: var(--mika-brand);
}
.dataTable td, .dataTable th {
	white-space: nowrap;
}

/*
 * Message tables wrap. Data tables do not.
 *
 * The rule above keeps tabular data on one line per cell, which is right: a column of
 * numbers or names reads worse broken across lines, and Responsive collapses columns out
 * of the way rather than wrapping them when the screen is too narrow.
 *
 * The error and warning tables are not that. They hold one column of prose -- "Row 1:
 * Employee X does not exist." -- and one column is nothing for Responsive to collapse, so
 * `nowrap` there does not defer the overflow, it guarantees it. At 375px the single cell
 * measured 526px inside a 293px wrapper and pushed the whole document 192px wider than the
 * viewport, which is the page-level overflow the audit refuses.
 *
 * Nine pages carry one of these tables, and every one of them is reached only by POSTing a
 * form. That is not a coincidence: no POST route in the inventory had ever actually been
 * measured, so nothing here had ever been looked at (#170).
 */
#error-table.dataTable td, #error-table.dataTable th,
#warning-table.dataTable td, #warning-table.dataTable th {
	white-space: normal;
}

/*
 * Cell text sits on the row's centre.
 *
 * Bootstrap 5's `.table` sets `vertical-align: top` and `.table > tbody` inherits
 * it, so every data cell computes `top`. Bootstrap 4 did not, which is what makes
 * this migration fallout rather than a choice anyone made.
 *
 * On its own it is invisible: a row as tall as one line of text has no centre to
 * miss. What made it visible is the 44px touch minimum further down, which inflates
 * any row carrying an action control -- /hr/employee's rows are 53px for a 24px
 * line, leaving the text 7.5px from the top with 27.5px beneath it (#46). The
 * taller the control in the row, the further the text drifts from the words beside
 * it. Centring the text is the fix; shrinking the row back is not, because that is
 * the touch target #7 added deliberately.
 *
 * Scoped to a data table's body, not to `.table`. `thead` keeps Bootstrap's
 * `vertical-align: bottom`, which is what a header sitting above its column wants,
 * and the layout tables -- form markup that becomes `display: block` on a phone --
 * are not data tables and are none of this rule's business.
 */
.dataTable > tbody {
	vertical-align: middle;
}
.dataTable {
	width: 100% !important;
}
.dataTable.table-hover tbody tr:hover {
    background-color: var(--mika-surface-hover);
}
.dataTable tbody tr {
	font-family: Courier;
}
/*
 * The Benefits Employee table keeps its actions in view while the rest of it scrolls sideways. A
 * pinned cell needs a solid background to cover what scrolls beneath it, which also covers the row's
 * hover colour, so that is laid back over the top.
 */
.bf-employee-table th[data-actions-column],
.bf-employee-table tbody tr:not(.child) > td:last-child:not(.dataTables_empty) {
	position: sticky;
	right: 0;
	z-index: 1;
	background-color: var(--mika-surface);
}
.bf-employee-table.table-hover tbody tr:not(.child):hover > td:last-child:not(.dataTables_empty) {
	background-image: linear-gradient(var(--mika-surface-hover), var(--mika-surface-hover));
}
.navbar-brand i.material-icons {
    vertical-align: -3px;
}

/* Customized Page stuff */
.settings-btn {
	float: none;
	padding: 0.2rem;
	border: 0px;
	background: transparent;
	cursor: pointer;
	color: var(--mika-brand);
	border-radius: .3rem;
}

.settings-btn:hover {
	background: var(--mika-brand);
	color: var(--mika-text-on-brand);
}

.dataTables_scrollBody {
	min-height: 250px !important;
	scrollbar-color: var(--mika-scrollbar-thumb) var(--mika-scrollbar-track);
}

/*
 * DataTables draws a left border on the scroll body and on nothing around it --
 * `div.dataTables_scrollBody { border-left: 1px solid #ddd !important }`, recoloured to
 * --bs-border-color under dark. In light mode it matched the surface and could not be
 * seen; in dark it is a line down the left of every scrolling table. Removed in both,
 * which also puts the body's columns under the header's, which has no such border.
 * The selector is DataTables' own: against its !important, only equal weight loaded
 * later wins.
 */
div.dataTables_scrollBody {
	border-left: 0 !important;
}

.hr-table a:hover {
	text-decoration: none;
}

.label-edit span {
	vertical-align: top;
}

.saz-action-btns {
	display: flex;
}

.table-button-row {
	text-align: end;
	padding: 1em 0 1em 0;
}

/* Accordion -> Tab */
.saz-tab .container {
	display: inline-block;
}

.saz-tab .col-sm {
	padding: 0;
}

/*
 * These are Bootstrap card headers outside any .card, so --bs-card-cap-padding-x, which
 * .card defines and .card-header reads, is unset and the label sat flush against the
 * tab's left edge. The inset is that variable's value, 1rem.
 */
.saz-tab .card-header {
	border: 0;
	padding-left: 1rem;
}

.saz-tab .card-header {
	cursor: pointer;
}

.saz-tab .accord-card-buttons .btn-primary {
	color: var(--mika-text-on-brand);
}

.saz-tab .mb-0 {
	font-size: 1.1em;
	color: var(--mika-text-on-brand);
	background: var(--mika-brand);
	border-top-left-radius: 0.2em;
	border-top-right-radius: 1em;
}

.saz-tab .mb-0.collapsed {
	color: var(--mika-text-muted);
	background: var(--mika-tab-collapsed-surface);
}

/* Modal */
.saz-modal .modal-body {
	width: 100%;
	max-height: 550px;
	overflow-y: auto;
}

/**
	TODO: deprecate 'data-submodule', change to data-modal-type
 */
.modal-dialog[data-modal-type='general-wide'],
.modal-dialog[data-submodule='cashcard-history'],
.modal-dialog[data-submodule='general-wide'] {
	max-width: 80%;
}

.modal-dialog[data-modal-type='general-half'],
.modal-dialog[data-submodule='general-half'] {
	max-width: 50%;
}
	
.modal-dialog[data-modal-type='general'],
.modal-dialog[data-submodule='general'] {
	max-width: 40%;
}

.modal-dialog[data-modal-type='general-small'],
.modal-dialog[data-submodule='general-small'] {
	max-width: 30%;
}

/* 40% of a phone leaves too little to read, so this one has a floor: as wide as 30rem, or as the screen allows. */
.modal-dialog[data-modal-type='employee-benefits'] {
	max-width: 40%;
	min-width: min(30rem, calc(100vw - 1rem));
}

.saz-modal td {
	padding: 0.2rem;
}

.saz-modal textarea {
	resize: none;
}

.modal-options {
	display: grid;
}

.modal-options > span {
	border: solid 1px var(--mika-brand);
	padding: 1rem;
	border-radius: .25rem;
	color: var(--mika-brand);
	background: var(--mika-surface);
	margin: 0.25rem;
	cursor: pointer;
}

.modal-options .material-icons {
	vertical-align: bottom;
}

.search-wrapper {
	display: flex;
	padding-bottom: .3rem;
}

.search-wrapper .form-control {
	margin-right: .3rem;
}

.search-result {
	overflow-y: auto;
	max-height: 30rem;
}
	
.search-result > div {
	display: flex;
}

.search-result > div .settings-btn {
	line-height: unset;
}

/* Popover */
.popover-body .search-wrapper .form-control {
	width: 70%;
}

.popover-body .search-result {
	max-height: 10rem;
}

/* DateRange Picker */
.daterangepicker td.active, .daterangepicker td.active:hover {
    background-color: var(--mika-brand);
}

.hidden-element {
    display: none !important;
}

.ui-datepicker-calendar {
    display: none;
}

.ui-datepicker-buttonpane button {
	background-color: var(--mika-brand);
    border-color: var(--mika-brand);
    padding: .25rem .5rem;
    color: var(--mika-text-on-brand);
	font-size: .875rem;
	line-height: 1.5;
	border-radius: .2rem;
	border: 1px solid transparent;
}

#ui-datepicker-div {
	margin: .125rem 0 0;
	font-size: 1rem;
	color: var(--mika-text);
	text-align: left;
	list-style: none;
	background-color: var(--mika-surface);
	background-clip: padding-box;
	border: 1px solid var(--mika-border-subtle);
	border-radius: .25rem;
	padding: 10px;
}

.ui-datepicker-prev {
	margin-right: 10px;
}

.ui-datepicker-prev span, .ui-datepicker-next span {
	color: var(--mika-link-hover);
}

.ui-datepicker-prev span:hover, .ui-datepicker-next span:hover {
    color: var(--mika-link-hover);
    text-decoration: underline;
}

.ui-datepicker-current, .ui-datepicker-month {
	margin-right: 10px;
	margin-top: 10px;
}

.ui-datepicker-month, .ui-datepicker-year {
	background-color: var(--mika-surface);
	background-clip: padding-box;
	border: 1px solid var(--mika-border);
	border-radius: .25rem;
}

/* Tom Select */
/*
 * The dropdown affordance (#43).
 *
 * Tom Select's Bootstrap 5 theme does draw a caret, but only for a wrapper that
 * is neither .form-control nor .form-select:
 *
 *   .ts-wrapper:not(.form-control,.form-select).single .ts-control { background-image: ... }
 *
 * The widget copies the original <select>'s classes onto the wrapper, and every
 * select in this application carries .form-control, so that rule excludes all of
 * them. The exclusion assumes Bootstrap's own caret takes over -- which is true
 * for .form-select and false for .form-control, the class we actually have. So
 * the control ends up with no caret from either side, which on /hr/employee left
 * two filters indistinguishable from the three text inputs beside them while the
 * rows-per-page control below kept its caret, being a native select still.
 *
 * The caret goes on the wrapper rather than on .ts-control, because the theme
 * puts `background: transparent !important` on the control -- a shorthand, so it
 * resets background-image along with the colour, and no ordinary declaration
 * survives it. The wrapper is not covered by that rule, the control above it is
 * transparent by that same rule, so a caret painted on the wrapper shows through
 * at the same inset and size Bootstrap uses on .form-select.
 *
 * The right padding that keeps the value clear of it is the theme's own, and was
 * failing for a second reason. It computes
 *
 *   padding-right: max(var(--ts-pr-min), var(--ts-pr-clear-button) + var(--ts-pr-caret)) !important
 *
 * and ships `--ts-pr-clear-button: 0` unitless. A number added to a length is
 * invalid inside calc, so the whole max() is invalid at computed-value time and
 * padding-right falls back to its initial 0 -- which is the `padding-right: 0px`
 * the report measured. Giving the variable a unit is enough to make the theme's
 * own arithmetic resolve, to exactly the 2.25rem Bootstrap uses. Only the caret's
 * own clearance is set here; the same unitless zero zeroes the padding on multi
 * controls too, which is a separate cosmetic defect and not this one.
 */
.ts-wrapper.single {
	--ts-pr-clear-button: 0px;
	background-image: var(--mika-select-caret);
	background-repeat: no-repeat;
	background-position: right .75rem center;
	background-size: 16px 12px;
}

/*
 * The search box is in the panel, and the panel says what is chosen (#237).
 *
 * select.js gives every single control the `dropdown_input` plugin, which moves
 * the search box out of the control and into the top of the dropdown -- where
 * bootstrap-select kept it. The rule that used to be here hid the selected item
 * while a query sat beside it in the control (#71); with the box gone from the
 * control there is nothing for the item to sit beside, so it went.
 *
 * The box is a field in its own right now, so it takes the shared field rules
 * further down -- 16px type and the 44px floor -- rather than the inner-text-node
 * exemption `.ts-control input` has. The theme gives it a hard-coded light border;
 * the token is used instead so it reads in both colour modes. The theme's focus
 * ring is dropped: it is drawn outside the box, so it spilled past the panel's
 * edge, and the open panel and the border's focus colour already say where typing
 * goes.
 *
 * And the control stops offering a text cursor once it has focus. The theme sets
 * `cursor: text` on a focused single control because that is where its box was;
 * nothing is typed there any more, and a text cursor is the "this is a text
 * field" cue #237 reported.
 *
 * The chosen option carries a check mark at the end of its row, as it did under
 * bootstrap-select. Tom Select marks it `.selected` and its Bootstrap 5 theme
 * draws nothing for that class, so an open list gave no sign of which entry the
 * control was showing. The mark is text in the option's own colour, so the
 * highlighted row's colour carries it too.
 */
.plugin-dropdown_input .ts-dropdown .dropdown-input {
	border-color: var(--mika-border);
	color: var(--mika-text);
}

.plugin-dropdown_input.focus .ts-dropdown .dropdown-input {
	box-shadow: none;
}

.ts-wrapper.single.plugin-dropdown_input.input-active .ts-control {
	cursor: pointer;
}

/*
 * A single control is one line high whatever it holds (#247, #248).
 *
 * With the search box gone from the control, the only thing left in it that can
 * make it grow is the chosen item's own text. `.ts-control` is a wrapping flex row
 * and the item wraps like any text, so a long choice -- "AFD1 - Audit Fixture
 * Deduction Code", "Non-Recurring - All" in a fifth of a row -- took the control
 * to two lines and 62-84px beside 44px neighbours. A native <select> truncates
 * instead, and so does this: the whole text is still in the open list, and the
 * list is where a reader goes to read it.
 *
 * `min-width: 0` on both, or the truncation never happens: a flex item's automatic
 * minimum is its content's width, and unbroken text's width is all of it. The
 * control would hold the wrapper open to the longest client name, and the column
 * around it with it -- the 296px column beside 196px ones #248 measured.
 *
 * `display: block` on the item because the theme makes it a flex container, and
 * `text-overflow` does nothing there: its text is an anonymous flex item, so the
 * name was cut off mid-letter at the padding with no ellipsis to say so.
 */
.ts-wrapper.single .ts-control {
	flex-wrap: nowrap;
	min-width: 0;
}

.ts-wrapper.single .ts-control > .item {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ts-dropdown .option.selected {
	position: relative;
	padding-right: 2.25rem;
}

.ts-dropdown .option.selected::after {
	content: "\2713";
	position: absolute;
	right: .75rem;
	top: 50%;
	transform: translateY(-50%);
}

.ts-dropdown-content {
	scrollbar-color: var(--mika-scrollbar-thumb) var(--mika-scrollbar-track);
}

/*
 * "Nothing chosen" reads as a prompt, not as a choice (#235).
 *
 * This application's empty option -- value `""` or the `#` sentinel -- carries the
 * field's own label as its text, and Tom Select renders it as a selected item at
 * full strength, so "Client" and "Work Status" looked like values already chosen
 * beside the dimmed "Employee No." placeholders of the text fields in the same row.
 * select.js marks the wrapper by value; this dims the item to the colour Bootstrap
 * gives a text field's `::placeholder`, which is a token and so already correct in
 * both colour modes. Choosing a real value takes the marker off, and the item goes
 * back to the control's own colour.
 */
.ts-wrapper.single.shows-prompt .ts-control > .item {
	color: var(--bs-secondary-color);
}

/* MultiSelect */
.ms-container {
    width: 100%;
}

/* Numbered Checkbox */
.numbered-checkbox {
	font-size: 18px;
	font-weight: bold;
	text-align: center;
	width: 40px;
	height: 33px;
}

.col-half {
	max-width: 50%;
}

.modal-form .row {
	margin-bottom: .5rem;
}

.display-inline {
	display: inline;
}
.float-right {
	float: right;
}

.not-tally-modal-link {
	margin-right: 10px;
}

#statusLegend, #deleteMultiple{
	margin-left: 10px;
}

.no-padding {
	padding: 0px;
}

/* Government Logos */
.logo-sss {
	width: 25px;
	height: 25px;
	max-width: 25px;
	max-height: 25px;
}

.logo-hdmf {
	width: 30px;
	height: 30px;	
	max-width: 30px;
	max-height: 30px;
}

.logo-phic {
	width: 20px;
	height: 30px;
	max-width: 20px;
	max-height: 30px;
}
.get-sss-prompt, .get-hdmf-prompt {
	padding-right: 10px;
}
.invoice-coop-logo {
	width: 200px;
	margin-left: auto;
}
.div-min-width {
	min-width: 50px;
}
.div-max-width {
	max-width: 90px;
}
.toggle-off.btn {
	background-color: lightgrey;
}

.hideshow {
	display: none;
}

.overlay{
	position: fixed;
	top: 0;
	left: 0;
	z-index: 100;
	width: 100%;
	height: 100%;
	display: none;
	background: var(--mika-overlay);
}
.cv-spinner {
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}
.spinner {
	width: 40px;
	height: 40px;
	border: 4px var(--mika-spinner-track) solid;
	border-top: 4px var(--mika-spinner-head) solid;
	border-radius: 50%;
	animation: sp-anime 0.8s infinite linear;
}
@keyframes sp-anime {
	100% {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   Toast notifications
   --------------------------------------------------------------------------
   A transient message in the bottom-right corner of the viewport: raised by
   UI.toast, built by toast.js, and never declared by a page. The container is
   created on first use, so a screen that raises no toast carries none of this.

   Drawn from the --mika-* tokens rather than from Bootstrap's own toast
   variables, so dark mode follows with no second rule set -- and so
   tools/audit/theme-check.mjs can assert the surface, the text and the accent
   against the token values instead of against hex strings.

   The component's own media query lives in this section rather than in the
   responsive block below: everything that decides how a toast looks is meant to
   be readable in one place.
   ========================================================================== */
.mika-toast-container {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	/*
	 * Above the modal (1055), its backdrop (1050) and the loading overlay (100).
	 * This is the property the component exists for: a message raised from inside
	 * a dialog has to be readable, which is exactly what #74 had to work around
	 * for the two call sites that hit it.
	 */
	z-index: 1090;
	display: flex;
	flex-direction: column;
	/* Newest last, so a run of messages reads downwards in the order it happened. */
	gap: 0.5rem;
	width: max-content;
	max-width: calc(100vw - 2rem);
	/*
	 * The container spans nothing the user wants to click; only the toasts
	 * themselves take pointer events, so the page underneath stays usable.
	 */
	pointer-events: none;
}

.mika-toast {
	pointer-events: auto;
	width: 22rem;
	max-width: 100%;
	background-color: var(--mika-surface);
	color: var(--mika-text);
	border: 1px solid var(--mika-border);
	/* Bootstrap tints its toast from --bs-body-bg and blurs what is behind it. */
	--bs-toast-bg: var(--mika-surface);
	--bs-toast-color: var(--mika-text);
	--bs-toast-border-color: var(--mika-border);
	backdrop-filter: none;
	box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

/*
 * The accent edge. Four tokens, four kinds, and nothing hard-coded: dark mode
 * already redefines each of these, so the toast follows the theme without a
 * second rule set. tools/audit/theme-check.mjs asserts exactly that.
 */
.mika-toast-success {
	border-left: 4px solid var(--mika-accent-green);
}

.mika-toast-error {
	border-left: 4px solid var(--mika-accent-red);
}

.mika-toast-warning {
	border-left: 4px solid var(--mika-accent-yellow);
}

.mika-toast-information {
	border-left: 4px solid var(--mika-accent-blue);
}

.mika-toast-success .mika-toast-icon {
	color: var(--mika-accent-green);
}

.mika-toast-error .mika-toast-icon {
	color: var(--mika-accent-red);
}

.mika-toast-warning .mika-toast-icon {
	color: var(--mika-accent-yellow);
}

.mika-toast-information .mika-toast-icon {
	color: var(--mika-accent-blue);
}

/*
 * The icon states the kind alongside the colour, so the two are not the same
 * signal twice -- a red-green colour deficiency still leaves a tick and a cross.
 *
 * It keeps the 44px box that i.material-icons gives every bare icon in this
 * application rather than being shrunk to its glyph. The audit measures every
 * such icon as a touch target and does not except this one; making it smaller
 * would mean relaxing a rule that guards 98 icons elsewhere so that one piece of
 * decoration could be 20px tighter. Only `flex` is set, so a long message cannot
 * squeeze the glyph.
 */
.mika-toast .mika-toast-icon {
	flex: 0 0 auto;
	font-size: 24px;
}

.mika-toast .mika-toast-body {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.mika-toast .mika-toast-message {
	flex: 1 1 auto;
	min-width: 0;
	/* A server message can be one long unbroken string; it wraps rather than
	   pushing the toast past the edge of the screen. */
	overflow-wrap: anywhere;
}

/*
 * The close control. It carries the 44px minimum every .btn-close in the
 * application has, so dismissing a message is one thumb press at any viewport.
 */
.mika-toast .mika-toast-close {
	flex: 0 0 auto;
	align-self: center;
	margin-left: auto;
}

/* --------------------------------------------------------------------------
   Below the medium breakpoint a corner card is a crammed corner card. The
   toast becomes a full-width inset strip instead, still inside the viewport so
   it cannot widen the page.

   It also moves to the top of the viewport rather than the bottom, which is a
   claim worth stating because on a wide screen the bottom corner is plainly the
   right place for it.

   On a phone it is not. A full-width strip pinned to the bottom edge spans the
   whole width of whatever is at the bottom of the page, and the bottom of the
   page is where a single-column layout puts its last control -- so the message
   confirming an action covers the control that performed it (#197: the
   appearance tile is the last card on the welcome grid, and the confirmation
   landed on top of it at every scroll position a user could press it from). The
   bottom edge on a phone is also where the browser's own chrome and the user's
   thumb live.

   The inset clears the sticky navbar, which measures 71px at this breakpoint.
   That number is not repeated anywhere: tools/audit/theme-check.mjs measures the
   gap against the navbar it actually finds, so this drifting out of step is a
   failed check rather than a message sitting over the menu.
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
	.mika-toast-container {
		left: 0.75rem;
		right: 0.75rem;
		top: 5rem;
		bottom: auto;
		width: auto;
		max-width: none;
	}

	.mika-toast {
		width: auto;
	}
}

/* ==========================================================================
   Release footer
   --------------------------------------------------------------------------
   A slim bar along the bottom edge of the viewport naming the release the
   running build was cut from. Its markup is in fragments/postbody.jspf, which
   all 135 JSPs include, so these rules apply everywhere -- including the
   signed-out views, which force light mode before including head.jspf and are
   the ones most likely to be in a screenshot somebody is asking about.

   Drawn entirely from the --mika-* tokens, like everything else below the token
   block, so dark mode follows with no second rule set.

   Nothing in it is interactive. It is read, not used.
   ========================================================================== */

/*
 * The bar's painted height, which the two rules below have to agree on: the bar
 * itself, and the body padding that keeps content off it.
 *
 * Held here rather than in the token block at the top of the file. That block is
 * the colour layer and says so -- every colour in this stylesheet is named there
 * and referenced by name. A length in the middle of it would read as a colour
 * somebody forgot to write.
 */
:root {
	--mika-release-footer-height: 1.625rem;
}

/*
 * The clearance. Without it a fixed bar covers the last 26px of every page, and
 * the thing sitting there on the pages that matter is a paginated table's pager
 * -- so the page would look complete and its second page would be unreachable.
 */
body {
	padding-bottom: calc(var(--mika-release-footer-height) + 1rem);
}

.mika-release-footer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	/*
	 * Above ordinary content and below everything that is meant to cover it: the
	 * loading overlay at 100, an open dropdown at 1030, the modal backdrop at 1050
	 * and a toast at 1090. The bar is the least important thing on the page and its
	 * stacking says so -- a version number must never be the reason a menu opening
	 * near the bottom of the viewport cannot be read.
	 *
	 * The toast is pinned to this same edge and so overlaps the bar's top edge by
	 * about 10px while it is up. That is deliberately left alone. Lifting the toast
	 * clear would move every message in the application permanently further into the
	 * page, and it was measured doing exactly that: at phone width on /admin/logs the
	 * lifted toast landed on the second row of the pager. A transient overlay briefly
	 * covering a static bar is what an overlay is for; the bar is not.
	 */
	z-index: 3;
	height: var(--mika-release-footer-height);
	/* Border-box is Bootstrap's global default, so the 1px border is inside the
	   height above and the text centres against what is left of it. */
	line-height: calc(var(--mika-release-footer-height) - 1px);
	padding: 0 0.75rem;
	background-color: var(--mika-surface-raised);
	color: var(--mika-text-muted);
	border-top: 1px solid var(--mika-border-subtle);
	font-size: 0.75rem;
	text-align: center;
	/*
	 * One line, always. At roughly 45 characters the text fits inside a 360px
	 * viewport with room to spare, but a wrap here would grow a fixed element
	 * upwards into the content the padding above was sized to clear. The overflow
	 * pair is the guard for that: the bar keeps its height and the page never
	 * widens, whatever the number turns out to be.
	 */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ==========================================================================
   Responsive behaviour
   --------------------------------------------------------------------------
   Before this block the stylesheet contained no media query at all: nothing in
   the application had ever been asked to respond to a screen size.
   ========================================================================== */

/*
 * 16px is not a style choice. Below it, iOS Safari zooms the whole page when a
 * field takes focus, and the user has to pinch back out to reach the next field.
 * Setting it on every text-entry control removes that behaviour application-wide.
 */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-control,
.form-select,
.ts-control,
.ts-control input,
.ts-dropdown,
.dataTables_filter input,
.dataTables_length select {
	font-size: 16px;
}

/*
 * Touch targets. iOS and Android both put the minimum at 44px. Icon controls,
 * table row actions and pagination were all sized for a mouse pointer.
 */
.btn,
.btn-close,
.page-link,
.dt-button,
.paginate_button {
	min-height: 44px;
	min-width: 44px;
}

/*
 * ...and the fields those buttons sit beside take the same floor.
 *
 * The direction is forced, not preferred. `tools/audit/rules.mjs` exports
 * MIN_TAP_TARGET_PX = 44 and fails any control under it, so lowering the button to
 * meet a 36-38px field would trade a cosmetic mismatch for a gate failure on every
 * button in the application. Raising the field is the only direction that both
 * closes the mismatch on a filter row and keeps the gate green -- and a text field
 * is a touch target in its own right, so it wanted the floor anyway.
 *
 * Unconditional, like the 16px input font-size above it: a target too small to hit
 * is too small at every width, and the heights are wanted to agree on desktop too,
 * which is where the mismatch was reported.
 *
 * Checkboxes and radios are excluded -- their shape carries meaning and their target
 * comes from .form-check above. .ts-dropdown and .ts-control input are excluded too:
 * a panel and an inner text node, neither a target in its own right.
 */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-control,
.form-select,
.ts-control,
.dataTables_filter input,
.dataTables_length select {
	min-height: 44px;
}

/*
 * ...counting the border the reader sees, not the one inside it (#236, #240, #242).
 *
 * Two kinds of field in this application are drawn inside somebody else's border.
 * An enhanced dropdown's visible box is Tom Select's wrapper -- it carries the
 * select's `.form-control`, and so its 1px border -- around a `.ts-control` the
 * theme makes borderless. A date range's visible box is `.input-group`, which this
 * stylesheet borders as a whole around a borderless label and input. The floor
 * above lands on the inner element in both, so the border went on top of it: 46px
 * boxes in a filter column of 44px text fields, the mismatch every stacked search
 * form reported.
 *
 * So the inner element takes the floor less the border around it, and the box the
 * reader sees -- which is also what a finger lands on -- is 44px like everything
 * beside it. The qualifiers are there to outrank the floor's own selectors, not for
 * decoration: `input:not(...):not(...)` is (0,2,1), and a bare `.input-group input`
 * would lose to it.
 *
 * Not the button in cc-records' employee lookup, the one input group that holds a
 * `.btn`: a button is a target in its own right and keeps the whole 44px, so that
 * group stays 46px rather than handing out a 42px button.
 */
.ts-wrapper.form-control > .ts-control,
.ts-wrapper.form-select > .ts-control,
.input-group > input:not([type="checkbox"]):not([type="radio"]) {
	min-height: calc(44px - 2px);
}

/*
 * Text links that act as navigation -- breadcrumbs, the brand, the module cards
 * -- are inline elements, and an inline box ignores width and height. They have
 * to become inline-flex before a minimum target size means anything at all.
 */
a.link-home,
a[class*="link-"],
.breadcrumb-item > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	/* A short label like "HR" is still a target that has to be hit. */
	min-width: 44px;
}

/* A card that is itself the link already provides the target. */
.card a[class*="link-"],
a.card[class*="link-"] {
	display: flex;
}

/*
 * Bootstrap's reboot underlines every <a>, including the href-less ones module tiles
 * are. A card is not running text, and hover-card already drops the underline the
 * moment a pointer arrives -- so it only ever showed until then. Keyed on the tile,
 * not on a `link-` class: a tile that opens a dialog rather than a page has none, and
 * the cashcard report tiles kept their underline for exactly that reason.
 */
a.card.hover-card {
	text-decoration: none;
}

/*
 * The nav panel's accordion links (#225 phase 2). `a[class*="link-"]` above
 * gives every one of these its 44px touch target for free -- but that rule
 * centres content for a square tile, and here the links read as a vertical
 * list, so only the layout is overridden, never the target itself.
 *
 * The selector is `a.nav-panel-link`, not `.nav-panel-link`, on purpose:
 * `a[class*="link-"]` above is one type selector plus one attribute selector,
 * the same specificity as one class selector plus one, so a bare class here
 * would tie it and lose the tiebreak to source order (it comes first). Adding
 * the type selector ties `a[class*="link-"]` on specificity and wins on
 * appearing later instead -- without it `justify-content` silently stayed
 * `center`, and every accordion-body link rendered as a shrink-to-fit box
 * centred in the row instead of flush left against the header above it.
 */
a.nav-panel-link {
	width: 100%;
	justify-content: flex-start;
	gap: 0.5rem;
	text-decoration: none;
}

.nav-panel-link:hover,
.nav-panel-link:focus-visible {
	background-color: var(--mika-surface-hover);
}

/*
 * The active section (#225 phase 3). navPanel.jspf sets `aria-current="page"`
 * on the one link that represents the page currently open, from `activeSection`
 * -- so this reuses that attribute as the styling hook rather than a second,
 * parallel class that could drift from the semantic that actually matters to a
 * screen reader.
 */
.nav-panel-link[aria-current="page"] {
	font-weight: bold;
	background-color: var(--mika-surface-hover);
}

/*
 * Home and BDO Auditor (#225 revision): plain, non-collapsing accordion items
 * that reuse `.accordion-button` for the same padding, border and hover/focus
 * styling as every module header, so the panel reads as one list instead of
 * two links bolted on before and after it. `collapsed` on the element itself
 * keeps Bootstrap's resting background rather than the `:not(.collapsed)`
 * highlighted one, since neither of these toggles anything; the chevron that
 * class draws is removed below for the same reason.
 *
 * `.accordion-button` alone is one class selector, the same tie `.nav-panel-
 * link` above resolves with a type selector -- here the second class does the
 * same job: `.accordion-button.nav-panel-static-item` outranks `a[class*=
 * "link-"]` on class count alone, so its own `display`/`justify-content` no
 * longer needs restating anywhere else to survive that rule.
 */
.accordion-button.nav-panel-static-item {
	display: flex;
	justify-content: flex-start;
	width: 100%;
	/* Real accordion-button headers are <button>s, so the reboot's link underline
	   never applies to them; these two are <a> instead (the `link-` convention
	   needs an anchor), so it has to be turned off explicitly here. */
	text-decoration: none;
	/* Same cause: an <a> inherits the enclosing <h3>'s heading weight, where a
	   <button> takes the UA's normal weight, so these two read bold beside every
	   module header until the weight is set back here. */
	font-weight: normal;
}

.accordion-button.nav-panel-static-item::after {
	display: none;
}

.nav-panel-module-icon {
	min-width: 24px;
}

/*
 * The panel header (#225 revision): the signed-in user's name in place of the
 * static "Navigation" label, with a profile icon ahead of it. `.offcanvas-title`
 * is already a flex item of `.offcanvas-header`, so the icon only needs to sit
 * inline with the text, the same way every accordion item's own icon does.
 */
.nav-panel-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nav-panel-profile-icon {
	min-width: 24px;
}

/*
 * The panel footer (#225 revision): Logout, moved here from the navbar row --
 * see the fragment's header comment. A `<button>`, not an `<a>` styled like the
 * links above it: it ends the session rather than resolving a `link-` class to
 * a destination, so it never needs the touch-target rules keyed on that
 * convention and the markup-convention test never has to know about it either.
 */
.nav-panel-footer {
	border-top: 1px solid var(--mika-border-subtle);
	padding: 0.75rem 1rem;
}

.nav-panel-logout {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.5rem;
	width: 100%;
	min-height: 44px;
	padding: 0;
	background: none;
	border: none;
	color: var(--mika-link);
}

.nav-panel-logout:hover,
.nav-panel-logout:focus-visible {
	background-color: var(--mika-surface-hover);
}

/*
 * Bootstrap's own accordion classes carry no colour of their own to override --
 * `--bs-accordion-bg`, `--bs-accordion-border-color` and the rest resolve from
 * `--bs-body-bg`/`--bs-border-color`, which already follow `[data-bs-theme]`
 * (see theme.js). Same reasoning as the offcanvas itself in phase 1.
 *
 * What is overridden is mostly shape: the accordion runs edge to edge across
 * the panel as one uniform list. The body's padding goes, and with it the rounded
 * first and last items and the side borders that made the list read as a card
 * inset in the panel. The rows keep their top and bottom borders as separators.
 * The two radius variables are Bootstrap's own, so its first-/last-of-type corner
 * rules for items, buttons and collapses all resolve to square from one place.
 *
 * The one colour is the separator: the subtle line the panel footer and the release
 * footer draw, not the input-outline weight --bs-border-color resolves to.
 */
.nav-panel-body {
	padding: 0;
	scrollbar-color: var(--mika-scrollbar-thumb) var(--mika-scrollbar-track);
}

.nav-panel-accordion {
	--bs-accordion-border-radius: 0;
	--bs-accordion-inner-border-radius: 0;
	--bs-accordion-border-color: var(--mika-border-subtle);
}

.nav-panel-accordion > .accordion-item {
	border-left: 0;
	border-right: 0;
}

/*
 * Checkboxes, radios and switches take their touch target from the row, not from
 * the control. Forcing 44x44 onto the control itself squares off a radio and
 * flattens Bootstrap's switch pill into a circle -- the control's shape carries
 * meaning, so the hit area goes around it instead.
 */
.form-check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	margin-bottom: 0;
}

.form-check .form-check-label {
	margin-bottom: 0;
	/* the label is part of the target: tapping the word toggles the control */
	min-height: 44px;
	display: flex;
	align-items: center;
}

.form-check-input {
	width: 1.35rem;
	height: 1.35rem;
	margin-top: 0;
	flex: 0 0 auto;
}

/* Bootstrap draws a switch as a pill roughly 2:1; keep that ratio, scaled up. */
.form-switch .form-check-input {
	width: 3rem;
	height: 1.5rem;
}

.btn-close {
	/* Bootstrap sizes this from its background image; give it a real hit area. */
	background-position: center;
	padding: 0;
}

/* An icon acting as a control needs the same hit area as a button. */
i.material-icons {
	font-size: 24px;
	line-height: 44px;
	min-width: 44px;
	text-align: center;
	vertical-align: middle;
}

/*
 * Inside a real button the button already provides the target.
 *
 * "Real button" means a control, not every <button> element. The appearance tile on
 * the welcome screen is a <button> that is also a .card: it is a control, but its
 * size comes from the tile, and the 44px line box above is what gives every other
 * module tile its height. Matching the bare element stripped that line box from the
 * one tile built as a button and left it 15px short of the other thirteen, so the
 * selector names the control classes the comment is actually about. .icon-btn has
 * its own icon rule further down and is listed here for the same reason: what is
 * exempt should be readable in one place.
 */
.btn i.material-icons,
.icon-btn i.material-icons,
a.btn i.material-icons {
	/*
	 * `1`, not `inherit`. A unitless line-height inherits as a *factor*, not as the
	 * parent's used value: `.btn` computes `line-height: 1.5`, and `inherit` hands the
	 * icon that 1.5 to re-resolve against its own 24px font-size -- a 36px line box,
	 * not the button's 24px. That is what pushed the search button on a filter row to
	 * 50px against a 38px field. `1` resolves against the icon's own font-size and
	 * gives the 24px box intended here, matching `.icon-btn i.material-icons` below.
	 */
	line-height: 1;
	min-width: 0;
}

/*
 * Breadcrumbs ran off the side rather than wrapping, taking the "where am I"
 * affordance off-screen with them.
 */
.breadcrumb {
	flex-wrap: wrap;
}

/*
 * ...and their parts have to sit on one line once they are there.
 *
 * The touch-target rule above makes a breadcrumb link `inline-flex` with a 44px
 * `min-height`, which centres its text inside a 44px box. The `/` separators
 * (Bootstrap's `.breadcrumb-item + .breadcrumb-item::before`, a floated block)
 * and the current-page label are plain inline content, so they sat in a line box
 * at the *top* of the `<li>` -- 10px above the link text. Two layout modes in one
 * line box, which never meet.
 *
 * Centring the item is what reconciles them: it puts the label and the separator
 * under `align-items`, and a float does not apply to a flex item, so the
 * separator comes along. `align-items` on the `<ol>` instead is not enough --
 * that shrinks each `<li>` to its own content, which realigns the last item but
 * leaves the separator inside a still-44px link item exactly where it was.
 *
 * The links keep their 44px target; the rest of the breadcrumb moves to meet it.
 */
.breadcrumb-item {
	display: flex;
	align-items: center;
}

/*
 * ...and the page-header row is the same defect wearing different clothes (#31).
 *
 * A header row is a heading with its action buttons at the right-hand end. It was
 * built out of floats -- `float-start` on the heading, `float-end` on each button --
 * and both touch-target rules above break it, for the same reason and in two places:
 *
 *   a[class*="link-"]        { display: inline-flex; ... }
 *   h1..h6 > a:only-child    { display: inline-flex; ... }
 *
 * Each makes the *wrapping anchor* a flex container, and a float does not apply to a
 * flex item -- so the `float-end` on the button inside is cancelled and the control
 * lands beside the heading rather than at the right edge, up to 1034px short of it.
 * The second selector is why /earnings/records reads as half-broken: its Add anchor is
 * not an only child, so that one still floats while the two beside it do not.
 *
 * Vertically it is the 44px target again. `.page-header` was `display: block`, so a
 * 26px heading and a 44px anchor both started at the same `y` and the anchor hung 18px
 * below -- which is the misalignment #31 reports.
 *
 * So the row stops being a float and becomes a row. `margin-left: auto` on the actions
 * rather than `justify-content: space-between` on the row, because several of these
 * headers carry a third child (a hidden input, a status glyph) and space-between would
 * spread those across the row instead of keeping the actions together at the end.
 *
 * The heading's margin has to go, and that is not cosmetic: `align-items` centres
 * margin boxes, so a heading that kept Bootstrap's `margin-bottom` would sit half that
 * margin above the buttons and reintroduce the defect at 4px instead of 18px.
 *
 * As with the breadcrumb, the links keep their 44px target and the row moves to meet
 * them. Neither touch-target rule above is weakened or narrowed.
 */
.page-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	/*
	 * ...and the space below the row is the row's, not the page's (#44).
	 *
	 * This replaces a `padding: 0 0 25px 0` that had been on `.page-header` since
	 * long before the row became a flex row. Padding is *inside* the box, so the
	 * 25px inflated a 44px row to 69px and the dead space it created sat under the
	 * heading rather than under the row -- which is why /hr/employee measured 24px
	 * between the header's box and its filters while the reader saw 58px between
	 * the words and the same filters. A gap you cannot see in the box you are
	 * setting it on is a gap nobody can reason about.
	 *
	 * Margin instead, so the number here is the separation itself, and 1rem because
	 * it converges two populations that had drifted apart: seventeen of the
	 * thirty-two pages carried a hand-written `<br>` or empty `<p>` after the row on
	 * top of the padding (49px of content-to-content space), and fifteen carried the
	 * padding alone (25px). Removing the padding alone -- the remedy #44 suggests,
	 * and doubts in the same breath -- leaves the first group at 24px and welds the
	 * second group's heading to its content at 0px. Removing both and setting the
	 * separation here lands every page on 1rem.
	 *
	 * Not on the heading. `align-items: center` centres margin boxes, so a heading
	 * carrying a bottom margin sits half that margin above the buttons beside it,
	 * which is #31 again at 8px instead of 18px. The `margin-bottom: 0` below is
	 * what keeps that from happening and is not to be relaxed.
	 */
	margin-bottom: 1rem;
}

.page-header > h1,
.page-header > h2,
.page-header > h3,
.page-header > h4,
.page-header > h5,
.page-header > h6,
.page-header > p {
	margin-bottom: 0;
}

/*
 * A note under the heading stays under it. Two transmittal pages put an instruction
 * line in the row ("* upload the transmittal file as generated") and the work
 * assignment form puts one under its <h1>, and a block-level heading used to push
 * those onto their own line for free. A flex item does not do that, so the break is
 * asked for explicitly rather than left to move up beside the heading.
 */
.page-header > span,
.page-header > p {
	flex-basis: 100%;
}

.page-header-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.25rem;
	/* Whatever else is in the row, the actions end it. */
	margin-left: auto;
}

/*
 * A rule between two groups of header actions (#241).
 *
 * /deductions/records drew this with a bare `more_vert` glyph, and every
 * `i.material-icons` is given a 44px box by the touch-target rules above -- so a
 * mark that is not a control took a control's width. Eight 44px items and their
 * gaps came to 380px in a 376px row at 400px, and Finish Batch wrapped onto a line
 * by itself.
 *
 * Painted, so it is presentation only: the markup carries `aria-hidden` and it is
 * never focusable. Hidden below `md`, where the seven buttons have 4px to spare at
 * 360px and a rule would cost the row its one line; on a phone the gap between
 * groups is the one gap there is.
 */
.page-header-divider {
	display: none;
}

@media (min-width: 768px) {
	.page-header-divider {
		display: block;
		align-self: center;
		width: 1px;
		height: 24px;
		margin: 0 0.25rem;
		background-color: var(--mika-border);
	}
}

/*
 * ...and a pager button is the third of them (#46).
 *
 * Both touch-target rules above name the pager: `.paginate_button` is the `<li>`
 * and `.page-link` is the anchor inside it, so both are at least 44x44. The anchor
 * is a block box around a 19.5px line, and a block box puts its line at the top --
 * so the label sat 9px from the top of a 44px button with 20px beneath it.
 *
 * Horizontally it was two things at once. DataTables' own stylesheet right-aligns
 * the pager's text, and the padding was asymmetric -- Bootstrap's `.75rem` on the
 * left against the `padding-right: 5px` this stylesheet sets for the footer's type
 * size. A "1" therefore sat 29.7px from the left of its 44px button and 6px from the
 * right; "Previous" sat 13px and 6px. Centring the anchor's content settles both,
 * and it has to be the anchor rather than the `<li>`: the anchor is what fills the
 * target and what paints the button.
 *
 * The padding becomes symmetric and smaller, which is where the issue's "~10% more
 * compact" comes from. It is the only place it can come from: the 44px minimum is
 * what makes these tappable and is not what is being traded away here.
 */
.dataTables_paginate .page-link {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
}

/*
 * Any table that is not inside a DataTables wrapper scrolls within itself, so
 * that a wide table never widens the page. The page body must not scroll
 * sideways; a table may.
 */
.table-responsive-wrapper {
	width: 100%;
	overflow-x: auto;
	scrollbar-color: var(--mika-scrollbar-thumb) var(--mika-scrollbar-track);
	-webkit-overflow-scrolling: touch;
}

/*
 * ...except a modal's form table. A layout table stacks to blocks on a phone and
 * never needs to scroll sideways, but the scroll container still clips anything
 * that overflows it -- a Tom Select dropdown opened inside it showed barely one
 * option before being cut off at the wrapper's edge.
 */
.modal-body .table-responsive-wrapper:has(> table.layout-table) {
	overflow: visible;
}

/*
 * Form fields wide enough to read on a narrow screen (#73).
 *
 * A bare Bootstrap `.col` divides its row into equal widths at every width and
 * has no breakpoint at which it wraps its children to full width -- so a
 * five-control filter row stays five controls at 375px, each about 5px of usable
 * text space, and every placeholder renders as "Emplc", "First N", "Middl". The
 * record-search sections could not be used on a phone because nothing on them
 * could be identified. Bootstrap 4 and 5 behave the same way here: this is a
 * pre-existing defect that reproduces on prod, not migration fallout.
 *
 * There are 234 such columns across 50 pages, so this is a rule rather than 234
 * edits agreeing with each other by hand.
 *
 * What earns a column the treatment is holding a control, not sitting in a form.
 * A form was the first scope tried and it was too narrow by measurement: the same
 * filter block appears outside one on u-active-employee-logs, the two ENC pages
 * and the two CCS pages, and those kept clipping. Narrowness is destructive to a
 * field, whose content is text the reader has to identify; a row of buttons is
 * not harmed by staying a row, which is why the 97 columns holding no control are
 * deliberately left alone.
 *
 * The control has to be the column's own child. Matching at any depth was tried
 * and is wrong: a layout column wrapping an entire table matches, because the
 * table's own filter row holds inputs, and the table was cut to half width on
 * dsh-reg-users and dsh-last-posted-payroll -- which broke their DataTables
 * footers onto extra lines and was caught by the audit's existing footer rules
 * rather than by eye. The filter blocks all put their control directly in the
 * column, so the child combinator loses nothing.
 *
 * Two selectors, not one list, and the duplication is load-bearing. A selector
 * list is dropped in its entirety by a browser that does not understand any part
 * of it, so pairing `:has()` with the plain selector would take both down
 * together on anything older than Chrome 105 or Safari 15.4. Split, the plain one
 * still stacks every filter block that is inside a form -- which is most of them
 * -- and `:has()` adds the rest wherever it is supported.
 *
 * Two tiers rather than one, because the measurement said so. At tablet width the
 * five-column row still clipped four fields, the worst wanting 235px and given
 * 94px, so stacking below `md` alone would have left the reported defect in place
 * on a tablet. Half width there gives about 360px of content, which clears the
 * longest placeholder in the application with room to spare, and full stacking is
 * kept for the phones that need it. The audit's input-clips-placeholder rule is
 * what all of these numbers are checked against.
 *
 * Not covered, and deliberately: the filter inputs a DataTable clones into its
 * header row on the column-filter pages. Those are table cells, sized by their
 * column, in a table that scrolls -- a different control in a different layout,
 * and a different decision from this one.
 */
@media (max-width: 991.98px) {
	form .row > .col {
		flex: 0 0 50%;
		max-width: 50%;
	}

	.row > .col:has(> .form-control, > .input-group, > .form-check, > select, > textarea) {
		flex: 0 0 50%;
		max-width: 50%;
	}
}

@media (max-width: 767.98px) {
	form .row > .col {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.row > .col:has(> .form-control, > .input-group, > .form-check, > select, > textarea) {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/*
 * A search form's fields are one gap apart, however they happen to stack (#236,
 * #240, #242).
 *
 * The rules above wrap a filter row's columns onto lines of their own on a narrow
 * screen, and nothing put any space between those lines: a Bootstrap row's
 * vertical gutter is zero unless asked for, so fields in the same row touched.
 * The space between rows was whatever each page wrote by hand -- a `<br>` on
 * /hr/employee (24px), `style="margin-top: 10px"` on the two records pages -- so a
 * stacked form read as clumps: none, none, 24px, none, none.
 *
 * One value, set here, used for both: between the lines a row wraps into, and
 * between one row and the next. A page opts in by putting the class on its form's
 * rows, and writes no spacing of its own.
 *
 * `row-gap` rather than Bootstrap's `--bs-gutter-y`, on purpose. The gutter is a
 * margin on every column paid for by a negative margin on the row, and the first
 * row's negative margin collapses through the form it sits in -- the form's box
 * moves up under the page header, and the header's own 1rem separation (#44) is
 * no longer what it measures. `row-gap` puts space only *between* lines, so the
 * first field sits exactly where the form begins.
 */
.search-form-row {
	--mika-search-form-gap: .75rem;
	row-gap: var(--mika-search-form-gap);
}

.search-form-row + .search-form-row {
	margin-top: var(--mika-search-form-gap);
}

/*
 * A grid cell holding a pair of switches side by side (#248), so two short
 * toggles share one column of a search form's grid rather than taking one each.
 * They wrap onto a second line only if the column is too narrow for both, which
 * no width this application is laid out at produces.
 */
.search-form-pair {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 1rem;
}

@media (max-width: 767.98px) {
	/*
	 * Header. Brand, the appearance toggle and the nav panel's burger button have to
	 * share one narrow line without pushing the page wider (#225). The offcanvas
	 * panel itself needs no rule here -- Bootstrap sizes and positions it off the
	 * viewport, not the container -- only the row that opens it.
	 */
	.navbar .container {
		flex-wrap: wrap;
		row-gap: 4px;
	}

	.navbar-brand.home-font {
		font-size: 1.1rem;
		margin-right: 0;
	}

	.home-logo {
		height: 32px;
	}

	/* Alerts have to stay readable with the dismiss control still reachable. */
	.alert-dismissible {
		padding-right: 3.5rem;
	}

	/* Stack form controls full width rather than squeezing them side by side. */
	.form-inline .form-control,
	.form-inline .btn {
		width: 100%;
		margin-bottom: 8px;
	}

	/* A button floated into a heading overlaps the heading text on a phone. */
	.float-end,
	.float-start {
		float: none !important;
		display: block;
		margin-top: 8px;
	}

	/*
	 * DataTables' own controls need to fit and be tappable.
	 *
	 * Stacking them is not this block's job. The header's buttons and filter each
	 * sit in a `col-12` of the header grid, so Bootstrap stacks them below `md` --
	 * this same 767px edge. The footer does not stack at all: it keeps its two lines
	 * on a phone (#246), and its rules are with the pager's further up. What used to
	 * be here alongside the search field's rule was `float: none !important` and
	 * `text-align: left`: the float override was compensation for floats that no
	 * longer exist, and the alignment never applied at all -- the bs5 stylesheet's
	 * own narrow-viewport rule is the more specific of the two.
	 *
	 * `div` qualifiers on the two rules below, and load-bearing for the same reason
	 * as the ones on the info text further up. What stood here was a bare
	 * `.dataTables_filter input { width: 100%; margin-left: 0 }`, and it never
	 * applied either: `div.dataTables_wrapper div.dataTables_filter input` in the
	 * bs5 stylesheet says `display: inline-block; width: auto; margin-left: .5em`
	 * and outranks two classes with four. So the search box was 218px of a 351px
	 * column at 375px -- its Bootstrap default, which is what a rule that never ran
	 * leaves behind -- and the comment that used to be here reasoned from a block
	 * filling its column, which is not what the element is.
	 *
	 * Width alone would not have been enough even qualified. The field shares a
	 * `<label>` with the word `Search:`, and that label carries `white-space: nowrap`
	 * from the same stylesheet, so a 100%-wide inline-block beside the text has
	 * nowhere to go and takes the page sideways. Laying the label out as a flex row
	 * is what lets the field take the rest of the line instead: the words keep their
	 * intrinsic width, the field grows into what is left, and the two stay on one
	 * line. Measured at 375px: 218px to 283px, right edge 12px inside the column's,
	 * no horizontal overflow; at 667px, 218px to 575px. Above `md` nothing moves --
	 * the field is 218px at 768px and at 1280px, before and after.
	 */
	div.dataTables_wrapper div.dataTables_filter label {
		display: flex;
		align-items: center;
		gap: .5em;
	}

	div.dataTables_wrapper div.dataTables_filter input {
		flex: 1 1 auto;
		width: auto;
		min-width: 0;
		margin-left: 0;
	}

	/*
	 * A table with enough rows produces more numbered page buttons than fit across
	 * a phone. The rule that lets the pager wrap used to live here, and now sits
	 * with the footer's rules further up: one pager that may wrap at every width is
	 * a smaller claim than two that may wrap for different reasons on either side
	 * of a breakpoint.
	 */
}

/* Phone landscape: short viewport, so give vertical space back. */
@media (max-height: 480px) and (orientation: landscape) {
	.container.body-container {
		padding-top: 6px;
	}

	.home-logo {
		height: 26px;
	}
}

/*
 * Icon controls produced by the iconButton tag. A button element brings Bootstrap
 * button chrome with it, which these never had, so it is stripped back to the bare
 * glyph -- what changes is the touch target and the accessible name, not the look.
 */
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	line-height: 1;
}

/*
 * A button element brings Bootstrap's button chrome with it, which a bare row-action
 * glyph never had. Stripped back -- but only when the call site has not asked for a
 * button: several pages pass `btn btn-primary btn-lg` to the tag precisely because
 * they want the blue primary button, and an unqualified reset would silently render
 * those as bare glyphs.
 */
.icon-btn:not(.btn) {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
}

.icon-btn:not(.btn):hover,
.icon-btn:not(.btn):focus-visible {
	color: inherit;
}

/*
 * ...except where the call site asked for a row-action control. `.settings-btn`
 * gives a glyph the brand colour and fills it on hover, and it loses both to the
 * reset above: `color` to specificity -- (0,2,0) against `.settings-btn`'s (0,1,0)
 * -- and `background` to source order, the two being equal. So a control migrated
 * to the tag rendered black instead of brand and did not react to hover at all,
 * while the raw <i> glyph beside it in the same cell still did (#53). Eighty-nine
 * call sites across thirty-two files combine the two classes, and each further
 * migration to the tag was silently joining them.
 *
 * Qualified with `.icon-btn:not(.btn)` rather than written as a bare
 * `.settings-btn` rule moved further down the file, so it outranks the reset by
 * specificity rather than by position -- position is what made this fragile in the
 * first place.
 *
 * :focus-visible is included alongside :hover because the reset names both, and a
 * keyboard user reaching one of these controls should see the same thing a mouse
 * user does.
 */
.icon-btn:not(.btn).settings-btn {
	color: var(--mika-brand);
}

.icon-btn:not(.btn).settings-btn:hover,
.icon-btn:not(.btn).settings-btn:focus-visible {
	background: var(--mika-brand);
	color: var(--mika-text-on-brand);
}

/*
 * The header's burger opens the nav panel whose .btn-close closes it, so the two
 * are drawn alike: Bootstrap's close glyph -- black, or white in dark mode -- at
 * its rest, hover and focus opacities of 0.5, 0.75 and 1. Under the reset above
 * the burger took the body text colour at full strength and never reacted, which
 * in dark mode left a solid white glyph beside a grey close control. The opacity
 * values are Bootstrap's, restated because it declares its --bs-btn-close-*
 * variables on .btn-close itself rather than on :root, where nothing else can read
 * them. Qualified the same way as .settings-btn, to outrank the reset.
 */
.icon-btn:not(.btn).nav-panel-toggle,
.icon-btn:not(.btn).theme-toggle {
	color: var(--mika-icon-control);
	opacity: 0.5;
}

.icon-btn:not(.btn).nav-panel-toggle:hover,
.icon-btn:not(.btn).theme-toggle:hover {
	color: var(--mika-icon-control);
	opacity: 0.75;
}

.icon-btn:not(.btn).nav-panel-toggle:focus-visible,
.icon-btn:not(.btn).theme-toggle:focus-visible {
	color: var(--mika-icon-control);
	opacity: 1;
}

/*
 * The appearance toggle (#252) sits directly left of the burger and is drawn the
 * same way, so the header's right edge reads as one pair of controls. They share
 * a group so the navbar's `justify-content: space-between` keeps them together
 * rather than parking the toggle in the middle of the row, and the group never
 * wraps: on a phone the brand shrinks, the pair does not split.
 */
.mika-navbar-controls {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 0.25rem;
}

.icon-btn i.material-icons {
	min-width: 0;
	line-height: 1;
}

/*
 * Layout tables.
 *
 * A good deal of this application's form markup is a <table> with no <thead> --
 * the table is doing layout, not presenting data. A table sizes itself to its
 * content and will not shrink, so on a phone these push the page wider no matter
 * what the container around them says.
 *
 * Below the medium breakpoint they become blocks, which stacks each field under
 * its label full width. Above it they lay out exactly as before, so the desktop
 * form is untouched.
 */
@media (max-width: 767.98px) {
	table.layout-table,
	table.layout-table > tbody,
	table.layout-table > tbody > tr,
	table.layout-table > tbody > tr > td,
	table.layout-table > tbody > tr > th,
	table.layout-table > tr,
	table.layout-table > tr > td,
	table.layout-table > tr > th {
		display: block;
		width: 100% !important;
		max-width: 100%;
	}

	table.layout-table > tbody > tr > td,
	table.layout-table > tr > td {
		padding-left: 0;
		padding-right: 0;
	}

	/* A label cell sitting above its field reads as a label, not a heading. */
	table.layout-table > tbody > tr > td:empty {
		display: none;
	}

	/*
	 * ...except a table of label/value pairs, which keeps each pair on one line
	 * (#244).
	 *
	 * Stacking is right for a form: a field under its label, full width, where there
	 * is room to type. It is wrong for a read-only summary -- "Total Fund:" on one
	 * line and the figure on the next, three pairs become six lines, in a 404px
	 * table the pairs fit across with room to spare. So a table whose rows are pairs
	 * says so with `data-layout-pairs`, and every other layout table keeps the
	 * stacking above.
	 *
	 * Each row is a wrapping flex line. The label takes at least half of it, which
	 * puts every value in one column down the table; a label longer than that pushes
	 * its own value along. A pair that genuinely cannot fit side by side -- a value
	 * too wide for what the label leaves -- wraps the value onto a line of its own,
	 * which is the stacking again, for that pair only and only when it is needed.
	 *
	 * The row, not the table, becomes flex: the table and its body stay the blocks
	 * the rule above makes them, so the table cannot size itself past its wrapper.
	 */
	table.layout-table[data-layout-pairs] > tbody > tr {
		display: flex;
		flex-wrap: wrap;
	}

	table.layout-table[data-layout-pairs] > tbody > tr > td {
		width: auto !important;
		min-width: 0;
	}

	table.layout-table[data-layout-pairs] > tbody > tr > td:first-child {
		flex: 0 0 auto;
		min-width: 50%;
		max-width: 100%;
		padding-right: .75rem;
	}

	table.layout-table[data-layout-pairs] > tbody > tr > td:not(:first-child) {
		flex: 1 1 auto;
	}
}

/*
 * A link that is the entire content of a heading is standalone navigation, not a
 * link inside a sentence, so it has to meet the minimum target size. (A link
 * genuinely inline in prose is exempt under WCAG 2.2 SC 2.5.8 and is left alone.)
 */
h1 > a:only-child,
h2 > a:only-child,
h3 > a:only-child,
h4 > a:only-child,
h5 > a:only-child,
h6 > a:only-child {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
}


/* ==========================================================================
   Third-party widgets in dark mode
   --------------------------------------------------------------------------
   Bootstrap 5.3's colour modes theme Bootstrap's own components and nothing
   else. Every widget below is a separate library that paints its own surfaces,
   so each needs its dark rules written by hand.

   This is the most iterative part of the theming work. Expect a tail of small
   fixes after real use rather than treating it as finished on first pass.
   ========================================================================== */

/* --- Bootstrap's own contextual table rows -------------------------------- */
/* The one part of Bootstrap 5.3 that its colour modes do not reach. .table-*
   set --bs-table-bg and --bs-table-color directly, in light values, with no
   [data-bs-theme="dark"] variant anywhere in the framework -- so the 14 JSPs and
   9 page scripts that mark a row's state kept black text on a pale background
   while the page around it went dark (#81).

   Only the variables are set; Bootstrap's own rules do the painting. Striped and
   hover are the application's existing overlays rather than six more tints,
   because 5.3 draws both as an inset shadow over the row's own background, so one
   translucent white composites correctly on every one of these. */
[data-bs-theme="dark"] .table > :not(caption) > tr.table-light,
[data-bs-theme="dark"] .table > :not(caption) > tr.table-primary,
[data-bs-theme="dark"] .table > :not(caption) > tr.table-info,
[data-bs-theme="dark"] .table > :not(caption) > tr.table-success,
[data-bs-theme="dark"] .table > :not(caption) > tr.table-warning,
[data-bs-theme="dark"] .table > :not(caption) > tr.table-danger,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-primary,
[data-bs-theme="dark"] .table-info,
[data-bs-theme="dark"] .table-success,
[data-bs-theme="dark"] .table-warning,
[data-bs-theme="dark"] .table-danger {
	--bs-table-color: var(--mika-text);
	--bs-table-border-color: var(--mika-border);
	--bs-table-striped-color: var(--mika-text);
	--bs-table-striped-bg: var(--mika-surface-sunken);
	--bs-table-hover-color: var(--mika-text);
	--bs-table-hover-bg: var(--mika-surface-hover);
	--bs-table-active-color: var(--mika-text);
	--bs-table-active-bg: var(--mika-surface-hover);
}

[data-bs-theme="dark"] .table > :not(caption) > tr.table-light,
[data-bs-theme="dark"] .table-light { --bs-table-bg: var(--mika-row-neutral); }
[data-bs-theme="dark"] .table > :not(caption) > tr.table-primary,
[data-bs-theme="dark"] .table-primary { --bs-table-bg: var(--mika-row-primary); }
[data-bs-theme="dark"] .table > :not(caption) > tr.table-info,
[data-bs-theme="dark"] .table-info { --bs-table-bg: var(--mika-row-info); }
[data-bs-theme="dark"] .table > :not(caption) > tr.table-success,
[data-bs-theme="dark"] .table-success { --bs-table-bg: var(--mika-row-success); }
[data-bs-theme="dark"] .table > :not(caption) > tr.table-warning,
[data-bs-theme="dark"] .table-warning { --bs-table-bg: var(--mika-row-warning); }
[data-bs-theme="dark"] .table > :not(caption) > tr.table-danger,
[data-bs-theme="dark"] .table-danger { --bs-table-bg: var(--mika-row-danger); }


/* --- DataTables ---------------------------------------------------------- */
/* The application never wrote markup for the search box, the page-length
   select, the pagination or the info line, so none of it inherits anything. */
[data-bs-theme="dark"] .dataTables_wrapper,
[data-bs-theme="dark"] .dataTables_info,
[data-bs-theme="dark"] .dataTables_length,
[data-bs-theme="dark"] .dataTables_filter,
[data-bs-theme="dark"] .dataTables_paginate {
	color: var(--mika-text);
}

[data-bs-theme="dark"] .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_length select,
[data-bs-theme="dark"] table.dataTable tbody input,
[data-bs-theme="dark"] table.dataTable thead input {
	background-color: var(--mika-surface-raised);
	color: var(--mika-text);
	border-color: var(--mika-border);
}

[data-bs-theme="dark"] .paginate_button,
[data-bs-theme="dark"] .page-link {
	background-color: var(--mika-surface-raised);
	color: var(--mika-link);
	border-color: var(--mika-border);
}

[data-bs-theme="dark"] .page-item.active .page-link {
	background-color: var(--mika-brand-deep);
	border-color: var(--mika-brand-deep);
	color: var(--mika-text-on-brand);
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
	background-color: var(--mika-surface);
	color: var(--mika-text-muted);
}

/* Export buttons sit above the table and are Bootstrap-shaped but not themed. */
[data-bs-theme="dark"] .dt-button {
	background-color: var(--mika-surface-raised) !important;
	color: var(--mika-text) !important;
	border-color: var(--mika-border) !important;
}

/* The expand control on a collapsed row, and the detail panel it opens. */
[data-bs-theme="dark"] table.dataTable > tbody > tr.child ul.dtr-details > li {
	border-bottom-color: var(--mika-border);
}

[data-bs-theme="dark"] table.dataTable td.dtr-control::before,
[data-bs-theme="dark"] table.dataTable th.dtr-control::before {
	background-color: var(--mika-brand-deep);
	border-color: var(--mika-border);
	color: var(--mika-text-on-brand);
}

/* The scroll body created for a column-filter table. */
[data-bs-theme="dark"] .dataTables_scrollBody,
[data-bs-theme="dark"] .dataTables_scrollHead {
	background-color: var(--mika-surface);
}

/* The progressive-load indicator (#60).
 *
 * Built by script into the DataTables wrapper rather than written into a JSP, so a page
 * adopts progressive loading without gaining any markup for it and the indicator cannot
 * drift between pages. It reads as a status line rather than a banner: a table that is
 * still filling is the normal case, not an alarm, and the bar is thin and quiet because
 * the rows arriving above it are the thing worth looking at.
 *
 * Colours come from the token layer, so the colour-mode toggle carries it like everything
 * else and no rule below is duplicated for dark mode. */
.progressive-load {
	margin: 0 0 0.5rem;
}

.progressive-load-label {
	font-size: 0.8125rem;
	color: var(--mika-text-muted);
	margin-bottom: 0.25rem;
}

.progressive-load .progress {
	height: 0.5rem;
	background-color: var(--mika-surface-sunken);
}

.progressive-load .progress-bar {
	background-color: var(--mika-brand-mid);
	transition: width 0.2s linear;
}

/* A load that failed for good. The bar stops being a progress bar and becomes the
   report of how far it got, which is why it keeps its fill rather than emptying. */
.progressive-load.is-failed .progress-bar {
	background-color: var(--mika-accent-red);
}

.progressive-load.is-failed .progressive-load-label {
	color: var(--mika-accent-red);
}

.progressive-load-retry {
	padding: 0 0 0 0.5rem;
	font-size: inherit;
	vertical-align: baseline;
}

/* A partly-loaded table is read-only (#86).
 *
 * Two kinds of thing wear this class. A `<tbody>` still filling wears it so that the row
 * actions the template drew inside it read as unavailable -- the rows themselves stay at
 * full contrast, because they are perfectly good data and worth reading; it is only the
 * actions on them that cannot be trusted yet. And a page-level control that acts on the
 * whole set -- Batch Control, which submits the record numbers the table is holding --
 * wears it directly.
 *
 * This is appearance only. What actually stops the click is a delegated handler in
 * helper.js, because `pointer-events: none` leaves a control reachable by keyboard and
 * dimming leaves it reachable by everything. */
tbody.progressive-gated .settings-btn,
tbody.progressive-gated .dropdown-toggle,
a.progressive-gated,
button.progressive-gated {
	opacity: 0.45;
	cursor: not-allowed;
}

/* --- Tom Select ---------------------------------------------------------- */
[data-bs-theme="dark"] .ts-wrapper .ts-control,
[data-bs-theme="dark"] .ts-dropdown {
	background-color: var(--mika-surface-raised);
	color: var(--mika-text);
	border-color: var(--mika-border);
}

[data-bs-theme="dark"] .ts-dropdown .option,
[data-bs-theme="dark"] .ts-dropdown .optgroup-header {
	background-color: var(--mika-surface-raised);
	color: var(--mika-text);
}

[data-bs-theme="dark"] .ts-dropdown .active {
	background-color: var(--mika-brand-deep);
	color: var(--mika-text-on-brand);
}

[data-bs-theme="dark"] .ts-control input,
[data-bs-theme="dark"] .ts-control > input {
	color: var(--mika-text) !important;
}

[data-bs-theme="dark"] .ts-wrapper.multi .item {
	background-color: var(--mika-brand-deep);
	color: var(--mika-text-on-brand);
	border-color: var(--mika-brand-mid);
}

/* --- multi-select: both panes have to read equally well ------------------ */
[data-bs-theme="dark"] .ms-container .ms-selectable,
[data-bs-theme="dark"] .ms-container .ms-selection,
[data-bs-theme="dark"] .ms-container .ms-list {
	background-color: var(--mika-surface-raised);
	color: var(--mika-text);
	border-color: var(--mika-border);
}

[data-bs-theme="dark"] .ms-container .ms-list li.ms-elem-selectable,
[data-bs-theme="dark"] .ms-container .ms-list li.ms-elem-selection {
	color: var(--mika-text);
	border-bottom-color: var(--mika-border);
}

[data-bs-theme="dark"] .ms-container .ms-list li.ms-hover {
	background-color: var(--mika-brand-deep);
	color: var(--mika-text-on-brand);
}

/* --- date-range picker --------------------------------------------------- */
[data-bs-theme="dark"] .daterangepicker {
	background-color: var(--mika-surface-raised);
	border-color: var(--mika-border);
	color: var(--mika-text);
}

[data-bs-theme="dark"] .daterangepicker .calendar-table {
	background-color: var(--mika-surface-raised);
	border-color: var(--mika-border);
}

[data-bs-theme="dark"] .daterangepicker td.available:hover,
[data-bs-theme="dark"] .daterangepicker th.available:hover {
	background-color: var(--mika-surface-hover);
}

[data-bs-theme="dark"] .daterangepicker td.off {
	background-color: var(--mika-surface);
	color: var(--mika-text-muted);
}

/* The selected date has to be unmistakable, not merely tinted. */
[data-bs-theme="dark"] .daterangepicker td.active,
[data-bs-theme="dark"] .daterangepicker td.active:hover {
	background-color: var(--mika-brand-deep);
	color: var(--mika-text-on-brand);
}

[data-bs-theme="dark"] .daterangepicker .drp-buttons {
	border-top-color: var(--mika-border);
}

/* --- jQuery UI date picker ----------------------------------------------- */
[data-bs-theme="dark"] .ui-datepicker,
[data-bs-theme="dark"] .ui-widget-content {
	background: var(--mika-surface-raised);
	color: var(--mika-text);
	border-color: var(--mika-border);
}

[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-header,
[data-bs-theme="dark"] .ui-widget-header {
	background: var(--mika-surface-sunken);
	color: var(--mika-text);
	border-color: var(--mika-border);
}

[data-bs-theme="dark"] .ui-state-default,
[data-bs-theme="dark"] .ui-widget-content .ui-state-default {
	background: var(--mika-surface-raised);
	color: var(--mika-text);
	border-color: var(--mika-border);
}

[data-bs-theme="dark"] .ui-state-active,
[data-bs-theme="dark"] .ui-widget-content .ui-state-active {
	background: var(--mika-brand-deep);
	color: var(--mika-text-on-brand);
	border-color: var(--mika-brand-mid);
}

/* ==========================================================================
   Print
   --------------------------------------------------------------------------
   Printed output goes to employees and clients and must not change with the
   on-screen theme. Printing from dark mode would otherwise waste toner and
   produce something barely readable.
   ========================================================================== */
@media print {
	:root,
	[data-bs-theme="dark"] {
		--mika-surface: #fff;
		--mika-surface-raised: #fff;
		--mika-surface-sunken: rgba(0,0,0,.03);
		--mika-surface-hover: transparent;
		--mika-text: #212529;
		--mika-text-muted: #676767;
		--mika-border: #ced4da;
		--mika-border-subtle: rgba(0,0,0,.15);
		--mika-brand: #28589b;
		--mika-brand-light: #4ca3da;
		--mika-brand-mid: #3e84c5;
		--mika-brand-deep: #3766b0;
		--mika-link: #28589b;
		--mika-link-hover: #0056b3;
		--mika-accent-red: #eb4339;
		--mika-accent-yellow: #eeb91d;
		--mika-accent-green: #5eac46;
		--mika-accent-blue: #15adb2;
		--mika-neutral-grey: #86898c;
	}

	html,
	body {
		background: #fff !important;
		color: #212529 !important;
	}

	/*
	 * A position: fixed element prints on every sheet, and in most engines it also
	 * lands on top of whatever is beneath it there. The release footer is worth
	 * having in a screenshot and worth nothing on a payslip, so it comes off the
	 * paper -- along with the clearance the screen reserves for it.
	 */
	body {
		padding-bottom: 0;
	}

	.mika-release-footer {
		display: none;
	}

	/* The touch minimums are a screen concern; on paper they only waste space. */
	.btn,
	.btn-close,
	.page-link,
	.icon-btn,
	.form-check,
	a[class*="link-"] {
		min-height: 0;
		min-width: 0;
	}
}
