.login-multiempresa-open {
    overflow: hidden;
}

.login-multiempresa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 59, 0.62);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1040;
}

.login-multiempresa-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.login-multiempresa-dialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1050;
}

.login-multiempresa-dialog.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.login-multiempresa-card {
    width: min(980px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(48, 86, 211, 0.14);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(8, 22, 63, 0.22);
}

.login-multiempresa-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 18px;
    background: linear-gradient(135deg, #3056D3 0%, #3d67ea 100%);
    color: #ffffff;
}

.login-multiempresa-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.login-multiempresa-copy {
    margin: 8px 0 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
}

.login-multiempresa-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.login-multiempresa-close:hover,
.login-multiempresa-close:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    outline: none;
}

.login-multiempresa-body {
    padding: 24px;
    overflow: auto;
}

.login-multiempresa-label {
    display: block;
    margin-bottom: 8px;
    color: #3056D3;
    font-size: 0.88rem;
    font-weight: 600;
}

.login-multiempresa-search {
    height: 46px;
    border-color: #d7e2ff;
    border-radius: 12px;
    box-shadow: none;
}

.login-multiempresa-search:focus {
    border-color: #3056D3;
    box-shadow: 0 0 0 0.2rem rgba(48, 86, 211, 0.15);
}

.login-multiempresa-table-wrap {
    margin-top: 16px;
    border: 1px solid rgba(48, 86, 211, 0.12);
    border-radius: 14px;
    overflow: auto;
}

.login-multiempresa-table {
    min-width: 760px;
    margin-bottom: 0;
}

.login-multiempresa-table thead th {
    border-top: 0;
    border-bottom: 1px solid rgba(48, 86, 211, 0.12);
    padding: 14px 16px;
    background: #f5f8ff;
    color: #3056D3;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.login-multiempresa-table tbody td {
    padding: 16px;
    border-top: 0;
    border-bottom: 1px solid rgba(15, 38, 95, 0.08);
    vertical-align: middle;
    color: #273152;
}

.login-multiempresa-table tbody tr:last-child td {
    border-bottom: 0;
}

.login-multiempresa-table tbody tr:hover {
    background: #f8faff;
}

.login-multiempresa-empty-row td {
    color: #6c7aa7;
    text-align: center;
}

.login-multiempresa-fantasia {
    font-weight: 600;
    color: #1f2a44;
}

.login-multiempresa-razao {
    color: #5f6f9b;
}

.login-multiempresa-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 24px 24px;
    border-top: 1px solid rgba(48, 86, 211, 0.1);
    background: #ffffff;
}

.login-multiempresa-footer .btn {
    min-width: 132px;
    border-radius: 12px;
}

.btn-select-empresa {
    width: 100%;
    min-width: 0;
    border-radius: 12px;
}

.btn-select-empresa[disabled] {
    opacity: 0.7;
    cursor: wait;
}

@media (max-width: 991.98px) {
    .login-multiempresa-dialog {
        padding: 16px;
    }

    .login-multiempresa-card {
        max-height: calc(100vh - 32px);
    }
}

@media (max-width: 767.98px) {
    .login-multiempresa-dialog {
        align-items: flex-end;
        padding: 12px;
    }

    .login-multiempresa-card {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 18px 18px 14px 14px;
    }

    .login-multiempresa-header,
    .login-multiempresa-body,
    .login-multiempresa-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .login-multiempresa-table {
        min-width: 0;
    }

    .login-multiempresa-table thead {
        display: none;
    }

    .login-multiempresa-table tbody tr {
        display: block;
        padding: 14px;
        border-bottom: 1px solid rgba(15, 38, 95, 0.08);
    }

    .login-multiempresa-table tbody tr:last-child {
        border-bottom: 0;
    }

    .login-multiempresa-table tbody td {
        display: grid;
        grid-template-columns: 92px 1fr;
        gap: 10px;
        padding: 8px 0;
        border: 0;
        text-align: left;
    }

    .login-multiempresa-table tbody td::before {
        content: attr(data-label);
        color: #6a799f;
        font-size: 0.76rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .login-multiempresa-table tbody td.login-multiempresa-action {
        grid-template-columns: 1fr;
        padding-top: 14px;
        margin-top: 6px;
        border-top: 1px solid rgba(15, 38, 95, 0.08);
    }

    .login-multiempresa-table tbody td.login-multiempresa-action::before {
        display: none;
    }

    .login-multiempresa-footer {
        justify-content: stretch;
    }

    .login-multiempresa-footer .btn {
        width: 100%;
    }
}
