/* ============================================================
   SHARED DESIGN COMPONENTS
   Reusable, layout-agnostic UI styles. Every page linking
   style.css or style-v2.css links this file just above it, with
   ?v=${assetVer} - not via @import, which carries no version and
   left browsers on a stale copy. Add future shared design rules
   (cards, badges, form patterns, etc.) here so they stay in one
   place instead of being duplicated across the two stylesheets.
   ============================================================ */

/* ---- Buttons ----
   One corner radius on both layouts; style-v2.css already gives its buttons 5px, the old layout
   was left on MDB's 2px. :where() keeps this at single-class weight, so the pill, circle and
   button-group corners MDB sets with more specific rules still win. */
.btn:where(:not(.btn-floating):not(.btn-rounded)) {
    border-radius: 5px;
}

/* ---- Sectioned-card form layout ----
   A page sets --accent / --accent-soft on a wrapper element and
   uses the .p-section / .p-section-head / .p-icon markup; these
   base rules cover the structure and fall back to the brand blue. */
.p-section {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 22px;
}

.p-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid #eef1f5;
}

.p-section-head .p-icon {
    height: 44px;
    width: 44px;
    min-width: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent-soft, #2876bd1a);
    color: var(--accent, #2876BD);
    font-size: 21px;
}

.p-section-head h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.p-section-head small {
    color: #8a94a6;
}

.p-section-body {
    padding: 20px 22px 10px;
}

.dark--mode .p-section {
    background: #3C3F41;
    border-color: #4b4f52;
}

.dark--mode .p-section-head {
    border-color: #4b4f52;
}

/* Inline clear (X) for a scanned RFID field. The icon sits inside the input, so the
   input needs room on the right for it. .md-form is already position:relative and
   its box is the input itself (the floating label is absolutely positioned), which
   is what makes the 50% centring land on the input rather than the whole group. */
.md-form .input-clear-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
    color: #9e9e9e;
    cursor: pointer;
}

.md-form .input-clear-icon:hover {
    color: #f44336;
}

.md-form input.has-clear-icon {
    padding-right: 34px;                /* keep the value from running under the X */
}

.dark--mode .md-form .input-clear-icon {
    color: #b0b0b0;
}

/* RFID reader status line. <small> is relative, so inside the <h4> on the borrow
   screen it still renders at heading size and inherits the heading's weight - pin
   both to absolute values so it reads the same wherever the status is placed. */
#pairStatus {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
}

/* Scan-only RFID cell in the assign / bulk-update tables. The X sits inside the readonly
   input, so the input needs room on the right for it; it is shown only while the cell
   holds a tag. Left padding is dropped so the value stays centred despite that room. */
.rfid-cell {
    position: relative;
}

.rfid-cell input {
    padding-right: 24px;
    padding-left: 0;
}

.rfid-cell .rfid-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    line-height: 1;
    color: #9e9e9e;
    cursor: pointer;
}

.rfid-cell .rfid-clear:hover {
    color: #f44336;
}

/* Class strip: one line under a card header naming the batch / semester / section a student page is scoped to
   (student/lesson-plan). Icon takes the theme colour; text stays neutral. */
.dn-class-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 10px 20px;
    border-bottom: 1px solid #eef1f5;
    background: #fafbfc;
    font-size: 13px;
}

.dn-class-strip .material-icons {
    font-size: 20px;
    color: var(--dn-theme, #2876BD);
}

.dn-class-strip .dn-class-strip-label {
    color: #8a94a6;
    margin-right: 4px;
}

.dark--mode .dn-class-strip {
    background: #3C3F41;
    border-color: #4b4f52;
}

/* ---- Grouped variable chips ----
   Heading over a chip group (generateBadgeGroups in helper.js). The element is
   in the selector because .card .card-body h6 outranks a bare class. */
.variable-group h6.variable-group-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #212529;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
    margin: 0 0 8px;
}

/* dark-mode colour comes from light-dark-mode.css; only the rule changes */
.dark--mode .variable-group h6.variable-group-title {
    border-bottom-color: #4b4f52;
}

/* Live character/credit count under an SMS message box (sms-compose.js). */
.sms-credit-info {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 16px;
}

.sms-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    background: #f1f3f5;
    color: #5f6b7a;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.sms-chip .material-icons {
    font-size: 15px;
    align-self: center;
    opacity: .8;
}

.sms-chip-credit .material-icons {
    color: var(--dn-theme, #2876BD);
}

.sms-chip .sms-chip-info {
    margin-left: 2px;
    cursor: help;
    opacity: .7;
}

.sms-chip b {
    color: #343a40;
    font-weight: 600;
}

.sms-chip-credit {
    background: #2876bd1a;
    background: color-mix(in srgb, var(--dn-theme, #2876BD) 12%, transparent);
}

.sms-chip-credit b {
    color: var(--dn-theme, #2876BD);
}

/* Shown only while the send will swap look-alike punctuation for plain characters (CORE-20). The attribute
   rule is needed because .sms-chip sets display and would otherwise override [hidden]. */
.sms-chip-notice {
    align-items: center;
    background: #fff3cd;
    color: #856404;
}

.sms-chip-notice[hidden] {
    display: none;
}

.sms-chip-notice .material-icons:first-child {
    color: #856404;
}

.dark--mode .sms-chip {
    background: #4b4f52;
    color: #c5cad1;
}

.dark--mode .sms-chip b {
    color: #fff;
}

.dark--mode .sms-chip-notice {
    background: #4a3f12;
    color: #ffe08a;
}

.dark--mode .sms-chip-notice .material-icons:first-child {
    color: #ffe08a;
}

/* ---- SMS module ----
   One accent per destination, shared by the SMS dashboard cards and the send page each card opens,
   so a school recognises the page it landed on by the colour it clicked. */
.sms-accent-bulk { --accent: #4f46e5; --accent-soft: #4f46e51a; }
.sms-accent-student { --accent: #0284c7; --accent-soft: #0284c71a; }
.sms-accent-employee { --accent: #16a34a; --accent-soft: #16a34a1a; }
.sms-accent-guardian { --accent: #d97706; --accent-soft: #d977061a; }

/* Send-page cards: neutral header with an accent icon badge, actions in the footer. */
.sms-compose-card {
    display: flex;
    flex-direction: column;
    height: calc(100% - 22px);
    margin-bottom: 22px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: none;
}

.sms-compose-card > form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.sms-compose-card > form > .card-body {
    flex: 1;
}

/* .white-skin .card-header is painted with the theme colour by theme.jsp */
.sms-compose-card > .sms-compose-head,
.white-skin .sms-compose-card > .sms-compose-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: transparent;
    border-bottom: 1px solid #eef1f5;
}

.sms-compose-head .p-icon {
    display: grid;
    place-items: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-soft, #2876bd1a);
    color: var(--accent, #2876BD);
}

.sms-compose-head h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.sms-compose-head small {
    color: #8a94a6;
}

.sms-compose-card > form > .sms-compose-foot {
    display: flex;
    justify-content: flex-start;
    padding: 12px 20px;
    background: transparent;
    border-top: 1px solid #eef1f5;
}

.dark--mode .sms-compose-card {
    background: #3C3F41;
    border-color: #4b4f52;
}

.dark--mode .sms-compose-card > .sms-compose-head,
.dark--mode .sms-compose-card > form > .sms-compose-foot {
    border-color: #4b4f52;
}

/* Expand chevron beside a custom-list row's first value; the row itself toggles .dropdown-active (custom-list.js),
   so the icon only follows that state. Same job as the chevron a[data-toggle=list-col-dropdown] draws. */
.lp-expand-icon {
    color: inherit;
    font-size: 20px;
    vertical-align: middle;
    transition: transform .15s ease;
}

.list-row.dropdown-active .lp-expand-icon {
    transform: rotate(180deg);
}

/* Variable chips (certificate themes, email/SMS templates, attendance formats). They are both
   click-to-copy and draggable into the content editor, so the cursor advertises the drag.
   The tint is mixed from the school's theme color toward white, which keeps the chip light
   whatever color the school picked; browsers without color-mix keep the plain fallback. */
.badge.variable {
    cursor: grab;
    font-weight: 500;
    /* mdb.min.css paints every .badge white with !important, so the ink has to answer in kind */
    color: #2f3742 !important;
    background: #eef2f7;
    background: color-mix(in srgb, var(--dn-theme, #2876BD) 10%, #fff);
    border: 1px solid #dfe5ee;
    border-color: color-mix(in srgb, var(--dn-theme, #2876BD) 22%, #fff);
}

.badge.variable:hover {
    background: #e2e9f3;
    background: color-mix(in srgb, var(--dn-theme, #2876BD) 18%, #fff);
}

.badge.variable:active {
    cursor: grabbing;
}

.dark--mode .badge.variable {
    color: #e6e6e6 !important;
    background: #45484a;
    border-color: #55585a;
}

.dark--mode .badge.variable:hover {
    background: #4f5254;
}

/* ---------------------------------------------------------------------------
   Record detail pages (certificate info, certificate theme preview): a hero that
   names the record, spec rows, and a tray holding the printable sheet. The page
   wraps its content in .detail-view and sets --accent / --accent-soft from the
   school's theme color; everything else falls back to the brand blue.
   --------------------------------------------------------------------------- */
.detail-view {
    --d-line: #e8ecf2;
    --d-muted: #6b7280;
    --d-ink: #2f3742;
    --d-surface: #fff;
    --d-tray: #f4f6fa;
    --d-green: #16a34a;
    --d-green-soft: #dcfce7;
    --d-red: #dc2626;
    --d-red-soft: #fee2e2;
}

.detail-view .detail-card {
    border: 1px solid var(--d-line);
    border-radius: 12px;
    background: var(--d-surface);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.detail-view .detail-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--d-line);
}

.detail-view .detail-card-head .detail-icon {
    height: 32px;
    width: 32px;
    min-width: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--accent-soft, #2876bd1a);
    color: var(--accent, #2876BD);
    font-size: 17px;
}

.detail-view .detail-card-head h5 {
    margin: 0;
    font-size: .92rem;
    font-weight: 600;
    color: var(--d-ink);
}

.detail-view .detail-card-head small {
    color: var(--d-muted);
    font-size: 11px;
}

/* hero */
.detail-view .detail-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.detail-view .detail-seal {
    height: 62px;
    width: 62px;
    min-width: 62px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--accent-soft, #2876bd1a);
    color: var(--accent, #2876BD);
}

.detail-view .detail-seal .material-icons {
    font-size: 32px;
}

.detail-view .detail-hero-id {
    /* narrow enough that the seal and the name still share a line on a phone */
    flex: 1 1 200px;
    min-width: 0;
}

.detail-view .detail-hero-id h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--d-ink);
    line-height: 1.25;
}

.detail-view .detail-hero-id h3 a {
    color: inherit;
}

.detail-view .detail-sub {
    color: var(--d-muted);
    font-size: .82rem;
    margin-top: 2px;
}

.detail-view .detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.detail-view .detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--d-line);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--d-ink);
    background: #fbfcfe;
}

.detail-view .detail-chip .material-icons {
    font-size: 13px;
    color: var(--d-muted);
}

.detail-view .detail-hero-actions {
    margin-left: auto;
    text-align: right;
}

.detail-view .detail-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--d-green-soft);
    color: var(--d-green);
}

.detail-view .detail-status.is-danger {
    background: var(--d-red-soft);
    color: var(--d-red);
}

.detail-view .detail-status .material-icons {
    font-size: 14px;
}

/* spec rows */
.detail-view .detail-rows {
    padding: 4px 16px 10px;
}

.detail-view .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--d-line);
}

.detail-view .detail-row:last-child {
    border-bottom: 0;
}

.detail-view .detail-row dt {
    margin: 0;
    font-weight: 400;
    font-size: .78rem;
    color: var(--d-muted);
    white-space: nowrap;
}

.detail-view .detail-row dd {
    margin: 0;
    font-size: .85rem;
    font-weight: 500;
    color: var(--d-ink);
    text-align: right;
    word-break: break-word;
}

/* second group inside the same list: the row above it supplies the rule */
.detail-view .detail-group {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--d-muted);
    padding: 16px 0 2px;
}

.detail-view .detail-mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

/* a condition that stays true, called out above the cards */
.detail-view .detail-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #f5c2c2;
    border-radius: 12px;
    background: var(--d-red-soft);
    color: #8a1c1c;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.detail-view .detail-note .material-icons {
    font-size: 19px;
    color: var(--d-red);
}

.detail-view .detail-note strong {
    display: block;
    font-size: .85rem;
}

.detail-view .detail-note span {
    font-size: .82rem;
}

/* the printable sheet, on its tray */
.detail-view .detail-tray {
    background: var(--d-tray);
    padding: 18px;
    overflow: auto;
}

.detail-view .detail-sheet {
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(16, 24, 40, .1);
    padding: 32px 36px;
    margin: 0 auto;
}

@media (max-width: 575px) {
    .detail-view .detail-tray {
        padding: 12px;
    }

    .detail-view .detail-sheet {
        padding: 20px 18px;
    }
}

.dark--mode .detail-view {
    --d-line: #4b4f52;
    --d-muted: #b0b0b0;
    --d-ink: #e6e6e6;
    --d-surface: #3C3F41;
    --d-tray: #2f3133;
}

.dark--mode .detail-view .detail-chip {
    background: #45484a;
}

/* the sheet is paper: it keeps print colors whatever the app theme is. Without this the
   content inherits the dark-mode body color and reads light grey on white. */
.dark--mode .detail-view .detail-sheet {
    color: #1f2937;
}

.dark--mode .detail-view .detail-sheet :is(h1, h2, h3, h4, h5, h6):not([style*="color"]) {
    color: #111827 !important;
}

.dark--mode .detail-view .detail-status {
    background: #14532d;
    color: #86efac;
}

.dark--mode .detail-view .detail-status.is-danger {
    background: #4c1d1d;
    color: #fca5a5;
}

.dark--mode .detail-view .detail-note {
    background: #4c1d1d;
    border-color: #7f2a2a;
    color: #fecaca;
}

/* Nepali phonetic typing suggestions (js/utils/nepali-input-tool.js), opened under the field. */
.nepali-ime-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1060;
    min-width: 160px;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.nepali-ime-word {
    padding: 2px 12px 4px;
    border-bottom: 1px solid #eee;
    color: #6c757d;
}

.nepali-ime-option {
    padding: 3px 12px;
    cursor: pointer;
}

.nepali-ime-option.active,
.nepali-ime-option:hover {
    background: #eef1f5;
}

.dark--mode .nepali-ime-option.active,
.dark--mode .nepali-ime-option:hover {
    background: #4b4f52;
}

.dark--mode .nepali-ime-popup {
    background: #3C3F41;
    border-color: #4b4f52;
}

.dark--mode .nepali-ime-word {
    border-color: #4b4f52;
}

/* ---- Report filter bar ----
   The filter of a report page, drawn as one card: captioned inputs, the option toggles and the action
   buttons flow on one wrapping line, with the actions held at the right end. Inside
   .filter-block.fixed, which scripts.js lifts into the fixed header, it is kept as short as the width
   allows; inside a .card-header it drops its own frame. The controls stay the house ones (md-outline inputs, mdb-select, form-check radios and
   checkboxes), so ids, names and JS hooks are untouched; only their layout and paint change.
   Captions sit above the boxes instead of floating on the outline, because a bar of this many controls
   reads faster with its labels in one line. Used by Trial Balance (both types), Ledger Group Entries and Ledger Entries.
   Widths: free wrapping from 992px, with group dividers only from 1920px where everything fits on one
   line; a three-column input grid below 992px; a stacked phone layout below 576px. */
.report-filter {
    --report-filter-control-height: calc(2.25rem + 2px);
    margin: .25rem 0 .75rem;
    padding: .875rem 1.25rem 1rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.report-filter-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .875rem 1.25rem;
}

/* the inputs and options flow as one line of items on wide screens; they regain a box below 992px */
.report-filter-inputs,
.report-filter-options {
    display: contents;
}

.report-filter-item {
    flex: 0 0 auto;
    min-width: 0;
}

.report-filter-select {
    width: 12rem;
}

.report-filter-date {
    width: 10rem;
}

/* a long-named dropdown, e.g. Ledger Account */
.report-filter-wide {
    width: 18rem;
}

/* inside a card header the card is already the surface, so the bar drops its own frame */
.card-header .report-filter {
    margin: 0;
    padding: .25rem 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* spaced with padding: style-v2 forces margin-bottom: 0 !important on every label */
.report-filter .report-filter-label {
    display: block;
    margin: 0;
    padding-bottom: .375rem;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.2;
    color: #343a40;
}

/* captions are above the boxes, so the md-form spacing reserved for a floating label goes */
.report-filter .select-outline,
.report-filter .select2-outline,
.report-filter .md-form.md-outline {
    margin-top: 0;
    margin-bottom: 0;
}

/* select2 writes the width it measured inline; let it follow the item instead */
.report-filter .select2-container {
    width: 100% !important;
}

/* the CDN select2 theme loads after ours and shrinks the box to 28px; hold it to the bar's control height */
.report-filter .select2-container .select2-selection--single {
    display: flex;
    align-items: center;
    height: var(--report-filter-control-height);
    padding: 0 .75rem;
    border-color: #ced4da;
    border-radius: .25rem;
}

.report-filter .select2-container .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
    line-height: 1.5;
}

.report-filter .select2-container .select2-selection--single .select2-selection__arrow {
    top: 0;
    height: 100%;
}

/* the fiscal-year partial brings its own floating label; keep it for screen readers only */
.report-filter-select .select-outline > label,
.report-filter-select .select-outline > .md-form > label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* calendar glyph inside the date box; clicks pass through to the input, which opens the picker */
.report-filter-icon {
    position: absolute;
    top: 50%;
    left: .625rem;
    z-index: 1;
    font-size: 1.125rem;
    color: #6c757d;
    transform: translateY(-50%);
    pointer-events: none;
}

.report-filter-date .md-form.md-outline input.form-control {
    padding-left: 2.25rem;
}

/* a captioned group with no input box of its own: Report Type, Orientation, the checkboxes */
.report-filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* the checkboxes have no caption, so they centre on the control line instead */
.report-filter-checks {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 1.25rem;
    min-height: var(--report-filter-control-height);
}

.report-filter-checks .form-check {
    padding-left: 0;
    margin: 0;
}

/* filled-in is MDB's solid checkbox; paint it in the school colour */
.report-filter-checks .form-check-input[type=checkbox].filled-in:checked + label:after {
    background-color: var(--dn-theme, #2876BD);
    border-color: var(--dn-theme, #2876BD);
}

/* Segmented toggle out of house radios. MDB paints a radio on its label's :before/:after, so hiding
   those and styling the label turns each option into a button; the input stays focusable and its
   label keeps the for/id pair that makes it clickable. The selected one is filled the way btn-primary
   is, so it reads as the same family as the Filter button. */
.report-filter-segment {
    display: inline-flex;
    gap: .5rem;
}

.report-filter-segment .form-check {
    padding-left: 0;
    margin: 0;
}

.report-filter-segment .form-check-input[type=radio] + label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--report-filter-control-height);
    padding: 0 1rem;
    margin: 0;
    font-size: .875rem;
    line-height: 1;
    white-space: nowrap;
    color: #343a40;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.report-filter-segment .form-check-input[type=radio] + label:hover {
    border-color: var(--dn-theme, #2876BD);
}

.report-filter-segment .form-check-input[type=radio] + label:before,
.report-filter-segment .form-check-input[type=radio] + label:after {
    display: none;
}

.report-filter-segment .form-check-input[type=radio]:checked + label {
    font-weight: 600;
    color: #fff;
    background: var(--dn-theme, #2876BD);
    border-color: var(--dn-theme, #2876BD);
}

.report-filter-segment .form-check-input[type=radio]:focus-visible + label {
    outline: 2px solid var(--dn-theme, #2876BD);
    outline-offset: 2px;
}

/* the buttons ride at the right end of whichever line they land on */
.report-filter-actions {
    display: flex;
    gap: .5rem;
    margin-left: auto;
}

.report-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    height: var(--report-filter-control-height);
    margin: 0;
    padding: 0 1.125rem;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: none;
    border-radius: .375rem;
}

.report-filter-actions .btn .material-icons {
    font-size: 1.25rem;
}

/* Print and Excel are icon-only; their names come from title and aria-label */
.report-filter-actions .report-filter-icon-btn {
    width: calc(var(--report-filter-control-height) + .25rem);
    padding: 0;
}

/* Print reads as an outlined secondary, not a grey block; style-v2's btn-light gradient is !important */
.report-filter-actions .btn-light {
    color: #343a40;
    background: #fff !important;
    border: 1px solid #ced4da;
    box-shadow: none;
}

.report-filter-actions .btn-light:hover,
.report-filter-actions .btn-light:active {
    background: #f1f3f5 !important;
    box-shadow: none;
}

/* the excel button keeps .buttons-excel / .button-excel for its green text and hover; this gives it the
   outline and an icon size to match Print, which style-v2 pins at .8rem !important */
.report-filter-actions .buttons-excel,
.report-filter-actions .button-excel {
    font-size: 1.125rem !important;
    border: 1px solid #017f02;
}

/* the widest screens fit the whole bar on one line, so the groups can carry dividers without one
   ever starting a wrapped line */
@media (min-width: 1920px) {
    .report-filter-group {
        padding-left: 1.25rem;
        border-left: 1px solid #e0e0e0;
    }
}

/* tablets: the three inputs share a row, the options and buttons wrap below */
@media (max-width: 991.98px) {
    .report-filter {
        padding: .75rem 1rem .875rem;
    }

    .report-filter-inputs {
        display: grid;
        flex: 1 1 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .875rem 1rem;
    }

    .report-filter-options {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: .875rem 1.25rem;
    }

    .report-filter-select,
    .report-filter-date {
        width: auto;
    }

    .report-filter-wide {
        grid-column: 1 / -1;
    }
}

/* phones: fiscal year on its own line, the dates side by side, toggles and the Filter button full width */
@media (max-width: 575.98px) {
    /* style-v2 keeps 4.375rem on the right of the header filter for the help button, which is hidden here */
    .header .filter-block:has(> .report-filter) {
        padding-right: .75rem;
        padding-left: .75rem;
    }

    .report-filter {
        padding: .75rem;
        border-radius: .5rem;
    }

    .report-filter-inputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .75rem;
    }

    .report-filter-select {
        grid-column: 1 / -1;
    }

    .report-filter-options {
        flex: 1 1 100%;
        gap: .75rem;
    }

    .report-filter-options > .report-filter-group {
        flex: 1 1 100%;
    }

    .report-filter-segment {
        display: flex;
        width: 100%;
    }

    .report-filter-segment .form-check {
        flex: 1 1 0;
        min-width: 0;
    }

    .report-filter-checks {
        row-gap: .5rem;
    }

    .report-filter-actions {
        flex: 1 1 100%;
    }

    .report-filter-actions .btn-primary {
        flex: 1 1 auto;
    }
}

.dark--mode .card-header .report-filter {
    background: transparent;
}

.dark--mode .report-filter,
.dark--mode .report-filter-segment .form-check-input[type=radio] + label {
    color: inherit;
    background: #3C3F41;
    border-color: #4b4f52;
    box-shadow: none;
}

.dark--mode .report-filter-actions .btn-light {
    color: inherit;
    background: #3C3F41 !important;
    border-color: #4b4f52;
}

.dark--mode .report-filter-group {
    border-color: #4b4f52;
}

.dark--mode .report-filter .report-filter-label,
.dark--mode .report-filter-icon {
    color: #afb1b3;
}

/* style-v2 clears every .form-check-label background with !important in dark mode */
.dark--mode .report-filter-segment .form-check-input[type=radio]:checked + label {
    color: #fff;
    background: var(--dn-theme, #2876BD) !important;
    border-color: var(--dn-theme, #2876BD);
}
