/* Final app-level overrides. Theme files are linked individually for cache busting. */
:root {
    --navbar-height: 76px;
    --sidebar-width: 220px;
    --content-gutter: 2rem;
    --mobile-content-gutter: 1rem;
    --surface-radius: 0.65rem;
    --surface-radius-sm: 0.65rem;
    --form-border-radius: 0.65rem;
}

html {
    font-size: 14px;
}

body {
    font-size: 13.5px !important;
    line-height: 1.35;
}

.body-content {
    padding: 1.35rem 0 1.25rem;
}

@media (max-width: 991.98px) {
    .body-content {
        padding-left: var(--mobile-content-gutter);
        padding-right: var(--mobile-content-gutter);
    }
}

.page-title {
    font-size: 1.15rem;
}

.card,
.table-shell,
.table-card-clean,
.widget-card,
.dashboard-tile,
.dashboard-index-hero,
.dashboard-index-empty,
.section-index-card,
.import-page-shell {
    border-radius: 0.65rem;
}

.auth-login {
    --auth-card-width: 50rem;
    --auth-form-width: 24.5rem;
    align-items: center;
    min-height: calc(100vh - 2rem);
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.auth-login .auth-shell {
    max-width: var(--auth-card-width);
}

.auth-login .auth-card {
    animation: auth-card-enter 220ms ease-out both;
    max-width: var(--auth-card-width);
    margin-inline: auto;
    border-radius: 0.65rem !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, var(--auth-form-width));
    overflow: hidden;
    text-align: initial;
}

.auth-login .auth-illustration-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 26rem;
    padding: 1.5rem;
    background:
        linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.08), rgba(var(--primary-color-rgb), 0.02) 42%, rgba(25, 135, 84, 0.05)),
        var(--surface-color);
    position: relative;
}

.auth-login .auth-illustration-panel::before {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1), rgba(var(--primary-color-rgb), 0));
    content: "";
    height: 42%;
    left: 0;
    position: absolute;
    top: 0;
    width: 58%;
}

.auth-login .auth-illustration-panel::after {
    background: rgba(var(--primary-color-rgb), 0.14);
    border-radius: 50%;
    bottom: 4.2rem;
    content: "";
    filter: blur(5px);
    height: 0.75rem;
    position: absolute;
    width: min(42%, 12rem);
}

.auth-login .auth-illustration {
    width: min(100%, 23rem);
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

.auth-login .auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 26rem;
    padding: 1.2rem 1.05rem 1.15rem;
}

.auth-login .auth-logo {
    width: 5.75rem;
    height: auto;
    max-height: 6.5rem;
    object-fit: contain;
    margin-top: 1.15rem !important;
    margin-bottom: 0.9rem !important;
}

.auth-login .card-title {
    font-size: 1.08rem;
    line-height: 1.2;
}

.auth-login .card-body {
    padding: 1.1rem 0 0 !important;
}

@keyframes auth-card-enter {
    from {
        opacity: 0;
        transform: translateY(0.4rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-page {
    align-items: center;
    display: flex;
    min-height: calc(100vh - var(--navbar-height) - 2.7rem);
    padding: 1rem 0;
}

.page-content:not(.logged-in) .error-page {
    min-height: calc(100vh - 2rem);
}

.error-shell {
    width: 100%;
}

.error-card {
    animation: error-card-enter 220ms ease-out both;
    border-radius: 0.65rem !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 24.5rem);
    margin-inline: auto;
    max-width: 50rem;
    overflow: hidden;
}

.error-illustration-panel {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.08), rgba(var(--primary-color-rgb), 0.02) 42%, rgba(25, 135, 84, 0.05)),
        var(--surface-color);
    display: flex;
    justify-content: center;
    min-height: 24rem;
    padding: 1.5rem;
    position: relative;
}

.error-illustration-panel::before {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1), rgba(var(--primary-color-rgb), 0));
    content: "";
    height: 42%;
    left: 0;
    position: absolute;
    top: 0;
    width: 58%;
}

.error-illustration-panel::after {
    background: rgba(var(--primary-color-rgb), 0.14);
    border-radius: 50%;
    bottom: 4.2rem;
    content: "";
    filter: blur(5px);
    height: 0.75rem;
    position: absolute;
    width: min(42%, 12rem);
}

.error-illustration {
    display: block;
    height: auto;
    position: relative;
    width: min(100%, 23rem);
    z-index: 1;
}

.error-copy-panel {
    align-content: center;
    display: grid;
    gap: 0.85rem;
    min-height: 24rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.error-status {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-radius: 999px;
    color: var(--primary-color);
    font-size: 0.76rem;
    font-weight: 800;
    justify-self: center;
    line-height: 1;
    padding: 0.42rem 0.7rem;
}

.error-title {
    color: var(--header-color);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.16;
    margin: 0;
}

.error-message {
    color: var(--sub-title-color);
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0;
}

.error-action {
    justify-self: center;
    margin-top: 0.45rem;
}

@keyframes error-card-enter {
    from {
        opacity: 0;
        transform: translateY(0.4rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767.98px) {
    .auth-login {
        --auth-card-width: 24.5rem;
    }

    .auth-login .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-login .auth-illustration-panel {
        min-height: 12rem;
        padding: 1rem 1rem 0.25rem;
    }

    .auth-login .auth-illustration-panel::after {
        bottom: 1.15rem;
        height: 0.55rem;
        width: min(38%, 7rem);
    }

    .auth-login .auth-illustration {
        width: min(100%, 12rem);
    }

    .auth-login .auth-form-panel {
        min-height: auto;
        padding: 1rem 1.05rem 1.15rem;
    }

    .error-page {
        min-height: auto;
    }

    .error-card {
        grid-template-columns: 1fr;
        max-width: 24.5rem;
    }

    .error-illustration-panel {
        min-height: 12rem;
        padding: 1rem 1rem 0.25rem;
    }

    .error-illustration-panel::after {
        bottom: 1.15rem;
        height: 0.55rem;
        width: min(38%, 7rem);
    }

    .error-illustration {
        width: min(100%, 12rem);
    }

    .error-copy-panel {
        min-height: auto;
        padding: 1.15rem 1.05rem 1.2rem;
    }

    .error-title {
        font-size: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-login .auth-card,
    .error-card {
        animation: none;
    }
}

.card-header,
.card-header > :is(h1, h2, h3, h4, h5, h6),
.card-title,
.widget-title,
.widget-header .widget-title,
.tab-tabs-header .widget-title,
.tab-section-header h5,
.tile-title,
.dashboard-index-hero__title,
.section-index-card__title,
.report-upload-group__title,
.report-upload-card__title,
.import-page-body .report-upload-card__title {
    font-size: 1rem;
    line-height: 1.2;
}

.card-header,
.card-body,
.widget-header,
.tab-tabs-header,
.tab-tab-content,
.import-page-header,
.import-page-body {
    padding: 0.85rem 1rem !important;
}

.row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.home-widget-grid {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.home-widget-grid.my-5 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.home-widget-grid > .mb-5 {
    margin-bottom: 0 !important;
}

@media (max-width: 991.98px) {
    .home-widget-grid {
        --bs-gutter-x: 0;
    }
}

.sidebar-nav {
    padding: 1.55rem 0.75rem 0.95rem;
}

.app-shell-toggle {
    --bs-btn-hover-border-color: transparent;
    --bs-btn-focus-box-shadow: none;
    --bs-btn-active-bg: var(--sidebar-hover);
    --bs-btn-active-border-color: transparent;
    --bs-btn-active-color: var(--primary-color);
    top: 1.45rem;
    right: 0.85rem;
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 999px !important;
    background: var(--surface-color);
    color: var(--text-muted-color);
    box-shadow: 0 0.35rem 0.9rem rgba(17, 24, 39, 0.1) !important;
    transition: right 0.28s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.app-shell-toggle:hover,
.app-shell-toggle:focus,
.app-shell-toggle:focus-visible {
    background: var(--sidebar-hover);
    border-color: transparent;
    color: var(--primary-color);
    box-shadow: 0 0.45rem 1rem rgba(17, 24, 39, 0.14) !important;
    outline: 0;
}

.app-shell-toggle:active,
.app-shell-toggle.active,
.app-shell-toggle.show,
.app-shell-toggle:focus:not(:focus-visible),
.app-shell-toggle:first-child:active {
    background: var(--sidebar-hover);
    border-color: transparent;
    color: var(--primary-color);
    box-shadow: 0 0.35rem 0.9rem rgba(17, 24, 39, 0.1) !important;
    outline: 0;
    opacity: 1;
}

.app-shell-toggle i {
    font-size: 0.72rem;
}

body.sidebar-collapsed .app-shell-toggle {
    right: -42px;
}

.sidebar-section + .sidebar-section {
    margin-top: 1.3rem;
}

.sidebar-section-label {
    border-bottom: 1px solid var(--form-border);
    margin-bottom: 0.65rem;
    padding-bottom: 0.45rem;
}

.sidebar-bottom .sidebar-section-label {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-link {
    gap: 0.7rem;
    padding: 0.56rem 0.7rem;
    border-radius: 8px;
}

.sidebar-link + .sidebar-link,
.sidebar-submenu + .sidebar-link,
.sidebar-link + .sidebar-submenu {
    margin-top: 0.12rem;
}

.sidebar-link span {
    font-size: 0.86rem;
}

.sidebar-link i {
    width: 16px;
    font-size: 0.86rem;
}

.app-topbar-inner {
    gap: 0.75rem;
}

@media (max-width: 991.98px) {
    .app-topbar-inner {
        gap: 0.9rem;
    }

    .app-topbar-inner > .d-flex {
        gap: 0.85rem !important;
    }

    .page-heading-wrap {
        padding-left: 0.1rem;
    }

    .app-navbar .app-user-toggle {
        gap: 0.15rem;
        min-width: 50px;
        width: 50px;
        max-width: 50px;
        flex-shrink: 0;
    }

    .app-navbar .app-user-toggle img.avatar-md,
    .app-navbar .app-user-toggle .post-card-author-fallback {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
    }

    .app-navbar .app-user-toggle img.avatar-md {
        object-fit: cover;
    }

    .app-navbar .app-user-toggle::after {
        flex: 0 0 auto;
        margin-left: 0.1rem;
    }
}

.table-shell {
    padding: 0.75rem;
}

.table-clean thead th,
.table-clean tbody td {
    padding: 0.38rem 0.45rem 0.65rem;
}

.table-clean,
.table-clean .cell-title-primary,
.table-clean .cell-title-secondary,
.cell-title-primary,
.cell-title-secondary {
    font-size: 0.86rem;
}

.table-clean .table-status,
.table-status {
    padding: 0.28rem 0.55rem;
    font-size: 0.72rem;
}

.table-toolbar,
.table-toolbar-left,
.table-toolbar-right {
    gap: 0.5rem;
}

.table-search,
.table-filter-btn,
.table-primary-btn {
    height: 2.15rem;
    font-size: 0.8rem;
}

.btn {
    --bs-btn-padding-y: 0.28rem;
    --bs-btn-padding-x: 0.6rem;
    --bs-btn-font-size: 0.82rem;
    min-height: 2.15rem;
    line-height: 1.2;
}

.form-control,
.form-select,
.form-select-white,
.checkbox-select-toggle {
    min-height: 2.15rem;
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
    font-size: 0.86rem;
}

.checkbox-select-toggle.checkbox-select-toggle--floating {
    display: flex !important;
    min-height: 2.95rem;
    height: auto;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0.125rem;
    padding: 0.62rem 2.75rem 0.38rem 0.72rem;
    line-height: 1.2;
}

.checkbox-select-toggle.checkbox-select-toggle--floating .checkbox-select-toggle-label,
.checkbox-select-toggle.checkbox-select-toggle--floating .checkbox-select-toggle-value {
    display: block;
    width: 100%;
    min-width: 0;
    text-align: left;
}

.checkbox-select-toggle.checkbox-select-toggle--floating .checkbox-select-toggle-label {
    font-size: 0.64rem;
}

@media (max-width: 767.98px) {
    input[type="date"],
    input[type="time"],
    input[type="month"],
    input[type="week"],
    input[type="datetime-local"] {
        direction: ltr;
        text-align: left !important;
        text-align-last: left;
    }

    input[type="date"]::-webkit-date-and-time-value,
    input[type="time"]::-webkit-date-and-time-value,
    input[type="month"]::-webkit-date-and-time-value,
    input[type="week"]::-webkit-date-and-time-value,
    input[type="datetime-local"]::-webkit-date-and-time-value,
    input[type="date"]::-webkit-datetime-edit,
    input[type="time"]::-webkit-datetime-edit,
    input[type="month"]::-webkit-datetime-edit,
    input[type="week"]::-webkit-datetime-edit,
    input[type="datetime-local"]::-webkit-datetime-edit {
        display: block;
        width: 100%;
        min-width: 0;
        text-align: left !important;
    }
}

.form-floating > input.form-control,
.form-floating > .form-select {
    height: 2.95rem;
    min-height: 2.95rem;
    padding: 1.02rem 0.72rem 0.34rem;
    line-height: 1.2;
}

.form-floating > input.form-control:focus,
.form-floating > input.form-control:not(:placeholder-shown),
.form-floating > .form-select {
    padding-top: 1.02rem;
    padding-bottom: 0.34rem;
}

.form-floating > label {
    height: auto;
    padding: 0.88rem 0.72rem;
    line-height: 1.15;
}

.form-floating > input.form-control:focus ~ label,
.form-floating > input.form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    transform: scale(0.78) translateY(-0.5rem) translateX(0.08rem);
}

.form-label,
.form-floating > label {
    font-size: 0.82rem;
}

.app-form.form-layout-vertical > .mb-3 {
    margin-bottom: 0.75rem !important;
}

.auth-login .app-form.form-layout-vertical > .mb-3 {
    margin-bottom: 0.8rem !important;
}

.auth-login .form-floating:has([data-field-name="two_factor_code"]) > span.d-block {
    text-align: left;
    padding-left: 0 !important;
}

.auth-login .form-floating:has([data-field-name="two_factor_code"]) .form-text {
    display: block;
    text-align: left;
}

.auth-login .auth-trust-device__divider {
    border: 0;
    border-top: 1px solid rgba(20, 28, 45, 0.14);
    margin: 1.15rem 0 1rem;
    opacity: 1;
}

.auth-login .auth-trust-device {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 0.55rem;
    align-items: start;
    text-align: left;
}

.auth-login .auth-trust-device .form-check-input {
    float: none;
    flex: 0 0 auto;
    grid-column: 1;
    width: 20px;
    height: 20px;
    border-color: rgba(20, 28, 45, 0.78);
    border-width: 1.5px;
    /* Centre the 20px box on the ~17px first text line (13.5px * 1.25). */
    margin: -0.1rem 0 0;
}

.auth-login .auth-trust-device .form-check-label {
    display: block;
    grid-column: 2;
    line-height: 1.25;
    min-width: 0;
}

.auth-login .auth-trust-device .form-text {
    grid-column: 2;
    margin-top: 0.2rem;
    line-height: 1.2;
}

.auth-login .auth-activation-check {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 0.55rem;
    /* Centre the box against the whole label, including when it wraps to two lines. */
    align-items: center;
    padding-left: 0;
}

.auth-login .auth-activation-check .form-check-input {
    float: none;
    width: 20px;
    height: 20px;
    margin: 0;
    border-color: rgba(20, 28, 45, 0.78);
    border-width: 1.5px;
}

.auth-login .auth-activation-check .form-check-label {
    line-height: 1.25;
}

.auth-login .auth-activation-check .invalid-feedback {
    grid-column: 2;
    margin-top: 0.25rem;
}

.auth-login .primary-link {
    margin-top: 0.95rem !important;
    font-size: 0.78rem;
}

@media (max-width: 767.98px) {
    .auth-login .form-text,
    .auth-login span:has(> .form-text) {
        text-align: center !important;
    }

    .auth-login .auth-trust-device,
    .auth-login .auth-trust-device .form-text {
        text-align: left !important;
    }
}

.widget-header {
    gap: 0.6rem;
}

.widget-table-row,
.widget-table-row--task {
    gap: 0.5rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.date-bubble,
.home-widget-empty-state__icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}

.widget-date {
    width: 42px;
    flex-basis: 42px;
}

.widget-table-row--task {
    grid-template-columns: 42px minmax(9rem, 40%) minmax(100px, 120px) minmax(0, 1fr) max-content;
}

.home-widget-empty-state,
.widget-empty-state-row {
    gap: 0.75rem;
    padding: 0.75rem;
}

.dashboard-index,
.dashboard-index-groups,
.report-upload-shell {
    gap: 0.8rem;
}

.dashboard-index-hero,
.section-index-card,
.report-upload-card__body {
    gap: 0.75rem;
    padding: 0.75rem;
}

.dashboard-index-search .form-control {
    min-height: 2.25rem;
}

.tile-icon,
.section-index-card__icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.9rem;
}

.tab-nav {
    gap: 0.45rem;
}

.tab-nav .nav-link {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
}

.tab-placeholder,
.empty-state {
    min-height: 220px;
    padding: 1rem;
}

.import-page-body .report-upload-card__body {
    gap: 1rem;
}

.import-page-body .report-upload-columns {
    gap: 0.35rem;
    margin: 0.75rem 0 0.75rem;
}

.import-page-shell > .alert {
    margin: 0.75rem 1rem 0 !important;
}

.drag-area {
    height: 200px;
    padding-top: 0.75rem;
    padding-bottom: 1rem;
}

.drag-area i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

footer .footer-column,
footer .colophon,
footer .footer-legal-links {
    text-align: center;
}

footer .footer-legal-links {
    align-items: center;
}
