html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ==========================================
   TOP NAVIGATION - HORIZONTAL LAYOUT
   ========================================== */

.portal-top-nav {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 20px;
    box-sizing: border-box;
}

/* Authenticated users */
.portal-authenticated-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 24px;
    width: 100%;
    min-height: 55px;
}

/* Brand */
.portal-top-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    color: #283593;
}

/* Navigation links */
.portal-authenticated-nav .portal-nav-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    width: auto;
    flex-shrink: 0;
}

/* Admin dropdown menus */
.portal-admin-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Account and logout */
.portal-top-account {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.portal-user-name {
    font-weight: 500;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Public navigation */
.portal-anonymous-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 55px;
    gap: 20px;
}

    .portal-anonymous-nav .portal-nav-link {
        display: inline-flex;
        align-items: center;
        width: auto;
        white-space: nowrap;
    }

/* Prevent navigation labels from wrapping */
.portal-top-nav .mud-nav-link-text {
    white-space: nowrap;
}

/* Small screens: allow horizontal scrolling */
@media (max-width: 1100px) {

    .portal-top-nav {
        overflow-x: auto;
    }

    .portal-authenticated-nav {
        min-width: max-content;
    }

    .portal-anonymous-nav {
        min-width: max-content;
    }
}


/* =========================================
   TOP NAVIGATION LAYOUT
   ========================================= */

.portal-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.portal-top-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
}

.portal-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 24px;
    width: 100%;
    min-height: 70px;
}

.portal-top-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1e3a8a;
    white-space: nowrap;
}

.portal-top-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.portal-top-account {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}


.portal-anonymous-nav {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
}


.portal-main-content {
    flex: 1;
    width: 100%;
    min-width: 0;
}

    .portal-main-content .content {
        width: 100%;
        max-width: none;
    }

/* Override old Blazor sidebar layout */
.portal-layout .content {
    padding-top: 16px;
}

.portal-anonymous-nav {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    width: 100%;
}


/* Responsive layout */
@media (max-width: 900px) {

    .portal-top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .portal-top-links {
        justify-content: center;
    }

    .portal-top-account {
        justify-content: flex-end;
        margin-left: 0;
    }

    .portal-top-brand {
        justify-content: center;
    }
}


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;
}

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,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;
}



/* ==========================================
   CUSTOMERS PORTAL - ACTIVE SIDEBAR LINKS
   Global styles for MudBlazor navigation
   ========================================== */

/* Active navigation link */

.portal-sidebar a.mud-nav-link.mud-nav-link-active,
.portal-sidebar a.mud-nav-link.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-radius: 9px !important;
    font-weight: 600 !important;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

    /* Active icon */

    .portal-sidebar a.mud-nav-link.mud-nav-link-active .mud-nav-link-icon,
    .portal-sidebar a.mud-nav-link.active .mud-nav-link-icon {
        color: #ffffff !important;
    }

    /* Active text */

    .portal-sidebar a.mud-nav-link.mud-nav-link-active .mud-nav-link-text,
    .portal-sidebar a.mud-nav-link.active .mud-nav-link-text {
        color: #ffffff !important;
    }

/* Hover effect for inactive links */

.portal-sidebar a.mud-nav-link:not(.mud-nav-link-active):not(.active):hover {
    background-color: rgba(255, 255, 255, 0.10) !important;
    color: #ffffff !important;
}


/* ==========================================
   COLLAPSIBLE SIDEBAR NAVIGATION GROUPS
   ========================================== */

/* Group heading */
.portal-sidebar .portal-nav-group > .mud-nav-link {
    margin: 12px 0 5px;
    padding: 12px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 700;
}

    /* Hover effect */
    .portal-sidebar .portal-nav-group > .mud-nav-link:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
    }

    /* Group heading icon */
    .portal-sidebar .portal-nav-group > .mud-nav-link .mud-nav-link-icon {
        color: #93c5fd;
    }

/* Nested navigation items */
.portal-sidebar .portal-nav-group .portal-nav-link {
    margin: 3px 0 3px 12px;
    border-radius: 9px;
    font-size: 13px;
}

/* Preserve active link appearance */
.portal-sidebar .portal-nav-group a.mud-nav-link.mud-nav-link-active {
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 600;
}

    /* Active icon */
    .portal-sidebar .portal-nav-group
    a.mud-nav-link.mud-nav-link-active .mud-nav-link-icon {
        color: #ffffff !important;
    }

/* Expansion arrow */
.portal-sidebar .portal-nav-group .mud-expand-panel-icon,
.portal-sidebar .portal-nav-group .mud-nav-group-icon {
    color: #a9bdd7;
}

/* Smaller screens */
@media (max-width: 768px) {
    .portal-sidebar .portal-nav-group > .mud-nav-link {
        font-size: 12px;
    }
}


/* ==========================================
   Customers RTL Dropdown Alignment
   Step 12.28.B2
   ========================================== */

/* Selected values */
.customers-rtl .mud-select-input,
.customers-rtl .mud-input-slot {
    text-align: right !important;
}

/* Dropdown input containers */
.customers-rtl .mud-select .mud-input-root {
    direction: rtl;
    text-align: right !important;
}

/* Dropdown menu items rendered in popovers */
.mud-popover .mud-list-item-text {
    text-align: right !important;
    width: 100%;
}

/* Arabic dropdown values */
.mud-popover .mud-list-item {
    direction: rtl;
    text-align: right;
}

/* =========================================
   Customers RTL Select Controls
   Step 12.28.B4
   ========================================= */

/* Keep selected text aligned to the right */
.customers-rtl .mud-select .mud-input-slot {
    text-align: right !important;
}

/* Position the select arrow on the right */
.customers-rtl .mud-select .mud-input-adornment {
    position: absolute !important;
    right: 8px !important;
    left: auto !important;
}

/* Reserve space for the arrow */
.customers-rtl .mud-select .mud-input-root {
    position: relative;
    padding-right: 36px !important;
}

/* Keep dropdown options aligned to the right */
.mud-popover .mud-list-item-text {
    text-align: right !important;
    width: 100%;
}

/* =========================================
   RTL SIDEBAR - ICON ALIGNMENT
   ========================================= */

.sidebar-rtl .mud-nav-link {
    display: flex !important;
    flex-direction: row !important;
    direction: rtl !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: right !important;
}

    /* Navigation icons on the far right */
    .sidebar-rtl .mud-nav-link .mud-nav-link-icon {
        order: 0 !important;
        margin-right: 0 !important;
        margin-left: 12px !important;
        flex-shrink: 0;
    }

    /* Navigation text follows the icon */
    .sidebar-rtl .mud-nav-link .mud-nav-link-text {
        order: 1 !important;
        text-align: right !important;
        flex-grow: 1;
    }

/* Navigation group headers */
.sidebar-rtl .mud-nav-group .mud-nav-link {
    direction: rtl !important;
}

/* Group expand/collapse arrow */
.sidebar-rtl .mud-nav-group .mud-nav-group-header {
    direction: rtl !important;
    text-align: right !important;
}

/* ==========================================
   CUSTOMERS PAGE - 80% CENTERED
   ========================================== */

.customers-page-container {
    width: 90%;
    max-width: none;
    margin-inline: auto;
    box-sizing: border-box;
}

    /* Prevent the inner MudContainer from
   restricting the available width. */
    .customers-page-container > .mud-container {
        width: 100%;
        max-width: none !important;
    }

/* Tablet */
@media (max-width: 960px) {
    .customers-page-container {
        width: 95%;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .customers-page-container {
        width: 100%;
        padding-inline: 12px;
    }
}

/* ==========================================
   CUSTOMERS PAGE - BACKGROUND DESIGN
   ========================================== */

.customers-page-container {
    background-color: #EFF6FF;
    border: 1px solid #DBEAFE;
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 18px rgba(30, 64, 175, 0.06);
}

    /* Keep the main content area transparent
   so the blue background remains visible */
    .customers-page-container > .mud-container > .mud-paper {
        background-color: transparent !important;
        box-shadow: none !important;
    }

    /* Keep customer cards white */
    .customers-page-container .mud-card {
        background-color: #FFFFFF;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    }

/* Mobile adjustments */
@media (max-width: 600px) {
    .customers-page-container {
        padding: 12px;
        border-radius: 10px;
    }
}

/* ==========================================
   CUSTOMERS PAGE - SEARCH BOX WIDTH
   ========================================== */

.customers-page-container .customers-search-box {
    width: 320px !important;
    min-width: 320px;
    max-width: 100%;
    flex-shrink: 0;
}

/* Responsive layout */
@media (max-width: 768px) {
    .customers-page-container .customers-search-box {
        width: 100% !important;
        min-width: 0;
    }
}

/* ==========================================
   CUSTOMERS PAGE - FILTER ALIGNMENT
   ========================================== */

.customers-page-container .customers-filters-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

    /* Align all filter controls */
    .customers-page-container .customers-filters-row .mud-input-control {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

/* Optional vertical adjustment */
.customers-page-container .customers-filter-item {
    position: relative;
    top: 0px;
    /* Customers filter layout */

    .customers-page-container .customers-filters-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    .customers-page-container .customers-filter-item {
        flex: 1 1 180px;
        min-width: 160px;
        max-width: 320px;
    }
    /* Search box can be wider */
    .customers-page-container .customers-search-box {
        flex: 2 1 280px;
        width: 100%;
        min-width: 240px;
        max-width: 400px;
    }
    /* Prevent Status from stretching */
    .customers-page-container .customers-status-filter {
        flex: 1 1 180px;
        min-width: 160px;
        max-width: 220px;
    }
}

/* ==========================================
   CUSTOMERS PAGE - FILTER LAYOUT
   ========================================== */

.customers-page-container .customers-filters-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(150px, 1fr)) minmax(140px, 0.8fr);
    gap: 14px;
    align-items: start;
    width: 100%;
}

    .customers-page-container .customers-filters-row > div {
        min-width: 0;
    }

    .customers-page-container .customers-filters-row .mud-input-control {
        width: 100%;
        margin: 0;
    }

/* Medium screens */
@media (max-width: 1200px) {
    .customers-page-container .customers-filters-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customers-page-container .customers-search-filter {
        grid-column: 1 / -1;
    }
}

/* Small screens */
@media (max-width: 600px) {
    .customers-page-container .customers-filters-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .customers-page-container .customers-search-filter {
        grid-column: auto;
    }
}

.customers-page-container {
    padding: 16px 24px;
    margin-top: 10px;
}

/* =========================================
   ANONYMOUS TOP NAVIGATION - HORIZONTAL
   ========================================= */

.portal-anonymous-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 24px;
    width: 100%;
}

    /* Override MudBlazor navigation link styling */
    .portal-anonymous-nav .mud-nav-link {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        white-space: nowrap;
        padding: 8px 12px !important;
    }

    /* Keep icon and text on the same line */
    .portal-anonymous-nav .mud-nav-link-text {
        white-space: nowrap;
    }

    /* Remove inherited vertical sidebar styling */
    .portal-anonymous-nav .portal-nav-link {
        margin: 0 !important;
        min-height: auto !important;
    }

/* ==========================================
   CUSTOMER EMAIL RESULTS - DARK THEME
   ========================================== */

.customer-email-results {
    background-color: #20242b !important;
    color: #ffffff !important;
    border: 1px solid #454b55;
    border-radius: 10px;
}

    .customer-email-results .mud-typography {
        color: #ffffff;
    }

    .customer-email-results .mud-divider {
        border-color: #505763;
    }

    /* Keep the result counters color-coded */

    .customer-email-results .mud-success-text {
        color: #4ade80 !important;
    }

    .customer-email-results .mud-error-text {
        color: #fb7185 !important;
    }

    .customer-email-results .mud-warning-text {
        color: #fbbf24 !important;
    }

/* Customers page action buttons */

.customers-action-buttons {
    gap: 16px !important;
    margin-top: 8px;
    margin-bottom: 8px;
}

    .customers-action-buttons .mud-button-root {
        border-radius: 6px;
        padding: 8px 16px;
        min-height: 40px;
        white-space: nowrap;
    }
