html, body {
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
}

/* pre-Blazor splash */
.crm-splash {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #5b6472;
    font-size: 14px;
    background: #eef1f8;
}

.crm-splash-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0b1f3a, #1c3a66);
}

/* sign-in gate */
.crm-gate {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--mud-palette-background);
}

.crm-brand-gradient {
    background: linear-gradient(120deg, #0b1f3a, #1c3a66);
}

.crm-appbar {
    background: linear-gradient(120deg, #0b1f3a, #1c3a66) !important;
}

/* ---------------------------------------------------------------------------
   App bar navigation
   Five grouped items instead of ten flat ones. nowrap + fixed padding keeps the
   row even — the old bar wrapped "Follow-ups" and knocked every gap out of step.
   --------------------------------------------------------------------------- */
.crm-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 24px;
    min-width: 0;
}

/* Flat links are MudButtons; groups are MudMenus that render their own button as a direct
   child. Both are styled identically so the row reads as one set of five. */
.crm-nav .crm-nav-btn,
.crm-nav .crm-nav-menu > .mud-button-root {
    color: #fff;
    text-transform: none;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    min-width: 0;
    border-radius: 8px;
    opacity: .86;
    transition: background-color .15s ease, opacity .15s ease;
}

    .crm-nav .crm-nav-btn:hover,
    .crm-nav .crm-nav-menu > .mud-button-root:hover {
        opacity: 1;
        background: rgba(255, 255, 255, .14);
    }

    /* Active reads clearly against the navy bar in both light and dark. A group lights up
       whenever any of its children is the current route. */
    .crm-nav .crm-nav-btn.crm-nav-on,
    .crm-nav .crm-nav-menu-on > .mud-button-root {
        opacity: 1;
        background: rgba(255, 255, 255, .22);
        box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .95);
    }

.crm-nav .mud-icon-root {
    color: #fff;
}

/* MudMenu wraps its button in a div; keep that div from breaking the flex row. */
.crm-nav .mud-menu {
    display: inline-flex;
}

/* The overdue badge must not clip inside the app bar row. */
.crm-nav-badge {
    display: inline-flex;
}

/* Active child inside a nav / env / account menu. Tokens so dark mode follows the theme. */
.crm-menu-on {
    background: var(--mud-palette-action-default-hover);
    font-weight: 700;
}

/* These are ListClass values (the popover list), NOT the menu root — the root class is
   crm-nav-menu / crm-env / crm-account and must keep its natural button width. */
.crm-menu-list,
.crm-env-menu,
.crm-account-menu {
    min-width: 200px;
}

.crm-account-menu {
    max-width: 280px;
}

/* Brand lockup: drops the word mark before it can squeeze the nav. */
.crm-brand {
    white-space: nowrap;
}

@media (max-width: 1279px) {
    .crm-brand-name {
        display: none;
    }
}

/* ---------------------------------------------------------------------------
   Environment switch
   Prod is quiet. Dev is loud on purpose: acting on the wrong data set is the
   expensive mistake, so it gets an amber chip plus a striped strip under the bar.
   --------------------------------------------------------------------------- */
.crm-env > .mud-button-root {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 3px 6px 3px 10px;
    min-width: 0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: none;
}

.crm-env-prod > .mud-button-root {
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .38);
}

    .crm-env-prod > .mud-button-root:hover {
        background: rgba(255, 255, 255, .24);
    }

.crm-env-dev > .mud-button-root {
    color: #3d2a00;
    background: #fbbf24;
    border: 1px solid #f59e0b;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, .30);
}

    .crm-env-dev > .mud-button-root:hover {
        background: #fcd34d;
    }

.crm-env .mud-icon-root {
    color: inherit;
}

/* Account avatar: MudMenu's own button, painted as a circle (Google picture when we have one,
   otherwise the signed-in initial). */
.crm-account > .mud-button-root {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-transform: none;
}

    .crm-account > .mud-button-root:hover {
        background: rgba(255, 255, 255, .34);
    }

.crm-account-pic > .mud-button-root {
    background-image: var(--crm-avatar);
    background-size: cover;
    background-position: center;
    color: transparent;
}

.crm-env-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    pointer-events: none;
    background: repeating-linear-gradient(45deg, #f59e0b 0 10px, #b45309 10px 20px);
}

#blazor-error-ui {
    background: #ffeded;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
}

/* Email previews: MudBlazor zeroes paragraph and list margins, which ran every paragraph together. */
.email-preview p { margin: 0 0 12px; }
.email-preview ul, .email-preview ol { margin: 0 0 12px; padding-left: 22px; }
.email-preview li { margin: 0 0 6px; }

/* ---- Leffel Consulting brand: navy bar with a gold rule ---- */
.crm-appbar { border-bottom: 3px solid #c9a227; }
.crm-nav .crm-nav-btn.crm-nav-on,
.crm-nav .crm-nav-menu-on > .mud-button-root { box-shadow: inset 0 -2px 0 #c9a227; }
.crm-gold { color: #c9a227 !important; }
.crm-tile { border-radius: 12px; border-top: 3px solid #c9a227; }
.email-frame { width: 100%; min-height: 420px; border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; background: #fff; }
