/* My Workers — FC / AODA list patterns */

.mw-page {
    --mw-brand: #033D53;
    --mw-ink: #32434B;
    --mw-strong: #121A1F;
    --mw-soft: #F0F4F8;
    --mw-input: #F4F7FA;
    --mw-sky: #E0F2FE;
    --mw-border: #E2E8F0;
    --mw-hr: #E8ECF1;
    --mw-white: #FFFFFF;
    --mw-press: #022a3a;
}

.mw-page ::deep .app-card,
.mw-page ::deep .card {
    border: 1px solid var(--mw-border) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    background: var(--mw-white) !important;
    overflow: hidden !important;
}

.mw-page ::deep .card > .card-header,
.mw-page ::deep .app-card > .card-header,
.mw-page ::deep .app-card-header {
    display: none !important;
}

/* ---- Toolbar ---- */
.mw-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 0.85rem 0 0.9rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--mw-hr);
}

.mw-toolbar__search {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: min(100%, 16rem);
    flex: 1 1 14rem;
    max-width: 26rem;
}

.mw-toolbar__label {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #32434B;
    letter-spacing: 0;
    white-space: nowrap;
    line-height: 1;
}

.mw-toolbar__search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.mw-toolbar__search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--mw-ink);
    font-size: 0.8125rem;
    pointer-events: none;
}

.mw-toolbar__input {
    width: 100%;
    height: 2.375rem;
    padding: 0 0.85rem 0 2.35rem;
    border: 1.5px solid transparent;
    border-radius: 8px;
    background: var(--mw-input);
    color: var(--mw-brand);
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    box-shadow: none;
}

.mw-toolbar__input::placeholder {
    color: #32434B;
}

.mw-toolbar__input:hover {
    background: var(--mw-sky);
}

.mw-toolbar__input:focus {
    background: var(--mw-white);
    border-color: var(--mw-brand);
}

.mw-filter-chips {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.mw-toolbar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    justify-content: flex-end;
}

.mw-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 2.375rem;
    padding: 0 1rem;
    border-radius: 8px;
    border: 1.5px solid var(--mw-brand);
    background: var(--mw-brand);
    color: var(--mw-white);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
}

.mw-add-btn:hover {
    background: var(--mw-press);
    border-color: var(--mw-press);
}

.mw-add-btn:focus-visible {
    outline: 2px solid var(--mw-brand);
    outline-offset: 2px;
}

.mw-add-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mw-add-btn:disabled:hover {
    background: var(--mw-brand);
    border-color: var(--mw-brand);
}

.mw-add-btn.is-busy {
    gap: 0.45rem;
    opacity: 0.92;
}

.mw-add-btn.is-busy .fa-spinner {
    font-size: 0.8125rem;
}

/* Organization User Management — full-width stack on tablet/phone */
.mw-page.vos-staff-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.mw-page.vos-staff-page ::deep .app-card,
.mw-page.vos-staff-page ::deep .card,
.mw-page.vos-staff-page ::deep .card-body,
.mw-page.vos-staff-page ::deep .app-card > .card-body {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.mw-dev-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.375rem;
    padding: 0 1rem;
    border-radius: 8px;
    border: 1.5px solid #5E0011;
    background: var(--mw-white);
    color: #5E0011;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
    white-space: nowrap;
}

.mw-dev-btn:hover {
    background: #FFF0F2;
}

.mw-dev-btn:focus-visible {
    outline: 2px solid #5E0011;
    outline-offset: 2px;
}

.mw-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.375rem;
    padding: 0 0.95rem;
    border-radius: 8px;
    border: 1.5px solid var(--mw-brand);
    background: var(--mw-white);
    color: var(--mw-brand);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
}

.mw-chip:hover {
    background: var(--mw-sky);
}

.mw-chip:focus-visible {
    outline: 2px solid var(--mw-brand);
    outline-offset: 2px;
}

.mw-chip.is-active {
    background: var(--mw-brand);
    color: var(--mw-white);
    border-color: var(--mw-brand);
}

.mw-chip.is-active:hover {
    background: var(--mw-press);
    border-color: var(--mw-press);
}

/* ---- Empty ---- */
.mw-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 18rem;
    padding: 2.75rem 1.5rem;
    text-align: center;
}

.mw-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    margin-bottom: 1.1rem;
    border-radius: 1rem;
    background: var(--mw-soft);
    border: 1px solid var(--mw-border);
    color: var(--mw-brand);
    font-size: 1.85rem;
}

.mw-add__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    color: var(--mw-muted, #64748b);
    font-size: 0.9375rem;
}

.mw-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 8rem;
    margin: 1.5rem 0;
    color: #033D53;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
}

.mw-loading__icon {
    font-size: 1rem;
    color: #033D53;
}

.mw-empty__title {
    margin: 0 0 0.4rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--mw-strong);
}

.mw-empty__description {
    margin: 0;
    max-width: 26rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--mw-ink);
}

/* ---- List ---- */
.mw-list {
    width: 100%;
    padding: 0.35rem 0 0.25rem;
}

.mw-list__header,
.mw-list__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 0.9fr) minmax(6.5rem, 1.15fr) minmax(5.75rem, 0.85fr);
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 0.5rem;
    border-left: 3px solid transparent;
    border-radius: 6px;
    box-sizing: border-box;
}

.mw-list__header {
    border-bottom: 1px solid var(--mw-hr);
    border-radius: 0;
    margin-bottom: 0.15rem;
}

.mw-list__header .mw-col {
    color: var(--mw-strong);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.mw-col--phone,
.mw-col--amount {
    padding-left: 1rem;
}

.mw-list__row {
    background: var(--mw-white);
    border-bottom: 1px solid var(--mw-hr);
    cursor: pointer;
}

.mw-list__row:hover {
    background: var(--mw-sky);
    border-left-color: var(--mw-brand);
}

.mw-list__row.is-selected,
.mw-list__row:active {
    background: var(--mw-brand);
    border-left-color: var(--mw-brand);
    color: var(--mw-white);
}

.mw-list__row.is-selected .mw-name,
.mw-list__row:active .mw-name,
.mw-list__row.is-selected .mw-col,
.mw-list__row:active .mw-col {
    color: var(--mw-white);
}

.mw-list__row.is-selected .mw-view-btn,
.mw-list__row:active .mw-view-btn,
.mw-list__row.is-selected .mw-action-btn,
.mw-list__row:active .mw-action-btn {
    background: var(--mw-white);
    border-color: var(--mw-white);
    color: var(--mw-brand);
}

.mw-col {
    display: flex;
    align-items: center;
    min-width: 0;
    color: var(--mw-ink);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
}

.mw-name {
    color: var(--mw-strong);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mw-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.mw-col--status {
    overflow: hidden;
}

.mw-col--status .mw-status-pill {
    max-width: 100%;
    height: auto;
    min-height: 1.5rem;
    line-height: 1.3;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    white-space: normal;
}

.mw-col--actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.4rem;
    position: relative;
    z-index: 1;
}

.mw-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    padding: 0 0.75rem;
    border-radius: 6px;
    border: 1.5px solid var(--mw-brand);
    background: var(--mw-white);
    color: var(--mw-brand);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
}

.mw-view-btn:hover {
    background: var(--mw-sky);
}

.mw-view-btn:focus-visible {
    outline: 2px solid var(--mw-brand);
    outline-offset: 2px;
}

.mw-view-btn--wrap {
    height: auto;
    min-height: 1.75rem;
    padding: 0.4rem 0.55rem;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
}

.mw-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    padding: 0 0.65rem;
    border-radius: 6px;
    border: 1.5px solid transparent;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
    background: var(--mw-white);
}

.mw-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mw-action-btn--danger {
    border-color: #5E0011;
    color: #5E0011;
}

.mw-action-btn--danger:hover:not(:disabled) {
    background: #FFF0F2;
}

.mw-action-btn--success {
    border-color: #003D1F;
    color: #003D1F;
}

.mw-action-btn--success:hover:not(:disabled) {
    background: #EAFBF1;
}

.mw-action-btn:focus-visible {
    outline: 2px solid var(--mw-brand);
    outline-offset: 2px;
}

.mw-status-pill {
    display: inline-flex;
    align-items: center;
    height: 1.5rem;
    padding: 0 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5rem;
    white-space: nowrap;
}

.mw-status-pill--active {
    background: #EAFBF1;
    color: #003D1F;
}

.mw-status-pill--inactive {
    background: var(--mw-soft);
    color: var(--mw-ink);
}

.mw-status-pill--approved {
    background: #EAFBF1;
    color: #003D1F;
}

.mw-status-pill--pending {
    background: #F9ECD4;
    color: #35260C;
}

.mw-status-pill--default {
    background: var(--mw-soft);
    color: var(--mw-ink);
}

.mw-list__row.is-selected .mw-status-pill,
.mw-list__row:active .mw-status-pill {
    background: rgba(255, 255, 255, 0.18);
    color: var(--mw-white);
}

/* ---- Pagination (AODA overrides under page) ---- */
.mw-page ::deep .module-list-pagination {
    border-top-color: var(--mw-hr) !important;
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
}

.mw-page ::deep .module-list-pagination__label {
    color: var(--mw-ink) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}

.mw-page ::deep .module-list-pagination__nav,
.mw-page ::deep .module-list-pagination__page {
    min-width: 2rem !important;
    height: 2rem !important;
    border-radius: 6px !important;
    border: 1px solid #D0D5DD !important;
    background: var(--mw-white) !important;
    color: var(--mw-brand) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.mw-page ::deep .module-list-pagination__nav:hover:not(:disabled),
.mw-page ::deep .module-list-pagination__page:hover:not(.is-active) {
    background: var(--mw-sky) !important;
    border-color: var(--mw-brand) !important;
}

.mw-page ::deep .module-list-pagination__page.is-active {
    background: var(--mw-brand) !important;
    border-color: var(--mw-brand) !important;
    color: var(--mw-white) !important;
}

.mw-page ::deep .module-list-pagination__nav:disabled {
    opacity: 0.45 !important;
}

/* ---- Details dialog (scoped fallback; teleported styles in .razor <style>) ---- */
.mw-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem 0.75rem;
}

.mw-dialog__identity {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.mw-dialog__identity-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #32434B;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mw-dialog__hr {
    margin: 0 1.15rem;
    border: 0;
    border-top: 1px solid var(--mw-border);
}

.mw-dialog__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--mw-brand);
    cursor: pointer;
}

.mw-dialog__close:hover,
.mw-dialog__close:focus-visible {
    background: var(--mw-sky);
    color: var(--mw-brand);
    outline: none;
}

.mw-dialog__close:active {
    background: var(--mw-brand);
    color: var(--mw-white);
}

.mw-dialog__btn--secondary:active {
    background: var(--mw-brand);
    color: var(--mw-white);
}

.mw-dialog__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.75rem 0.85rem;
    background: var(--mw-white);
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

@media (max-width: 1023px) {
    .mw-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .mw-toolbar__search {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .mw-toolbar__right {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .mw-filter-chips {
        flex: 1 1 auto;
        flex-wrap: wrap;
    }

    .mw-add-btn {
        width: auto;
        flex-shrink: 0;
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    .mw-page ::deep .card > .card-body,
    .mw-page ::deep .app-card > .card-body {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        box-sizing: border-box !important;
    }

    .mw-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 0.5rem;
        row-gap: 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .mw-toolbar__search {
        grid-column: 1 / -1;
        grid-row: 1;
        width: auto;
        max-width: none;
        min-width: 0;
    }

    .mw-toolbar:has(.mw-add-btn) .mw-toolbar__search {
        grid-column: 1;
    }

    .mw-toolbar__right {
        display: contents;
    }

    .mw-filter-chips {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }

    .mw-add-btn {
        grid-column: 2;
        grid-row: 1;
        width: auto;
        max-width: none;
        min-width: 0;
        justify-self: end;
        padding: 0 0.75rem;
        white-space: nowrap;
    }

    .mw-dev-btn {
        grid-column: 1 / -1;
        grid-row: 3;
        width: auto;
        max-width: 100%;
        min-width: 0;
        height: auto;
        min-height: 2.375rem;
        justify-self: start;
        white-space: normal;
        text-align: center;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 1023px) {
    .mw-list {
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
        padding-top: 0.25rem;
    }

    .mw-list__header {
        display: none;
    }

    .mw-list__row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "name amount"
            "email email"
            "phone phone"
            "type type"
            "fc fc"
            "status status"
            "actions actions";
        column-gap: 0.75rem;
        row-gap: 0.25rem;
        padding: 0.875rem 1rem 0.75rem;
        margin: 0;
        border: 1px solid #E4E8EE;
        border-left-width: 1px;
        border-radius: 12px;
        border-bottom: 0;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
    }

    .mw-list__row > .mw-col {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        padding: 0;
    }

    .mw-list__row .mw-col--phone,
    .mw-list__row .mw-col--amount {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    .mw-list__row > .mw-col:nth-child(1) {
        grid-area: name;
        align-self: center;
        font-size: 0.9375rem;
        font-weight: 700;
        color: #121A1F;
        padding-bottom: 0.15rem;
    }

    .mw-list__row > .mw-col:nth-child(2) {
        grid-area: email;
        word-break: break-word;
        padding-bottom: 0.35rem;
        font-size: 0.8125rem;
        color: #32434B;
    }

    .mw-list__row > .mw-col:nth-child(3) {
        grid-area: phone;
        align-self: start;
        justify-self: stretch;
        width: 100%;
        max-width: 100%;
        text-align: left;
        padding-bottom: 0.2rem;
        font-size: 0.8125rem;
        color: #32434B;
    }

    .mw-list__row > .mw-col:nth-child(4) {
        grid-area: type;
        align-self: start;
        justify-self: stretch;
        width: 100%;
        max-width: 100%;
        text-align: right;
        padding-bottom: 0.35rem;
        font-size: 0.8125rem;
        color: #32434B;
    }

    .mw-list__row > .mw-col:nth-child(5) {
        grid-area: fc;
        padding-top: 0.1rem;
        padding-bottom: 0.5rem;
        font-size: 0.8125rem;
        color: #32434B;
        line-height: 1.35;
    }

    .mw-list__row > .mw-col:nth-child(6) {
        grid-area: amount;
        align-self: center;
        justify-self: end;
        text-align: right;
        font-size: 0.9375rem;
        font-weight: 700;
        color: #121A1F;
        padding-bottom: 0;
    }

    .mw-list__row > .mw-col:nth-child(7) {
        grid-area: status;
        width: 100%;
        justify-content: flex-start;
        padding: 0.6rem 0;
        border-top: 1px solid #E9EDF2;
        border-bottom: 1px solid #E9EDF2;
    }

    .mw-list__row > .mw-col--actions {
        grid-area: actions;
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.5rem;
        padding-top: 0.55rem;
    }

    .mw-list__row:hover {
        border-left-color: #E4E8EE;
        box-shadow: inset 3px 0 0 var(--mw-brand), 0 1px 3px rgba(16, 24, 40, 0.06);
    }

    .mw-dialog__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .mw-list__row {
        column-gap: 0.65rem;
        row-gap: 0.2rem;
    }

    .mw-list__row > .mw-col:nth-child(1) {
        min-width: 0;
        padding-right: 0.25rem;
    }

    .mw-list__row > .mw-col:nth-child(6) {
        min-width: 0;
        white-space: nowrap;
    }
}
