html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

/* ------------------------------------------------------------------
   Brand colours: override Bootstrap defaults site-wide.

   Primary  → dark navy  #161d39  (replaces Bootstrap royal blue)
   Success  → brand green #3F8734 (Feel The Benefit brand colour)

   Cascades to ALL Bootstrap utility classes:
     bg-primary / bg-success, btn-primary / btn-success,
     text-primary / text-success, border-primary / border-success,
     table-primary / table-success, alert-primary / alert-success,
     badge bg-primary / bg-success, etc.
------------------------------------------------------------------ */
:root {
    /* --- Dark navy primary --- */
    --bs-primary: #161d39;
    --bs-primary-rgb: 22, 29, 57;
    --bs-primary-text-emphasis: #0d1122;
    --bs-primary-bg-subtle: #d0d1d7;
    --bs-primary-border-subtle: #a1a1b0;

    /* --- Bootstrap utility overrides for navy --- */
    .bg-primary,
    .table-primary,
    .border-primary,
    .btn-primary,
    .badge-primary,
    .text-primary,
    .card-header.bg-primary,
    .card.border-primary,
    .alert-primary,
    .panel-icon.bg-primary-subtle,
    .panel-icon.text-primary {
        background-color: #161d39 !important;
        color: #fff !important;
        border-color: #a1a1b0 !important;
    }
    .table-primary {
        background-color: #d0d1d7 !important;
        color: #161d39 !important;
    }
    .border-primary {
        border-color: #161d39 !important;
    }
    .btn-primary {
        background-color: #161d39 !important;
        border-color: #161d39 !important;
        color: #fff !important;
    }
    .btn-primary:hover,
    .btn-primary:active {
        background-color: #131a32 !important;
        border-color: #12182f !important;
    }
    .btn-outline-primary {
        border-color: #161d39 !important;
        color: #161d39 !important;
    }
    .btn-outline-primary:hover {
        background-color: #161d39 !important;
        color: #fff !important;
    }
    /* --- Brand green success --- */
    --bs-success: #3F8734;
    --bs-success-rgb: 63, 135, 52;
    --bs-success-text-emphasis: #1e4319;
    --bs-success-bg-subtle: #e4f2e2;
    --bs-success-border-subtle: #b7d9b2;
}

.btn-success {
    --bs-btn-bg: #3F8734;
    --bs-btn-border-color: #3F8734;
    --bs-btn-hover-bg: #346e2a;
    --bs-btn-hover-border-color: #2e6025;
    --bs-btn-active-bg: #2e6025;
    --bs-btn-active-border-color: #29551f;
    --bs-btn-disabled-bg: #3F8734;
    --bs-btn-disabled-border-color: #3F8734;
}

.btn-outline-success {
    --bs-btn-color: #3F8734;
    --bs-btn-border-color: #3F8734;
    --bs-btn-hover-bg: #3F8734;
    --bs-btn-hover-border-color: #3F8734;
    --bs-btn-active-bg: #3F8734;
    --bs-btn-active-border-color: #3F8734;
}

a, .btn-link {
    color: #161d39;
}

.btn-primary {
    --bs-btn-bg: #161d39;
    --bs-btn-border-color: #161d39;
    --bs-btn-hover-bg: #131a32;
    --bs-btn-hover-border-color: #12182f;
    --bs-btn-active-bg: #12182f;
    --bs-btn-active-border-color: #0e1326;
    --bs-btn-disabled-bg: #161d39;
    --bs-btn-disabled-border-color: #161d39;
    color: #fff;
}

.btn-outline-primary {
    --bs-btn-color: #161d39;
    --bs-btn-border-color: #161d39;
    --bs-btn-hover-bg: #161d39;
    --bs-btn-hover-border-color: #161d39;
    --bs-btn-active-bg: #161d39;
    --bs-btn-active-border-color: #161d39;
}

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

h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIg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0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}


/* ------------------------------------------------------------
   Global overlays: reconnect + error
   These live once at the root to ensure availability for all layouts.
   Reconnect (z:11000) sits beneath error overlay (z:12000) when both trigger.
------------------------------------------------------------- */
#components-reconnect-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11000;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 28px 28px 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
    min-width: 300px;
    max-width: 440px;
    width: 340px;
    text-align: center;
    display: none;
    margin: 0;
}

/* Base: all child panels hidden */
#components-reconnect-modal .reconnecting,
#components-reconnect-modal .reconnected,
#components-reconnect-modal .failed,
#components-reconnect-modal .rejected {
    display: none;
    padding: 4px 24px 4px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Reconnecting (Blazor is actively retrying) ── */
#components-reconnect-modal.components-reconnect-show {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#components-reconnect-modal.components-reconnect-show .reconnecting { display: block; }

/* ── Briefly shown when Blazor reconnects ── */
#components-reconnect-modal.components-reconnect-show.components-reconnect-reconnected .reconnecting { display: none; }
#components-reconnect-modal.components-reconnect-show.components-reconnect-reconnected .reconnected { display: block; }

/* ── Failed: all retries exhausted ── */
#components-reconnect-modal.components-reconnect-show.components-reconnect-failed .reconnecting,
#components-reconnect-modal.components-reconnect-show.components-reconnect-failed .reconnected { display: none; }
#components-reconnect-modal.components-reconnect-show.components-reconnect-failed .failed { display: block; }

/* ── Rejected: server restarted / stale circuit ──
   Must beat all the .show.failed rules above when rejected is also present.
   Cover every combo Blazor might apply (with or without show/failed). */
#components-reconnect-modal.components-reconnect-rejected,
#components-reconnect-modal.components-reconnect-show.components-reconnect-rejected,
#components-reconnect-modal.components-reconnect-show.components-reconnect-failed.components-reconnect-rejected {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#components-reconnect-modal.components-reconnect-rejected .reconnecting,
#components-reconnect-modal.components-reconnect-rejected .reconnected,
#components-reconnect-modal.components-reconnect-rejected .failed,
#components-reconnect-modal.components-reconnect-show.components-reconnect-rejected .reconnecting,
#components-reconnect-modal.components-reconnect-show.components-reconnect-rejected .reconnected,
#components-reconnect-modal.components-reconnect-show.components-reconnect-rejected .failed,
#components-reconnect-modal.components-reconnect-show.components-reconnect-failed.components-reconnect-rejected .reconnecting,
#components-reconnect-modal.components-reconnect-show.components-reconnect-failed.components-reconnect-rejected .reconnected,
#components-reconnect-modal.components-reconnect-show.components-reconnect-failed.components-reconnect-rejected .failed { display: none !important; }
#components-reconnect-modal.components-reconnect-rejected .rejected,
#components-reconnect-modal.components-reconnect-show.components-reconnect-rejected .rejected,
#components-reconnect-modal.components-reconnect-show.components-reconnect-failed.components-reconnect-rejected .rejected { display: block !important; }

#blazor-error-ui {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 12000;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    min-width: 340px;
    max-width: 520px;
    width: auto;
    display: none;
}

#blazor-error-ui.show {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

#blazor-error-ui .blazor-error-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.05rem;
    color: #dc3545;
}

#blazor-error-ui .blazor-error-body {
    line-height: 1.5;
    font-size: 0.9rem;
    color: #6c757d;
}

#blazor-error-ui .blazor-error-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

#blazor-error-ui .blazor-error-actions .btn {
    flex: 0 0 auto;
    min-width: 95px;
    white-space: nowrap;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    text-decoration: none;
}

/* Save notification (centered modal-like panel) */
.save-notification {
    position: fixed;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.save-notification-box {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    min-width: 320px;
    max-width: 90vw;
    border: 1px solid rgba(0,0,0,0.08);
}

.save-notification-body {
    font-weight: 600;
    color: #161d39;
    text-align: center;
}

.save-notification .btn-close {
    border: none;
    background: transparent;
}

/* ============================================================
   Hide Scrollbars (keep scroll functionality)
   Only hide sidebar-body scrollbar, allow page-level scrollbar
   ============================================================ */
.sidebar-body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.sidebar-body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* ============================================================
   Testing Environment Watermark
   Applies to all layouts when testing-environment class is present
   ============================================================ */
.testing-environment::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/test-environ-background.png');
    background-repeat: repeat;
    background-position: center;
    background-size: 300px 300px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 9999;
}
