/*
 * Oncera overrides on top of the DashForge theme.
 *
 * Deliberately small: everything here is either a gap the theme leaves for
 * dynamically injected markup, or a density tweak for the data-heavy screens.
 */

.aside-logo span {
    color: #0168fa;
}

/* Avatar initials, used instead of the theme's photo avatars. */
.avatar .avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
}

.avatar-sm .avatar-initial {
    font-size: 11px;
}

.avatar-lg .avatar-initial {
    font-size: 20px;
}

/* The header profile dropdown is the theme's own, just not inside a navbar. */
.content-header .dropdown-profile .dropdown-link {
    display: block;
    line-height: 1;
}

/*
 * The theme hides its footer below 992px; the attribution should still show. From 992px
 * the theme's own row applies (name on the left, attribution on the right). Below it the
 * two halves are centred one above the other, so they read as one footer rather than
 * two loose lines.
 */
.footer {
    display: flex;
    background-color: transparent;
    margin-top: 10px;
}

@media (max-width: 991.98px) {
    .footer {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        text-align: center;
    }
}

/*
 * The footer sits at the foot of the screen when a page is shorter than the screen, and
 * after the content when it is longer: the page grows to fill the scrolling area.
 */
.content-body {
    display: flex;
    flex-direction: column;
}

.content-body > [data-page-root] {
    flex: 1 0 auto;
}

/* The sign-in pages: the form area fills the screen, and the footer takes what is left. */
body[data-public] {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* min-height cleared: the theme's "screen less 106px" assumes its own footer's height. */
body[data-public] > .content-auth {
    flex: 1 0 auto;
    min-height: 0;
}

/* Tables carry a lot of columns; keep them readable rather than roomy. */
.table > :not(caption) > * > * {
    padding: 0.55rem 0.6rem;
}

.table thead th {
    border-bottom-width: 1px;
    white-space: nowrap;
    font-weight: 500;
}

.table td {
    vertical-align: middle;
}

.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 11px;
    line-height: 1.5;
    border-radius: 0.2rem;
    white-space: nowrap;
}

.badge {
    font-weight: 500;
    font-size: 10.5px;
    text-transform: capitalize;
}

.card {
    margin-bottom: 20px;
}

.card-header {
    background-color: transparent;
    padding: 0.75rem 1.25rem;
}

/* Modals used as forms get long; scroll the body rather than the page. */
.modal-body {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.form-label {
    margin-bottom: 0.25rem;
}

/* Validation messages are injected, so they need to show without Bootstrap's
   :invalid state having been triggered by the browser. */
.invalid-feedback:not(:empty) {
    display: block;
}

.list-group-item.active {
    background-color: #0168fa;
    border-color: #0168fa;
}

.sign-wrapper {
    max-width: 420px;
}

.content-auth .media {
    align-items: center;
}

pre {
    max-height: 320px;
    overflow: auto;
    margin-bottom: 0;
}

/* Select2 inside a form modal: full width, and the theme's invalid state on the
   visible control rather than the hidden <select> it replaces. */
.modal .select2-container {
    width: 100% !important;
}

.is-invalid + .select2-container .select2-selection {
    border-color: #dc3545;
}

/* The theme pins the datepicker at z-index 5, which is under a modal backdrop
   (1050) — so a date field inside a modal would open its calendar behind it.
   jQuery UI writes its own inline z-index, and an inline value without
   !important loses to this rule. */
body.modal-open .ui-datepicker {
    z-index: 1080 !important;
}

/* Filter bars: one line per label, so every control in the row starts at the
   same height however long the label is ("Expiring within (days)" was pushing
   its own input out of line with the one beside it). The full text stays
   available as a tooltip. */
.oncera-filters .form-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.oncera-filters .form-group > small {
    min-height: 0;
}

/* A chart lives in a box that owns its height. Chart.js sizes the canvas to its
   parent, and a canvas that is also what gives the parent its height grows
   without end (the dashboard trend chart reached 56,000px and crashed the tab). */
.oncera-chart {
    position: relative;
    width: 100%;
}

.oncera-chart > canvas {
    display: block;
}

/* Line-item rows (a purchase order's or a bill's lines).

   table-layout: fixed so a declared column width is honoured. Left to size
   itself by content, the browser gave a three-digit quantity the same 211px as
   Description — a free text field — and squeezed VAT % down to 113px at the end
   of a seven-column row, where it read as missing rather than narrow.

   The minimum width keeps the row legible instead of collapsing: below it the
   wrapping .table-responsive scrolls, which is the honest answer on a phone. */
.oncera-lines {
    table-layout: fixed;
    min-width: 54rem;
}

.oncera-lines td,
.oncera-lines th {
    vertical-align: top;
}

/* A control the server ignores is shown switched off rather than hidden: the
   column still has to line up with its heading and with the rows around it. */
.oncera-lines .form-control:disabled,
.oncera-lines .form-select:disabled {
    cursor: not-allowed;
}
