.app-shell {
    width: min(96vw, 2240px);
    margin-inline: auto;
}

.page {
    background: #f4f7fb;
}

.page-wrapper .container-xl {
    width: 100%;
    max-width: none;
    padding-inline: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(244, 247, 251, .94);
    border-bottom: 1px solid #d8e2ec;
    backdrop-filter: blur(14px);
    box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .07);
}

.app-header-row {
    border-bottom: 0;
}

.app-header-top {
    padding-top: .55rem;
    font-size: .82rem;
}

.app-header-line {
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #475569;
}

.app-meta {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}

.app-meta span {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    white-space: nowrap;
}

.app-meta .ti {
    color: var(--tblr-primary);
    font-size: 1rem;
}

.app-meta-user {
    color: #64748b;
}

.app-header-identity {
    padding: 0;
}

.app-header-identity .app-shell {
    margin-top: .45rem;
    padding: .85rem 1rem;
    border: 1px solid #dce6f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 .55rem 1.35rem rgba(15, 23, 42, .055);
}

.app-identity-grid {
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(260px, 1fr) auto;
    align-items: center;
    gap: 1rem;
}

.app-agency-brand,
.app-user-actions,
.app-system-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.app-agency-logo-frame {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    line-height: 0 !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.app-agency-logo-img {
    display: block !important;
    width: 7.4rem !important;
    height: auto !important;
    max-height: 3.4rem !important;
    object-fit: contain !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.app-agency-brand img.app-agency-logo,
img.app-agency-logo {
    display: block !important;
    width: 7.4rem !important;
    height: auto !important;
    max-height: 3.4rem !important;
    flex: 0 0 auto !important;
    border-radius: 0 !important;
    object-fit: contain !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.app-agency-logo-fallback {
    width: 3.4rem;
    height: 3.4rem;
    flex-basis: 3.4rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #dce6f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 850;
    color: var(--tblr-primary);
}

.app-brand-title {
    font-size: 1.18rem;
    font-weight: 850;
    letter-spacing: 0;
    color: #0f172a;
    line-height: 1.15;
}

.app-brand-subtitle {
    margin-top: .2rem;
    font-size: .88rem;
    color: #64748b;
}

.app-search {
    position: relative;
}

.app-search .form-control {
    height: 2.7rem;
    border-radius: 8px;
    padding-left: 2.45rem;
    background: #f8fafc;
    border-color: #dbe5ef;
    box-shadow: none;
}

.app-search .form-control:focus {
    background: #fff;
    border-color: rgba(var(--tblr-primary-rgb), .45);
    box-shadow: 0 0 0 .18rem rgba(var(--tblr-primary-rgb), .08);
}

.app-search-icon {
    position: absolute;
    top: 50%;
    left: .9rem;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 2;
}

.app-search-results {
    position: absolute;
    top: calc(100% + .45rem);
    left: 0;
    right: 0;
    z-index: 1040;
    max-height: 24rem;
    overflow: auto;
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 8px;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .16);
}

.app-user-actions {
    justify-content: flex-end;
}

.app-system-brand {
    color: #0f172a;
    font-weight: 850;
    text-decoration: none;
}

.app-system-brand:hover {
    text-decoration: none;
}

.app-mobile-toggle {
    display: none;
}

.app-header-nav {
    background: transparent;
}

.app-header-nav .app-shell {
    margin-top: .55rem;
    padding: .35rem;
    border: 1px solid #dce6f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 .45rem 1.1rem rgba(15, 23, 42, .045);
}

.app-nav-line {
    min-height: 2.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
}

@media (min-width: 992px) {
    .app-header-nav .navbar-collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
    }
}

.app-main-nav {
    min-height: 2.65rem;
    align-items: center;
    gap: .25rem;
    flex-direction: row !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    flex: 1 1 auto;
    min-width: 0;
}

.app-main-nav .nav-item {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.app-main-nav .nav-link {
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: auto;
    min-height: 2.35rem;
    padding: .52rem .82rem;
    color: #334155;
    white-space: nowrap;
}

.app-main-nav .nav-link:hover {
    background: #f4f7fb;
    color: var(--tblr-primary);
}

.app-main-nav .nav-link-icon {
    width: 1.15rem;
    min-width: 1.15rem;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-main-nav .nav-item.active > .nav-link {
    background: rgba(var(--tblr-primary-rgb), .1);
    color: var(--tblr-primary);
    font-weight: 800;
}

.app-quick-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    flex: 0 0 auto;
}

.app-quick-action {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    padding: .52rem .78rem;
    border: 1px solid rgba(var(--tblr-primary-rgb), .35);
    border-radius: 8px;
    font-size: .86rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.app-quick-action:hover {
    text-decoration: none;
    box-shadow: 0 .35rem .9rem rgba(32, 107, 196, .11);
}

.app-quick-action .ti {
    font-size: 1rem;
}

.app-quick-primary {
    background: var(--tblr-primary);
    border-color: var(--tblr-primary);
    color: #fff;
}

.app-quick-primary:hover {
    background: #1d5fae;
    border-color: #1d5fae;
    color: #fff;
}

.app-quick-outline {
    background: #fff;
    color: var(--tblr-primary);
}

.app-quick-outline:hover {
    background: rgba(var(--tblr-primary-rgb), .08);
    border-color: rgba(var(--tblr-primary-rgb), .55);
    color: var(--tblr-primary);
}

.app-header-actions {
    padding: .4rem 0 .55rem;
    background: transparent;
}

.app-actions-line {
    min-height: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-actions-line > div:first-child {
    min-width: 180px;
    padding: .25rem .1rem;
}

.app-section-actions {
    justify-content: flex-end;
}

.page-body {
    --tblr-page-padding-y: 1.25rem;
}

@media (max-width: 991.98px) {
    .app-shell {
        width: min(94vw, 2240px);
    }

    .app-header {
        position: static;
    }

    .app-header-line,
    .app-actions-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-meta {
        width: 100%;
        justify-content: flex-start;
        gap: .75rem;
        overflow-x: auto;
    }

    .app-meta-user {
        display: none;
    }

    .app-identity-grid {
        grid-template-columns: 1fr auto;
    }

    .app-search {
        grid-column: 1 / -1;
        order: 3;
    }

    .app-mobile-toggle {
        display: inline-flex;
    }

    .app-system-brand span:last-child {
        display: none;
    }

    .app-main-nav {
        align-items: stretch;
        flex-direction: column !important;
        overflow-x: visible;
        padding: .2rem 0;
    }

    .app-nav-line {
        align-items: stretch;
        flex-direction: column;
    }

    .app-main-nav .nav-item {
        display: block;
    }

    .app-main-nav .nav-link {
        justify-content: flex-start;
        width: 100%;
    }

    .app-section-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .app-quick-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        padding-top: .35rem;
        border-top: 1px solid #e7edf4;
    }
}

@media (max-width: 575.98px) {
    .app-identity-grid {
        gap: .75rem;
    }

    .app-brand-subtitle,
    .app-system-brand {
        display: none;
    }

    .app-header-identity .app-shell,
    .app-header-nav .app-shell {
        padding-inline: .75rem;
    }

    .app-section-actions .btn {
        flex: 1 1 auto;
    }

    .app-quick-action {
        flex: 1 1 100%;
    }
}
