.partner-management {
    width: 100%;
    min-height: 240px;
    padding: 14px 16px 20px;
    color: #172b3a;
    font-size: 14px;
    letter-spacing: 0;
}

.partner-management *,
.partner-management *::before,
.partner-management *::after {
    box-sizing: border-box;
}

.pm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding-bottom: 12px;
}

.pm-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 520px;
    max-width: 620px;
}

.pm-search > .fa-search {
    position: absolute;
    left: 13px;
    z-index: 1;
    color: #647788;
    pointer-events: none;
}

.pm-search input {
    width: 100%;
    height: 38px;
    padding: 7px 40px 7px 38px;
    border: 1px solid #c8d3de;
    border-radius: 5px;
    background: #fff;
    color: #172b3a;
    font-size: 14px;
    line-height: 22px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pm-search input:focus {
    border-color: #2376b9;
    box-shadow: 0 0 0 3px rgba(35, 118, 185, .12);
}

.pm-search input::placeholder {
    color: #7b8b98;
    text-align: left;
}

.pm-search-clear {
    position: absolute;
    right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #607384;
    cursor: pointer;
}

.pm-search-clear:hover {
    background: #edf2f6;
    color: #1f5f91;
}

.pm-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.pm-add-contractor {
    display: grid;
    grid-template-columns: minmax(320px, 1.5fr) minmax(260px, 1fr) auto;
    align-items: end;
    gap: 16px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #9cbcd2;
    border-radius: 6px;
    background: #f3f8fb;
}

.pm-add-contractor-field {
    min-width: 0;
}

.pm-add-contractor-field label {
    display: block;
    margin: 0 0 6px;
    color: #263f51;
    font-size: 13px;
    font-weight: 600;
}

.pm-add-contractor-field .select2-container {
    width: 100% !important;
    max-width: 100%;
}

.pm-add-contractor-field .select2-container .select2-selection--single {
    height: 36px;
    border-color: #b9c7d2;
    border-radius: 4px;
}

.pm-add-contractor-field .select2-selection__rendered {
    padding-left: 10px;
    padding-right: 32px;
    line-height: 34px;
    text-align: left;
}

.pm-add-contractor-field .select2-selection__arrow {
    height: 34px;
}

.pm-add-contractor-contact {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 36px;
    color: #607484;
    font-size: 13px;
}

.pm-add-contractor-contact span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.pm-add-contractor-contact .fa {
    color: #2a709f;
}

.pm-add-contractor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.partner-management .pm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: none;
}

.partner-management .pm-btn-primary {
    border: 1px solid #0f6faf;
    background: #0f6faf;
    color: #fff;
}

.partner-management .pm-btn-primary:hover,
.partner-management .pm-btn-primary:focus {
    border-color: #0b5b91;
    background: #0b5b91;
    color: #fff;
}

.partner-management .pm-btn-secondary {
    border: 1px solid #aebdca;
    background: #fff;
    color: #29475d;
}

.partner-management .pm-btn-secondary:hover,
.partner-management .pm-btn-secondary:focus {
    border-color: #6e879a;
    background: #f4f7f9;
    color: #18384f;
}

.partner-management .pm-btn-light {
    border: 1px solid #cbd5dd;
    background: #f6f8fa;
    color: #344d60;
}

.pm-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 43px;
    padding: 8px 12px;
    border: 1px solid #d5dfe7;
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    background: #f7f9fb;
}

.pm-summary-item {
    display: flex;
    align-items: baseline;
    gap: 7px;
    white-space: nowrap;
}

.pm-summary-label {
    color: #617484;
    font-size: 13px;
}

.pm-summary-item strong,
.pm-summary-result strong {
    color: #173b55;
    font-size: 15px;
}

.pm-summary-divider {
    width: 1px;
    height: 22px;
    background: #d6dfe6;
}

.pm-summary-result {
    margin-left: auto;
    color: #617484;
    font-size: 13px;
    white-space: nowrap;
}

.pm-text-success {
    color: #137654 !important;
}

.pm-text-muted {
    color: #687985 !important;
}

.pm-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #d5dfe7;
    border-radius: 0 0 6px 6px;
    background: #fff;
}

.pm-table {
    width: 100%;
    min-width: 980px;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.pm-table th {
    height: 42px;
    padding: 9px 11px;
    border-right: 1px solid #d8e1e8;
    border-bottom: 1px solid #bdcad5;
    background: #e8eef3;
    color: #213b4e;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    text-align: left;
    vertical-align: middle;
}

.pm-table th:last-child,
.pm-table td:last-child {
    border-right: 0;
}

.pm-table td {
    height: 50px;
    padding: 7px 11px;
    border-right: 1px solid #e0e6eb;
    border-bottom: 1px solid #dde5eb;
    color: #243b4b;
    font-size: 13px;
    line-height: 20px;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.pm-table tbody tr:last-child td {
    border-bottom: 0;
}

.pm-table tbody tr:hover:not(.pm-row-editing) td {
    background: #f7fafc;
}

.pm-table .pm-row-editing td {
    background: #fffbea;
}

.pm-col-index {
    width: 54px;
    text-align: center !important;
}

.pm-col-contractor {
    width: 24%;
}

.pm-col-password {
    width: 18%;
}

.pm-col-email {
    width: 20%;
}

.pm-col-status {
    width: 132px;
}

.pm-col-actions {
    width: 104px;
    text-align: center !important;
}

.pm-index {
    color: #617484 !important;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pm-cell-primary,
.pm-person-name {
    color: #173b55;
    font-weight: 600;
}

.pm-cell-button {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.pm-cell-button:hover,
.pm-cell-button:focus {
    color: #0f6faf;
    text-decoration: underline;
    outline: none;
}

.pm-login-name {
    color: #315066;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.pm-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #285a7d;
    text-decoration: none;
}

.pm-contact-link:hover {
    color: #0f6faf;
    text-decoration: underline;
}

.pm-contact-link .fa {
    color: #6f8392;
}

.pm-muted {
    color: #7a8995;
    font-style: italic;
}

.partner-management .pm-input,
.partner-management .pm-field-edit .form-control {
    height: 34px;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid #b9c7d2;
    border-radius: 4px;
    color: #1e3444;
    font-size: 13px;
    line-height: 20px;
}

.partner-management .pm-input:focus,
.partner-management .pm-field-edit .form-control:focus {
    border-color: #2376b9;
    box-shadow: 0 0 0 2px rgba(35, 118, 185, .11);
}

.partner-management .pm-select-contractor + .select2,
.partner-management .pm-field-edit .select2-container {
    width: 100% !important;
    max-width: 100%;
}

.partner-management .pm-field-edit .select2-container .select2-selection--single {
    height: 34px;
    border-color: #b9c7d2;
    border-radius: 4px;
}

.partner-management .pm-field-edit .select2-selection__rendered {
    padding-left: 9px;
    padding-right: 30px;
    line-height: 32px;
    text-align: left;
}

.partner-management .pm-field-edit .select2-selection__arrow {
    height: 32px;
}

.pm-password {
    flex-wrap: nowrap;
}

.partner-management .pm-password-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 34px;
    padding: 0;
    border: 1px solid #b9c7d2;
    border-left: 0;
    border-radius: 0 4px 4px 0;
    background: #f1f5f7;
    color: #476174;
}

.partner-management .pm-password-button:hover,
.partner-management .pm-password-button:focus {
    background: #e5edf2;
    color: #0f6faf;
}

.pm-status-cell {
    white-space: nowrap;
}

.pm-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.pm-status .fa-circle {
    font-size: 7px;
}

.pm-status-active {
    background: #e4f3ec;
    color: #11704e;
}

.pm-status-inactive {
    background: #eef1f3;
    color: #63727d;
}

.pm-status-empty {
    background: #fff4dc;
    color: #8a5a00;
}

.pm-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pm-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.pm-icon-edit {
    border-color: #b7cfdf;
    background: #eef6fb;
    color: #176b9e;
}

.pm-icon-add {
    border-color: #a9d3bf;
    background: #e8f6ef;
    color: #137654;
}

.pm-icon-delete {
    border-color: #e4b9bd;
    background: #fff0f1;
    color: #b9333b;
}

.pm-icon-save {
    border-color: #add4c1;
    background: #e8f6ef;
    color: #137654;
}

.pm-icon-cancel {
    border-color: #ccd5dc;
    background: #f3f5f7;
    color: #5c6d78;
}

.pm-icon-button:hover,
.pm-icon-button:focus {
    filter: brightness(.95);
    outline: none;
}

.pm-icon-button:disabled {
    border-color: #d5dde3;
    background: #eef1f3;
    color: #9aa7b0;
    cursor: not-allowed;
    filter: none;
}

.pm-empty {
    height: 180px !important;
    padding: 28px !important;
    color: #607484 !important;
    text-align: center;
}

.pm-empty > .fa {
    display: block;
    margin-bottom: 10px;
    color: #8ea1af;
    font-size: 30px;
}

.pm-empty strong,
.pm-empty span {
    display: block;
}

.pm-empty strong {
    margin-bottom: 3px;
    color: #385468;
    font-size: 14px;
}

.pm-contractor-table-wrap {
    background: #f1f5f7;
}

.pm-contractor-row td {
    height: 56px;
    border-top: 1px solid #9eb3c3;
    border-bottom: 1px solid #b8c8d3;
    background: #e5edf2 !important;
}

.pm-contractor-row:first-child td {
    border-top: 0;
}

.pm-contractor-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pm-contractor-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: #1a6fa8;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.pm-contractor-info strong {
    display: block;
    color: #173b55;
    font-size: 14px;
}

.pm-contractor-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 2px;
    color: #5d7282;
    font-size: 12px;
}

.pm-contractor-contact span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pm-account-count {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid #b7c8d4;
    border-radius: 4px;
    background: #fff;
    color: #36576d;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.pm-no-account-row td {
    height: 48px;
    padding-left: 54px;
    background: #fbfcfd;
    color: #6a7c89;
}

.pm-no-account-row td > span {
    margin-right: 10px;
    font-style: italic;
}

.pm-no-account-row button {
    padding: 3px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #126c9f;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pm-no-account-row button:hover {
    background: #eaf3f8;
}

.pm-group-spacer td {
    height: 8px;
    padding: 0;
    border: 0;
    background: #f1f5f7;
}

.pm-modal .pm-modal-dialog {
    width: calc(100% - 32px);
    max-width: 820px;
    min-width: 0 !important;
    margin: 42px auto;
}

.pm-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 7px;
    box-shadow: 0 18px 50px rgba(17, 39, 55, .28);
}

.pm-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #d4dee6;
    background: #f5f8fa;
}

.pm-modal-header .modal-title {
    margin: 0;
    color: #173b55;
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
}

.pm-modal-subtitle {
    display: block;
    margin-top: 2px;
    color: #657887;
    font-size: 13px;
}

.pm-modal .pm-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: -4px -6px 0 12px;
    padding: 0;
    border-radius: 4px;
    color: #536b7d;
    font-size: 25px;
    line-height: 1;
    opacity: 1;
}

.pm-modal .pm-modal-close:hover {
    background: #e6edf2;
    color: #173b55;
}

.pm-modal-body {
    padding: 20px;
}

.pm-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px 18px;
}

.pm-form-group {
    min-width: 0;
}

.pm-form-group label {
    display: block;
    margin: 0 0 6px;
    color: #263f51;
    font-size: 13px;
    font-weight: 600;
}

.pm-form-group .form-control {
    width: 100%;
    height: 38px;
    border: 1px solid #bac8d3;
    border-radius: 4px;
    color: #203746;
    font-size: 14px;
}

.pm-form-group .form-control:focus {
    border-color: #2376b9;
    box-shadow: 0 0 0 3px rgba(35, 118, 185, .11);
}

.pm-required {
    color: #c43e46;
}

.pm-account-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid #d7e0e6;
    border-radius: 5px;
    background: #f8fafb;
}

.pm-account-state strong,
.pm-account-state span {
    display: block;
}

.pm-account-state strong {
    color: #263f51;
    font-size: 13px;
}

.pm-account-state span {
    margin-top: 2px;
    color: #687b89;
    font-size: 12px;
}

.pm-switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    margin: 0;
    cursor: pointer;
}

.pm-switch input {
    width: 1px;
    height: 1px;
    opacity: 0;
}

.pm-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: #9ba9b3;
    transition: background-color .18s ease;
}

.pm-switch-slider::before {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .24);
    content: "";
    transition: transform .18s ease;
}

.pm-switch input:checked + .pm-switch-slider {
    background: #16805b;
}

.pm-switch input:checked + .pm-switch-slider::before {
    transform: translateX(18px);
}

.pm-switch input:focus + .pm-switch-slider {
    box-shadow: 0 0 0 3px rgba(35, 118, 185, .16);
}

.pm-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #d4dee6;
    background: #f8fafb;
}

@media (max-width: 900px) {
    .pm-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .pm-search {
        flex-basis: auto;
        max-width: none;
    }

    .pm-toolbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .pm-summary {
        flex-wrap: wrap;
    }

    .pm-summary-result {
        width: 100%;
        margin-left: 0;
    }

    .pm-add-contractor {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .pm-add-contractor-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .partner-management {
        padding: 10px;
    }

    .pm-toolbar-actions .pm-btn {
        flex: 1 1 auto;
    }

    .pm-summary-divider {
        display: none;
    }

    .pm-summary-item {
        width: calc(50% - 7px);
        justify-content: space-between;
    }

    .pm-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pm-modal .pm-modal-dialog {
        width: calc(100% - 16px);
        margin: 20px auto;
    }

    .pm-account-state {
        align-items: flex-start;
    }
}
