﻿html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

:root {
    --dashboard-row-height: 120px;
}

body {
    background: #f4f7fb;
    color: #1f2a44;
}

a,
.btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
    padding-bottom: 2rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.required-label-star {
    color: #dc3545;
    font-weight: 700;
    margin-left: 0.2rem;
}

.form-floating > input[required] ~ label::after,
.form-floating > input[aria-required="true"] ~ label::after,
.form-floating > select[required] ~ label::after,
.form-floating > select[aria-required="true"] ~ label::after,
.form-floating > textarea[required] ~ label::after,
.form-floating > textarea[aria-required="true"] ~ label::after,
.required-field:not(.form-floating) > label::after,
.required-field:not(.form-floating) > .form-label::after,
.required-field:not(.form-floating) .form-label:first-child::after,
.required-field:not(.form-floating) .form-check-label::after,
label.required-field::after {
    color: #dc3545;
    content: "*";
    font-weight: 700;
    margin-left: 0.2rem;
}

.workflow-step-guide {
    margin-bottom: 1rem;
}

.workflow-step-guide-list {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.workflow-step-guide-item {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #dce4f2;
    border-radius: 0.85rem;
    display: flex;
    gap: 0.7rem;
    padding: 0.75rem;
}

.workflow-step-guide-item-current {
    background: #eef5ff;
    border-color: #7db4ff;
}

.workflow-step-guide-item-complete {
    background: #eefaf1;
    border-color: #95d5a7;
}

.workflow-step-guide-number {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd7e8;
    border-radius: 999px;
    color: #234062;
    display: inline-flex;
    flex: 0 0 1.8rem;
    font-weight: 800;
    height: 1.8rem;
    justify-content: center;
}

.workflow-step-guide-item-complete .workflow-step-guide-number {
    background: #198754;
    border-color: #198754;
    color: #ffffff;
}

.workflow-step-guide-title,
.workflow-step-guide-description {
    display: block;
}

.workflow-step-guide-title {
    color: #20344f;
    font-weight: 800;
}

.workflow-step-guide-description {
    color: #5f7088;
    font-size: 0.88rem;
}

.review-queue-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.review-diff-summary {
    display: grid;
    gap: 0.4rem;
    margin: 0;
}

.review-diff-summary-row {
    background: #f8fafc;
    border: 1px solid #e0e7f0;
    border-radius: 0.55rem;
    padding: 0.5rem;
}

.review-diff-summary-row dt {
    color: #314762;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.review-diff-summary-row dd {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
}

.review-diff-old,
.review-diff-new {
    border-radius: 0.35rem;
    padding: 0.15rem 0.35rem;
}

.review-diff-old {
    background: #fff3cd;
    color: #6c4b00;
    text-decoration: line-through;
}

.review-diff-new {
    background: #d1e7dd;
    color: #0f5132;
    font-weight: 700;
}

.actionable-report-summary {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    margin-bottom: 1rem;
}

.actionable-report-summary-card {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #dfe7f1;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    justify-content: space-between;
    padding: 1rem;
}

.actionable-report-summary-value {
    color: #16375c;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.actionable-report-summary-label {
    color: #263f5f;
    font-weight: 800;
    margin-top: 0.35rem;
}

.actionable-report-summary-description {
    color: #60758d;
    font-size: 0.9rem;
    margin: 0.35rem 0 0;
}

.release-smoke-checklist {
    display: grid;
    gap: 1rem;
}

.admin-guide-topic-nav {
    position: sticky;
    top: 0.75rem;
    z-index: 5;
}

.admin-guide-topic {
    scroll-margin-top: 1rem;
}

.admin-guide-scenario-list {
    display: grid;
    gap: 1rem;
}

.admin-guide-scenario {
    background: #ffffff;
    border: 1px solid #dfe7f1;
    border-radius: 1rem;
    padding: 1rem;
}

.admin-guide-callout,
.admin-guide-verify {
    background: #f8fafc;
    border-left: 4px solid #0d6efd;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.admin-guide-steps {
    margin-bottom: 0;
}

.admin-guide-steps li + li {
    margin-top: 0.35rem;
}

.skip-link {
    background: #0d6efd;
    border-radius: 0 0 0.5rem 0;
    color: #ffffff;
    font-weight: 800;
    left: 0;
    padding: 0.75rem 1rem;
    position: fixed;
    top: 0;
    transform: translateY(-120%);
    transition: transform 0.15s ease-in-out;
    z-index: 3000;
}

.skip-link:focus {
    color: #ffffff;
    outline: 3px solid #ffc107;
    outline-offset: 2px;
    transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

main:focus {
    outline: none;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4) no-repeat 1rem / 1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.card-box {
    background: #ffffff;
    border: 1px solid #d7e2ef;
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 12px 30px rgba(16, 34, 68, 0.08);
}

/* Overlay viewport safety baseline (system-wide): keep overlays visible and scroll internally. */
:root {
    --overlay-viewport-gap: 1rem;
    --overlay-safe-max-height: calc(100dvh - (var(--overlay-viewport-gap) * 2));
}

.k-window,
.k-dialog {
    max-height: var(--overlay-safe-max-height);
    max-width: calc(100vw - (var(--overlay-viewport-gap) * 2));
    overflow-x: hidden;
}

.k-window .k-window-content,
.k-dialog .k-dialog-content {
    max-height: calc(var(--overlay-safe-max-height) - 4.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.k-window .k-window-titlebar {
    padding-right: 3.25rem;
}

.k-window .k-window-titlebar-actions {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    align-items: stretch;
}

.k-window .k-window-titlebar-actions .k-window-titlebar-action,
.k-window .k-window-titlebar-actions .k-button {
    min-width: 3rem;
    height: 100%;
    border-radius: 0;
    border: 0;
    background: #9edee8;
    color: #687078;
    font-size: 1.25rem;
}

.k-window .k-window-titlebar-actions .k-window-titlebar-action:hover,
.k-window .k-window-titlebar-actions .k-button:hover {
    background: #85d2de;
    color: #3f4a52;
}

.confirm-modal,
.training-modal,
.decision-overlay,
.properties-overlay,
.notification-overlay-card,
.messages-policy-modal,
.login-customizer-background-modal,
.login-customizer-item-editor-modal,
.login-customizer-confirm-modal {
    max-height: var(--overlay-safe-max-height);
    max-width: calc(100vw - (var(--overlay-viewport-gap) * 2));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.confirm-modal-backdrop,
.training-modal-backdrop,
.login-customizer-background-overlay,
.login-customizer-item-editor-overlay,
.login-customizer-confirm-overlay,
.notification-overlay-backdrop,
.messages-policy-overlay,
.decision-overlay-backdrop,
.properties-overlay-backdrop {
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-close,
.overlay-panel .close,
.confirm-modal-close,
.notification-overlay-close,
.resx-overlay-close {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 3rem;
    min-height: 3rem;
    border: 0;
    border-radius: 0;
    background: #9edee8;
    color: #687078;
    font-size: 1.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover,
.overlay-panel .close:hover,
.confirm-modal-close:hover,
.notification-overlay-close:hover,
.resx-overlay-close:hover {
    background: #85d2de;
    color: #3f4a52;
}

.training-profile-window-scroll {
    max-height: calc(88vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: .25rem;
}

.training-profile-window-scroll .card-box,
.training-profile-window-scroll .row,
.training-profile-window-scroll [class*="col-"] {
    min-width: 0;
}

.training-profile-rule-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    width: 100%;
    min-width: 0;
}

.training-profile-rule-field {
    flex: 1 1 12rem;
    min-width: 0;
}

.training-profile-rule-type {
    flex-basis: 14rem;
}

.training-profile-rule-scope,
.training-profile-rule-match {
    flex: 1 1 10rem;
}

.training-profile-rule-value {
    flex: 2 1 18rem;
}

.training-profile-rule-actions {
    flex: 0 1 9rem;
    min-width: 0;
}

.training-profile-rule-actions .btn {
    white-space: normal;
}

.training-profile-window-scroll .k-multiselect,
.training-profile-window-scroll .k-input,
.training-profile-window-scroll .k-picker,
.training-profile-window-scroll .k-chip-list {
    max-width: 100%;
    min-width: 0;
}

.operation-status-banner {
    position: sticky;
    top: 0.85rem;
    z-index: 1040;
}

.top-shell {
    position: sticky;
    z-index: 12000;
}

.top-shell .profile-dropdown-shell,
.top-shell .header-popover-shell,
.top-shell .header-menu-details[open] {
    position: relative;
    z-index: 12001;
}

.top-shell .profile-dropdown-panel,
.top-shell .header-popover-panel {
    z-index: 12002;
}

.top-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(18, 59, 109, 0.08);
}

.brand-mark {
    font-weight: 800;
    color: #123b6d;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

.profile-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.top-shell-link,
.top-shell-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid #d6e4f5;
    background: #fff;
    color: #123b6d;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(18, 59, 109, 0.08);
}

.top-shell-link-button {
    border: 1px solid #d6e4f5 !important;
    text-decoration: none !important;
}

.dashboard-page-shell {
    width: 100%;
    max-width: none;
}

:root {
    --dashboard-column-count: 12;
    --dashboard-row-height: 120px;
    --dashboard-gap: 1rem;
}

.dashboard-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

    .dashboard-page-header h1 {
        margin: 0;
        font-size: clamp(1.65rem, 2.1vw, 2.35rem);
        font-weight: 800;
        color: #15345b;
    }

.dashboard-page-subtitle {
    margin: 0.35rem 0 0;
    color: #63708a;
    max-width: 70rem;
}

.dashboard-page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* SAME GRID RULES FOR MAIN AND ORGANIZE */
.dashboard-layout-grid,
.dashboard-layout-grid-edit {
    display: grid;
    grid-template-columns: repeat(var(--dashboard-column-count), minmax(0, 1fr));
    grid-auto-rows: var(--dashboard-row-height);
    grid-auto-flow: dense;
    gap: var(--dashboard-gap);
    align-items: stretch;
}

.dashboard-layout-grid-edit {
    min-height: calc(var(--dashboard-row-height) * 6);
    padding: 0.35rem;
    background-image: linear-gradient(to right, rgba(88, 110, 166, 0.08) 1px, transparent 1px), linear-gradient(to bottom, rgba(88, 110, 166, 0.08) 1px, transparent 1px);
    background-size: calc((100% - (var(--dashboard-gap) * (var(--dashboard-column-count) - 1))) / var(--dashboard-column-count)) var(--dashboard-row-height);
    border-radius: 16px;
}

.dashboard-widget-shell,
.dashboard-editor-widget,
.dashboard-widget {
    min-width: 0;
    min-height: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
}

    /* MAKE BOTH PAGES USE IDENTICAL CARD SIZING */
    .dashboard-widget-card,
    .dashboard-widget .card-box,
    .dashboard-widget-shell .card-box,
    .dashboard-editor-widget .card-box {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
        min-height: 100%;
        border-radius: 20px;
        padding: 1.15rem;
        overflow: hidden;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 252, 0.98));
        border: 1px solid rgba(24, 65, 130, 0.08);
        box-shadow: 0 10px 28px rgba(15, 33, 65, 0.08);
    }

        .dashboard-widget-card::before,
        .dashboard-widget .card-box::before,
        .dashboard-widget-shell .card-box::before,
        .dashboard-editor-widget .card-box::before {
            content: "";
            position: absolute;
            inset: 0 0 auto 0;
            height: 5px;
            background: var(--widget-accent, #4b6bfb);
        }

.accent-blue {
    --widget-accent: linear-gradient(90deg, #4166f5, #6fa3ff);
}

.accent-green {
    --widget-accent: linear-gradient(90deg, #1da773, #81d87b);
}

.accent-purple {
    --widget-accent: linear-gradient(90deg, #7b4dff, #d36cf8);
}

.accent-orange {
    --widget-accent: linear-gradient(90deg, #ff8c42, #ffb454);
}

.accent-slate {
    --widget-accent: linear-gradient(90deg, #37506b, #7389a3);
}

.widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.widget-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1f2a44;
    margin: 0;
}

.widget-subtitle,
.widget-secondary,
.widget-footer {
    color: #66758f;
}

.overlay-close-guard-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(24, 39, 71, 0.35), rgba(8, 14, 28, 0.66));
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25000;
    padding: 1rem;
}

.overlay-close-guard-modal {
    width: min(34rem, 100%);
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 34px 70px rgba(12, 24, 50, 0.42), 0 8px 20px rgba(12, 24, 50, 0.2);
    border: 1px solid #d9e3f3;
    padding: 1.4rem;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    position: relative;
    animation: overlay-close-guard-entrance 180ms ease-out;
}

.overlay-close-guard-close {
    position: absolute;
    top: .65rem;
    right: .75rem;
    border: 0;
    background: transparent;
    color: #1e3252;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.overlay-close-guard-title {
    margin: 0 0 0.6rem;
    color: #1e3252;
    font-size: 1.18rem;
    font-weight: 800;
}

.overlay-close-guard-message {
    margin: 0;
    color: #43597d;
    font-size: 0.98rem;
    line-height: 1.45;
}

.overlay-close-guard-actions {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.k-window-titlebar-actions {
    margin: 0;
    position: absolute;
    top: 0;
    right: 0;
}

.k-window-titlebar-actions .k-button,
.k-window-titlebar-actions .k-window-action {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 0 0 0 18px;
    border: 1px solid #1b1b1b;
    background: var(--overlay-close-brand-color, #132b76) !important;
    color: #000000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    position: relative;
}

.k-window-titlebar-actions .k-window-action,
.k-window-titlebar-actions .k-button {
    text-indent: 0 !important;
}

.k-window-titlebar-actions .k-button:hover,
.k-window-titlebar-actions .k-window-action:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.16) 100%), var(--overlay-close-brand-color, #132b76) !important;
    border-color: #000000;
}

.k-window-titlebar-actions .k-icon,
.k-window-titlebar-actions .k-svg-icon {
    color: #000000;
}

.k-window-titlebar,
.k-dialog-titlebar {
    position: relative;
    padding-right: 2.35rem;
}

.k-window-titlebar-actions .k-window-action::before,
.k-window-titlebar-actions .k-button::before {
    content: "×";
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    color: #000000;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-indent: 0 !important;
    letter-spacing: normal;
    font-family: Arial, Helvetica, sans-serif;
}

.k-window-titlebar-actions .k-window-action .k-icon,
.k-window-titlebar-actions .k-window-action .k-svg-icon,
.k-window-titlebar-actions .k-button .k-icon,
.k-window-titlebar-actions .k-button .k-svg-icon {
    display: inline-flex !important;
    color: #000000 !important;
    opacity: 1 !important;
}

.k-overlay {
    background: rgba(19, 43, 118, 0.42) !important;
}

@keyframes overlay-close-guard-entrance {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.widget-subtitle {
    font-size: 0.92rem;
    margin-top: 0.2rem;
}

.widget-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1 1 auto;
}

.widget-text-body {
    padding-top: 0.4rem;
}

.widget-value {
    font-size: clamp(1.5rem, 2vw, 2.35rem);
    font-weight: 800;
    line-height: 1;
    color: #15345b;
}

.widget-kicker {
    font-size: 1.05rem;
    font-weight: 700;
    color: #15345b;
}

.widget-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e8edf5;
    overflow: hidden;
    margin-top: 0.35rem;
}

.widget-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--widget-accent, #4b6bfb);
}

.widget-list-item {
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    background: rgba(77, 107, 251, 0.08);
    color: #2a3c63;
    font-weight: 600;
}

.widget-chip {
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 33, 65, 0.06);
    color: #516079;
    font-size: 0.82rem;
    font-weight: 700;
}

.widget-footer {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.widget-chart-body {
    min-height: 12.5rem;
    height: 100%;
    overflow: hidden;
}

.dashboard-widget-card.type-stockchart .widget-chart-body,
.dashboard-widget-card.type-sankeychart .widget-chart-body {
    min-height: 14rem;
}

.dashboard-widget-card.type-donutchart .widget-chart-body,
.dashboard-widget-card.type-piechart .widget-chart-body,
.dashboard-widget-card.type-radarareachart .widget-chart-body,
.dashboard-widget-card.type-radarcolumnchart .widget-chart-body,
.dashboard-widget-card.type-radarlinechart .widget-chart-body {
    min-height: 13rem;
}

.widget-chart-host {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

    .widget-chart-host > .k-chart,
    .widget-chart-host > .k-stockchart,
    .widget-chart-host > .k-sankey {
        width: 100%;
        height: 100%;
        min-height: 12.5rem;
    }

    .widget-chart-host .k-chart-surface,
    .widget-chart-host .k-stockchart-surface,
    .widget-chart-host .k-sankey-surface,
    .widget-chart-host svg {
        width: 100% !important;
        height: 100% !important;
    }

    .widget-chart-host .k-legend,
    .widget-chart-host .k-chart-legend,
    .widget-chart-host .k-chart-title,
    .widget-chart-host .k-chart-tooltip,
    .widget-chart-host .k-sankey-tooltip {
        max-width: 100%;
    }


.dashboard-admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.dashboard-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.dashboard-form-span-2 {
    grid-column: 1 / -1;
}

.dashboard-admin-canvas {
    overflow: hidden;
}

.canvas-header {
    margin-bottom: 1rem;
}

.widget-editor-toolbar {
    position: absolute;
    top: 0.7rem;
    right: 0.8rem;
    z-index: 25;
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.widget-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #d8e3f0;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(15, 33, 65, 0.12);
    user-select: none;
}

.widget-resize-handle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 16px;
    height: 16px;
    border-right: 2px solid rgba(71, 102, 245, 0.95);
    border-bottom: 2px solid rgba(71, 102, 245, 0.95);
    cursor: nwse-resize;
    z-index: 20;
    opacity: 0.85;
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
}

    .widget-resize-handle:hover {
        opacity: 1;
    }

.editor-preview .widget-chip {
    display: none;
}


.dashboard-layout-grid-responsive {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: var(--dashboard-row-height);
}

    .dashboard-layout-grid-responsive > .dashboard-widget-shell {
        grid-column: var(--widget-col-start) / span var(--widget-col-span);
        grid-row: var(--widget-row-start) / span var(--widget-row-span);
    }

@media (max-width: 1399.98px) {
    .dashboard-layout-grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        grid-auto-rows: auto;
        grid-auto-flow: row dense;
        align-items: stretch;
    }

        .dashboard-layout-grid-responsive > .dashboard-widget-shell {
            grid-column: auto !important;
            grid-row: auto !important;
            height: auto;
            overflow: visible;
        }

        .dashboard-layout-grid-responsive .dashboard-widget-card {
            height: 100%;
            min-height: 18rem;
        }
}

@media (min-width: 900px) and (max-width: 1399.98px) {
    .dashboard-layout-grid-responsive > .widget-span-wide {
        grid-column: span 2 !important;
    }
}

@media (max-width: 899.98px) {
    .dashboard-layout-grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .widget-chart-body {
        min-height: 11.5rem;
    }

    .dashboard-widget-card.type-stockchart .widget-chart-body,
    .dashboard-widget-card.type-sankeychart .widget-chart-body {
        min-height: 13.5rem;
    }
}

@media (max-width: 575.98px) {
    .dashboard-layout-grid-responsive {
        grid-template-columns: minmax(0, 1fr);
    }

        .dashboard-layout-grid-responsive .dashboard-widget-card {
            min-height: 0;
            height: auto;
        }

    .widget-chart-body {
        min-height: 10.5rem;
    }

    .widget-chart-host > .k-chart,
    .widget-chart-host > .k-stockchart,
    .widget-chart-host > .k-sankey {
        min-height: 10.5rem;
    }

    .dashboard-widget-card.type-stockchart .widget-chart-body,
    .dashboard-widget-card.type-sankeychart .widget-chart-body {
        min-height: 12.75rem;
    }

    .dashboard-widget-card.type-donutchart .widget-chart-body,
    .dashboard-widget-card.type-piechart .widget-chart-body,
    .dashboard-widget-card.type-radarareachart .widget-chart-body,
    .dashboard-widget-card.type-radarcolumnchart .widget-chart-body,
    .dashboard-widget-card.type-radarlinechart .widget-chart-body {
        min-height: 11.75rem;
    }

    .widget-chart-host .k-chart,
    .widget-chart-host .k-stockchart,
    .widget-chart-host .k-sankey {
        font-size: 0.8rem;
    }
}

@media (max-width: 399.98px) {
    .widget-chart-body {
        min-height: 10rem;
    }

    .dashboard-widget-card.type-stockchart .widget-chart-body,
    .dashboard-widget-card.type-sankeychart .widget-chart-body {
        min-height: 12rem;
    }

    .widget-chart-host .k-chart,
    .widget-chart-host .k-stockchart,
    .widget-chart-host .k-sankey {
        font-size: 0.74rem;
    }

    .widget-chart-host .k-chart-legend,
    .widget-chart-host .k-legend {
        max-height: 3rem;
        overflow: hidden;
    }
}

.dashboard-widget {
    transition: grid-column 0.12s ease, grid-row 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

    .dashboard-widget.dragging,
    .dashboard-widget.resizing {
        z-index: 1000;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    }

    .dashboard-widget.dragging {
        opacity: 0.92;
    }

    .dashboard-widget .card-box,
    .dashboard-widget .editor-preview,
    .dashboard-widget .widget-card {
        height: 100%;
    }

.profile-setup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.profile-setup-modal {
    width: 100%;
    max-width: 520px;
    border-radius: 16px;
}

.terms-acceptance-modal {
    width: 75vw;
    max-width: 75vw;
    height: 75vh;
    max-height: 75vh;
}

.terms-acceptance-modal .card-body {
    height: 100%;
    overflow-y: auto;
}

@media (max-width: 1400px) {
    :root {
        --dashboard-column-count: 8;
    }
}

@media (max-width: 992px) {
    :root {
        --dashboard-column-count: 4;
    }

    .dashboard-admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --dashboard-row-height: 110px;
    }

    .dashboard-form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-form-span-2 {
        grid-column: auto;
    }
}

@media (max-width: 576px) {
    :root {
        --dashboard-column-count: 1;
    }

    .content.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .dashboard-widget-shell,
    .dashboard-editor-widget,
    .dashboard-widget {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .top-shell {
        padding: 0.85rem 1rem;
    }
}


#blazor-error-ui {
    background: #fff4ce;
    color: #3b2f00;
    bottom: 0;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.18);
    display: none;
    left: 0;
    padding: 0.9rem 3rem 0.9rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.55rem;
    font-size: 1.1rem;
}

/* MainLayout header fallback styles */
.page {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    background: #f5f7fb;
}

.page > .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
}

.page > main {
    margin-left: 250px;
    min-width: 0;
    width: calc(100% - 250px);
    min-height: 100vh;
    overflow-x: hidden;
}

.top-shell {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 4.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 0.85rem 1.5rem;
    background: rgba(241, 244, 250, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f3;
}

.top-shell-left {
    min-width: 0;
    flex: 1 1 auto;
}

.top-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex-wrap: wrap;
}

.breadcrumb-link {
    color: #23395b;
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 600;
}

.breadcrumb-link:hover {
    color: #0f2f6d;
}

.top-breadcrumb-separator {
    color: #8b98ad;
    font-size: 0.85rem;
    font-weight: 700;
}

.breadcrumb-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: #e9eefc;
    color: #4b5fd6;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
}

.breadcrumb-chip-active {
    box-shadow: inset 0 0 0 1px rgba(75, 95, 214, 0.08);
}

.top-shell-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 0 1 auto;
    min-width: 0;
}

.global-search-form {
    position: relative;
    width: min(100%, 320px);
    min-width: 220px;
}

.global-search-input {
    width: 100%;
    height: 2.8rem;
    border: 1px solid #d8deea;
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 0.7rem 3rem 0.7rem 1rem;
    font-size: 0.95rem;
    color: #21324d;
    outline: none;
    box-shadow: 0 3px 12px rgba(28, 45, 90, 0.04);
}

.global-search-input::placeholder {
    color: #7f8ba1;
}

.global-search-input:focus {
    border-color: #7d8cf0;
    box-shadow: 0 0 0 3px rgba(125, 140, 240, 0.16);
}

.global-search-submit {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 0.7rem;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shell-circle-button {
    position: relative;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid #dce3ef;
    border-radius: 999px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(28, 45, 90, 0.05);
}

.shell-circle-button:hover,
.global-search-submit:hover,
.profile-summary:hover {
    background: #f6f8fd;
}

.shell-status-dot {
    position: absolute;
    top: 0.32rem;
    right: 0.32rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: #4f68ff;
    border: 2px solid #ffffff;
}

.shell-status-dot-orange {
    background: #ff8a3d;
}

.profile-dropdown-shell {
    position: relative;
}

.profile-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.3rem 0.25rem 0.85rem;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    user-select: none;
}

.profile-summary-button {
    border: 0;
    outline: none;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
}

.profile-name {
    color: #2a3550;
    font-size: 0.96rem;
    font-weight: 700;
    white-space: nowrap;
}

.profile-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #50a7ff 0%, #5a58f2 100%);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(69, 95, 219, 0.22);
}

.profile-dropdown-panel {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    min-width: 13rem;
    padding: 0.45rem;
    border-radius: 1rem;
    background: #ffffff;
    border: 1px solid #e3e8f2;
    box-shadow: 0 18px 38px rgba(30, 44, 76, 0.14);
}

.profile-dropdown-link,
.profile-dropdown-button {
    width: 100%;
    display: flex;
    align-items: center;
    border: 0;
    background: transparent;
    text-decoration: none;
    color: #33425f;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 0.85rem;
    border-radius: 0.8rem;
}

.profile-dropdown-link:hover,
.profile-dropdown-button:hover {
    background: #f4f7fd;
    color: #182b52;
}

.profile-logout-form {
    margin: 0;
}

.content {
    padding: 1rem 1.25rem 1.5rem 1.25rem;
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
}

.shell-icon {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.shell-icon-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23526686' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.shell-icon-bell {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23526686' stroke-width='1.9'%3E%3Cpath d='M12 4.5a4 4 0 0 0-4 4v2.1c0 .7-.2 1.4-.6 2l-1.1 1.8c-.4.7.1 1.6.9 1.6h9.6c.8 0 1.3-.9.9-1.6l-1.1-1.8c-.4-.6-.6-1.3-.6-2V8.5a4 4 0 0 0-4-4Z'/%3E%3Cpath d='M10 18a2 2 0 0 0 4 0' stroke-linecap='round'/%3E%3C/svg%3E");
}

.shell-icon-chat {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23526686' stroke-width='1.9'%3E%3Cpath d='M6 17.5 3.5 20v-4A6.5 6.5 0 0 1 10 9.5h4A6.5 6.5 0 0 1 20.5 16 6.5 6.5 0 0 1 14 22.5h-4A6.4 6.4 0 0 1 6 21.1' stroke-linejoin='round'/%3E%3Cpath d='M9 15h6M9 12h4' stroke-linecap='round'/%3E%3C/svg%3E");
}

@media (max-width: 1100px) {
    .top-shell {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .top-shell-left,
    .top-shell-right {
        width: 100%;
    }

    .top-shell-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 770px) {
    .page {
        display: block;
        min-height: 100vh;
    }

    .page > .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        z-index: auto;
        overflow: visible;
    }

    .page > main {
        margin-left: 0;
        width: 100%;
        min-height: 100vh;
    }

    .top-shell {
        min-height: 3.5rem;
        padding: 0.85rem 1rem;
    }

    .top-breadcrumbs {
        gap: 0.45rem;
    }

    .global-search-form {
        min-width: 0;
        width: 100%;
    }

    .profile-summary {
        padding-left: 0;
    }

    .profile-name {
        max-width: 9rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .content {
        padding: 1rem;
    }
}


/* Top header fallback styling */
.top-shell {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 4.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 0.85rem 1.5rem;
    margin-bottom: 1.25rem;
    background: rgba(241, 244, 250, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f3;
}

.top-shell-left {
    min-width: 0;
    flex: 1 1 auto;
}

.top-shell-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 0 1 auto;
    min-width: 0;
}

.top-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex-wrap: wrap;
}

.breadcrumb-link {
    color: #23395b;
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 600;
}

.top-breadcrumb-separator {
    color: #8b98ad;
    font-size: 0.85rem;
    font-weight: 700;
}

.breadcrumb-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: #e9eefc;
    color: #4b5fd6;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
}

.global-search-form {
    position: relative;
    width: min(100%, 320px);
    min-width: 220px;
}

.global-search-input {
    width: 100%;
    height: 2.8rem;
    border: 1px solid #d8deea;
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 0.7rem 3rem 0.7rem 1rem;
    font-size: 0.95rem;
    color: #21324d;
    outline: none;
    box-shadow: 0 3px 12px rgba(28, 45, 90, 0.04);
}

.global-search-submit {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 0.7rem;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-popover-shell,
.profile-dropdown-shell {
    position: relative;
}

.shell-circle-button {
    position: relative;
    width: 2.9rem;
    height: 2.9rem;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(28, 45, 90, 0.12);
}

.shell-circle-button-strong {
    color: #ffffff;
}

.bell-button {
    background: linear-gradient(135deg, #5677ff 0%, #4058df 100%);
}

.chat-button {
    background: linear-gradient(135deg, #ff9a52 0%, #ff7a39 100%);
}

.shell-count-badge {
    position: absolute;
    top: -0.15rem;
    right: -0.2rem;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: #163fdb;
    border: 2px solid #f5f7fb;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shell-count-badge-orange {
    background: #d65318;
}

.profile-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.3rem 0.25rem 0.85rem;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    user-select: none;
}

.profile-summary-button {
    border: 0;
    outline: none;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
}

.profile-name {
    color: #2a3550;
    font-size: 0.96rem;
    font-weight: 700;
    white-space: nowrap;
}

.profile-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #50a7ff 0%, #5a58f2 100%);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(69, 95, 219, 0.22);
}

.profile-dropdown-panel,
.header-popover-panel {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    min-width: 13rem;
    padding: 0.45rem;
    border-radius: 1rem;
    background: #ffffff;
    border: 1px solid #e3e8f2;
    box-shadow: 0 18px 38px rgba(30, 44, 76, 0.14);
    z-index: 60;
}

.header-popover-panel {
    width: 22rem;
    padding: 0.55rem;
}

.header-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.6rem 0.8rem;
    color: #22344f;
    font-size: 0.96rem;
    font-weight: 800;
}

.header-popover-count {
    font-size: 0.8rem;
    color: #6e7d98;
    font-weight: 700;
}

.header-popover-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.header-popover-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    border: 0;
    background: transparent;
    text-align: left;
    border-radius: 0.9rem;
    padding: 0.8rem;
}

.header-popover-item:hover {
    background: #f5f8fe;
}

.header-popover-item-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    flex: 0 0 2rem;
}

.bell-mini-icon {
    background: linear-gradient(135deg, #5677ff 0%, #4058df 100%);
}

.chat-mini-icon {
    background: linear-gradient(135deg, #ff9a52 0%, #ff7a39 100%);
}

.header-popover-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.header-popover-item-title {
    color: #22344f;
    font-weight: 800;
    line-height: 1.2;
}

.header-popover-item-text {
    color: #5c6f8e;
    font-size: 0.88rem;
    line-height: 1.35;
}

.header-popover-item-time {
    color: #8391a8;
    font-size: 0.76rem;
    font-weight: 700;
}

.profile-dropdown-link,
.profile-dropdown-button {
    width: 100%;
    display: flex;
    align-items: center;
    border: 0;
    background: transparent;
    text-decoration: none;
    color: #33425f;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 0.85rem;
    border-radius: 0.8rem;
}

.profile-logout-form {
    margin: 0;
}

@media (max-width: 1100px) {
    .top-shell {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .top-shell-left,
    .top-shell-right {
        width: 100%;
    }

    .top-shell-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 770px) {
    .global-search-form {
        min-width: 0;
        width: 100%;
    }

    .header-popover-panel {
        width: min(22rem, calc(100vw - 2rem));
        right: auto;
        left: 0;
    }
}


.shell-icon {
    display: inline-block;
    width: 1.18rem;
    height: 1.18rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.shell-icon-strong {
    width: 1.28rem;
    height: 1.28rem;
}

.shell-icon-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23526686' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.shell-icon-bell {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3.75a4.5 4.5 0 0 0-4.5 4.5v1.83c0 .88-.25 1.74-.72 2.48l-1.1 1.74A1.5 1.5 0 0 0 6.95 16.5h10.1a1.5 1.5 0 0 0 1.27-2.3l-1.1-1.74a4.64 4.64 0 0 1-.72-2.48V8.25A4.5 4.5 0 0 0 12 3.75Zm0 16.5a2.26 2.26 0 0 0 2.14-1.5H9.86A2.26 2.26 0 0 0 12 20.25Z'/%3E%3C/svg%3E");
}

.shell-icon-chat {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M4.5 5.25A2.25 2.25 0 0 1 6.75 3h10.5a2.25 2.25 0 0 1 2.25 2.25v7.5A2.25 2.25 0 0 1 17.25 15H9.31l-3.97 3.4a.75.75 0 0 1-1.24-.57V15.6A2.25 2.25 0 0 1 2.25 13.5v-8.25ZM7.5 8.25A.75.75 0 0 0 7.5 9.75h9a.75.75 0 0 0 0-1.5h-9Zm0 3A.75.75 0 0 0 7.5 12.75h6a.75.75 0 0 0 0-1.5h-6Z'/%3E%3C/svg%3E");
}


.top-shell-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    border: 0;
    background: transparent;
    cursor: default;
}

.header-popover-shell,
.profile-dropdown-shell {
    position: relative;
    z-index: 65;
}

.header-popover-panel,
.profile-dropdown-panel {
    z-index: 70;
}

.header-menu-details > summary {
    list-style: none;
}

.header-menu-details > summary::-webkit-details-marker {
    display: none;
}

.header-menu-details[open] > .profile-summary,
.header-menu-details[open] > .shell-circle-button {
    filter: brightness(1.03);
}

.top-shell-overlay {
    display: none !important;
}

/* Login pre-auth full-canvas fallback styles */
.page-unauthenticated {
    background: transparent;
    min-height: 100vh;
    overflow: hidden;
}

main.main-unauthenticated {
    margin-left: 0;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.content-unauthenticated {
    padding: 0 !important;
    margin: 0;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.systems247-login-page {
    height: 100vh;
    min-height: 100vh;
    width: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.systems247-login-canvas {
    height: 100vh;
    min-height: 100vh;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
}

/* Login/customizer canvas alignment fallback */
.systems247-login-panel-shell {
    display: block;
    width: 100%;
    max-width: none;
}

.systems247-login-card {
    width: 100%;
}

.login-customizer-page {
    width: calc(100% + 3rem);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
}

.login-customizer-page > .dashboard-page-header,
.login-customizer-page .login-customizer-actions {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
}

.login-customizer-page .login-customizer-canvas {
    height: 100vh;
    min-height: 720px;
    border-radius: 0;
}

/* Contextual navigation: only the menu items scroll; Home remains reachable. */
.nav-scrollable:has(.contextual-sidebar) { overflow:hidden!important; padding:0!important; }
.nav-scrollable > nav:has(.contextual-sidebar) { height:100%; min-height:0; }
.contextual-sidebar { display:flex; flex-direction:column; height:100%; min-height:0; }
.contextual-sidebar-items { flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; padding:12px 8px; }
.contextual-sidebar-title { padding:8px 12px 16px; color:#fff; font-weight:600; overflow-wrap:anywhere; }
.contextual-sidebar-footer { flex:0 0 auto; padding:12px 12px max(12px,env(safe-area-inset-bottom)); border-top:1px solid #ffffff30; }
.return-home-button { display:flex; align-items:center; justify-content:center; gap:8px; padding:10px 12px; border:1px solid #ffffff60; border-radius:6px; background:#fff; color:#173871; text-decoration:none; font-weight:600; }
.return-home-button:hover { background:#e1edf7; color:#005c91; }
.return-home-button:focus-visible { outline:3px solid #ec8a24; outline-offset:2px; }
[data-user-layout="new"] .nav-menu-shell:has(.contextual-sidebar) { height:100%; }
.contextual-sidebar .nav-link { display:block; padding:12px; color:#fff; text-decoration:none; border-radius:6px; overflow-wrap:anywhere; }
.contextual-sidebar .nav-link:hover,.contextual-sidebar .nav-link.active { background:#ffffff20; }
