/* ==========================================================================
   BadiuNet — Theme/Base — Report / Filter / Table / Dashboard layer
   --------------------------------------------------------------------------
   Design language lifted from the LLM correction report
   (Badiu/Moodle/SyncBundle/View/LLM/CorretionModAssign/Index/Custom.css)
   and generalized to every report, filter form, table and dashboard card in
   the platform.

   Scope: this file styles the OUTPUT area only. The site shell (header,
   sidebar, footer, forms) lives in badiu.css.

   Tokens are defined in badiu.css (:root) and consumed here.
   All original structural rules from the legacy file are preserved at the
   bottom of this file so nothing that depended on them breaks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. PAGE TITLE
   -------------------------------------------------------------------------- */

#badiunet-system-core-output .page-header,
#badiunet-system-core-output h1.page-header {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
    font-size: clamp(1.55rem, 2.2vw, 2.2rem);
    font-weight: 760;
    letter-spacing: -.045em;
    color: var(--bd-text);
}

/* --------------------------------------------------------------------------
   2. FILTER / ADVANCED SEARCH  (#badiu-report-search)
   -------------------------------------------------------------------------- */

#badiu-report-search > .card {
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-md);
    box-shadow: var(--bd-shadow-sm);
    overflow: visible;
    margin-bottom: 1.25rem;
    background: var(--bd-surface);
}

#badiu-report-search > .card > .card-header {
    background: var(--bd-surface-2);
    border-bottom: 1px solid var(--bd-border);
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .01em;
    color: var(--bd-primary-ink);
    padding: .75rem 1rem;
}

#badiu-report-search > .card > .card-body {
    padding: 1rem;
}

/* First row: input + submit + advanced toggle, all on one baseline. */
#badiu-report-search #badiu-report-search-firtrow .col,
#badiu-report-search #badiu-report-search-firtrow > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

#badiu-report-search #badiu-report-search-firtrow-elements {
    flex: 1 1 260px;
    min-width: 0;
}

#badiu-report-search #badiu-report-search-firtrow-elements .form-control {
    width: 100%;
}

#badiu-report-search #badiu-report-search-firtrow .btn-primary {
    padding: .5rem 1.15rem;
    font-weight: 600;
    border-radius: var(--bd-radius);
    white-space: nowrap;
}

/* "Busca avançada" — pill toggle with hamburger + chevron affordance. */
#badiu-report-search a[href="#badiu-report-search-othersrows"] {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    margin-left: .25rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--bd-accent-ink);
    background: var(--bd-accent-bg);
    border: 1px solid var(--bd-accent-border);
    border-radius: 999px;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease,
                box-shadow .15s ease, transform .05s ease;
}

#badiu-report-search a[href="#badiu-report-search-othersrows"]::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23087f78'><path d='M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z'/></svg>");
}

#badiu-report-search a[href="#badiu-report-search-othersrows"]::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: .15rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23087f78'><path d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>");
    transition: transform .2s ease;
}

#badiu-report-search a[href="#badiu-report-search-othersrows"]:hover,
#badiu-report-search a[href="#badiu-report-search-othersrows"]:focus {
    background: #d8efed;
    border-color: #70bcb7;
    color: var(--bd-accent-ink);
    text-decoration: none;
    box-shadow: 0 .125rem .35rem rgba(8, 127, 120, .18);
    outline: none;
}

#badiu-report-search a[href="#badiu-report-search-othersrows"]:active {
    transform: translateY(1px);
}

/* Expanded state: Bootstrap sets aria-expanded="true" on the toggle. */
#badiu-report-search a[href="#badiu-report-search-othersrows"][aria-expanded="true"] {
    background: var(--bd-accent);
    color: #fff;
    border-color: var(--bd-accent);
}

#badiu-report-search a[href="#badiu-report-search-othersrows"][aria-expanded="true"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'><path d='M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z'/></svg>");
}

#badiu-report-search a[href="#badiu-report-search-othersrows"][aria-expanded="true"]::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'><path d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>");
    transform: rotate(-180deg);
}

/* Expanded filter area — grouped fieldsets. */
#badiu-report-search-othersrows {
    margin-top: .85rem;
}

#badiu-report-search-othersrows fieldset.form-group,
#badiunet-system-core-output #badiu-report-search-othersrows fieldset {
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-md);
    background: var(--bd-surface-3);
    padding: .9rem 1rem;
    margin-bottom: .75rem;
}

#badiu-report-search-othersrows fieldset.form-group > legend,
#badiunet-system-core-output #badiu-report-search-othersrows legend {
    float: none;
    width: auto;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bd-primary-ink);
    margin-bottom: .6rem;
    padding: 0;
    border: 0;
    border-bottom: 0;
}

#badiu-report-search-othersrows fieldset.form-group > legend a {
    color: var(--bd-primary-ink);
    text-decoration: none;
}

#badiu-report-search-othersrows fieldset.form-group > legend a:hover {
    text-decoration: underline;
}

/* Filter fields inside the expanded area. */
#badiu-report-search-othersrows .form-group {
    margin-bottom: .75rem;
}

#badiu-report-search-othersrows label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--bd-text-soft);
    margin-bottom: .3rem;
}

@media (max-width: 767.98px) {
    #badiu-report-search #badiu-report-search-firtrow .col,
    #badiu-report-search #badiu-report-search-firtrow > div {
        flex-direction: column;
        align-items: stretch;
    }

    #badiu-report-search #badiu-report-search-firtrow .btn-primary,
    #badiu-report-search a[href="#badiu-report-search-othersrows"] {
        width: 100%;
        justify-content: center;
        text-align: center;
        margin-left: 0;
    }
}

/* --------------------------------------------------------------------------
   3. RESULT PANEL  (#badiu-report-result)
   The generic report renders: .card > .card-header ("Resultado") +
   .card-body > .row [ h5 result count | export | scheduler | scheduled ].
   -------------------------------------------------------------------------- */

#badiu-report-result > .card {
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-md);
    background: var(--bd-surface);
    box-shadow: var(--bd-shadow-sm);
    overflow: hidden;
}

#badiu-report-result > .card > .card-header {
    background: var(--bd-surface-2);
    border-bottom: 1px solid var(--bd-border);
    font-weight: 600;
    font-size: .9rem;
    color: var(--bd-primary-ink);
    padding: .75rem 1rem;
}

#badiu-report-result > .card > .card-body {
    padding: 1rem;
}

/* Toolbar row: result count on the left, actions on the right. */
#badiu-report-result > .card > .card-body > .row:first-of-type {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem .75rem;
    margin: 0 0 .25rem;
    padding: .75rem .9rem;
    background: var(--bd-surface);
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-md);
    box-shadow: var(--bd-shadow-sm);
}

/* Result count — "Resultado: 1 - 10 de 3879". */
#badiu-report-result > .card > .card-body > .row:first-of-type > .col:first-child {
    flex: 1 1 220px;
    min-width: 0;
    padding: 0;
}

#badiu-report-result > .card > .card-body > .row:first-of-type > .col:first-child h5 {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--bd-text);
}

/* The count itself becomes a pill chip. */
#badiu-report-result > .card > .card-body > .row:first-of-type > .col:first-child h5 span,
#badiu-report-result .result-search span {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    background: var(--bd-info-bg);
    color: var(--bd-info-ink);
    border: 1px solid var(--bd-info-border);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

/* Action buttons (export / scheduler / scheduled) — each wrapped in a .col.
   The framework gives them .form-control.btn.btn-outline-primary, which
   stretches to full width; we shrink them back to content-sized pills. */
#badiu-report-result > .card > .card-body > .row:first-of-type > .col {
    flex: 0 0 auto;
    width: auto;
    padding: 0;
}

#badiu-report-result > .card > .card-body > .row:first-of-type > .col > a.btn,
#badiu-report-result > .card > .card-body > .row:first-of-type > .col > a.form-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: auto;
    height: auto;
    padding: .5rem .9rem;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    color: var(--bd-primary);
    background: var(--bd-surface);
    border: 1px solid var(--bd-info-border);
    border-radius: var(--bd-radius);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease,
                box-shadow .15s ease, transform .05s ease;
}

#badiu-report-result > .card > .card-body > .row:first-of-type > .col > a.btn:hover,
#badiu-report-result > .card > .card-body > .row:first-of-type > .col > a.btn:focus {
    background: var(--bd-info-bg);
    border-color: #70bcb7;
    color: var(--bd-info-ink);
    text-decoration: none;
    box-shadow: 0 .125rem .35rem rgba(8, 127, 120, .12);
    outline: none;
}

#badiu-report-result > .card > .card-body > .row:first-of-type > .col > a.btn:active {
    transform: translateY(1px);
}

/* Empty spacer column the renderer injects — collapse it. */
#badiu-report-result > .card > .card-body > .row:first-of-type > .col:empty {
    display: none;
}

/* Icons before the action labels, keyed off position in the toolbar. */
#badiu-report-result > .card > .card-body > .row:first-of-type > .col > a.btn::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23087f78'><path d='M8.5 1a.5.5 0 0 0-1 0v7.793L5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 8.793V1z'/><path d='M2 12.5a.5.5 0 0 1 1 0V14h10v-1.5a.5.5 0 0 1 1 0V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-1.5z'/></svg>");
}

/* Export to excel — green accent. */
#badiu-report-result > .card > .card-body > .row:first-of-type > .col:nth-child(2) > a.btn {
    color: var(--bd-success-ink);
    border-color: var(--bd-success-border);
}

#badiu-report-result > .card > .card-body > .row:first-of-type > .col:nth-child(2) > a.btn:hover,
#badiu-report-result > .card > .card-body > .row:first-of-type > .col:nth-child(2) > a.btn:focus {
    background: var(--bd-success-bg);
    border-color: #60b995;
    color: var(--bd-success-ink);
    box-shadow: 0 .125rem .35rem rgba(22, 135, 93, .12);
}

#badiu-report-result > .card > .card-body > .row:first-of-type > .col:nth-child(2) > a.btn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2316875d'><path d='M8.5 1a.5.5 0 0 0-1 0v7.793L5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 8.793V1z'/><path d='M2 12.5a.5.5 0 0 1 1 0V14h10v-1.5a.5.5 0 0 1 1 0V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-1.5z'/></svg>");
}

/* Scheduler / scheduled reports — teal accent + clock icon. */
#badiu-report-result > .card > .card-body > .row:first-of-type > .col:nth-child(n+3) > a.btn {
    color: var(--bd-accent-ink);
    border-color: var(--bd-accent-border);
}

#badiu-report-result > .card > .card-body > .row:first-of-type > .col:nth-child(n+3) > a.btn:hover,
#badiu-report-result > .card > .card-body > .row:first-of-type > .col:nth-child(n+3) > a.btn:focus {
    background: var(--bd-accent-bg);
    border-color: #70bcb7;
    color: var(--bd-accent-ink);
    box-shadow: 0 .125rem .35rem rgba(8, 127, 120, .12);
}

#badiu-report-result > .card > .card-body > .row:first-of-type > .col:nth-child(n+3) > a.btn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23087f78'><path d='M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z'/><path d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z'/></svg>");
}

@media (max-width: 767.98px) {
    #badiu-report-result > .card > .card-body > .row:first-of-type {
        flex-direction: column;
        align-items: stretch;
        padding: .75rem;
    }

    #badiu-report-result > .card > .card-body > .row:first-of-type > .col {
        width: 100%;
    }

    #badiu-report-result > .card > .card-body > .row:first-of-type > .col:first-child {
        flex: 0 1 auto;
    }

    #badiu-report-result > .card > .card-body > .row:first-of-type > .col > a.btn {
        width: 100%;
    }
}

/* Webservice param debug box. */
#badiunet-system-core-output .label-webserviceshowparamreport {
    margin-top: .5rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bd-text-muted);
}

/* --------------------------------------------------------------------------
   4. DATA TABLE  (.bootgrid-table)
   -------------------------------------------------------------------------- */

#badiunet-system-core-output .table-window {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-md);
    background: var(--bd-surface);
}

#badiunet-system-core-output .table-window:focus-visible {
    outline: 2px solid var(--bd-primary);
    outline-offset: 2px;
}

/* Inherited dashboard/detail factories place tables directly inside cards.
   Limit scrolling to those card bodies without changing the Core markup. */
.badiu-dashboard-view .card-body:has(> table.bootgrid-table),
.badiu-detail-view .card-body:has(> table.bootgrid-table) {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Columns are sized by their own content, which is what `table-layout: auto`
   does only when the table is free to grow. A fixed `width: 100%` makes the
   browser squeeze every column into the wrapper and wrap the text mid-value,
   so the table is sized automatically and merely kept from being narrower
   than its container; the overflow is absorbed by `.table-window`. */
#badiunet-system-core-output .table-window > .table,
#badiunet-system-core-output table.bootgrid-table {
    width: auto;
    min-width: 100%;
    max-width: none;
    table-layout: auto;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .875rem;
    color: var(--bd-text);
    background: var(--bd-surface);
}

#badiunet-system-core-output table.bootgrid-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: .7rem .85rem;
    background: var(--bd-surface-2);
    border: 0;
    border-bottom: 1px solid var(--bd-border);
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .065em;
    color: var(--bd-text-muted);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

#badiunet-system-core-output table.bootgrid-table > thead > tr > th a {
    color: inherit;
    text-decoration: none;
}

#badiunet-system-core-output table.bootgrid-table > thead > tr > th a:hover {
    text-decoration: underline;
}

/* A cell keeps its value on one line, which is what makes the auto layout give
   the column its content width. No `max-width` belongs on the cell itself: it
   would wrap every column at the same bound instead of letting each one take
   its content width. The bound that does apply is on the inner value wrapper
   below, so it only affects a column an oversized value would otherwise blow
   up. The table is free to become wider than the viewport, and `.table-window`
   scrolls it. */
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td {
    padding: .9rem .95rem;
    border: 0;
    border-top: 1px solid var(--bd-border-soft);
    vertical-align: middle;
    line-height: 1.5;
    white-space: nowrap;
}

/* The renderer wraps every cell value in two `div`s (`td > div > div`); the
   inner one carries the sizing rule below. */
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td > div {
    min-width: 0;
}

/* How wide one value makes its column, and where the value may break.

   A table with `width: auto` takes the width of its container whenever its
   content does not fit, and then shrinks each column down to its values'
   min-content width. That minimum is what decides whether words survive: with
   `overflow-wrap: anywhere` it is a single character, so every column was
   squeezed to the width of its (nowrap) header and words broke in the middle
   ("Admi/n", an ID "10" over two lines). Measured on /tms/enrol/classe/index
   (10 rows): 93 broken words at 768-1024 px, 33 at 1366 px.

   So a value reports its whole width, up to a bound, as its minimum too:
   - `width: max-content` + `max-width`: a value up to the bound never wraps and
     keeps its column at least that wide; when the columns do not fit, the table
     grows and `.table-window` scrolls it;
   - a longer value stops at the bound. Prose wraps at its spaces
     (`white-space: normal`), and only a single word longer than the bound (a
     URL, a token, a JSON or base64 blob) is broken, at the bound:
     `overflow-wrap: break-word` breaks a word only when it cannot fit a line
     and, unlike `anywhere`, never lowers the column's minimum width;
   - `min-width: 100%` still lays the value out over the column's whole width,
     as the block it is: a column wider than the value (a long header, spare
     room) keeps it on fewer lines, and content with no width of its own (a
     progress bar) is not collapsed to zero by `max-content`.

   The bound is `--bd-table-value-max` (default 40ch: about 280 px, roughly 45
   characters of ordinary text in the body face). A page or a tenant stylesheet
   tunes it by setting the property, without restating this selector.
   See doc/responsive-review.md, revision 2026-11-14. */
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td > div > div {
    width: max-content;
    min-width: 100%;
    max-width: var(--bd-table-value-max, 40ch);
    white-space: normal;
    overflow-wrap: break-word;
}

/* An explicitly multi-line cell (markup the report itself emitted with <br> or
   block children) must still be allowed to lay out over several lines. */
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td > div > div:has(br),
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td > div > div:has(p),
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td > div > div:has(ul),
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td > div > div:has(div) {
    white-space: normal;
}

/* Zebra + hover, overriding Bootstrap's table-hover defaults. */
#badiunet-system-core-output table.bootgrid-table > tbody > tr:nth-child(odd) > td {
    background: var(--bd-surface);
}

#badiunet-system-core-output table.bootgrid-table > tbody > tr:nth-child(even) > td {
    background: var(--bd-surface-alt);
}

#badiunet-system-core-output table.bootgrid-table.table-hover > tbody > tr:hover > td,
#badiunet-system-core-output table.bootgrid-table > tbody > tr:hover > td {
    background: var(--bd-surface-2);
    --bs-table-accent-bg: transparent;
}

#badiunet-system-core-output table.bootgrid-table > tbody > tr:last-child > td:first-child {
    border-bottom-left-radius: var(--bd-radius-md);
}

#badiunet-system-core-output table.bootgrid-table > tbody > tr:last-child > td:last-child {
    border-bottom-right-radius: var(--bd-radius-md);
}

/* Links inside cells. */
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td a:not(.btn) {
    color: var(--bd-primary);
    font-weight: 600;
    text-decoration: none;
}

#badiunet-system-core-output table.bootgrid-table > tbody > tr > td a:not(.btn):hover {
    text-decoration: underline;
}

/* Row action icons (_ctrl column) — quiet until hovered. */
#badiunet-system-core-output .table-icon-manager {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    white-space: nowrap;
}

#badiunet-system-core-output .table-icon-manager > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--bd-radius-sm);
    color: var(--bd-text-muted);
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

#badiunet-system-core-output .table-icon-manager > a:hover,
#badiunet-system-core-output .table-icon-manager > a:focus {
    background: var(--bd-info-bg);
    border-color: var(--bd-info-border);
    color: var(--bd-primary);
    outline: none;
}

/* Destructive actions turn red only on hover. */
#badiunet-system-core-output .table-icon-manager > a:hover .fa-trash,
#badiunet-system-core-output .table-icon-manager > a:hover .fa-times-circle {
    color: var(--bd-danger);
}

#badiunet-system-core-output .table-icon-manager > a:has(.fa-trash):hover,
#badiunet-system-core-output .table-icon-manager > a:has(.fa-times-circle):hover {
    background: var(--bd-danger-bg);
    border-color: var(--bd-danger-border);
    color: var(--bd-danger-ink);
}

/* Inline edit widgets inside cells stay compact. */
#badiunet-system-core-output table.bootgrid-table > tbody > tr > td .form-control {
    min-width: 140px;
    font-size: .85rem;
    padding: .3rem .5rem;
}

/* Empty-state helper (when a report renders no rows). */
#badiunet-system-core-output table.bootgrid-table > tbody:empty::after,
#badiunet-system-core-output .badiu-report-empty {
    display: block;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--bd-text-muted);
    font-size: .9rem;
}

@media (max-width: 767.98px) {
    #badiunet-system-core-output table.bootgrid-table {
        font-size: .82rem;
    }

    #badiunet-system-core-output table.bootgrid-table > thead > tr > th,
    #badiunet-system-core-output table.bootgrid-table > tbody > tr > td {
        padding: .5rem .55rem;
    }
}

/* --------------------------------------------------------------------------
   5. PAGINATION
   -------------------------------------------------------------------------- */

#badiunet-system-core-output .report-container .pagination,
#badiunet-system-core-output .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    margin: 1rem 0 .25rem;
    padding: 0;
    list-style: none;
}

#badiunet-system-core-output .pagination > .page-item > .page-link,
#badiunet-system-core-output .pagination > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 .55rem;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-sm);
    background: var(--bd-surface);
    color: var(--bd-text-soft);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

#badiunet-system-core-output .pagination > .page-item > .page-link:hover,
#badiunet-system-core-output .pagination > li > a:hover {
    background: var(--bd-info-bg);
    border-color: var(--bd-info-border);
    color: var(--bd-primary);
}

#badiunet-system-core-output .pagination > .page-item.active > .page-link,
#badiunet-system-core-output .pagination > li.active > a {
    background: var(--bd-primary);
    border-color: var(--bd-primary);
    color: #fff;
    box-shadow: 0 .125rem .35rem rgba(8, 127, 120, .25);
}

#badiunet-system-core-output .pagination > .page-item.disabled > .page-link,
#badiunet-system-core-output .pagination > li.disabled > a {
    opacity: .5;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. DASHBOARD CARDS / KPI TILES
   -------------------------------------------------------------------------- */

#badiunet-system-core-output .row .card {
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-md);
    background: var(--bd-surface);
    box-shadow: var(--bd-shadow-sm);
    transition: box-shadow .2s ease, transform .12s ease, border-color .2s ease;
}

#badiunet-system-core-output .row .card:hover {
    box-shadow: var(--bd-shadow-md);
    border-color: var(--bd-border-strong);
}

#badiunet-system-core-output .row .card > .card-header {
    background: var(--bd-surface-2);
    border-bottom: 1px solid var(--bd-border);
    padding: .7rem .9rem;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bd-primary-ink);
}

#badiunet-system-core-output .row .card > .card-body {
    padding: 1rem;
}

/* A dashboard tile whose body is a single big number reads as a KPI. */
#badiunet-system-core-output .row .card > .card-body > h1,
#badiunet-system-core-output .row .card > .card-body > h2,
#badiunet-system-core-output .row .card > .card-body > .badiu-kpi-value {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: var(--bd-primary-ink);
}

/* Charts always centered inside their tile. */
#badiunet-system-core-output .chartitem,
#badiunet-system-core-output .badiu-sync-freport-monitor .chartitem {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* --------------------------------------------------------------------------
   7. MODALS (delete confirmation, scheduler form)
   -------------------------------------------------------------------------- */

#badiunet-system-core-output .modal-content,
.modal .modal-content {
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-md);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .18);
}

.modal .modal-header {
    background: var(--bd-surface-2);
    border-bottom: 1px solid var(--bd-border);
    padding: .85rem 1.1rem;
}

.modal .modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bd-primary-ink);
}

.modal .modal-body {
    padding: 1.1rem;
}

.modal .modal-footer {
    background: var(--bd-surface-2);
    border-top: 1px solid var(--bd-border);
    padding: .75rem 1.1rem;
    gap: .5rem;
}

/* --------------------------------------------------------------------------
   8. LEGACY STRUCTURAL RULES — preserved from the original stylesheet
   These keep the inline layout the renderer depends on.
   -------------------------------------------------------------------------- */

#badiunet-system-core-output #badiu-report-search-firtrow-elements {
    display: inline;
}

#badiunet-system-core-output #badiu-report-search-firtrow-elements .form-control {
    display: inline;
    width: 80%;
}

#badiunet-system-core-output #badiu-report-search-firtrow-elements div {
    display: inline;
    width: 80%;
}

#badiunet-system-core-output #badiu-report-search .card {
    border: none;
}

#badiunet-system-core-output #badiu-report-result .card {
    border: none;
}

#badiunet-system-core-output .row {
    max-height: max-content;
}

#badiunet-system-core-output .row .card {
    height: 100%;
}

/* Re-assert the flex layout of the first search row after the legacy
   `display:inline` rules above (they must stay for the renderer, but the
   modern layout wins inside the flex container). */
#badiunet-system-core-output #badiu-report-search #badiu-report-search-firtrow-elements {
    display: flex;
    flex: 1 1 260px;
    align-items: center;
    width: auto;
}

#badiunet-system-core-output #badiu-report-search #badiu-report-search-firtrow-elements .form-control,
#badiunet-system-core-output #badiu-report-search #badiu-report-search-firtrow-elements > div {
    display: block;
    width: 100%;
}

/* A desktop flex basis is a width; in the stacked mobile row it becomes a
   height. Reset it here, after the legacy renderer rules. */
@media (max-width: 767.98px) {
    #badiunet-system-core-output #badiu-report-search #badiu-report-search-firtrow-elements {
        flex: 0 1 auto;
        width: 100%;
    }
}

/* Restore the visible card chrome the legacy `border:none` rules removed. */
#badiunet-system-core-output #badiu-report-search > .card,
#badiunet-system-core-output #badiu-report-result > .card {
    border: 1px solid var(--bd-border);
}
