:root {
    --portal-sidebar-bg: #1f2a37;
    --portal-sidebar-link: #d9e2ec;
    --portal-sidebar-link-hover: #ffffff;
    --portal-sidebar-active: #334155;
    --portal-sidebar-collapsed-width: 84px;
    --portal-shell-bg: #f4f6fb;
    --portal-header-bg: #ffffff;
    --portal-card-border: #d7dee8;
    --portal-accent: #0d6efd;
    --portal-text-muted: #6b7280;
}

body {
    background: linear-gradient(180deg, #eef2f8 0%, #f8fafc 100%);
    color: #1f2933;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

a,
a:hover,
a:focus,
a:active,
a:visited {
    text-decoration: none;
}

.portal-shell {
    min-height: 100vh;
}

.portal-sidebar {
    background: linear-gradient(180deg, #1f2a37 0%, #16202c 100%);
    color: #fff;
    flex: 0 0 240px;
    min-height: 100vh;
    overflow: hidden;
    transition: flex-basis 0.24s ease, max-width 0.24s ease, padding 0.24s ease, box-shadow 0.24s ease;
    width: 240px;
}

.portal-sidebar > * {
    transition: opacity 0.18s ease;
}

.portal-shell.sidebar-collapsed .portal-sidebar {
    box-shadow: none;
    flex-basis: var(--portal-sidebar-collapsed-width);
    max-width: var(--portal-sidebar-collapsed-width);
    min-width: var(--portal-sidebar-collapsed-width);
    padding: 1rem 0.65rem !important;
    width: var(--portal-sidebar-collapsed-width);
}

.portal-brand {
    color: #fff;
    display: flex;
    align-items: center;
    font-weight: 700;
    gap: 0.6rem;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.portal-brand-mark {
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(191, 224, 255, 0.18);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 10px 24px rgba(8, 31, 70, 0.18);
    color: #fff;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    overflow: hidden;
    width: 36px;
}

.portal-brand-icon {
    display: block;
    height: 28px;
    width: 28px;
}

.portal-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.portal-brand-name {
    white-space: nowrap;
}

.portal-brand-subtitle {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-shell.sidebar-collapsed .portal-brand {
    justify-content: center;
}

.portal-shell.sidebar-collapsed .portal-brand-copy {
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-6px);
    width: 0;
}

.portal-nav-title {
    color: rgba(217, 226, 236, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 1rem 0 0.45rem;
    text-transform: uppercase;
}

.portal-nav a {
    border-radius: 0.75rem;
    color: var(--portal-sidebar-link);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.2rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.portal-nav-icon {
    align-items: center;
    color: #9fb3c8;
    display: inline-flex;
    flex: 0 0 1.1rem;
    height: 1.1rem;
    justify-content: center;
    transition: color 0.18s ease, transform 0.18s ease;
    width: 1.1rem;
}

.portal-nav-icon svg {
    display: block;
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1rem;
}

.portal-nav-label {
    min-width: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

.portal-nav a:hover,
.portal-nav a.active {
    background: var(--portal-sidebar-active);
    color: var(--portal-sidebar-link-hover);
}

.portal-nav a:hover .portal-nav-icon,
.portal-nav a.active .portal-nav-icon {
    color: var(--portal-sidebar-link-hover);
    transform: scale(1.04);
}

.portal-nav-group {
    margin-bottom: 0.2rem;
}

.portal-nav-divider {
    background: rgba(159, 179, 200, 0.28);
    border-radius: 999px;
    height: 1px;
    margin: 0.55rem 0;
}

.portal-nav-submenu {
    margin: 0.15rem 0 0.35rem 1.35rem;
    padding-left: 0.7rem;
    position: relative;
}

.portal-nav-submenu::before {
    background: rgba(159, 179, 200, 0.3);
    border-radius: 999px;
    bottom: 0.1rem;
    content: "";
    left: 0;
    position: absolute;
    top: 0.1rem;
    width: 1px;
}

.portal-nav-submenu .portal-nav-sublink {
    border-radius: 0.65rem;
    color: rgba(217, 226, 236, 0.82);
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
    min-height: 2rem;
    padding: 0.45rem 0.75rem;
}

.portal-nav-sublabel {
    min-width: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

.portal-shell.sidebar-collapsed .portal-nav-title {
    opacity: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
}

.portal-shell.sidebar-collapsed .portal-nav-divider {
    display: none;
}

.portal-shell.sidebar-collapsed .portal-nav a {
    justify-content: center;
    padding: 0.7rem;
}

.portal-shell.sidebar-collapsed .portal-nav-label {
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-6px);
    width: 0;
}

.portal-shell.sidebar-collapsed .portal-nav-submenu {
    display: none;
}

.portal-content {
    min-width: 0;
    width: 100%;
}

.portal-secondary-sidebar {
    background: rgba(255, 255, 255, 0.94);
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #dbe4ef;
    flex: 0 0 260px;
    max-width: 260px;
    min-height: 100vh;
    width: 260px;
}

.portal-secondary-sidebar-inner {
    height: 100vh;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
}

.api-workspace-sidebar-heading {
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.85rem;
    text-transform: uppercase;
}

.api-workspace-sidebar-meta {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.api-workspace-sidebar-name {
    font-size: 1rem;
    font-weight: 700;
}

.api-workspace-sidebar-version {
    color: var(--portal-text-muted);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.api-workspace-nav,
.api-workspace-mobile-links {
    display: grid;
    gap: 0.35rem;
}

.api-workspace-nav-link {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    color: #334155;
    display: flex;
    font-weight: 600;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.api-workspace-nav-icon {
    align-items: center;
    color: #64748b;
    display: inline-flex;
    flex: 0 0 1.1rem;
    height: 1.1rem;
    justify-content: center;
    transition: color 0.18s ease, transform 0.18s ease;
    width: 1.1rem;
}

.api-workspace-nav-icon svg {
    display: block;
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1rem;
}

.api-workspace-nav-link:hover,
.api-workspace-nav-link.active {
    background: #eef4ff;
    border-color: #c8dafd;
    color: #0b5ed7;
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.08);
}

.api-workspace-nav-link.is-disabled {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.api-workspace-nav-link.is-disabled .api-workspace-nav-icon {
    color: #94a3b8;
    transform: none;
}

.api-workspace-nav-link:hover .api-workspace-nav-icon,
.api-workspace-nav-link.active .api-workspace-nav-icon {
    color: #0b5ed7;
    transform: scale(1.04);
}

.api-workspace-nav-note {
    color: var(--portal-text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
    margin-top: 1rem;
}

.api-workspace-hero {
    align-items: flex-start;
}

.api-workspace-mobile-nav {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
}

.api-workspace-mobile-toggle {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0.75rem 0.85rem;
}

.api-workspace-mobile-toggle::-webkit-details-marker {
    display: none;
}

.api-workspace-mobile-links {
    border-top: 1px solid #e2e8f0;
    padding: 0.35rem;
}

.workspace-summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.workspace-summary-item {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem;
}

.workspace-summary-item-full {
    grid-column: 1 / -1;
}

.workspace-placeholder {
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
    border: 1px dashed #c7d6e6;
    border-radius: 1rem;
    padding: 1rem;
}

.workspace-form-section-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.workspace-form-section-copy {
    color: var(--portal-text-muted);
    margin-bottom: 0;
    max-width: 70ch;
}

.workspace-form-subsection {
    background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    padding: 1rem;
}

.documentation-rendered {
    color: #1f2933;
    line-height: 1.7;
}

.documentation-view-panel {
    background: linear-gradient(180deg, #fcfdff 0%, #f5f8fc 100%);
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 16px 28px rgba(15, 23, 42, 0.05);
    padding: 1.25rem 1.35rem;
}

.documentation-view-label {
    color: #52606d;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.documentation-rendered h2,
.documentation-rendered h3 {
    color: #102a43;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
}

.documentation-rendered h2:first-child,
.documentation-rendered h3:first-child {
    margin-top: 0;
}

.documentation-rendered p,
.documentation-rendered ul,
.documentation-rendered ol,
.documentation-rendered blockquote,
.documentation-rendered pre {
    margin-bottom: 1rem;
}

.documentation-rendered ul,
.documentation-rendered ol {
    padding-left: 1.35rem;
}

.documentation-rendered blockquote {
    border-left: 4px solid #cfe2ff;
    color: #52606d;
    margin-left: 0;
    padding-left: 1rem;
}

.documentation-rendered pre {
    background: #0f172a;
    border-radius: 0.85rem;
    color: #e2e8f0;
    padding: 1rem 1.1rem;
}

.documentation-rendered code {
    background: #eef2ff;
    border-radius: 0.35rem;
    color: #1d4ed8;
    padding: 0.1rem 0.35rem;
}

.documentation-editor-shell {
    border: 1px solid #d7dee8;
    border-radius: 1rem;
    overflow: hidden;
}

.documentation-editor-actions {
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
    border: 1px solid #d7dee8;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
}

.documentation-editor-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #d7dee8;
    padding: 0.65rem 0.75rem;
}

.documentation-editor-surface {
    min-height: 420px;
}

.documentation-editor-surface .ql-editor {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    min-height: 420px;
}

.documentation-editor-surface .ql-editor h2,
.documentation-editor-surface .ql-editor h3 {
    color: #102a43;
}

.portal-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #dbe4ef;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.portal-header-start {
    align-items: center;
    display: flex;
}

.portal-header-title {
    font-size: 0.95rem;
    line-height: 1.2;
}

.portal-tenancy-link {
    display: block;
    max-width: 20rem;
    text-align: right;
}

.portal-tenancy-label {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-tenancy-value {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
}

.portal-sidebar-toggle {
    align-items: center;
    background: #fff;
    border: 1px solid #dbe4ef;
    border-radius: 0.85rem;
    color: #1f2933;
    cursor: pointer;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    padding: 0;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    width: 38px;
}

.portal-sidebar-toggle:hover {
    background: #f8fbff;
    border-color: #c7d6e6;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    color: #0d6efd;
}

.portal-sidebar-toggle-bars {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
}

.portal-sidebar-toggle-bars span {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 14px;
}

.portal-header-user {
    align-items: center;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    color: #1f2933;
    display: inline-flex;
    gap: 0.65rem;
    padding: 0.35rem 0.75rem;
}

.portal-header-user-badge {
    align-items: center;
    background: #e9f2ff;
    border-radius: 999px;
    color: #0d6efd;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.portal-user-menu {
    position: relative;
}

.portal-user-menu summary {
    list-style: none;
}

.portal-user-menu summary::-webkit-details-marker {
    display: none;
}

.portal-user-menu-toggle {
    align-items: center;
    background: #fff;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    color: #1f2933;
    cursor: pointer;
    display: inline-flex;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.25rem 0.4rem 0.25rem 0.25rem;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.portal-user-menu-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user-menu-toggle:hover,
.portal-user-menu[open] .portal-user-menu-toggle {
    background: #f8fbff;
    border-color: #c7d6e6;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

@media (max-width: 991.98px) {
    .portal-secondary-sidebar {
        display: none !important;
    }

    .portal-tenancy-link {
        display: none;
    }

}

.portal-user-menu-icon {
    align-items: center;
    background: #e9f2ff;
    border-radius: 999px;
    color: #0d6efd;
    flex: 0 0 auto;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.portal-user-menu-panel {
    background: #fff;
    border: 1px solid #dbe4ef;
    border-radius: 0.95rem;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
    min-width: 180px;
    padding: 0.45rem;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 1030;
}

.portal-user-menu-item {
    align-items: center;
    border: 0;
    border-radius: 0.65rem;
    color: #1f2933;
    display: flex;
    gap: 0.65rem;
    font-weight: 600;
    padding: 0.7rem 0.85rem;
    text-decoration: none;
    width: 100%;
}

.portal-user-menu-item-icon {
    align-items: center;
    color: #5f6f82;
    display: inline-flex;
    flex: 0 0 auto;
    height: 1rem;
    justify-content: center;
    width: 1rem;
}

.portal-user-menu-item-icon svg {
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1rem;
}

.portal-user-menu-item:hover {
    background: #f3f7fc;
    color: #0d6efd;
}

.portal-user-menu-item:hover .portal-user-menu-item-icon,
.portal-user-menu-button:hover .portal-user-menu-item-icon {
    color: currentColor;
}

.portal-user-menu-button {
    background: transparent;
    text-align: left;
}

.portal-user-menu-divider {
    border-top: 1px solid #e5edf7;
    margin: 0.25rem 0;
}

.page-card {
    background: #fff;
    border: 1px solid var(--portal-card-border);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.page-hero {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.summary-stat {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d7dee8;
    border-radius: 1rem;
    padding: 1rem 1.1rem;
}

.summary-stat .value {
    font-size: 1.9rem;
    font-weight: 700;
}

.summary-stat .value-compact {
    font-size: 1.4rem;
    line-height: 1.2;
}

.breadcrumb {
    margin-bottom: 0.25rem;
}

.table td,
.table th {
    vertical-align: middle;
}

.detail-label {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.detail-value {
    margin-bottom: 1rem;
}

.detail-value-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.api-call-doc {
    background: linear-gradient(180deg, #f8fbff 0%, #f2f6fc 100%);
    border: 1px solid #dbe4ef;
    border-radius: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
}

.api-call-doc:last-child {
    margin-bottom: 0;
}

.api-call-doc-label {
    color: var(--portal-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.api-call-doc-code {
    color: #0f172a;
    display: block;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.form-help {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

.alert-list-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.alert-list-detail {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.alert-list-badge {
    flex-shrink: 0;
    white-space: nowrap;
}

.analytics-helper-copy {
    max-width: 70ch;
}

.analytics-empty-state {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-style: dashed;
}

.analytics-mini-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.analytics-mini-stat {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe4ef;
    border-radius: 0.9rem;
    padding: 0.85rem 0.95rem;
}

.analytics-mini-stat .value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.analytics-window-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.analytics-chart-shell {
    height: 320px;
    position: relative;
}

.analytics-section-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.analytics-section-header-copy {
    flex: 1 1 18rem;
    min-width: 0;
}

.analytics-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.analytics-anchor-section {
    clear: both;
    scroll-margin-top: 5.5rem;
}

.analytics-request-log-table td,
.analytics-request-log-table th {
    white-space: nowrap;
}

.analytics-monospace {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.92rem;
}

.api-operations-time-window-label {
    white-space: nowrap;
}

@media (min-width: 992px) {
    .api-operations-filter-form .api-operations-time-window-col {
        flex: 0 0 9rem;
        width: 9rem;
    }

    .api-operations-filter-form .api-operations-filter-submit {
        flex: 0 0 6rem;
        width: 6rem;
    }
}

.playground-pre {
    background: linear-gradient(180deg, #f8fbff 0%, #f2f6fc 100%);
    border: 1px solid #dbe4ef;
    border-radius: 0.9rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    margin: 0;
    min-height: 12rem;
    overflow: auto;
    padding: 0.95rem 1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.portal-toast-region {
    display: grid;
    gap: 0.75rem;
    max-width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
    position: fixed;
    left: 50%;
    top: 1rem;
    width: 100%;
    transform: translateX(-50%);
    z-index: 1090;
}

.portal-toast {
    align-items: flex-start;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    color: #102a43;
    display: grid;
    gap: 0.2rem;
    grid-template-columns: 1fr auto;
    opacity: 0;
    padding: 0.95rem 1rem;
    pointer-events: auto;
    transform: translateY(-12px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.portal-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.portal-toast-success {
    background: rgba(236, 253, 245, 0.96);
    border-color: rgba(5, 150, 105, 0.22);
}

.portal-toast-error {
    background: rgba(254, 242, 242, 0.97);
    border-color: rgba(220, 38, 38, 0.22);
}

.portal-toast-body {
    display: grid;
    gap: 0.15rem;
}

.portal-toast-title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
}

.portal-toast-copy {
    font-size: 0.9rem;
    line-height: 1.35;
}

.portal-toast-close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font-size: 1.15rem;
    height: 1.9rem;
    justify-content: center;
    line-height: 1;
    margin-left: 0.75rem;
    opacity: 0.75;
    width: 1.9rem;
}

.portal-toast-close:hover {
    background: rgba(15, 23, 42, 0.06);
    opacity: 1;
}

.portal-modal[hidden] {
    display: none;
}

.portal-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 1080;
}

.portal-modal-backdrop {
    background: rgba(15, 23, 42, 0.48);
    inset: 0;
    position: absolute;
}

.portal-modal-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.25rem;
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.24);
    max-width: 30rem;
    padding: 1.35rem;
    position: relative;
    width: min(100%, 30rem);
}

.portal-modal-header {
    margin-bottom: 0.75rem;
}

.portal-modal-title {
    font-size: 1.1rem;
    margin: 0;
}

.portal-modal-copy {
    color: var(--portal-text-muted);
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.portal-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

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

button.is-loading,
input[type="submit"].is-loading {
    cursor: wait;
    opacity: 0.8;
}

.login-shell {
    align-items: center;
    background: radial-gradient(circle at top left, #dcecff 0%, #f8fafc 55%, #eef2f8 100%);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 1.25rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
    max-width: 460px;
    padding: 2rem;
    width: 100%;
}

.auth-body {
    background:
            radial-gradient(circle at top left, rgba(112, 165, 255, 0.2) 0%, rgba(112, 165, 255, 0) 28%),
            radial-gradient(circle at bottom right, rgba(22, 32, 44, 0.12) 0%, rgba(22, 32, 44, 0) 34%),
            linear-gradient(180deg, #edf3fa 0%, #f7f9fc 100%);
}

.login-shell.auth-shell {
    background:
            radial-gradient(circle at 10% 12%, rgba(79, 156, 255, 0.12) 0%, rgba(79, 156, 255, 0) 26%),
            radial-gradient(circle at 92% 88%, rgba(11, 31, 54, 0.08) 0%, rgba(11, 31, 54, 0) 24%),
            linear-gradient(180deg, #edf3fa 0%, #f7f9fc 100%);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.auth-shell-grid {
    align-items: stretch;
    display: grid;
    gap: clamp(1.5rem, 2.4vw, 2.5rem);
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 440px);
    max-width: 1180px;
    width: 100%;
}

.auth-showcase,
.auth-form-panel {
    min-width: 0;
}

.auth-form-panel {
    align-items: stretch;
    display: flex;
}

.auth-showcase-panel {
    background:
            radial-gradient(circle at top right, rgba(136, 195, 255, 0.16) 0%, rgba(136, 195, 255, 0) 34%),
            linear-gradient(145deg, #112742 0%, #173a5b 52%, #0d2237 100%);
    border: 1px solid rgba(203, 224, 255, 0.14);
    border-radius: 1.75rem;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
    color: #f8fbff;
    height: 100%;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 3rem);
    position: relative;
}

.auth-showcase-panel,
.auth-login-card {
    display: flex;
    flex-direction: column;
}

.auth-showcase-panel::after {
    background:
            linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
            linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.08) calc(100% - 1px));
    content: "";
    inset: 0;
    mask-image: radial-gradient(circle at top left, black 0%, transparent 72%);
    opacity: 0.8;
    pointer-events: none;
    position: absolute;
}

.auth-shell-consumer .auth-showcase-panel {
    background:
            radial-gradient(circle at top right, rgba(105, 215, 204, 0.16) 0%, rgba(105, 215, 204, 0) 34%),
            linear-gradient(145deg, #10324c 0%, #0d4b67 52%, #10283f 100%);
}

.auth-brand {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-bottom: clamp(2rem, 4vw, 3.25rem);
    position: relative;
    z-index: 1;
}

.auth-brand-mark {
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(216, 233, 255, 0.16);
    border-radius: 1.15rem;
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            0 14px 30px rgba(6, 19, 44, 0.16);
    display: inline-flex;
    flex: 0 0 68px;
    height: 68px;
    justify-content: center;
    overflow: hidden;
    width: 68px;
}

.auth-brand-mark .portal-brand-icon {
    height: 50px;
    width: 50px;
}

.auth-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-brand-subtitle {
    color: rgba(232, 242, 255, 0.72);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    margin-top: 0.2rem;
    text-transform: uppercase;
}

.auth-kicker {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(216, 233, 255, 0.14);
    border-radius: 999px;
    color: #d8e8ff;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    margin-bottom: 1.25rem;
    padding: 0.55rem 0.9rem;
    position: relative;
    text-transform: uppercase;
    z-index: 1;
}

.auth-shell-consumer .auth-kicker {
    color: #d6fffa;
}

.auth-showcase-title {
    font-size: clamp(2.25rem, 4vw, 3.35rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.04;
    margin: 0 0 1rem;
    max-width: 11ch;
    position: relative;
    z-index: 1;
}

.auth-showcase-copy {
    color: rgba(232, 242, 255, 0.8);
    font-size: 1.03rem;
    line-height: 1.7;
    margin: 0;
    max-width: 60ch;
    position: relative;
    z-index: 1;
}

.auth-highlights {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.auth-highlight {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(216, 233, 255, 0.14);
    border-radius: 1.2rem;
    padding: 1.1rem 1rem;
}

.auth-highlight-label {
    color: rgba(216, 232, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 0.55rem;
    text-transform: uppercase;
}

.auth-highlight-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.55rem;
}

.auth-highlight-copy {
    color: rgba(232, 242, 255, 0.72);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
}

.auth-login-card {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(210, 220, 233, 0.95);
    border-radius: 1.5rem;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
    height: 100%;
    max-width: none;
    padding: clamp(1.75rem, 4vw, 2.5rem);
}

.auth-form-header {
    margin-bottom: 1.5rem;
}

.auth-form-eyebrow {
    color: #526275;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    margin-bottom: 0.65rem;
    text-transform: uppercase;
}

.auth-form-title {
    color: #16202c;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.65rem;
}

.auth-form-copy {
    color: #607082;
    line-height: 1.65;
    margin: 0;
}

.auth-login-card .alert {
    border: none;
    border-radius: 1rem;
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
}

.auth-login-card .form-label {
    color: #314255;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.auth-login-card .form-control {
    background: #f7f9fc;
    border: 1px solid #d6dfeb;
    border-radius: 0.95rem;
    box-shadow: none;
    min-height: 3.4rem;
    padding: 0.9rem 1rem;
}

.auth-login-card .form-control:focus {
    background: #fff;
    border-color: #5f8ef5;
    box-shadow: 0 0 0 0.25rem rgba(95, 142, 245, 0.14);
}

.auth-login-card .btn-primary {
    background: linear-gradient(135deg, #1d5fd3 0%, #1146a5 100%);
    border: none;
    border-radius: 0.95rem;
    box-shadow: 0 16px 28px rgba(17, 70, 165, 0.18);
    font-weight: 700;
    min-height: 3.5rem;
}

.auth-login-card .btn-primary:hover,
.auth-login-card .btn-primary:focus {
    background: linear-gradient(135deg, #1b57bf 0%, #0f3e95 100%);
}

.auth-shell-consumer .auth-login-card .btn-primary {
    background: linear-gradient(135deg, #0f7a88 0%, #0b5b77 100%);
    box-shadow: 0 16px 28px rgba(11, 91, 119, 0.18);
}

.auth-shell-consumer .auth-login-card .btn-primary:hover,
.auth-shell-consumer .auth-login-card .btn-primary:focus {
    background: linear-gradient(135deg, #0e6c79 0%, #0a516c 100%);
}

.auth-form-note {
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
    border: 1px solid #dde6f0;
    border-radius: 1.05rem;
    margin-top: 1.25rem;
    padding: 1rem;
}

.auth-form-note-label {
    color: #29405c;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.auth-form-note-copy {
    color: #617282;
    font-size: 0.94rem;
    line-height: 1.55;
}

.auth-trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.auth-trust-strip span {
    background: #eef3f9;
    border: 1px solid #dce5ef;
    border-radius: 999px;
    color: #4d6177;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.7rem;
    text-transform: uppercase;
}

.auth-switch-link {
    color: #617282;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-top: 1.2rem;
}

.auth-switch-link a {
    color: #1146a5;
    font-weight: 700;
}

.auth-shell-consumer .auth-switch-link a {
    color: #0b5b77;
}

.error-shell {
    align-items: center;
    background:
            radial-gradient(circle at top left, rgba(79, 156, 255, 0.16) 0%, rgba(79, 156, 255, 0) 32%),
            radial-gradient(circle at bottom right, rgba(31, 42, 55, 0.12) 0%, rgba(31, 42, 55, 0) 30%),
            linear-gradient(180deg, #eef4fb 0%, #f8fafc 100%);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.error-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #d7dee8;
    border-radius: 1.5rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    max-width: 720px;
    padding: 2.5rem;
    width: 100%;
}

.error-badge {
    background: #e9f2ff;
    border-radius: 999px;
    color: #0d6efd;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding: 0.45rem 0.8rem;
    text-transform: uppercase;
}

.error-code {
    color: #1f2a37;
    font-size: clamp(3.5rem, 10vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin-bottom: 1rem;
}

.error-meta {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 2rem;
}

.error-meta-item {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d7dee8;
    border-radius: 1rem;
    padding: 1rem;
}

@media (max-width: 991.98px) {
    .auth-shell-grid {
        grid-template-columns: 1fr;
    }

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

    .auth-showcase-title {
        max-width: none;
    }

    .auth-form-panel {
        align-items: stretch;
    }

    .portal-shell {
        display: block !important;
    }

    .portal-sidebar {
        flex-basis: auto;
        max-height: 1000px;
        max-width: none;
        min-height: auto;
        width: 100%;
        transition: max-height 0.24s ease, padding 0.24s ease;
    }

    .portal-shell.sidebar-collapsed .portal-sidebar {
        max-height: 0;
        max-width: none;
        min-width: 0;
        padding: 0 !important;
        width: 100%;
    }

    .portal-shell.sidebar-collapsed .portal-sidebar > * {
        opacity: 0;
        pointer-events: none;
    }

    .error-card {
        padding: 2rem;
    }

    .portal-toast-region {
        left: 50%;
        max-width: min(24rem, calc(100vw - 2rem));
        transform: translateX(-50%);
    }

    .portal-modal-actions {
        flex-direction: column-reverse;
    }

    .portal-modal-actions .btn {
        width: 100%;
    }

    .page-hero {
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .login-shell.auth-shell {
        padding: 1rem;
    }

    .auth-showcase-panel,
    .auth-login-card {
        border-radius: 1.35rem;
        padding: 1.5rem;
    }

    .auth-brand {
        margin-bottom: 1.75rem;
    }

    .auth-brand-mark {
        flex-basis: 56px;
        height: 56px;
        width: 56px;
    }

    .auth-brand-mark .portal-brand-icon {
        height: 32px;
        width: 32px;
    }

    .auth-form-title {
        font-size: 1.7rem;
    }
}
