:root {
    --app-bg: #f4f6f9;
    --app-surface: #ffffff;
    --app-text: #2f3542;
    --app-muted: #6b7280;
    --app-border: #e6ebf2;
    --app-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --app-radius: 1rem;
    --app-tap-size: 44px;
    --app-font-sm: clamp(.8rem, .76rem + .2vw, .92rem);
    --app-font-base: clamp(.92rem, .88rem + .24vw, 1rem);
    --app-font-xl: clamp(1.3rem, 1.1rem + .95vw, 1.95rem);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--app-text);
    font-size: var(--app-font-base);
    line-height: 1.5;
    overflow-x: hidden;
}

a:hover {
    text-decoration: none;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

.app-shell {
    min-height: 100vh;
    overflow-x: clip;
}

@media (min-width: 992px) {
    .app-shell.is-authenticated {
        padding-left: 280px;
    }
}

.app-sidebar-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    background: rgba(17, 24, 39, 0.45);
}

@media (min-width: 992px) {
    .app-sidebar-backdrop {
        display: none !important;
    }
}

.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    width: min(280px, 86vw);
    display: flex;
    flex-direction: column;
    background: #243447;
    color: #dbe4ee;
    transform: translateX(-100%);
    transition: transform .2s ease-in-out;
    box-shadow: 0 0 30px rgba(15, 23, 42, 0.18);
}

@media (min-width: 992px) {
    .app-sidebar {
        transform: translateX(0);
    }
}

body.sidebar-mobile-open .app-sidebar {
    transform: translateX(0);
}

.app-sidebar__brand,
.app-sidebar__footer {
    padding: clamp(1rem, 1.8vw, 1.25rem);
}

.app-sidebar__brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar__footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar__brand-link {
    display: flex;
    align-items: center;
    color: #fff;
}

.app-sidebar__brand-badge,
.brand-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #007bff, #17a2b8);
    color: #fff;
    font-size: 1.4rem;
    margin-right: .9rem;
    box-shadow: 0 12px 24px rgba(0, 123, 255, 0.22);
}

.app-sidebar__brand-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}

.app-sidebar__brand-subtitle {
    display: block;
    font-size: .8rem;
    color: rgba(219, 228, 238, 0.72);
}

.app-sidebar__content {
    padding: clamp(1rem, 1.8vw, 1.25rem) 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.app-sidebar__section + .app-sidebar__section {
    margin-top: 1.25rem;
}

.app-sidebar__section-title {
    padding: 0 .75rem;
    margin-bottom: .75rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(219, 228, 238, 0.58);
}

.app-sidebar__nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-sidebar__link {
    display: flex;
    align-items: center;
    min-height: var(--app-tap-size);
    padding: .8rem .95rem;
    border-radius: .75rem;
    color: #dbe4ee;
    transition: background-color .15s ease, color .15s ease;
}

.app-sidebar__link:hover,
.app-sidebar__link.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-sidebar__icon {
    width: 24px;
    margin-right: .75rem;
    text-align: center;
}

.app-sidebar__user {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.app-sidebar__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
    margin-right: .75rem;
}

.app-sidebar__user-name {
    color: #fff;
    font-weight: 600;
}

.app-sidebar__user-role {
    font-size: .85rem;
    color: rgba(219, 228, 238, 0.7);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(.95rem, 1.8vw, 1.1rem) clamp(1rem, 2vw, 1.5rem);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e9ecef;
    backdrop-filter: saturate(180%) blur(14px);
}

.app-header__left,
.app-header__right {
    display: flex;
    align-items: center;
}

.app-header__toggle {
    width: var(--app-tap-size);
    height: var(--app-tap-size);
    border: 1px solid #ced4da;
    border-radius: .6rem;
    background: #fff;
    color: #495057;
    margin-right: 1rem;
}

@media (min-width: 992px) {
    .app-header__toggle {
        display: none;
    }
}

.app-header__eyebrow {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c757d;
}

.app-header__title {
    margin: 0;
    font-size: var(--app-font-xl);
    font-weight: 700;
    color: #212529;
}

.app-header__chip {
    display: inline-flex;
    align-items: center;
    padding: .55rem .9rem;
    border-radius: 999px;
    background: #eaf4ff;
    color: #0c63e7;
    font-size: .9rem;
    font-weight: 600;
}

.app-header__chip i {
    margin-right: .45rem;
}

.page-shell {
    padding: clamp(1rem, 2vw, 1.5rem) 0;
}

.container-fluid {
    width: min(100%, 1680px);
    padding-left: clamp(.85rem, 2vw, 1.5rem);
    padding-right: clamp(.85rem, 2vw, 1.5rem);
}

.page-title {
    margin-bottom: 0;
    font-size: var(--app-font-xl);
    font-weight: 700;
    color: #212529;
}

.card {
    border-radius: 1rem;
}

.content-card,
.metric-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--app-shadow);
}

.content-card .card-body,
.metric-card .card-body {
    padding: clamp(1rem, 1.8vw, 1.35rem);
}

.metric-label {
    margin-bottom: .45rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c757d;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.card .card-header,
.modal-header,
.modal-footer {
    border-color: #edf2f7;
}

.modal-content {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.modal-content > form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
}

.modal-content > form .modal-header,
.modal-content > form .modal-footer {
    flex: 0 0 auto;
}

.modal-dialog {
    margin: .85rem auto;
}

.modal-header,
.modal-footer,
.modal-body {
    padding-left: 1.35rem;
    padding-right: 1.35rem;
}

.modal-title {
    font-weight: 700;
    color: #212529;
}

.form-shell-note {
    display: flex;
    align-items: center;
    padding: .7rem .9rem;
    margin-bottom: .95rem;
    border: 1px solid #dbe7f3;
    border-radius: .8rem;
    background: #f8fbff;
    color: #49627b;
    font-size: .83rem;
}

.form-section {
    margin-bottom: .75rem;
}

.form-section--spaced {
    margin-top: .4rem;
}

.form-section__title {
    font-size: .82rem;
    font-weight: 700;
    color: #445468;
}

.form-section__hint {
    margin-top: .15rem;
    font-size: .8rem;
    color: #7b8794;
}

.form-shell-note--quiet {
    padding: .8rem .95rem;
    border: 1px solid #e7edf3;
    background: #fafcfe;
    color: #536274;
}

.module-access-panel {
    padding: 1.1rem;
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    background: #fff;
}

.user-form-single-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-form-single-column__section {
    width: 100%;
}

.module-access-panel--sticky {
    position: static;
    top: auto;
}

.module-access-panel__label {
    display: block;
    margin-bottom: .45rem;
    font-size: .82rem;
    font-weight: 700;
    color: #6c757d;
}

.module-access-panel__toolbar {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: .95rem;
    align-items: stretch;
}

.module-access-panel__action {
    width: 100%;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: .85rem;
}

.module-access-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .2rem .1rem 0 .1rem;
}

.module-access-list-shell {
    margin-top: .75rem;
    border: 1px solid #dde5ee;
    border-radius: .95rem;
    background: #fff;
    overflow: hidden;
}

.module-access-list-shell.is-invalid {
    border-color: #dc3545;
}

.module-access-list-shell__header {
    padding: .95rem 1rem .85rem 1rem;
    border-bottom: 1px solid #edf1f5;
}

.module-access-list-shell__title {
    margin-bottom: .7rem;
    font-size: .82rem;
    font-weight: 700;
    color: #516171;
}

.module-access-list-shell__search {
    border-radius: .7rem;
}

.module-access-list-shell__body {
    max-height: none;
    overflow: visible;
    padding: .45rem .75rem .8rem .75rem;
}

.module-access-group {
    padding-top: .25rem;
}

.module-access-group + .module-access-group {
    margin-top: .75rem;
    border-top: 1px solid #f0f3f7;
    padding-top: .85rem;
}

.module-access-group__title {
    margin: 0 0 .5rem 0;
    padding: 0 .55rem;
    font-size: .75rem;
    font-weight: 700;
    color: #7d8896;
}

.module-access-group__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .38rem .65rem;
}

.module-access-option {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    padding: .42rem .45rem;
    border-radius: .6rem;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
    border: 1px solid transparent;
    min-width: 0;
}

.module-access-option:hover {
    background: #f8fafc;
    border-color: #eef2f6;
}

.module-access-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.module-access-option__box {
    position: relative;
    flex: 0 0 auto;
    width: 1.08rem;
    height: 1.08rem;
    border: 1.5px solid #bfcddd;
    border-radius: .3rem;
    background: #fff;
}

.module-access-option__text {
    font-size: .84rem;
    color: #233142;
    line-height: 1.25;
}

.module-access-option input:checked ~ .module-access-option__text {
    font-weight: 600;
}

.module-access-option input:checked + .module-access-option__box {
    border-color: #0b63ce;
    background: #0b63ce;
}

.module-access-option input:checked + .module-access-option__box::after {
    content: "";
    position: absolute;
    top: .08rem;
    left: .3rem;
    width: .3rem;
    height: .56rem;
    border: solid #fff;
    border-width: 0 .12rem .12rem 0;
    transform: rotate(45deg);
}

.module-access-panel__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .85rem;
}

.module-access-panel__summary-title {
    font-size: .8rem;
    font-weight: 700;
    color: #495057;
}

.module-access-panel__summary-count {
    font-size: .77rem;
    font-weight: 700;
    color: #0b63ce;
    background: #edf5ff;
    border: 1px solid #d6e5fa;
    border-radius: 999px;
    padding: .22rem .55rem;
}

.module-access-selected-input {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .45rem;
    min-height: calc(2.25rem + 2px);
    margin-top: .7rem;
    padding: .5rem .65rem;
    border: 1px solid #ced4da;
    border-radius: .7rem;
    background: #fff;
    overflow: visible;
}

.module-access-selected-input__placeholder {
    align-self: center;
    font-size: .84rem;
    color: #97a3b3;
}

.module-access-tag {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .34rem .62rem;
    border: 1px solid #cfe0f7;
    border-radius: 999px;
    background: #eef5ff;
    color: #1c4f94;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: none;
    outline: 0;
    appearance: none;
}

.module-access-tag:hover {
    background: #e4efff;
    border-color: #bfd6f6;
}

.module-access-tag__label {
    white-space: nowrap;
}

.module-access-tag__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: rgba(11, 99, 206, 0.12);
    color: #0b63ce;
    font-size: .9rem;
    line-height: 1;
}

.compact-form .form-row {
    margin-left: -.4rem;
    margin-right: -.4rem;
}

.compact-form .form-row > .form-group,
.compact-form .form-group {
    margin-bottom: .8rem;
    padding-left: .4rem;
    padding-right: .4rem;
}

.compact-form .form-text {
    margin-top: .2rem;
    font-size: .75rem;
}

.compact-form textarea.form-control {
    min-height: 76px;
}

.compact-form .modal-body {
    padding-bottom: 1rem;
}

#user-modal .modal-dialog {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

#user-modal .modal-content {
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
}

#user-modal .modal-body {
    flex: 0 1 auto;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    overflow-x: hidden;
}

#user-modal .module-access-panel {
    max-height: none;
    overflow: visible;
    display: block;
}

.compact-form .modal-footer {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2;
}

#user-modal .modal-footer {
    position: static;
    flex: 0 0 auto;
}

.close {
    opacity: .55;
}

.close:hover {
    opacity: .8;
}

label {
    margin-bottom: .45rem;
    font-size: var(--app-font-sm);
    font-weight: 600;
    color: #495057;
}

.form-label-required::after {
    content: " *";
    color: #dc3545;
    font-weight: 700;
}

.form-text {
    font-size: .8rem;
    color: #6c757d;
}

.form-control,
.custom-select,
.btn {
    border-radius: .75rem;
}

.form-control,
.custom-select {
    min-height: var(--app-tap-size);
    border-color: #ced4da;
    box-shadow: none;
    background-color: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: #9aa4b2;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .module-access-panel--sticky {
        position: static;
        top: auto;
    }

    .module-access-group__options {
        grid-template-columns: 1fr;
    }
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.custom-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 .12rem rgba(0, 123, 255, 0.18);
    background-color: #fcfeff;
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    font-size: .8rem;
}

.compact-form .form-group:focus-within label {
    color: #0c63e7;
}

.btn {
    font-weight: 600;
    min-height: var(--app-tap-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .6rem .95rem;
}

.btn-light {
    border-color: #d7dee7;
}

.btn-sm {
    min-height: 38px;
    padding: .45rem .75rem;
}

:focus-visible {
    outline: 3px solid rgba(12, 99, 231, 0.28);
    outline-offset: 2px;
}

.alert-light.border {
    background: #f8fbff;
    border-color: #dbe7f3 !important;
    color: #425466;
}

.monitoring-tabs-sticky {
    position: sticky;
    top: 78px;
    z-index: 1010;
    background: rgba(244, 246, 249, 0.96);
    padding-bottom: .35rem;
}

.monitoring-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid #dce5ef;
    border-radius: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f7faff 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.monitoring-hero__content {
    min-width: 0;
}

.monitoring-hero__eyebrow {
    margin-bottom: .3rem;
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c7a89;
}

.monitoring-hero__title {
    margin: 0 0 .35rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2937;
}

.monitoring-hero__desc {
    max-width: 720px;
    font-size: .94rem;
    color: #5b6675;
}

.monitoring-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    justify-content: flex-end;
}

.monitoring-hero__action {
    white-space: nowrap;
}

.monitoring-tabs {
    gap: .65rem;
}

.monitoring-tabs .nav-link {
    border-radius: 999px;
    padding: .62rem .95rem;
    font-weight: 700;
    color: #495057;
    background: #ffffff;
    border: 1px solid #dbe3ec;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.monitoring-tabs .nav-link.active {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.monitoring-summary-row {
    margin-bottom: .5rem;
}

.monitoring-summary-card {
    border-radius: .95rem;
    padding: .9rem 1rem;
    border: 1px solid #e5eaf0;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    min-height: 112px;
}

.monitoring-summary-card__label {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: .45rem;
}

.monitoring-summary-card__value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
    color: #212529;
}

.monitoring-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.monitoring-toolbar__content {
    min-width: 0;
}

.monitoring-toolbar__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.monitoring-toolbar__desc {
    margin-top: .15rem;
    font-size: .86rem;
    color: #697586;
}

.monitoring-summary-card--done,
.monitoring-summary-card--due-soon {
    background: #fffbe0;
}

.monitoring-summary-card--pending,
.monitoring-summary-card--expired {
    background: #ffe3e3;
}

.monitoring-summary-card--empty {
    background: #f8f9fa;
}

.monitoring-summary-card--paid,
.monitoring-summary-card--ok {
    background: #e4f7e8;
}

.monitoring-inline-note {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    padding: .8rem 1rem;
    border: 1px solid #dbe7f3;
    border-radius: .85rem;
    background: #f8fbff;
    color: #425466;
    font-size: .92rem;
}

.monitoring-inline-note code {
    padding: .08rem .38rem;
    border-radius: .35rem;
    background: rgba(0, 123, 255, 0.08);
    color: #0c63e7;
}

@media (max-width: 991.98px) {
    .monitoring-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .monitoring-hero__actions,
    .monitoring-toolbar {
        width: 100%;
    }

    .monitoring-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

.monitoring-export-header {
    margin-bottom: 1rem;
}

.monitoring-export-header h2 {
    margin: 0 0 .35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}

.monitoring-export-header p {
    margin: 0 0 .2rem;
    color: #495057;
    font-size: .92rem;
}

.monitoring-export-sheet .monitoring-grid-wrap {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.monitoring-export-sheet .monitoring-grid-table {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: auto !important;
}

.monitoring-export-sheet .monitoring-grid-table thead tr:first-child th,
.monitoring-export-sheet .monitoring-grid-table thead tr:nth-child(2) th,
.monitoring-export-sheet .freeze-col {
    position: static !important;
    left: auto !important;
    top: auto !important;
    z-index: auto !important;
}

.monitoring-export-sheet .monitoring-grid-table th,
.monitoring-export-sheet .monitoring-grid-table td,
.monitoring-export-sheet .monitoring-report-table th,
.monitoring-export-sheet .monitoring-report-table td {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.monitoring-export-sheet .monitoring-grid-table td {
    font-size: .72rem !important;
    padding: .28rem .35rem !important;
}

.monitoring-export-sheet .monitoring-export-detail {
    display: block !important;
}

.monitoring-report-block {
    margin-top: 1.5rem;
}

.monitoring-report-block h4 {
    margin-bottom: .75rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #212529;
}

.monitoring-report-table th,
.monitoring-report-table td {
    font-size: .78rem;
    vertical-align: top;
}

.monitoring-report-table {
    width: 100% !important;
    table-layout: auto !important;
}

.monitoring-report-table thead th {
    background: #eef4fb;
    color: #1f2937;
    white-space: normal;
}

.badge-status {
    padding: .45rem .6rem;
    font-size: .78rem;
    border-radius: 999px;
}

.monitoring-cell {
    min-width: 145px;
    padding: .85rem;
    border-radius: .85rem;
    cursor: pointer;
}

.monitoring-cell.cursor-default {
    cursor: default;
}

.monitoring-cell.status-pending {
    background: #fff7df;
}

.monitoring-cell.status-scheduled {
    background: #e7f4ff;
}

.monitoring-cell.status-completed {
    background: #e6f7ee;
}

.monitoring-cell.status-overdue {
    background: #fcebea;
}

.monitoring-grid-table {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.monitoring-grid-table thead th {
    background: #76aee3;
    color: #111827;
    text-align: center;
    border-color: #202020;
    font-size: .82rem;
    font-weight: 700;
    padding: .45rem .35rem;
    line-height: 1.1;
    white-space: nowrap;
}

.monitoring-grid-wrap {
    --monitoring-header-row-1: 40px;
    max-height: 70vh;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid #202020;
    border-radius: .85rem;
}

.monitoring-grid-wrap .monitoring-grid-table {
    margin-bottom: 0;
}

.monitoring-grid-table thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--monitoring-header-row-1);
}

.monitoring-grid-table thead tr:nth-child(2) th {
    position: sticky;
    top: var(--monitoring-header-row-1);
    z-index: 29;
    border-top: 0;
}

.monitoring-grid-table tbody td {
    border-color: #202020;
    padding: .35rem .45rem;
    font-size: .9rem;
    text-align: center;
    background-clip: padding-box;
    white-space: nowrap;
}

.monitoring-grid-table tbody td:nth-child(2),
.monitoring-grid-table tbody td:nth-child(3),
.monitoring-grid-table tbody td:nth-child(4) {
    text-align: left;
}

.monitoring-grid-table tbody tr:hover td {
    box-shadow: inset 0 0 0 9999px rgba(0, 123, 255, 0.08);
}

.monitoring-grid-table tbody tr:hover .freeze-col {
    background: #eef6ff;
}

.monitoring-grid-table tr.monitoring-grid__row-hover td {
    box-shadow: inset 0 0 0 9999px rgba(0, 123, 255, 0.12);
}

.monitoring-grid-table .monitoring-grid__col-hover {
    box-shadow: inset 0 0 0 9999px rgba(23, 162, 184, 0.12);
}

.monitoring-grid-table thead .monitoring-grid__year-hover {
    background: #d7f0f8 !important;
}

.monitoring-grid-table thead .monitoring-grid__col-hover,
.monitoring-grid-table tbody .freeze-col.monitoring-grid__col-hover {
    background: #e6f7fb !important;
}

.monitoring-grid-table .monitoring-grid__cell--clickable.monitoring-grid__col-hover,
.monitoring-grid-table tr.monitoring-grid__row-hover .monitoring-grid__cell--clickable {
    position: relative;
}

.monitoring-grid-table .monitoring-grid__cell--clickable.monitoring-grid__col-hover::after,
.monitoring-grid-table tr.monitoring-grid__row-hover .monitoring-grid__cell--clickable::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(0, 123, 255, 0.28);
    pointer-events: none;
}

.monitoring-grid-table__service-heading {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
}

.freeze-col {
    position: sticky;
    z-index: 20;
}

.monitoring-grid-table thead .freeze-col {
    z-index: 40 !important;
    background: #76aee3;
}

.monitoring-grid-table tbody .freeze-col {
    background: #ffffff;
}

.freeze-col--1 {
    left: 0;
    width: 64px;
    min-width: 64px;
}

.freeze-col--2 {
    left: 64px;
    width: 160px;
    min-width: 160px;
}

.freeze-col--3 {
    left: 224px;
    width: 120px;
    min-width: 120px;
}

.freeze-col--4 {
    left: 344px;
    width: 140px;
    min-width: 140px;
}

.freeze-col--5 {
    left: 484px;
    width: 100px;
    min-width: 100px;
}

@media (max-width: 991.98px) {
    .monitoring-grid-wrap {
        max-height: none;
    }

    .monitoring-grid-table thead tr:first-child th,
    .monitoring-grid-table thead tr:nth-child(2) th {
        position: static;
    }

    .freeze-col,
    .monitoring-grid-table thead .freeze-col,
    .monitoring-grid-table tbody .freeze-col {
        position: static;
        left: auto !important;
        z-index: auto !important;
        background: inherit;
    }

    .freeze-col--1,
    .freeze-col--2,
    .freeze-col--3,
    .freeze-col--4,
    .freeze-col--5 {
        width: auto;
        min-width: unset;
    }
}

.monitoring-grid__cell {
    font-weight: 500;
    white-space: nowrap;
    min-width: 82px;
}

.monitoring-grid__cell--clickable {
    cursor: pointer;
}

.monitoring-grid__cell--clickable:hover {
    box-shadow: inset 0 0 0 2px rgba(17, 24, 39, 0.2);
}

.doc-grid__cell--paid {
    background: #9be7a4;
    color: #111827;
    font-weight: 700;
}

.monitoring-grid__cell--done {
    background: #fff200;
    color: #111827;
}

.monitoring-grid__cell--pending {
    background: #ff1f1f;
    color: #111827;
}

.monitoring-grid__cell--empty {
    background: #ffffff;
    color: #6c757d;
}

.doc-grid__cell--expired {
    background: #ff1f1f;
    color: #111827;
}

.doc-grid__cell--due-soon {
    background: #fff200;
    color: #111827;
}

.doc-grid__cell--ok {
    background: #d9f7be;
    color: #111827;
}

.doc-grid__cell--five-year {
    background: #b7e3ff;
    color: #111827;
}

.doc-grid__cell--empty {
    background: #ffffff;
    color: #6c757d;
}

.monitoring-grid-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
    gap: .65rem 1.5rem;
}

.monitoring-grid-legend__item {
    display: inline-flex;
    align-items: center;
    font-size: .9rem;
}

.monitoring-grid-legend__swatch {
    width: 34px;
    height: 18px;
    margin-right: .55rem;
    border: 1px solid #202020;
}

.monitoring-grid__legend--done {
    background: #fff200;
}

.monitoring-grid__legend--pending {
    background: #ff1f1f;
}

.doc-grid__legend--expired {
    background: #ff1f1f;
}

.doc-grid__legend--due-soon {
    background: #fff200;
}

.doc-grid__legend--ok {
    background: #d9f7be;
}

.doc-grid__legend--paid {
    background: #9be7a4;
}

.doc-grid__legend--empty {
    background: #ffffff;
}

.select2-container {
    width: 100% !important;
}

.select2-container--bootstrap4 .select2-selection {
    border: 1px solid #ced4da !important;
    border-radius: .6rem !important;
    box-shadow: none !important;
}

.select2-container--bootstrap4 .select2-selection--single {
    height: calc(2.25rem + 2px) !important;
    padding-left: .15rem;
    background-color: #fff !important;
}

.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(2.25rem + 2px);
    padding: .25rem .45rem .1rem;
    border: 1px solid #ced4da;
    border-radius: .6rem;
    background-color: #fff !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: 0;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    margin-top: 0;
    padding: .18rem .45rem;
    border: 1px solid #cfe1f8;
    border-radius: 999px;
    background: #eaf4ff;
    color: #0b63ce;
    font-size: .78rem;
    font-weight: 600;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-search__field {
    margin-top: .15rem;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    line-height: calc(2.25rem + 2px) !important;
    color: #495057 !important;
    padding-left: .75rem !important;
    padding-right: 2.35rem !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 2.25rem !important;
    height: calc(2.25rem + 2px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-left: 1px solid #e9ecef;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    position: static !important;
    margin: 0 !important;
    border-color: #6c757d transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

.select2-container--bootstrap4.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6c757d transparent !important;
    border-width: 0 4px 5px 4px !important;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 .12rem rgba(0, 123, 255, 0.18) !important;
}

.select2-container--bootstrap4.select2-container--open .select2-selection {
    border-bottom-left-radius: .6rem !important;
    border-bottom-right-radius: .6rem !important;
}

.select2-container--bootstrap4 .select2-selection.is-invalid,
.select2-container--bootstrap4.select2-container--focus .select2-selection.is-invalid {
    border-color: #dc3545 !important;
}

.select2-dropdown {
    border-color: #ced4da !important;
    border-radius: .75rem !important;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.select2-search--dropdown {
    padding: .65rem;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da !important;
    border-radius: .55rem !important;
    padding: .5rem .75rem !important;
}

.select2-results__option {
    padding: .55rem .75rem;
}

.select2-container--bootstrap4 .select2-selection {
    min-height: var(--app-tap-size);
    border-radius: .75rem;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    line-height: calc(var(--app-tap-size) - 2px);
    padding-left: .85rem;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: calc(var(--app-tap-size) - 2px);
}

.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] {
    background-color: #007bff !important;
}

.dataTables_wrapper {
    color: #495057;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 34px;
    margin-left: .5rem;
    border: 1px solid #ced4da;
    border-radius: .35rem;
    padding-top: .2rem;
    padding-bottom: .2rem;
    font-size: .86rem;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: .5rem;
    margin-bottom: .15rem;
}

.dataTables_wrapper .dataTables_info {
    color: #6c757d;
    font-size: .82rem;
}

.dataTables_wrapper .paginate_button {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.dataTables_wrapper .paginate_button:hover {
    border: 0 !important;
    background: transparent !important;
}

.table {
    margin-bottom: 0;
    font-size: .88rem;
}

.table thead th {
    vertical-align: middle;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    background: #f8fafc;
    border-bottom-width: 1px;
    padding: .42rem .55rem;
    line-height: 1.2;
}

.table td {
    vertical-align: middle;
    padding: .42rem .55rem;
    line-height: 1.25;
}

.table td.table-cell--truncated {
    min-width: 140px;
    max-width: 240px;
}

.table-cell-truncate {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .4rem;
    min-height: 2.5rem;
    max-height: 2.5rem;
    overflow: hidden;
}

.table-cell-truncate__text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    flex: 1 1 auto;
    min-width: 0;
    max-height: 2.5rem;
}

.table-cell-truncate__button {
    display: none;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #0d6efd;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
}

.table-cell-truncate.is-overflowing .table-cell-truncate__button {
    display: inline-block;
}

.table-sm th,
.table-sm td {
    padding: .3rem .45rem;
}

.table .btn-sm {
    padding: .2rem .45rem;
    font-size: .74rem;
    line-height: 1.15;
}

.table-responsive {
    border-radius: 0 !important;
    position: relative;
    overflow: auto;
    max-height: 68vh;
    -webkit-overflow-scrolling: touch;
}

.table-responsive:not(.table-responsive--stack) > .table,
.table-responsive:not(.table-responsive--stack) > table {
    border-collapse: separate;
    border-spacing: 0;
}

.table-responsive:not(.table-responsive--stack) > .table thead,
.table-responsive:not(.table-responsive--stack) > table thead {
    position: sticky;
    top: 0;
    z-index: 3;
}

.table-responsive:not(.table-responsive--stack) > .table thead tr,
.table-responsive:not(.table-responsive--stack) > table thead tr {
    position: sticky;
    top: 0;
    z-index: 3;
}

.table-responsive:not(.table-responsive--stack) > .table thead th,
.table-responsive:not(.table-responsive--stack) > table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f8fafc;
    box-shadow: inset 0 -1px 0 #d8e1ea;
}

.row > [class*="col-"] {
    margin-bottom: 1rem;
}

.row.mb-3 > [class*="col-"] {
    margin-bottom: 0;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #eef4fb 0%, #f8fafc 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    border-radius: 1rem;
}

@media (max-width: 991.98px) {
    .app-header {
        flex-wrap: wrap;
        gap: .85rem;
    }

    .app-header__left,
    .app-header__right {
        width: 100%;
    }

    .app-header__right {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .modal {
        padding: 0 !important;
        overflow-y: auto !important;
    }

    .modal-dialog,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        margin: 0;
        max-width: 100%;
        min-height: 100dvh;
        height: 100dvh;
    }

    .modal-dialog-scrollable {
        display: flex;
        align-items: stretch;
        max-height: none;
    }

    .modal-dialog-scrollable .modal-content,
    .modal-content {
        height: 100dvh;
        max-height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
        border-radius: 0;
    }

    .modal-content > form {
        height: 100%;
        min-height: 0;
    }

    .modal-dialog-scrollable .modal-body,
    .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .modal-dialog-scrollable .modal-body {
        max-height: none;
    }

    .modal-content > form .modal-body,
    .modal-content > form .modal-footer,
    .modal-content > form .modal-header {
        min-height: 0;
    }

    .modal-header {
        position: sticky;
        top: 0;
        z-index: 3;
        flex: 0 0 auto;
        background: #fff;
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 3;
        flex: 0 0 auto;
        background: #fff;
        padding-bottom: calc(.9rem + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: .6rem;
    }

    .modal-footer > * {
        margin: 0 !important;
    }

    .modal-footer .btn,
    .modal-footer .ml-auto,
    .modal-footer .mr-auto {
        width: 100%;
    }

    .modal-footer .ml-auto,
    .modal-footer .mr-auto {
        display: flex;
        flex-direction: column;
        gap: .6rem;
    }

    .modal-footer .btn + .btn {
        margin-top: 0;
    }

    .modal-body,
    .compact-form .modal-body {
        padding-top: 1rem;
        padding-bottom: 6rem;
    }

    .app-header {
        padding: .9rem 1rem;
    }

    .app-header__title {
        font-size: 1.15rem;
    }

    .page-shell {
        padding: 1rem 0;
    }

    .content-card .card-body,
    .metric-card .card-body,
    .modal-header,
    .modal-footer,
    .modal-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .row.mb-3 > [class*="col-"] {
        margin-bottom: 1rem;
    }

    .dataTables_wrapper .row {
        margin-left: 0;
        margin-right: 0;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0;
        margin-top: .4rem;
    }

    .table-responsive.table-responsive--stack {
        overflow: visible;
    }

    .table-responsive.table-responsive--stack thead {
        display: none;
    }

    .table-responsive.table-responsive--stack table,
    .table-responsive.table-responsive--stack tbody,
    .table-responsive.table-responsive--stack tr,
    .table-responsive.table-responsive--stack td {
        display: block;
        width: 100%;
    }

    .table-responsive.table-responsive--stack tbody tr {
        margin-bottom: .9rem;
        background: #fff;
        border: 1px solid var(--app-border);
        border-radius: .95rem;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
        overflow: hidden;
    }

    .table-responsive.table-responsive--stack tbody td {
        position: relative;
        border: 0;
        border-bottom: 1px solid #eef2f7;
        padding: .72rem .85rem .72rem 8rem;
        min-height: 48px;
        text-align: left !important;
        white-space: normal;
    }

    .table-responsive.table-responsive--stack tbody td:last-child {
        border-bottom: 0;
    }

    .table-responsive.table-responsive--stack tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: .85rem;
        top: .72rem;
        width: 6rem;
        font-size: .72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: #64748b;
        white-space: normal;
    }

    .table-responsive.table-responsive--stack tbody td[colspan] {
        padding-left: .85rem;
    }

    .table-responsive.table-responsive--stack tbody td[colspan]::before {
        content: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
