﻿/* ----------------------------------------------------
   Icons
---------------------------------------------------- */
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ----------------------------------------------------
   Base / Tokens
---------------------------------------------------- */
:root {
    /* colors */
    --bg: #fff;
    --text: #0b1220;
    --muted: #6b7280;
    --border: #e8eef6;
    --primary-50: #eaf2fb;
    --primary-600: #0b3d91;
    --success-600: #0f6b41;
    --warning-700: #7a5400;
    /* brand (marketing match) */
    --em-blue-50: #f4fbff;
    --em-blue-600: #059ec6;
    --em-navy: #0d4161;
    --em-orange: #f37021;
    /* components */
    --card-bg: #fff;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-md: 0 6px 18px rgba(13,65,97,.06),0 2px 6px rgba(13,65,97,.04);
    /* layout */
    --container: 1380px;
    --gap: clamp(12px,1.5vw,18px);
    --pad: clamp(10px,1.2vw,14px);
}

html, body {
    height: 100%;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Lower z-index on header elements when a modal is open to prevent stacking context issues */
body.modal-open .em-profile,
body.modal-open .pm,
body.modal-open .pm-panel,
body.modal-open .account-dropdown-wrapper {
    z-index: auto;
}

a {
    color: var(--em-blue-600);
    text-decoration: none;
}

    a:hover {
        color: #11b0d7;
        text-decoration: underline;
    }

.muted {
    opacity: .7;
    font-size: .9rem
}

:focus-visible {
    outline: 3px solid rgba(11,61,145,.35);
    outline-offset: 2px;
    border-radius: 8px
}

/* validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050
}

.invalid {
    outline: 1px solid #e11d48
}

.validation-message {
    color: #e11d48
}

/* DevExpress container fix */
.dxbl-app, .dxbl-app-content {
    height: auto !important;
    overflow: visible !important
}

/* blazor error */
#blazor-error-ui {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    padding: .6rem 1.25rem .7rem;
    background: #fff7d6;
    box-shadow: 0 -1px 2px rgba(0,0,0,.12)
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: .75rem;
        top: .5rem
    }

/* ----------------------------------------------------
   App Shell
---------------------------------------------------- */
.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column
}

.app-main {
    flex: 1 0 auto
}

.em-footer {
    flex-shrink: 0
}

.container-xxl {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px
}

/* ----------------------------------------------------
   Header
---------------------------------------------------- */
.em-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 6px 18px rgba(13,65,97,.05),0 2px 6px rgba(13,65,97,.04);
}

/* Navigation */
.em-nav {
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

.em-nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
}

.em-nav-spacer {
    flex: 1;
}

.em-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.em-nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.em-nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.em-nav-link .oi {
    font-size: 1.125rem;
}

@media (max-width: 600px) {
    .em-nav-link span:not(.oi) {
        display: none;
    }

    .em-nav-link {
        padding: 0.75rem 1rem;
    }
}

.em-header-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    align-items: center;
    gap: 1rem;
    grid-template-columns: minmax(0,1fr) auto auto; /* brand | sponsors | profile */
    padding: .75rem 1rem;
    overflow: hidden;
}

.em-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: inherit
}

.em-brand-logo {
    width: 180px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain
}

/* Header sponsor lockup (bigger) */
.em-sponsor-lockup {
    height: 64px; /* up from 48 */
    max-width: 48vw;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Profile button tweaks */
.em-profile {
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 9999;
}

.em-profile-btn.dxbl-btn {
    border-radius: 999px
}

    .em-profile-btn.dxbl-btn.dxbl-btn-mode-contained.dxbl-btn-dark {
        background: var(--em-blue-600);
        border-color: var(--em-blue-600);
    }

    .em-profile-btn.dxbl-btn.dxbl-btn-mode-contained.dxbl-btn-light {
        color: var(--em-navy);
    }

/* ----------------------------------------------------
   Cards / Dashboard
---------------------------------------------------- */
.dashboard {
    padding: 18px 0 28px
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12,minmax(0,1fr));
    gap: var(--gap)
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: box-shadow .18s ease,transform .18s ease,border-color .18s ease;
}

    .card:hover {
        box-shadow: 0 10px 22px rgba(10,22,70,.09),0 3px 8px rgba(10,22,70,.06);
        transform: translateY(-1px)
    }

.card-header {
    padding: 12px var(--pad);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--em-navy);
    background: linear-gradient(180deg,var(--em-blue-50),#fff);
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 12px var(--pad) 16px
}

.dashboard-chart {
    height: clamp(260px,38vh,360px)
}

/* spans */
.span-12 {
    grid-column: span 12
}

.span-8 {
    grid-column: span 8
}

.span-6 {
    grid-column: span 6
}

.span-4 {
    grid-column: span 4
}

/* Utility tiles */
.util-grid.modern {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px
}

.util-card {
    background: #fbfeff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(15,23,42,.03);
}

.util-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem
}

.util-name {
    font-weight: 700;
    color: var(--em-navy)
}

.util-tag {
    font-size: .78rem;
    color: #0f3e8d;
    background: #eef4ff;
    border: 1px solid #d8e6ff;
    padding: .1rem .45rem;
    border-radius: 999px;
    white-space: nowrap
}

.util-actions {
    display: flex;
    gap: 10px;
    margin-top: .6rem
}

.btn-link {
    text-decoration: none;
    padding: .25rem 0;
    color: #0f3e8d;
    border-bottom: 1px dashed #b8cdf8
}

    .btn-link:hover {
        color: #0a2b65;
        border-bottom-style: solid
    }

/* ----------------------------------------------------
   Account Summary
---------------------------------------------------- */
.account-summary-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-value.text-danger {
    color: #dc3545;
}

.summary-value.text-success {
    color: #198754;
}

.summary-value.text-info {
    color: #0dcaf0;
}

.unapplied-payments-detail {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.unapplied-payments-detail .detail-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-right: 0.5rem;
}

.unapplied-payment-item {
    font-size: 0.85rem;
    background: #e0f7fa;
    color: #006064;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* ----------------------------------------------------
   Invoices / Payments
---------------------------------------------------- */
.invoices .invoice-row {
    display: grid;
    grid-template-columns: 1fr 85px 85px 85px 150px;
    gap: 0.5rem;
    align-items: start;
    padding: .85rem 1rem;
    margin-bottom: .6rem;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;
    background: #fbfdff;
    transition: box-shadow .18s ease,transform .18s ease;
}

    .invoices .invoice-row:hover {
        box-shadow: 0 8px 24px rgba(15,23,42,.06);
        transform: translateY(-1px)
    }

.inv-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.inv-num-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inv-main .inv-num {
    font-weight: 600;
}

.inv-main .inv-dates {
    font-size: .85rem;
    opacity: .7;
}

.inv-total, .inv-balance, .inv-applied {
    text-align: right;
}

.inv-total .label,
.inv-applied .label,
.inv-balance .label {
    display: block;
    font-size: .72rem;
    color: #6c757d;
    margin-bottom: 0.1rem;
}

.inv-applied {
    color: #036a83;
}

.inv-payments-applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 0.3rem;
}

.inv-payments-applied .label {
    font-weight: 500;
    color: #495057;
    font-size: 0.75rem;
}

.applied-payment {
    background: #e8f7fb;
    color: #036a83;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    font-size: 0.72rem;
}

.applied-payment.partial {
    background: #fff3e7;
    color: #8a3b00;
}

.inv-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .4rem;
    align-self: center;
}

/* Selected invoice checkmark (Make Payment page) */
.invoice-selected-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0f6b41;
    color: #fff;
    font-size: 0.8rem;
}

/* When inv-actions only contains the checkmark, center it */
.inv-actions:has(.invoice-selected-check):not(:has(.badge)) {
    justify-content: center;
}

.badge {
    padding: .25rem .55rem;
    border-radius: 999px;
    font-size: .75rem
}

.badge-open {
    background: #fff3e7;
    color: #8a3b00;
    border: 1px solid #ffd9b3
}

.badge-partial {
    background: #e8f7fb;
    color: #036a83;
    border: 1px solid #bfe8f2
}

.badge-paid {
    background: #e9faf2;
    color: #0f6b41;
    border: 1px solid #c7efd9
}

.payments .payment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem .25rem;
    border-bottom: 1px dashed rgba(0,0,0,.08)
}

    .payments .payment-row:last-child {
        border-bottom: none
    }

/* Upload row */
.upload-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap
}

    .upload-row input[type="file"] {
        max-width: 100%
    }

    .upload-row .dxbl-btn {
        margin-left: 0;
        float: none !important;
        position: static !important
    }

/* ----------------------------------------------------
   Footer
---------------------------------------------------- */
.em-footer {
    background: #1f3a40;
    color: #e6eff2
}

    .em-footer a {
        color: #cfe7ff;
        text-decoration: underline
    }

    .em-footer .sep {
        opacity: .5;
        margin: 0 .5rem
    }

.em-footer-top, .em-footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem 1rem
}

.em-footer-top {
    display: grid;
    align-items: center;
    gap: 2rem;
    grid-template-columns: 1fr auto;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.em-foot-company {
    font-size: 1.5rem;
    font-weight: 700
}

.em-foot-city {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: .25rem
}

.em-foot-address {
    font-style: normal;
    line-height: 1.6;
    font-size: 1.05rem;
    margin-top: .25rem
}

.em-footer-bottom {
    padding-top: 1rem;
    padding-bottom: 1.25rem
}

.em-foot-meta {
    font-size: .95rem;
    opacity: .95;
    margin-bottom: .75rem
}

.em-foot-fineprint {
    font-size: .9rem;
    line-height: 1.35;
    opacity: .85
}

/* Bigger footer sponsor lockup + white caption */
.em-sponsor-lockup--footer {
    height: 104px; /* bigger footer logo */
    max-width: none; /* no 50vw cap */
    width: auto;
    object-fit: contain;
    display: block;
}

.em-footer .em-sponsor-caption {
    color: #fff;
    opacity: .95
}

/* ----------------------------------------------------
   Responsive
---------------------------------------------------- */
@media (max-width:1200px) {
    .dashboard-grid {
        gap: 14px
    }

    .em-sponsor-lockup {
        height: 56px
    }

    .em-sponsor-lockup--footer {
        height: 96px
    }
}

@media (max-width:1100px) {
    .span-8, .span-4 {
        grid-column: span 12
    }
}

@media (max-width:992px) {
    .em-header-inner {
        grid-template-columns: 1fr auto;
        row-gap: .5rem
    }

    .em-sponsor-lockup {
        order: 3;
        grid-column: 1/-1;
        justify-self: center;
        height: 50px;
        max-width: 70vw
    }

    .em-footer-top {
        grid-template-columns: 1fr;
        row-gap: 1.25rem
    }

    .em-sponsor-lockup--footer {
        height: 84px;
        justify-self: center
    }

    .invoices .invoice-row {
        grid-template-columns: 1fr auto;
        align-items: start
    }

    .inv-money {
        order: 3;
        grid-column: 1/-1;
        justify-content: flex-end
    }

    /* Make span-6 cards full width on tablet/mobile */
    .span-6 {
        grid-column: span 12
    }

    /* Reset row-span-2 on mobile since cards stack vertically */
    .dashboard-grid .row-span-2 {
        grid-row: auto
    }

    .dashboard-grid .push-right {
        order: 0
    }
}

@media (max-width:600px) {
    .em-brand-logo {
        width: 150px
    }

    .em-sponsor-lockup {
        height: 46px
    }

    .util-grid.modern {
        grid-template-columns: 1fr
    }

    .dashboard-chart {
        height: 260px
    }

    .inv-total, .inv-balance, .inv-applied {
        min-width: 90px
    }
}

/* ----------------------------------------------------
   Motion preference
---------------------------------------------------- */
@media (prefers-reduced-motion:reduce) {
    * {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important
    }
}

/* Header dropdown fix */
.em-header-inner {
    overflow: visible !important; /* was hidden – caused clipping */
}

/* z-index removed - header is no longer sticky */

/* Make sure DevExpress overlays sit above the header */
.dxbl-dropdown,
.dxbl-overlay,
.dxbl-popup,
.dxbl-overlay-content {
    z-index: 3000 !important;
}

.profile-menu {
    min-width: 220px;
}

/* Ensure the dropdown can escape the header */
.em-header-inner {
    overflow: visible !important;
}

.dxbl-dropdown, .dxbl-overlay, .dxbl-popup, .dxbl-overlay-content {
    z-index: 3000 !important;
}

/* Profile dropdown card */
.profile-card-dd .dxbl-dropdown-content,
.profile-card-dd .dxbl-dd-content { /* both to cover versions */
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15,23,42,.14), 0 2px 8px rgba(15,23,42,.08);
    padding: 0; /* we’ll pad sections individually */
}

/* Header: title + small secondary */
.pm-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.pm-title {
    font-weight: 700;
    line-height: 1.2;
}

.pm-sub {
    font-size: .9rem;
    opacity: .75;
}

/* List items */
.pm-list {
    padding: 6px;
}

.pm-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    padding: 10px 10px;
    border-radius: 10px;
}

    .pm-item:hover {
        background: rgba(0,0,0,.05);
    }

    .pm-item.danger {
        color: #b42318;
    }

.pm-ico {
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* Divider */
.pm-sep {
    height: 1px;
    background: rgba(0,0,0,.08);
    margin: 4px 6px;
}


/* --- Profile menu --- */
.pm {
    position: relative;
    display: inline-block;
    z-index: 9999;
}

.pm-trigger {
    border-radius: 999px;
    padding: .45rem .9rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.pm-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: default;
    z-index: 9998;
}

.pm-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: clamp(260px, 24vw, 360px);
    background: #fff;
    color: #0b1220;
    border: 1px solid var(--border, #e8eef6);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15,23,42,.10);
    overflow: hidden;
    z-index: 9999;
}

.pm-header {
    padding: .9rem 1rem .6rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.pm-title {
    font-weight: 700;
}

.pm-sub {
    font-size: .9rem;
    opacity: .75;
    margin-top: .15rem;
}

.pm-list {
    padding: .35rem;
}

.pm-item {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .65rem;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: inherit;
}

    .pm-item:hover {
        background: rgba(15,23,42,.05);
    }

    .pm-item.danger {
        color: #b42318;
    }

.pm-sep {
    height: 1px;
    margin: .35rem 0;
    background: rgba(0,0,0,.08);
}

.pm-ico {
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* optional: use your existing icon masks if desired */

/* Simple Bar Chart - DevExpress style */
.simple-bar-chart {
    display: flex;
    height: 320px;
    position: relative;
}

.simple-bar-chart .chart-y-axis {
    width: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding-right: 8px;
    padding-top: 0;
    padding-bottom: 24px;
    font-size: 12px;
    color: #767676;
    font-style: italic;
}

.simple-bar-chart .chart-y-axis .y-label {
    line-height: 1;
}

.simple-bar-chart .chart-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.simple-bar-chart .chart-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.simple-bar-chart .chart-grid .grid-line {
    border-bottom: 1px solid #e0e0e0;
    height: 0;
}

.simple-bar-chart .chart-grid .grid-line:first-child {
    border-bottom: none;
}

.simple-bar-chart .chart-bars-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    flex: 1;
    padding-bottom: 0;
    position: relative;
    z-index: 1;
}

.simple-bar-chart .chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
    padding: 0 4px;
}

.simple-bar-chart .chart-bar {
    width: 100%;
    max-width: 60px;
    background: #3366ff;
    min-height: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.simple-bar-chart .chart-bar:hover {
    background: #5588ff;
}

.simple-bar-chart .chart-label {
    margin-top: 6px;
    font-size: 12px;
    color: #767676;
    font-style: italic;
    text-align: center;
    height: 18px;
}


@media (min-width: 992px) {
    .dashboard-grid .push-right {
        grid-column: 7 / span 6; /* columns 7-12 */
    }
}

@media (min-width: 992px) {
    .dashboard-grid .row-span-2 {
        grid-row: span 2;
    }
}

/* ----------------------------------------------------
   Custom Account Dropdown
---------------------------------------------------- */
/* Ensure parent elements don't clip the dropdown */
.card:has(.account-dropdown-wrapper),
.card-header:has(.account-dropdown-wrapper),
section:has(.account-dropdown-wrapper) {
    overflow: visible !important;
}

.account-dropdown-wrapper {
    position: relative;
    display: inline-block;
    z-index: 2000;
}

.account-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    cursor: pointer;
    min-width: 200px;
    font-size: 0.95rem;
}

.account-dropdown-trigger:hover {
    border-color: #adb5bd;
}

.selected-account-name {
    flex: 1;
    text-align: left;
}

.dropdown-chevron {
    font-size: 0.75rem;
    color: #6c757d;
}

.account-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: transparent;
}

.account-dropdown-popup {
    position: fixed;
    top: auto;
    right: auto;
    width: 360px;
    max-height: 480px;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 2600;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.account-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.account-dropdown-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.account-dropdown-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.account-dropdown-close:hover {
    color: #212529;
}

.account-search-container {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    gap: 0.5rem;
}

.search-icon {
    font-size: 0.875rem;
    color: #6c757d;
}

.account-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #212529;
}

.account-search-input::placeholder {
    color: #adb5bd;
}

.account-list {
    flex: 1;
    overflow-y: auto;
    max-height: 340px;
}

.account-list-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    gap: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.account-list-item:hover {
    background-color: #f8f9fa;
}

.account-list-item.selected {
    background-color: #e7f1ff;
}

.account-item-icon {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    flex-shrink: 0;
}

.account-item-details {
    flex: 1;
    min-width: 0;
}

.account-item-name {
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-item-id {
    font-size: 0.8rem;
    color: #6c757d;
}

.account-item-check {
    color: #0d6efd;
    font-size: 1.1rem;
    font-weight: bold;
}

/* ----------------------------------------------------
   Modal Styles (Global)
---------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    overflow-y: auto;
    isolation: isolate;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.modal-icon {
    font-size: 2.5rem;
    color: #3182ce;
    display: block;
    margin-bottom: 0.75rem;
}

.modal-warning-icon {
    font-size: 3rem;
    color: #e53e3e;
    display: block;
    margin-bottom: 0.75rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0 0 1rem 0;
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-warning-text {
    color: #c53030 !important;
    font-size: 0.9rem !important;
    background: #fed7d7;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
}

.modal-actions {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Form styling within modal */
.modal-body .form-label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.25rem;
    display: block;
}

.modal-body .form-control {
    border-radius: 8px;
    width: 100%;
}

/* Custom modal input - doesn't use Bootstrap form-control */
.modal-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal-input:focus {
    background-color: #fff;
    border-color: #3182ce;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.modal-input::placeholder {
    color: #9ca3af;
}

/* DevExpress inputs within modals - subtle off-white background */
/* Target the actual input element inside DevExpress text editors */
.modal-overlay input[type="text"],
.modal-overlay input:not([type]),
.modal-content input[type="text"],
.modal-content input:not([type]),
.modal-body input[type="text"],
.modal-body input:not([type]) {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

.modal-overlay input[type="text"]:focus,
.modal-overlay input:not([type]):focus,
.modal-content input[type="text"]:focus,
.modal-content input:not([type]):focus,
.modal-body input[type="text"]:focus,
.modal-body input:not([type]):focus {
    background-color: #fff !important;
    border-color: #3182ce !important;
    outline: none;
}

/* DevExpress specific: target the wrapper and inner elements */
.modal-overlay .dxbl-text-edit,
.modal-content .dxbl-text-edit,
.modal-body .dxbl-text-edit {
    background-color: #f8fafc !important;
}

.modal-overlay .dxbl-text-edit input,
.modal-content .dxbl-text-edit input,
.modal-body .dxbl-text-edit input {
    background-color: #f8fafc !important;
}

.modal-overlay .dxbl-text-edit:focus-within,
.modal-content .dxbl-text-edit:focus-within,
.modal-body .dxbl-text-edit:focus-within {
    background-color: #fff !important;
}

.modal-overlay .dxbl-text-edit:focus-within input,
.modal-content .dxbl-text-edit:focus-within input,
.modal-body .dxbl-text-edit:focus-within input {
    background-color: #fff !important;
}

/* Alternative: target by DevExpress input wrapper classes */
.modal-overlay .dxbl-input-editor,
.modal-content .dxbl-input-editor,
.modal-body .dxbl-input-editor,
.modal-overlay .dxbl-edit,
.modal-content .dxbl-edit,
.modal-body .dxbl-edit {
    background-color: #f8fafc !important;
}

.modal-overlay .dxbl-input-editor input,
.modal-content .dxbl-input-editor input,
.modal-body .dxbl-input-editor input,
.modal-overlay .dxbl-edit input,
.modal-content .dxbl-edit input,
.modal-body .dxbl-edit input {
    background-color: transparent !important;
}

/* Fallback: target any input element inside modal with highest specificity */
.modal-overlay .modal-content .modal-body input {
    background-color: #f8fafc !important;
}

.modal-overlay .modal-content .modal-body input:focus {
    background-color: #fff !important;
}

/* Alert styling in modal */
.modal-body .alert {
    border-radius: 8px;
    font-size: 0.95rem;
}

.modal-body .alert-info {
    background-color: #ebf8ff;
    border-color: #90cdf4;
    color: #2c5282;
}

.modal-body .alert-danger {
    background-color: #fed7d7;
    border-color: #fc8181;
    color: #c53030;
}

.modal-body .alert-success {
    background-color: #c6f6d5;
    border-color: #68d391;
    color: #276749;
}

/* Modal responsive */
@media (max-width: 576px) {
    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 12px;
        max-height: calc(100vh - 1rem);
    }

    .modal-header {
        padding: 1.25rem 1rem 0.75rem;
    }

    .modal-header h3 {
        font-size: 1.2rem;
    }

    .modal-icon,
    .modal-warning-icon {
        font-size: 2rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-body p {
        font-size: 0.95rem;
    }

    .modal-actions {
        padding: 0.75rem 1rem 1.25rem;
        flex-direction: column;
    }

    .modal-actions button,
    .modal-actions .dx-button {
        width: 100%;
    }

    /* Stack name fields on mobile */
    .modal-body .row .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .modal-content {
        max-width: 90%;
    }
}
