:root {
    --helm-navy: #0F172A;
    --helm-navy-2: #1B2436;
    --helm-orange: #FF5C1A;
    --helm-orange-lt: #FF8A3D;
    --helm-orange-deep: #E14E12;
    --helm-cream: #FAF4E8;
    --helm-cream-2: #FFF1E6;
    --helm-slate: #64748B;
    --helm-slate-lt: #94A3B8;
    --helm-border: #E7DED0;
    --helm-border-hard: #D8CCB8;
    --helm-green: #15803D;
    --helm-green-bg: #DCFCE7;
    --helm-amber: #B45309;
    --helm-amber-bg: #FEF3C7;
    --helm-red: #B91C1C;
    --helm-red-bg: #FEE2E2;
    --helm-grey-bg: #EEE9DF;
    --helm-blue: #1D4ED8;
    --helm-blue-bg: #DBEAFE;
}

html, body {
    font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.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;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.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."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.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;
}

.portal-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--helm-navy);
    border: none;
    border-radius: 1rem;
    padding: 1.9rem 2.1rem;
    color: #ffffff;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.portal-hero::after {
    content: '';
    position: absolute;
    right: -8rem;
    bottom: -10rem;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 92, 26, 0.4) 0%, transparent 64%);
    pointer-events: none;
}

.portal-hero > * {
    position: relative;
    z-index: 2;
}

.portal-login-card {
    max-width: 32rem;
    margin: 3rem auto;
    background: #ffffff;
    border: 1px solid #d7dfe5;
    border-radius: 1.25rem;
    padding: 2rem;
}

body {
    margin: 0;
    background: var(--helm-cream);
    color: var(--helm-navy);
}

.portal-shell {
    display: grid;
    grid-template-columns: 19rem minmax(0, 1fr);
    min-height: 100vh;
    background: var(--helm-cream);
}

.portal-sidebar {
    background: var(--helm-navy);
    color: #ffffff;
}

.portal-main {
    min-width: 0;
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 4rem;
    border-bottom: 1px solid var(--helm-border);
    background: #ffffff;
}

.portal-title {
    font-weight: 800;
    color: var(--helm-navy);
}

.portal-breadcrumbs,
.portal-account-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.portal-breadcrumb {
    color: var(--helm-slate);
    font-weight: 600;
}

.portal-breadcrumb-separator {
    color: var(--helm-slate-lt);
}

.portal-session-chip,
.portal-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--helm-border-hard);
    background: #ffffff;
    padding: 0.45rem 0.8rem;
    font-size: 0.92rem;
}

.logout-button,
.helm-primary-button,
.portal-hero .btn-primary {
    background: var(--helm-navy);
    border-color: var(--helm-navy);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 0.7rem 1.5rem rgba(15, 23, 42, 0.16);
}

.logout-button:hover,
.helm-primary-button:hover,
.portal-hero .btn-primary:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

.portal-content {
    padding: 1.5rem;
}

.portal-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 0.85rem;
    gap: 1.25rem;
}

.portal-brand,
.helm-brand-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-brand-icon,
.helm-brand-icon,
.portal-user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, var(--helm-orange-lt), var(--helm-orange));
    color: #ffffff;
    font-weight: 800;
}

.portal-brand-name,
.helm-brand-name {
    font-weight: 800;
    line-height: 1.1;
}

.portal-brand-subtitle,
.helm-brand-subtitle,
.portal-user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.portal-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-nav-heading {
    padding: 0.35rem 0.8rem;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    border-radius: 0.7rem;
    color: rgba(255, 255, 255, 0.72);
    padding: 0.7rem 0.8rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.14s;
}

.portal-nav-item i {
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.portal-nav-item span {
    flex: 1;
    text-align: left;
}

.portal-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.portal-nav-item.active {
    background: linear-gradient(135deg, var(--helm-orange-lt), var(--helm-orange));
    color: #ffffff;
    box-shadow: 0 0.5rem 1.25rem rgba(255, 92, 26, 0.34);
}

.portal-nav-item small {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.16);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.portal-nav-item.active small {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.portal-nav-item.coming-soon {
    cursor: default;
    opacity: 0.92;
}

.portal-nav-footer {
    margin-top: auto;
}

.portal-user-chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.portal-user-name {
    font-weight: 700;
    line-height: 1.1;
}

.portal-user-role {
    color: rgba(255, 255, 255, 0.72);
}

.portal-topbar .portal-title {
    font-size: 1rem;
}

.portal-eyebrow,
.helm-auth-eyebrow {
    color: var(--helm-orange-deep);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

.portal-hero h1,
.helm-login-card h1,
.helm-login-card h2 {
    margin-bottom: 0.65rem;
    font-weight: 800;
    line-height: 1.05;
}

.helm-hero-accent {
    color: var(--helm-orange-lt);
}

.portal-hero-refresh-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-hero-refresh-button:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.portal-stat-card.clickable {
    display: block;
    text-decoration: none;
    color: inherit;
}

.portal-stat-drill {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.55rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--helm-orange-deep);
    opacity: 0;
    transition: 0.15s;
}

.portal-stat-card.clickable:hover .portal-stat-drill {
    opacity: 1;
}

.portal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.portal-hero-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 700;
}

.portal-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.portal-stat-card,
.portal-panel,
.helm-login-card {
    background: #ffffff;
    border: 1.5px solid var(--helm-border);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.portal-stat-card {
    padding: 1.15rem 1.2rem;
    transition: 0.15s;
}

.portal-stat-card:hover {
    border-color: var(--helm-orange-lt);
    transform: translateY(-2px);
}

.portal-stat-label {
    color: var(--helm-slate);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--helm-navy);
    margin: 0.3rem 0;
}

.portal-stat-meta {
    color: var(--helm-slate);
    font-size: 0.85rem;
    font-weight: 600;
}

.portal-mock-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.portal-panel {
    padding: 0;
    overflow: hidden;
}

.portal-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.1rem 1.5rem 0.9rem;
    border-bottom: 1px solid var(--helm-border);
    margin-bottom: 0;
}

.portal-panel h2 {
    margin-bottom: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.portal-panel-sub {
    font-size: 0.78rem;
    color: var(--helm-slate);
    max-width: 34rem;
    line-height: 1.45;
    margin: 0.35rem 0 0;
}

.portal-mock-list {
    display: flex;
    flex-direction: column;
}

.portal-mock-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.95rem 1.5rem;
    border-bottom: 1px solid var(--helm-border);
    background: transparent;
    border-radius: 0;
    transition: background 0.12s;
}

.portal-mock-list-item:last-child {
    border-bottom: 0;
}

.portal-mock-list-item.clickable {
    cursor: pointer;
}

.portal-mock-list-item.clickable:hover {
    background: var(--helm-cream);
}

.portal-mock-list-item.soon {
    opacity: 0.7;
}

.portal-mock-list-item .portal-mock-list-chevron {
    color: var(--helm-slate-lt);
    flex-shrink: 0;
}

.portal-mock-list-item strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--helm-navy);
    font-weight: 700;
    font-size: 0.86rem;
}

.portal-mock-list-item span {
    color: var(--helm-slate);
    font-size: 0.78rem;
}

.portal-mock-list-item .portal-pill-soon {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--helm-slate);
    background: var(--helm-grey-bg);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.helm-auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(28rem, 0.85fr);
    min-height: 100vh;
}

.helm-auth-shell-reset {
    grid-template-columns: minmax(0, 1fr);
}

.helm-auth-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem;
    color: #f7f1e8;
    background: linear-gradient(180deg, #112035 0%, #0d1828 100%);
}

.helm-auth-brand-panel h1 {
    max-width: 32rem;
    font-size: clamp(2.8rem, 4vw, 4.4rem);
    color: #ffffff;
}

.helm-auth-brand-panel p {
    max-width: 31rem;
    color: rgba(247, 241, 232, 0.86);
    font-size: 1.05rem;
}

.helm-feature-list {
    display: grid;
    gap: 0.85rem;
    max-width: 31rem;
}

.helm-feature-card {
    display: flex;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
}

.helm-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    background: rgba(244, 122, 32, 0.12);
    color: #f47a20;
}

.helm-feature-card strong {
    display: block;
    color: #ffffff;
}

.helm-feature-card span {
    display: block;
    color: rgba(247, 241, 232, 0.76);
}

.helm-login-card h1,
.helm-login-card h2 {
    color: #10243b;
}

.helm-auth-footer {
    color: rgba(247, 241, 232, 0.68);
    font-size: 0.85rem;
}

.helm-auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f4eee3;
}

.helm-auth-form-panel-reset {
    min-height: 100vh;
}

.helm-login-card {
    width: min(100%, 33rem);
    padding: 2rem;
}

.helm-api-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.5rem 0 1.25rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid #dfd3c0;
    background: #fffaf2;
    font-size: 0.95rem;
}

.helm-api-chip code {
    color: #f47a20;
}

.helm-input {
    border-color: #dfd3c0;
    border-radius: 0.85rem;
    padding: 0.8rem 0.95rem;
}

.helm-input:focus {
    border-color: #f47a20;
    box-shadow: 0 0 0 0.2rem rgba(244, 122, 32, 0.12);
}

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

    .portal-sidebar {
        min-height: auto;
    }

    .portal-stat-grid,
    .portal-mock-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .portal-topbar,
    .portal-hero {
        flex-direction: column;
    }

    .portal-stat-grid,
    .portal-mock-grid {
        grid-template-columns: 1fr;
    }

    .helm-auth-brand-panel,
    .helm-auth-form-panel {
        padding: 1.25rem;
    }
}

/* ---------- Shared admin table/panel/button components (mockup parity) ---------- */

.portal-adm-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.portal-chart-card {
    background: #ffffff;
    border: 1.5px solid var(--helm-border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.4rem;
}

.portal-panel-eye {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--helm-orange-deep);
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-panel-eye .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--helm-orange);
}

.portal-chart-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--helm-navy);
    margin: 0.4rem 0;
}

.portal-chart-card p {
    font-size: 0.82rem;
    color: var(--helm-slate);
    line-height: 1.5;
}

.portal-statebox {
    background: var(--helm-cream);
    border: 1px dashed var(--helm-border-hard);
    border-radius: 0.7rem;
    padding: 0.9rem 1rem;
    font-size: 0.82rem;
    color: var(--helm-slate);
    font-weight: 600;
    margin: 1rem 0;
}

.portal-filein {
    width: 100%;
    font-size: 0.82rem;
    color: var(--helm-slate);
    background: #ffffff;
    border: 1.5px solid var(--helm-border-hard);
    border-radius: 0.7rem;
    padding: 0.55rem 0.75rem;
    margin: 1rem 0;
}

.btn-helm-orange {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, var(--helm-orange-lt), var(--helm-orange));
    border-color: transparent;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 0.5rem 1.1rem rgba(255, 92, 26, 0.3);
}

.btn-helm-orange:hover {
    color: #ffffff;
    filter: brightness(0.96);
}

.btn-helm-orange:disabled {
    opacity: 0.55;
    box-shadow: none;
}

.btn-white {
    background: #ffffff;
    color: var(--helm-navy);
    border: 1.5px solid var(--helm-border-hard);
    font-weight: 800;
}

.btn-white:hover {
    border-color: var(--helm-orange-lt);
    color: var(--helm-orange-deep);
}

.btn-white:disabled {
    opacity: 0.55;
}

.btn-red {
    background: var(--helm-red);
    border-color: transparent;
    color: #ffffff;
    font-weight: 800;
}

.btn-red:hover {
    background: #991B1B;
    color: #ffffff;
}

.btn-red:disabled {
    opacity: 0.55;
}

.btn-green {
    background: var(--helm-green);
    border-color: transparent;
    color: #ffffff;
    font-weight: 800;
}

.btn-green:hover {
    background: #166534;
    color: #ffffff;
}

.portal-panel-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table-scroll {
    overflow-x: auto;
}

.portal-table thead th {
    text-align: left;
    font-size: 0.66rem;
    font-weight: 800;
    color: var(--helm-slate);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.75rem 1.5rem;
    background: var(--helm-cream);
    border-bottom: 1.5px solid var(--helm-border);
    white-space: nowrap;
}

.portal-table thead th.r {
    text-align: right;
}

.portal-table tbody td {
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--helm-border);
    font-size: 0.83rem;
    vertical-align: middle;
}

.portal-table tbody tr:last-child td {
    border-bottom: 0;
}

.portal-table tbody td.r {
    text-align: right;
}

.portal-table tbody tr.is-muted td {
    opacity: 0.6;
}

.portal-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-av-sq {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.65rem;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--helm-orange-lt), var(--helm-orange));
}

.portal-nm {
    font-weight: 700;
    color: var(--helm-navy);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-mt {
    font-size: 0.7rem;
    color: var(--helm-slate);
    margin-top: 0.05rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.portal-pill {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 0.4rem;
}

.portal-pill-green { background: var(--helm-green-bg); color: var(--helm-green); }
.portal-pill-amber { background: var(--helm-amber-bg); color: var(--helm-amber); }
.portal-pill-red { background: var(--helm-red-bg); color: var(--helm-red); }
.portal-pill-grey { background: var(--helm-grey-bg); color: var(--helm-slate); }
.portal-pill-orange { background: var(--helm-cream-2); color: var(--helm-orange-deep); }
.portal-pill-blue { background: var(--helm-blue-bg); color: var(--helm-blue); }

.portal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.portal-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 0.45rem;
    background: var(--helm-cream);
    border: 1px solid var(--helm-border-hard);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--helm-navy);
    white-space: nowrap;
}

@media (max-width: 900px) {
    .portal-adm-cols {
        grid-template-columns: 1fr;
    }
}

/* Lightweight modal used by admin pages (e.g. Venue Financials "Add Payment"). No Bootstrap JS
   bundle is loaded in this project, so visibility is toggled purely via Blazor state (@if) rather
   than data-bs-* attributes. */
.modal-backdrop-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 28, 46, 0.5);
    z-index: 1040;
}

.modal.d-block {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
}

.modal.d-block .modal-dialog {
    width: 100%;
    max-width: 32rem;
    margin: 0;
}

/* ---------- Right-hand slide-in drawer (mockup parity, e.g. Venue Financials) ---------- */

.portal-drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1060;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.portal-drawer-scrim.show {
    opacity: 1;
    pointer-events: auto;
}

.portal-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 440px;
    max-width: 92vw;
    background: #ffffff;
    z-index: 1061;
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.2);
    transform: translateX(100%);
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.portal-drawer.show {
    transform: translateX(0);
}

.portal-drawer-head {
    padding: 1.375rem 1.5rem;
    border-bottom: 1px solid var(--helm-border);
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.portal-drawer-close {
    margin-left: auto;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.55rem;
    background: var(--helm-cream);
    border: 1px solid var(--helm-border);
    display: grid;
    place-items: center;
    color: var(--helm-slate);
    font-weight: 700;
}

.portal-drawer-close:hover {
    color: var(--helm-red);
    border-color: var(--helm-red);
}

.portal-drawer-body {
    padding: 1.375rem 1.5rem;
    display: grid;
    gap: 1rem;
}

.portal-ledger-box {
    background: var(--helm-cream);
    border: 1px solid var(--helm-border);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
}

.portal-dl {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--helm-border);
    font-size: 0.8rem;
}

.portal-dl:last-child {
    border-bottom: 0;
}

.portal-dl .k {
    color: var(--helm-slate);
    font-weight: 600;
}

.portal-dl .v {
    font-weight: 700;
    color: var(--helm-navy);
    text-align: right;
}

.portal-dcard-t {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--helm-slate);
}

.portal-drill-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--helm-border);
}

.portal-drill-row:last-child {
    border-bottom: 0;
}

.portal-num {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.portal-num.red {
    color: var(--helm-red);
}

.portal-num.orange {
    color: var(--helm-orange-deep);
}

.portal-num.zero {
    color: var(--helm-slate-lt);
}

.portal-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    background: var(--helm-cream);
    border: 1.5px solid var(--helm-border);
    border-radius: 0.7rem;
    padding: 0.25rem;
    margin-bottom: 1.1rem;
}

.portal-tab {
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--helm-slate);
    white-space: nowrap;
    background: transparent;
    border: none;
}

.portal-tab.active {
    background: linear-gradient(135deg, var(--helm-orange-lt), var(--helm-orange));
    color: #ffffff;
    box-shadow: 0 0.25rem 0.75rem rgba(255, 92, 26, 0.3);
}

/* Count badge inside a filter tab, e.g. "Incomplete 3". Inherits the tab's colour so it stays
   readable against both the cream and the active orange background. */
.portal-tab-count {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.35rem;
    border-radius: 0.35rem;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.portal-tab.active .portal-tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Inline filter control that sits on the same row as .portal-tabs. Deliberately not .helm-input:
   that is the auth/form control and renders a step larger and taller, which reads as mismatched
   next to the 0.78rem tabs. Label sits to the left of the select rather than stacked above it. */
.portal-inline-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.portal-inline-filter-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--helm-slate);
    white-space: nowrap;
    margin-bottom: 0;
}

.portal-inline-select {
    background: #ffffff;
    border: 1.5px solid var(--helm-border-hard);
    border-radius: 0.55rem;
    padding: 0.42rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--helm-navy);
    outline: none;
    cursor: pointer;
}

.portal-inline-select:focus {
    border-color: var(--helm-orange);
    box-shadow: 0 0 0 0.2rem rgba(244, 122, 32, 0.12);
}

/* Filter panel for a directory page (Staff): a search box plus a wrapping grid of labelled
   selects, sized to the same scale as .portal-inline-select. */
.portal-filter-panel {
    background: #ffffff;
    border: 1.5px solid var(--helm-border);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    padding: 1rem 1.1rem;
    margin-bottom: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 0.9rem;
    align-items: flex-end;
}

.portal-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 9.5rem;
}

.portal-filter-field.grow {
    flex: 1 1 14rem;
    min-width: 12rem;
}

.portal-filter-lbl {
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--helm-slate);
}

.portal-filter-panel select,
.portal-filter-panel input[type="search"],
.portal-filter-panel input[type="text"] {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--helm-border-hard);
    border-radius: 0.6rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--helm-navy);
    outline: none;
}

.portal-filter-panel select {
    cursor: pointer;
    font-weight: 700;
}

.portal-filter-panel select:focus,
.portal-filter-panel input:focus {
    border-color: var(--helm-orange);
    box-shadow: 0 0 0 0.2rem rgba(244, 122, 32, 0.12);
}

/* Dropdown panel for a multi-select filter (Reports customer picker). Anchored under its trigger
   button, which is why the containing .portal-filter-field sets position:relative. */
.portal-picker-panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    margin-top: 0.3rem;
    min-width: 16rem;
    background: #ffffff;
    border: 1.5px solid var(--helm-border-hard);
    border-radius: 0.7rem;
    box-shadow: 0 0.6rem 1.5rem rgba(15, 23, 42, 0.12);
    padding: 0.6rem;
}

.portal-picker-panel input[type="search"] {
    width: 100%;
    border: 1.5px solid var(--helm-border-hard);
    border-radius: 0.5rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    outline: none;
    margin-bottom: 0.45rem;
}

.portal-picker-list {
    max-height: 12rem;
    overflow-y: auto;
}

.portal-picker-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--helm-navy);
    cursor: pointer;
    border-radius: 0.4rem;
}

.portal-picker-row:hover {
    background: var(--helm-cream);
}

/* "Select all" row pinned above a picker list; acts on whatever the search currently shows. */
.portal-picker-row.portal-picker-all {
    font-weight: 800;
    border-bottom: 1px solid var(--helm-border);
    border-radius: 0.4rem 0.4rem 0 0;
    margin-bottom: 0.2rem;
}

/* Remove button inside a selected-staff chip. */
.portal-chip-x {
    margin-left: 0.35rem;
    border: 0;
    background: transparent;
    color: var(--helm-slate);
    font-size: 0.7rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.portal-chip-x:hover {
    color: var(--helm-red);
}

/* Small "TEST" marker shown beside a test account's name in the directory. */
.portal-test-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.3rem;
    border-radius: 0.3rem;
    background: var(--helm-cream-2);
    border: 1px solid var(--helm-orange-lt);
    color: var(--helm-orange-deep);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.portal-chkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.4rem;
    border: 1.5px solid var(--helm-border-hard);
    background: #ffffff;
    display: grid;
    place-items: center;
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
}

.portal-chkbox.on {
    background: var(--helm-orange);
    border-color: var(--helm-orange);
}

.portal-ts-grp td {
    background: var(--helm-grey-bg);
    font-weight: 800;
    color: var(--helm-navy);
    font-size: 0.75rem;
}

.portal-ts-inv {
    color: var(--helm-orange-deep);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.75rem;
}


    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--helm-slate);
    margin-bottom: 0.4rem;
}

.portal-amt-wrap {
    display: flex;
    align-items: stretch;
}

.portal-amt-pre {
    display: inline-flex;
    align-items: center;
    padding: 0 0.9rem;
    border: 1.5px solid var(--helm-border-hard);
    border-right: none;
    border-top-left-radius: 0.7rem;
    border-bottom-left-radius: 0.7rem;
    background: var(--helm-cream);
    color: var(--helm-slate);
    font-weight: 700;
}

.portal-amt-wrap .helm-input {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

tr.portal-row-clickable {
    cursor: pointer;
}

tr.portal-row-clickable:hover {
    background: var(--helm-cream);
}

.portal-stat-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1300px) {
    .portal-stat-grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .portal-stat-grid-5 {
        grid-template-columns: 1fr 1fr;
    }
}

.portal-stat-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 767px) {
    .portal-stat-grid-3 {
        grid-template-columns: 1fr;
    }
}

.portal-grp-chev {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.45rem;
    background: var(--helm-cream);
    border: 1px solid var(--helm-border);
    display: inline-grid;
    place-items: center;
    color: var(--helm-slate);
    transition: transform 0.2s;
    flex-shrink: 0;
}

tr.portal-open-grp .portal-grp-chev {
    transform: rotate(90deg);
    background: var(--helm-cream-2);
    color: var(--helm-orange-deep);
}

.portal-tag-group {
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.13rem 0.4rem;
    border-radius: 0.3rem;
    background: var(--helm-navy);
    color: #ffffff;
    margin-left: 0.45rem;
    vertical-align: middle;
}

tr.portal-child-row td {
    background: var(--helm-cream);
}

tr.portal-child-row td:first-child {
    padding-left: 3.5rem;
}

tr.portal-total-row td {
    background: var(--helm-cream-2);
    font-weight: 800 !important;
    color: var(--helm-navy) !important;
    border-top: 2px solid var(--helm-border-hard);
}

/* ---------- Pending Payments job accordion ---------- */

.portal-job {
    border-bottom: 1px solid var(--helm-border);
}

.portal-job:last-child {
    border-bottom: 0;
}

.portal-job-head {
    padding: 0.95rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    cursor: pointer;
    transition: background 0.12s;
}

.portal-job-head:hover {
    background: var(--helm-cream);
}

.portal-job.open .portal-grp-chev {
    transform: rotate(90deg);
    background: var(--helm-cream-2);
    color: var(--helm-orange-deep);
}

.portal-job-body {
    background: var(--helm-cream);
    padding: 0.25rem 1.5rem 1.1rem;
}

/* Venue name is the record's headline on the Jobs list - deliberately a step larger and heavier
   than the job title beneath it, because the venue is what an admin scans the list for. */
.portal-job-venue {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--helm-navy);
    line-height: 1.25;
}

.portal-job-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--helm-navy);
    line-height: 1.35;
}

.portal-job-ref {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--helm-slate);
    margin-top: 0.1rem;
}

/* The full job GUID, shown so a row can be found directly in dbo.Jobs. Muted and slightly
   smaller: useful when you need it, not competing with the reference number. */
.portal-job-guid {
    opacity: 0.65;
    font-size: 0.65rem;
}

/* The Jobs tiles double as category filters, so the selected one is outlined. */
.portal-stat-card.is-active {
    border-color: var(--helm-orange);
    box-shadow: 0 0 0 0.15rem rgba(255, 92, 26, 0.15);
}

.portal-sub-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid var(--helm-border);
    border-radius: 0.7rem;
    overflow: hidden;
    margin-top: 0.5rem;
}

.portal-sub-table th {
    text-align: left;
    font-size: 0.63rem;
    font-weight: 800;
    color: var(--helm-slate);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.6rem 0.9rem;
    background: var(--helm-cream);
    border-bottom: 1px solid var(--helm-border);
}

.portal-sub-table th.r,
.portal-sub-table td.r {
    text-align: right;
}

.portal-sub-table td {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--helm-border);
    font-size: 0.78rem;
}

.portal-sub-table tr:last-child td {
    border-bottom: 0;
}


/* ── Invoice page (/timesheet-payments/invoice/...) ─────────────────────── */

/* Was inline on the iframe; a class so the print rules below can override it. */
.helm-invoice-frame {
    display: block;
    width: 100%;
    height: 1180px;
    border: 0;
    border-radius: var(--bs-card-border-radius);
}

/* Normally "Print / Save as PDF" prints the invoice frame on its own and none of this applies.
   It matters when the browser prints the whole page instead - an older invoice with no stored
   document, or Ctrl+P - and strips the Helm down to just the invoice. */
@media print {
    .portal-sidebar,
    .portal-topbar,
    .portal-hero,
    .helm-invoice-print-error {
        display: none !important;
    }

    .portal-shell,
    .portal-main,
    .portal-content {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    .helm-invoice-frame-card,
    .helm-invoice-fallback-card {
        max-width: none !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .helm-invoice-frame {
        height: auto;
        min-height: 100vh;
        border-radius: 0;
    }
}

/* Comms "Email staff": recipient list, HTML editor and sandboxed preview. */
.portal-comms-recipients {
    max-height: 26rem;
    overflow-y: auto;
}

.portal-comms-recipients .form-check-input {
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0;
    cursor: pointer;
    border-width: 1.5px;
    border-color: var(--helm-border-hard);
}

.portal-comms-recipients .form-check-input:checked {
    background-color: var(--helm-orange);
    border-color: var(--helm-orange);
}

.portal-comms-recipients .form-check-input:focus {
    border-color: var(--helm-orange);
    box-shadow: 0 0 0 0.2rem rgba(244, 122, 32, 0.15);
}

.portal-comms-recipients td,
.portal-comms-recipients th {
    vertical-align: middle;
}

.portal-comms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 991.98px) {
    .portal-comms-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.portal-comms-html {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.45;
    resize: vertical;
}

.portal-comms-help {
    font-size: 0.75rem;
    color: var(--helm-slate);
}

.portal-comms-subject {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--helm-navy);
}

.portal-comms-subject span {
    color: var(--helm-slate);
    font-weight: 600;
}

.portal-comms-progress {
    height: 0.6rem;
    border-radius: 999px;
    background: var(--helm-grey-bg);
    overflow: hidden;
}

.portal-comms-progress > div {
    height: 100%;
    background: var(--helm-orange);
    transition: width 0.4s ease;
}

.portal-comms-preview {
    width: 100%;
    height: 32rem;
    border: 1.5px solid var(--helm-border);
    border-radius: 0.6rem;
    background: #ffffff;
}
