/**
 * SafetyNet global responsive overrides
 * Loaded after theme CSS on portal, auth, and public pages.
 */

/* Prevent horizontal page scroll */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Public site: edge-to-edge, no boxed/narrow column */
body[data-plugin-page-transition] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

body[data-plugin-page-transition] .body,
body[data-plugin-page-transition] .main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body[data-plugin-page-transition] #header,
body[data-plugin-page-transition] #header .header-body,
body[data-plugin-page-transition] section.section {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

body[data-plugin-page-transition] #header .header-nav-main:before {
    width: 100% !important;
    max-width: 100%;
}

@media (max-width: 991.98px) {
    body[data-plugin-page-transition] .container {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Soft UI oversized margin utilities — cripple mobile layouts */
@media (max-width: 991.98px) {
    .mx-7,
    .mx-8,
    .mx-9,
    .mx-10 {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }

    .ms-6,
    .ms-7 {
        margin-left: 0 !important;
    }

    .me-5 {
        margin-right: 0.75rem !important;
    }
}

@media (max-width: 575.98px) {
    .mx-7,
    .mx-8,
    .mx-9,
    .mx-10 {
        margin-left: 0.75rem !important;
        margin-right: 0.75rem !important;
    }
}

/* Auth / PIN digit inputs */
.digit-input,
.pin-digit-input {
    width: min(52px, 14vw) !important;
    height: min(52px, 14vw) !important;
    font-size: clamp(1rem, 4vw, 1.5rem) !important;
    padding: 0 !important;
}

.digit-input-row,
.pin-input-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    max-width: 100%;
}

/* Standalone auth shell */
.auth-page-shell {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 992px) {
    .auth-page-shell {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Request access modals & steps */
.request-access-modal .modal-content,
.modal-content.request-access-modal-content {
    width: 100% !important;
    max-width: 400px;
    margin: 0 auto;
}

.request-access-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    max-width: 100%;
}

.request-access-steps .step {
    width: min(120px, 28vw);
    min-width: 0;
}

/* Portal card headers */
.main-content .card-header.d-flex,
.main-content .card-header.d-lg-flex {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.main-content .card-header .ms-auto {
    margin-left: 0 !important;
    width: 100%;
}

@media (min-width: 768px) {
    .main-content .card-header .ms-auto {
        margin-left: auto !important;
        width: auto;
    }
}

/* Pagination / entries-per-page selects — keep number and chevron from overlapping */
.dataTable-selector,
select.dataTable-selector,
select.form-select-sm {
    min-width: 4.75rem !important;
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    padding-left: 0.65rem !important;
    padding-right: 1.85rem !important;
    background-position: right 0.5rem center !important;
    background-size: 12px 10px !important;
    appearance: none;
    -webkit-appearance: none;
}

.form-select.form-select-sm[style*="width:auto"],
.form-select.form-select-sm[style*="width: auto"],
#entriesPerPage,
#notificationsPerPage {
    width: auto !important;
    max-width: 100%;
}

.dataTable-dropdown label {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    white-space: normal;
}

.dataTable-dropdown .dataTable-selector {
    flex: 0 0 auto;
}

/* Soft UI injects a .moving-tab slider that misaligns on button-based tabs */
.nav.nav-pills .moving-tab {
    display: none !important;
}

.nav.nav-pills {
    overflow: hidden;
}

/* Subscription / settings tab bars */
.portal-tab-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.portal-tab-bar .nav-pills,
.portal-tab-bar .nav.flex-row {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}

.portal-tab-bar .portal-tab-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 767.98px) {
    .portal-tab-bar .portal-tab-actions {
        width: 100%;
    }

    .portal-tab-bar .portal-tab-actions .btn {
        flex: 1 1 auto;
    }
}

/* Wide tables: keep every column and scroll horizontally instead of clipping */
.table-responsive,
.dataTable-wrapper,
.dataTable-container {
    max-width: 100%;
}

.dataTable-wrapper {
    overflow: visible;
}

.table-responsive,
.dataTable-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table,
.dataTable-container table {
    width: max-content;
    min-width: 100%;
}

.table-responsive table th,
.table-responsive table td,
.dataTable-container table th,
.dataTable-container table td {
    white-space: nowrap;
}

/* Keep sort arrows beside the heading, not on top of the text */
.dataTable-sorter {
    padding-right: 1.15rem !important;
    box-sizing: border-box;
}

.dataTable-sorter::before,
.dataTable-sorter::after {
    right: 2px !important;
}

/* Status badges inside tables */
.table .badge.w-100 {
    width: auto !important;
    min-width: 0;
    white-space: nowrap;
}

/* URL history category select */
.url-history-select {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100%;
}

@media (min-width: 768px) {
    .url-history-select {
        width: auto;
        min-width: 150px !important;
        max-width: 220px !important;
    }
}

/* Frontend footer */
@media (max-width: 991.98px) {
    #footer .col-lg-8.d-flex.justify-content-end,
    #footer .col-lg-8 .col-lg-8.d-flex.justify-content-end {
        justify-content: flex-start !important;
    }

    #footer img[width="300"] {
        max-width: min(300px, 70vw);
        height: auto;
    }
}

/* Pricing cards — prevent featured shadow clip */
@media (max-width: 575.98px) {
    .pricing-card-featured {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    }
}

/* Notification access-request cards */
@media (max-width: 575.98px) {
    .access-request-card .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
}

/* Modal headers with large offsets */
@media (max-width: 575.98px) {
    .modal-header.ms-5 {
        margin-left: 0 !important;
    }
}

/* ===== Home hero CTA buttons ===== */
#home .hero-cta-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    margin-top: 1.25rem;
}

#home .hero-cta-item {
    width: 100%;
    max-width: 100%;
}

#home .hero-cta-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
}

#home .hero-cta-btn-primary {
    background: linear-gradient(135deg, #3abdc4 0%, #2a9da3 100%);
    border: 2px solid #3abdc4;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(58, 189, 196, 0.35);
}

#home .hero-cta-btn-primary:hover {
    background: linear-gradient(135deg, #45ccd3 0%, #32aeb4 100%);
    border-color: #45ccd3;
    color: #fff !important;
}

#home .hero-cta-btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: #fff !important;
}

#home .hero-cta-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff !important;
}

@media (min-width: 1200px) {
    #home .hero-cta-group {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 1rem;
    }

    #home .hero-cta-item {
        width: auto;
        flex: 0 0 auto;
    }

    #home .hero-cta-btn {
        width: auto;
        min-width: 11rem;
    }
}

/* Home hero — mobile/tablet full-bleed + inner spacing */
@media (max-width: 1199.98px) {
    html,
    body,
    body[data-plugin-page-transition],
    body[data-plugin-page-transition] .body,
    body[data-plugin-page-transition] .main {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }

    #home.custom-hero-section {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        left: 0 !important;
        right: 0 !important;
        box-sizing: border-box;
        overflow: hidden;
        background-color: #0f2649;
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        height: 100vh !important;
        height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 5.25rem 1.25rem 2rem !important;
    }

    #home.custom-hero-section .container {
        width: 100%;
        max-width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: auto;
        margin-right: auto;
    }

    #header.frontend-site-header .header-container.container {
        width: 100%;
        max-width: 100%;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        margin-left: auto;
        margin-right: auto;
    }

    #home.custom-hero-section .container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 1 auto;
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    #home.custom-hero-section .row,
    #home.custom-hero-section .custom-hero-row,
    #home.custom-hero-section .custom-hero-content-row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
        max-width: 100%;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #home.custom-hero-section [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100%;
        flex: 0 0 100%;
    }

    #home .custom-hero-content-row {
        padding: 0 !important;
    }

    #home .custom-hero-copy {
        padding: 0 !important;
        margin: 0 auto !important;
        width: 100%;
        max-width: 100%;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #home .custom-hero-copy h2 {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    #home .custom-hero-copy .overflow-hidden {
        overflow: visible !important;
    }

    html #home .hero-cta-group {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 1.5rem;
        gap: 0.85rem;
    }

    html #home .hero-cta-item {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
    }

    html #home a.btn.hero-cta-btn,
    html #home a.hero-cta-btn-primary,
    html #home a.hero-cta-btn-outline {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 48px;
        box-sizing: border-box !important;
    }

    #safetynet {
        margin-top: 0 !important;
        padding-top: 0 !important;
        background-color: #fff;
    }

    #safetynet .safetynet-container {
        margin-top: 0 !important;
        padding-top: 1.5rem !important;
        padding-bottom: 1.75rem !important;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    #home.custom-hero-section {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        height: 100vh !important;
        height: 100dvh !important;
        padding: 5rem 1.15rem 1.75rem !important;
    }

    #home.custom-hero-section .container,
    #header.frontend-site-header .header-container.container,
    #safetynet .safetynet-container {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    #home h2 {
        font-size: 1.4rem !important;
        line-height: 1.4 !important;
        padding-right: 0.25rem;
    }
}

/* ===== Auth & frontend site header & mobile navigation ===== */
html #header.header-transparent.auth-site-header,
html #header.header-transparent.frontend-site-header {
    position: absolute;
    top: 0;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
    z-index: 1030;
    height: auto !important;
    min-height: 0 !important;
}

html.sticky-header-active #header.auth-site-header,
html.sticky-header-active #header.frontend-site-header {
    height: 0 !important;
    min-height: 0 !important;
}

html.sticky-header-active #header.auth-site-header .header-body,
html.sticky-header-active #header.frontend-site-header .header-body {
    position: fixed !important;
    top: 0;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
}

html:not(.sticky-header-active) #header.header-transparent.auth-site-header:not(.header-semi-transparent) .header-body,
html:not(.sticky-header-active) #header.header-transparent.frontend-site-header:not(.header-semi-transparent) .header-body,
html #header.header-transparent.auth-site-header .header-body:not(.header-border-bottom),
html #header.header-transparent.frontend-site-header .header-body:not(.header-border-bottom),
html.sticky-header-active #header.auth-site-header .header-body,
html.sticky-header-active #header.frontend-site-header .header-body {
    background-color: #0f2649 !important;
    border-top: 0;
    border-bottom: 0;
}

#header.auth-site-header .header-container.header-container-height-sm,
#header.frontend-site-header .header-container.header-container-height-sm {
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px;
}

#header.auth-site-header .header-body,
#header.frontend-site-header .header-body {
    min-height: 0 !important;
}

#header.auth-site-header .header-column,
#header.frontend-site-header .header-column {
    justify-content: center;
}

#header.auth-site-header .header-row,
#header.frontend-site-header .header-row {
    position: relative;
    top: 0 !important;
    align-items: center;
    max-height: 72px;
}

#header.auth-site-header .header-nav,
#header.frontend-site-header .header-nav {
    min-height: 0 !important;
    padding: 0.35rem 0 !important;
}

.auth-site-header .header-logo-img,
.frontend-site-header .header-logo-img {
    height: 48px;
    width: auto;
    max-width: min(180px, 50vw);
}

.header-nav-main .auth-mobile-nav-link {
    padding: 0.5rem 1rem !important;
}

.site-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
}

.auth-mobile-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3abdc4 0%, #2a9da3 100%);
    box-shadow: 0 4px 14px rgba(58, 189, 196, 0.35);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    z-index: 1100;
}

.auth-mobile-nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.auth-mobile-nav-toggle[aria-expanded="true"] .auth-mobile-nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.auth-mobile-nav-toggle[aria-expanded="true"] .auth-mobile-nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.auth-mobile-nav-toggle[aria-expanded="true"] .auth-mobile-nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.auth-mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 12px;
}

.auth-mobile-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.auth-mobile-nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(58, 189, 196, 0.35) 0%, rgba(58, 189, 196, 0.15) 100%);
    box-shadow: inset 3px 0 0 #3abdc4;
}

.auth-mobile-nav-icon {
    width: 1.25rem;
    text-align: center;
    color: #3abdc4;
    font-size: 0.95rem;
}

.auth-mobile-nav-link.active .auth-mobile-nav-icon {
    color: #fff;
}

.auth-mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-mobile-nav-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 12px !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.75rem 1rem !important;
}

.auth-mobile-nav-btn-outline {
    background: transparent !important;
    border: 2px solid rgba(58, 189, 196, 0.85) !important;
    color: #3abdc4 !important;
}

.auth-mobile-nav-btn-primary {
    background: linear-gradient(135deg, #3abdc4 0%, #2a9da3 100%) !important;
    border: none !important;
    color: #fff !important;
}

.site-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    padding: 4.25rem 1rem 1.25rem;
    background: rgba(8, 18, 40, 0.72);
    box-sizing: border-box;
}

.site-mobile-overlay.is-open {
    display: block;
}

.site-mobile-overlay[hidden] {
    display: none !important;
}

.site-mobile-overlay-panel {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 6.5rem);
    overflow-y: auto;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(165deg, #0f2448 0%, #0a1a36 100%);
    border: 1px solid rgba(58, 189, 196, 0.28);
    box-sizing: border-box;
}

.site-mobile-overlay-panel .auth-mobile-nav-list li + li {
    margin-top: 0.35rem;
}

@media (min-width: 992px) {
    .auth-mobile-nav-toggle,
    .site-mobile-overlay {
        display: none !important;
    }

    .auth-mobile-nav {
        display: block !important;
        height: auto !important;
    }

    .header-nav-main .auth-mobile-nav-list {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
    }

    .header-nav-main .auth-mobile-nav-link {
        font-size: 1.05rem;
        padding: 0.5rem 1rem;
    }

    .header-nav-main .auth-mobile-nav-link.active {
        box-shadow: none;
        background: rgba(58, 189, 196, 0.2);
    }
}

@media (max-width: 991.98px) {
    .auth-site-header .header-logo-img,
    .frontend-site-header .header-logo-img {
        max-width: 140px;
        height: 44px;
    }

    html #header.header-transparent.auth-site-header,
    html #header.header-transparent.frontend-site-header,
    #header.auth-site-header,
    #header.frontend-site-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1090;
        height: auto !important;
        min-height: 0 !important;
    }

    .auth-mobile-nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .site-desktop-nav-column,
    #header.auth-site-header .header-nav-main,
    #header.frontend-site-header .header-nav-main,
    #header.auth-site-header .header-nav-main:before,
    #header.frontend-site-header .header-nav-main:before {
        display: none !important;
    }

    html.frontend-mobile-nav-open,
    html.auth-mobile-nav-open,
    html.frontend-mobile-nav-open body,
    html.auth-mobile-nav-open body {
        overflow: hidden !important;
    }
}

/* Filters page controls */
@media (max-width: 767.98px) {
    .filters-page select.form-select,
    .filters-page .form-control {
        min-width: 0 !important;
        width: 100%;
    }

    .filters-page .filter-label-nowrap {
        white-space: normal !important;
    }

    .filters-page-select {
        min-width: 0;
        width: 100%;
    }
}

@media (min-width: 768px) {
    .filters-page-select {
        min-width: 200px;
        width: auto;
    }
}

/* ===== Notification overlay panel (does not shift page layout) ===== */
.portal-notifications-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1040;
}

.portal-notifications-backdrop[hidden],
.portal-notifications-panel[hidden] {
    display: none !important;
}

.portal-notifications-panel {
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    left: 1rem;
    z-index: 1050;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    max-height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .portal-notifications-panel {
        top: 3.5rem;
        right: 0.75rem;
        left: 0.75rem;
        max-height: min(58vh, 360px);
    }

    .portal-notifications-panel-header,
    .portal-notifications-panel-footer {
        padding: 0.55rem 0.85rem;
    }

    .portal-notifications-panel-header h6 {
        margin-bottom: 0.15rem !important;
        font-size: 0.9rem;
    }

    .portal-notifications-panel-header p {
        font-size: 0.7rem !important;
    }

    .portal-notification-link {
        padding: 0.45rem 0.6rem !important;
    }

    .portal-notification-item {
        margin-bottom: 0.1rem;
    }
}

@media (min-width: 576px) {
    .portal-notifications-panel {
        left: auto;
        width: min(400px, calc(100vw - 2rem));
    }
}

.portal-notifications-panel-header,
.portal-notifications-panel-footer {
    padding: 1rem 1.25rem;
    flex-shrink: 0;
}

.portal-notifications-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #eee;
}

.portal-notifications-panel-body {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
}

.portal-notifications-panel-body .portal-notification-title,
.portal-notifications-panel-body .portal-notification-message,
.notification-item p,
.notification-item h6 {
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.portal-notifications-panel-footer {
    border-top: 1px solid #eee;
    text-align: center;
}

body.portal-notifications-open {
    overflow: hidden;
}

/* ===== Settings profile summary card ===== */
.profile-summary-shell {
    width: 100%;
    max-width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid rgb(208, 208, 208);
    box-sizing: border-box;
}

.profile-summary-card {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.85rem;
    row-gap: 0;
    width: 100%;
    min-height: 0;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
}

.profile-summary-card .profile-summary-info {
    min-width: 0;
    max-width: 100%;
}

.profile-summary-card .profile-summary-info h6,
.profile-summary-card .profile-summary-info p {
    margin-bottom: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.profile-summary-card .profile-summary-info h6 {
    margin-bottom: 0.2rem;
}

.profile-summary-card .avatar-upload,
.profile-summary-card .avatar-preview {
    width: auto !important;
    max-width: 80px;
    flex: none !important;
}

.profile-summary-card .avatar-edit label {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    background-size: contain !important;
}

.profile-summary-card .profile-summary-edit,
.profile-summary-card .ms-auto {
    margin-left: 0 !important;
    width: auto !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
}

.profile-summary-card .edit-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
}

@media (max-width: 767.98px) {
    .profile-summary-shell {
        padding: 0.85rem 1rem;
        margin-bottom: 0;
    }

    .profile-summary-card {
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 0.75rem;
    }

    .profile-summary-card .avatar-preview img {
        width: 52px !important;
        height: 52px !important;
    }

    .profile-summary-card .profile-summary-edit,
    .profile-summary-card .ms-auto {
        width: auto !important;
        margin-left: 0 !important;
    }
}

/* Settings → All Notifications tab */
.notification-container {
    max-width: 100%;
    overflow: hidden;
}

.notification-container .notification-item {
    max-width: 100%;
    min-width: 0;
}

.notification-container .notification-item .flex-grow-1,
.notification-container .notification-item p,
.notification-container .notification-item h6 {
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .notification-container .d-flex.justify-content-between.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .notification-container .d-flex.justify-content-between.mb-3 > .d-flex {
        width: 100%;
        justify-content: flex-start;
    }

    .notification-container form.d-inline {
        display: block !important;
        width: 100%;
    }

    .notification-container form.d-inline .btn {
        width: 100%;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .notification-container .notification-item {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        padding: 0.45rem 0.6rem !important;
        margin-bottom: 0.35rem !important;
        gap: 0.4rem;
    }

    .notification-container .notification-item > .flex-grow-1 {
        flex: 1 1 auto;
        min-width: 0;
    }

    .notification-container .notification-item .me-3 {
        flex: 0 0 auto;
        margin-right: 0.35rem !important;
        margin-top: 0.15rem !important;
    }

    .notification-container .notification-item .ms-2 {
        flex: 0 0 auto;
        margin-left: 0.15rem !important;
        align-self: flex-start;
    }

    .notification-container .notification-item .me-3 i {
        font-size: 0.95rem !important;
    }

    .notification-container .notification-item h6 {
        font-size: 0.8rem;
        margin-bottom: 0.05rem !important;
        line-height: 1.2;
    }

    .notification-container .notification-item p {
        font-size: 0.7rem !important;
        margin-bottom: 0.1rem !important;
        line-height: 1.25;
    }

    .notification-container h5 {
        font-size: 1rem;
    }
}

/* Portal top navbar: keep breadcrumb + actions on one aligned row */
#navbarBlur.navbar-main .portal-navbar-inner {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 56px;
}

#navbarBlur .portal-navbar-start {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

#navbarBlur .portal-navbar-start nav[aria-label="breadcrumb"],
#navbarBlur .portal-navbar-start .breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0;
}

#navbarBlur .portal-navbar-start .breadcrumb {
    margin-right: 0 !important;
}

#navbarBlur .portal-navbar-start .breadcrumb-item {
    margin-top: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#navbarBlur .portal-navbar-end.navbar-collapse {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-basis: auto !important;
    flex-grow: 0 !important;
    width: auto !important;
    max-width: none !important;
    align-items: center;
    margin: 0 !important;
    padding: 0;
    height: auto !important;
    visibility: visible !important;
}

#navbarBlur .portal-navbar-end .navbar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.15rem;
}

#navbarBlur .portal-navbar-end .nav-item {
    align-items: center;
}

#navbarBlur .portal-navbar-end .nav-item.d-xl-none {
    display: none !important;
}

#navbarBlur .sidenav-toggler.d-none.d-xl-block,
#navbarBlur .sidenav-toggler.d-xl-block.d-none {
    display: none;
}

@media (min-width: 1200px) {
    #navbarBlur .sidenav-toggler.d-none.d-xl-block,
    #navbarBlur .sidenav-toggler.d-xl-block.d-none {
        display: flex !important;
        align-items: center;
    }
}

@media (max-width: 1199.98px) {
    #navbarBlur .portal-navbar-end .nav-item.d-xl-none {
        display: flex !important;
    }

    #navbarBlur .sidenav-toggler.d-xl-block.d-none {
        display: none !important;
    }
}

#navbarBlur .sidenav-toggler-inner {
    width: 18px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

#navbarBlur .sidenav-toggler-line {
    display: block !important;
    width: 18px !important;
    height: 2px !important;
    margin: 0 !important;
    background: #52525b !important;
    border-radius: 2px;
}

#navbarBlur .portal-navbar-end .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem !important;
    line-height: 1;
}

#navbarBlur .portal-navbar-end .avatar {
    width: 36px;
    height: 36px;
    margin: 0;
}

@media (max-width: 991.98px) {
    #navbarBlur.navbar-main .portal-navbar-inner {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
    }

    #navbarBlur .portal-navbar-end .nav-item.ps-3 {
        padding-left: 0.5rem !important;
    }

    #navbarBlur .portal-navbar-end .nav-item.pe-2 {
        padding-right: 0.35rem !important;
    }

    #navbarBlur .portal-navbar-end .nav-item.me-3 {
        margin-right: 0 !important;
    }

    #navbarBlur .portal-navbar-end .avatar {
        width: 32px;
        height: 32px;
    }
}
