.gh-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 8px;
    flex: 0 0 32px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.gh-avatar img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    object-fit: cover;
    margin: 0 !important;
}

.gh-avatar-ini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
    text-align: center;
}

.gh-party-cell {
    white-space: nowrap;
}

.gh-party-name {
    vertical-align: middle;
}

.gh-status-cell {
    width: 124px !important;
    min-width: 118px !important;
    max-width: 150px !important;
    overflow: visible !important;
}

.gh-status-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    max-width: 100%;
}

.gh-status-hint {
    font-size: 10px;
    font-style: normal;
    font-weight: 600;
    color: #8a97a3;
    line-height: 1.2;
    white-space: nowrap;
}

.gh-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
}

.gh-status-pill .gh-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 7px;
}

.gh-status-pill.is-on {
    background: #dcfce7;
    color: #166534;
}

.gh-status-pill.is-on .gh-status-dot {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.gh-status-pill.is-off {
    background: #fee2e2;
    color: #991b1b;
}

.gh-status-pill.is-off .gh-status-dot {
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.gh-status-pill.is-ok {
    background: #dcfce7;
    color: #166534;
}
.gh-status-pill.is-ok .gh-status-dot {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.gh-status-pill.is-info {
    background: #d1ecf1;
    color: #0c5460;
}
.gh-status-pill.is-info .gh-status-dot {
    background: #0ea5a4;
    box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.16);
}

.gh-status-pill.is-wait {
    background: #dbeafe;
    color: #1e40af;
}
.gh-status-pill.is-wait .gh-status-dot {
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.gh-status-pill.is-warn {
    background: #fef3c7;
    color: #92400e;
}
.gh-status-pill.is-warn .gh-status-dot {
    background: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16);
}

.gh-status-pill.is-danger {
    background: #fee2e2;
    color: #991b1b;
}
.gh-status-pill.is-danger .gh-status-dot {
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.gh-status-pill.is-muted {
    background: #eef1f4;
    color: #5b6b7a;
}
.gh-status-pill.is-muted .gh-status-dot {
    background: #8a97a3;
    box-shadow: 0 0 0 3px rgba(138, 151, 163, 0.16);
}
}

.gh-party-logo-box {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    text-align: left;
}

.gh-party-logo-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    flex: 0 0 64px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.gh-party-logo-preview img {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.gh-party-logo-preview .gh-avatar-ini {
    width: 64px;
    height: 64px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gh-party-logo-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.gh-party-logo-hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.gh-sel-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gh-sel-flag,
.gh-sel-logo {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex: 0 0 auto;
}

.gh-sel-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.gh-sel-ini {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
}

.gh-sel-txt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-group > .select2-container {
    flex: 1 1 auto;
    width: 1% !important;
}

.input-group .select2-selection--single {
    height: 35px;
    border: 1px solid #ced4da;
    border-radius: 0 .25rem .25rem 0;
}

.input-group .select2-selection__rendered {
    line-height: 33px;
    padding-left: 8px;
}

.input-group .select2-selection__arrow {
    height: 33px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] .gh-sel-ini {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

body > .select2-container {
    z-index: 20050 !important;
}

.gh-sel-drop .select2-search--dropdown {
    display: block !important;
    padding: 8px;
}

.gh-sel-drop .select2-search__field {
    width: 100% !important;
    height: 34px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 4px 8px;
}

.countriesComponent .select2-container,
.client_statusComponent .select2-container {
    width: 100% !important;
}

.countriesComponent .input-group,
.client_statusComponent .input-group {
    margin-bottom: 0 !important;
}

html.gh-list-page .table-scroll thead th.s_status_table,
html.gh-list-page .table-scroll .gh-status-cell {
    width: 124px;
    min-width: 118px;
    max-width: 150px;
    overflow: visible;
    text-overflow: clip;
}

#slide_modal.gh-party-overlay.overlay_show {
    width: 760px !important;
}

@media (max-width: 1024px) {
    #slide_modal.gh-party-overlay.overlay_show {
        width: 100% !important;
    }
}

.gh-party-form {
    text-align: left;
}

.gh-party-section {
    margin-bottom: 18px;
}

.gh-party-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0e2c40;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.gh-party-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.gh-party-span-2 {
    grid-column: 1 / -1;
}

.gh-party-field .input-group {
    margin-bottom: 0 !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
}

.gh-party-form .input-group-prepend {
    display: flex;
    width: auto;
    margin-right: 0;
    margin-bottom: 0;
}

.gh-party-form .input-group-prepend .input-group-text,
.gh-party-field .input-group-text {
    display: flex;
    align-items: center;
    width: 96px !important;
    min-width: 96px !important;
    height: auto;
    background: var(--gh-gray-100, #f4f6f8);
    border: 1px solid #ced4da;
    border-right: 0;
    padding: 0 10px;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
}

.gh-party-form .input-group > .form-control,
.gh-party-form .input-group > select.form-control,
.gh-party-form .input-group > .select2-container {
    flex: 1 1 auto;
    width: 1% !important;
    border-radius: 0 .25rem .25rem 0 !important;
}

.gh-party-form .form-control,
.gh-party-form .select2-container .select2-selection--single {
    height: 38px;
    min-height: 38px;
}

.gh-party-form textarea.form-control {
    height: auto;
    min-height: 84px;
}

.gh-party-form .select2-container .select2-selection__rendered {
    line-height: 36px;
}

.gh-party-form .select2-container .select2-selection__arrow {
    height: 36px;
}

.gh-party-req-hint {
    margin-left: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #be185d;
}

.gh-party-label {
    display: flex;
    align-items: center;
    flex: 0 0 96px;
    width: 96px;
    min-width: 96px;
    height: 38px;
    margin: 0;
    padding: 0 10px;
    background: var(--gh-gray-100, #f4f6f8);
    border: 1px solid #ced4da;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    text-align: left;
}

.gh-party-field:has(> .gh-party-label) {
    display: flex;
    align-items: stretch;
}

.gh-party-field:has(> .gh-party-label) > .form-control,
.gh-party-field:has(> .gh-party-label) > select,
.gh-party-field:has(> .gh-party-label) > .gh-phone-row {
    flex: 1 1 auto;
    min-width: 0;
}

.nifTypeComponent {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.nifTypeComponent .gh-nif-type {
    flex: 1 1 auto;
    min-width: 0;
}

.nifTypeComponent .gh-nif-other {
    flex: 1 1 100%;
    margin-top: 8px;
}

.gh-phone-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.gh-phone-code-wrap {
    flex: 0 0 168px;
    width: 168px;
    max-width: 42%;
}

.gh-phone-row > .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.gh-phone-code-wrap .select2-container {
    width: 100% !important;
}

.gh-phone-code-wrap .select2-selection--single {
    height: 35px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.gh-phone-code-wrap .select2-selection__rendered {
    line-height: 33px;
    padding-left: 6px;
}

.gh-phone-code-wrap .select2-selection__arrow {
    height: 33px;
}

.gh-set-phone {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.gh-set-phone .gh-phone-code,
.gh-set-phone .select2-container {
    flex: 0 0 168px;
    width: 168px !important;
}

.gh-set-phone .form-control {
    flex: 1 1 auto;
}

.gh-party-form .gh-party-logo-box {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .gh-party-grid {
        grid-template-columns: 1fr;
    }

    .gh-party-span-2 {
        grid-column: auto;
    }

    .gh-phone-code-wrap {
        flex-basis: 140px;
        width: 140px;
    }

    .gh-party-field .input-group,
    .gh-party-field:has(> .gh-party-label),
    .nifTypeComponent {
        flex-direction: column;
        align-items: stretch;
    }

    .gh-party-form .input-group-prepend .input-group-text,
    .gh-party-field .input-group-text,
    .gh-party-label {
        width: 100% !important;
        min-width: 0 !important;
        flex-basis: auto;
        height: auto;
        padding: 6px 10px;
        border-right: 1px solid #ced4da;
        border-radius: 4px 4px 0 0;
    }

    .gh-party-form .input-group > .form-control,
    .gh-party-form .input-group > select.form-control,
    .gh-party-form .input-group > .select2-container {
        width: 100% !important;
        border-radius: 0 0 .25rem .25rem !important;
    }
}
