/* Reseller owns composition only; controls and widget states use the shared theme. */
.reseller-page {
    max-width: 1600px;
    margin-inline: auto;
}

.reseller-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.reseller-header h1 {
    margin: 0;
    color: var(--mkp-foreground);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.reseller-header p,
.reseller-section-heading p {
    margin: 6px 0 0;
    color: var(--mkp-muted-foreground);
    line-height: 1.5;
}

.reseller-eyebrow {
    margin-bottom: 6px;
    color: var(--mkp-muted-foreground);
    font-size: 12px;
    font-weight: 500;
}

.reseller-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.reseller-page .reseller-section {
    padding: 24px;
}

.reseller-list > .card > .card-body {
    padding: 0;
}

.reseller-list-tools {
    padding: 16px 20px;
}

.reseller-list #Grid {
    border-inline: 0;
    border-bottom: 0;
}

.reseller-section-heading {
    margin-bottom: 24px;
}

.reseller-section-heading h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}

.reseller-tabs {
    margin-bottom: 16px;
}

.reseller-record-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 24px;
    margin-bottom: 16px;
}

.reseller-record-navigation .reseller-tabs {
    flex: 1 1 640px;
    min-width: 0;
    margin-bottom: 0;
}

.reseller-record-navigation .reseller-actions {
    padding-block: 4px;
}

.reseller-tabs #personTab {
    flex-wrap: wrap;
    overflow: visible;
}

.reseller-tabs #personTab > .nav-item {
    flex: 0 0 auto;
}

.reseller-tabs #personTab .nav-link {
    white-space: nowrap;
}

.reseller-list-tools {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 0;
}

.reseller-search {
    width: min(100%, 480px);
}

.reseller-list-tools > p {
    padding-bottom: 8px;
}

.reseller-list .k-grid td {
    min-width: 60px;
}

.reseller-list .k-grid img.rounded-circle {
    width: 36px;
    height: 36px;
    object-fit: cover;
}

.reseller-page #rev_2 > .reseller-section > .row {
    max-width: 800px;
}

.reseller-page #SecondHolder,
.reseller-page #personForm #Password {
    max-width: 640px;
}

.reseller-recovery > .card {
    max-width: 800px;
}

.reseller-recovery-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--mkp-border);
}

#bankAccount-content .reseller-bank-digit {
    flex: 0 0 104px;
    min-width: 0;
}

#bankAccount-content .reseller-bank-number {
    min-width: 160px;
    max-width: 360px;
}

#bankAccount-content .row:has(> .reseller-bank-digit) {
    align-items: flex-end;
}

/* Keep the full record readable; row actions stay aligned to the middle. */
.reseller-list #Grid .k-grid-table > tbody > tr > td {
    height: 44px;
    padding-block: 8px;
    vertical-align: middle;
    color: var(--mkp-foreground);
}

/* Names and referrers are working data: allow full values to wrap. */
.reseller-list #Grid td:is(.mkp-grid-text, .mkp-grid-email, .mkp-grid-referrer),
.reseller-list #Grid td.mkp-grid-name > .fw-bold,
.reseller-list #Grid .reseller-cell-text {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 20px;
}

.reseller-list #Grid td.mkp-grid-email {
    overflow-wrap: anywhere;
}

.reseller-list #Grid .k-grid-table td .btn-group > .btn .fa {
    font-size: 16px;
    color: var(--mkp-foreground);
}

.reseller-list #Grid td.mkp-grid-text:focus,
.reseller-list #Grid td.mkp-grid-text:focus > :is(.fw-bold, .reseller-cell-text) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.reseller-list #Grid .k-grid-table td .btn-group > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--mkp-muted-foreground);
}

.reseller-list #Grid .k-grid-table td .btn-group > .btn:hover {
    border-color: var(--mkp-border);
    background: var(--mkp-muted);
}

.reseller-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 20px;
    border: 1px dashed var(--mkp-border);
    border-radius: var(--mkp-radius);
    text-align: center;
    background: var(--mkp-background);
}

.reseller-empty > i {
    color: var(--mkp-muted-foreground);
    font-size: 20px;
    margin-bottom: 4px;
}

.reseller-empty p {
    margin: 0;
    color: var(--mkp-muted-foreground);
}

.reseller-page :is(#bankAccounts, #pixAccounts) .list-group-item {
    padding: 16px;
    overflow-wrap: anywhere;
}

@media (max-width: 1199.98px) {
    .reseller-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }


}

@media (max-width: 767.98px) {
    .reseller-header {
        gap: 16px;
        margin-bottom: 20px;
    }

    .reseller-header h1 {
        font-size: 22px;
    }

.reseller-actions {
        justify-content: flex-start;
        flex-shrink: 1;
    }

    .reseller-page .reseller-section {
        padding: 16px;
    }

    .reseller-list-tools {
        padding: 16px;
    }

    .reseller-edit .reseller-header > div:first-child {
        width: 100%;
    }

    .reseller-edit .reseller-header > .reseller-actions {
        width: 100%;
        justify-content: space-between;
    }

    .reseller-page :is(#bankAccounts, #pixAccounts) .float-end {
        float: none !important;
        display: block;
        margin-bottom: 12px;
    }
}

/* One section axis and one field axis throughout the personal record. */
.reseller-person-sections .reseller-form-section {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
    padding-block: 20px;
    border-top: 1px solid var(--mkp-border);
}

.reseller-person-sections .reseller-form-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.reseller-person-sections .reseller-form-section:last-child {
    padding-bottom: 0;
}

.reseller-person-sections .reseller-section-heading {
    margin: 0;
}

.reseller-person-sections .reseller-section-heading p {
    margin-top: 6px;
}

.reseller-section-fields { min-width: 0; }

.reseller-profile-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reseller-profile-image {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.reseller-page #personForm .reseller-section-fields > .row {
    --bs-gutter-x: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-inline: 0;
}

.reseller-page #personForm .reseller-section-fields > .row > div {
    width: 100%;
    min-width: 0;
    padding-inline: 0;
}

.reseller-page #personForm .reseller-section-fields > .row > div:only-child {
    grid-column: 1 / -1;
}

.reseller-page #personForm .reseller-section-fields > .mb-3:last-child {
    margin-bottom: 0 !important;
}

.reseller-page #personForm .reseller-address-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.reseller-page #personForm .reseller-address-fields > .mb-3 {
    margin: 0 !important;
    min-width: 0;
}

.reseller-page #personForm .reseller-address-fields > .row:has(#Address_Street, #Address_Country_select) {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reseller-page #personForm .reseller-address-fields > .row:has(#Address_Country_select) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reseller-page .reseller-access {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--mkp-border);
}

.reseller-recovery #Password {
    max-width: none;
}

.reseller-recovery #recoverResellerForm .reseller-recovery-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-inline: 0;
}

.reseller-recovery #recoverResellerForm .reseller-recovery-fields > div {
    width: 100%;
    min-width: 0;
    padding-inline: 0;
}

.reseller-recovery #div-password > div {
    grid-column: 1 / -1;
}

/* Names lead the roster; all secondary values remain fully readable. */
.reseller-list #Grid td.mkp-grid-name > .fw-bold {
    font-weight: 600 !important;
    color: var(--mkp-foreground);
}

.reseller-list #Grid td.mkp-grid-text:not(.mkp-grid-name) {
    color: var(--mkp-foreground);
}

/* Four short personal fields fit without adding a second row on desktop. */
@media (min-width: 1200px) {
    .reseller-page #personForm .reseller-section-fields > .reseller-person-details {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .reseller-page #personForm .reseller-section-fields > :is(.reseller-name-country, .reseller-document-fields, .reseller-contact-fields) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    }
}

.reseller-query-status:empty {
    margin: 0;
}

.reseller-query-status {
    margin: 0 0 24px;
    padding: 0;
    color: var(--mkp-muted-foreground);
    line-height: 20px;
}

/* Let every mobile column scroll fully into view, including Country. */
@media (max-width: 767.98px) {
    .reseller-person-sections .reseller-form-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .reseller-person-sections .reseller-section-heading p {
        max-width: none;
    }

    .reseller-page #personForm .reseller-section-fields > .row,
    .reseller-page #personForm .reseller-address-fields,
    .reseller-page #personForm .reseller-address-fields > .row:has(#Address_Street, #Address_Country_select) {
        grid-template-columns: minmax(0, 1fr);
    }

    .reseller-recovery #recoverResellerForm .mb-3.row > div {
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
    }

    .reseller-recovery #recoverResellerForm .reseller-recovery-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Keep the search, rows and pager within the desktop working area. */
@media (min-width: 768px) {
    .reseller-list #Grid > .k-grid-content,
    .reseller-list #Grid > .k-grid-container > .k-grid-content {
        max-height: clamp(280px, calc(100dvh - 390px), 680px);
    }

}

/* Short controls keep the same column edges as the surrounding fields. */
.reseller-page #personForm :is(#SecondHolder, #taxPayerId, #Password, #Address_PostalCode) {
    max-width: none;
}

.reseller-page #personForm .reseller-section-fields > .mb-3:last-child,
.reseller-page #personForm .reseller-section-fields > .row:last-child {
    margin-bottom: 0 !important;
}

.reseller-page #personForm .reseller-access-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
}

.reseller-page #personForm .reseller-access-options .form-check {
    margin: 0;
}

/* The shared empty-grid rule removes this existing operation. Restore it
   only within Reseller until the grid component owner corrects that rule. */
.reseller-page .k-grid.mkp-grid-empty > .k-grid-pager .k-pager-sizes {
    display: inline-flex !important;
}

@media (min-width: 768px) and (max-width: 1099.98px) {
    .reseller-person-sections .reseller-form-section {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 24px;
    }
}

.reseller-form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--mkp-border);
}

/* Keep the primary action next to Back on narrow record headers. */
@media (max-width: 767.98px) {
    .reseller-edit .reseller-header > .reseller-actions {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .reseller-edit .reseller-header > .reseller-actions > .reseller-actions {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .reseller-edit .reseller-header > .reseller-actions > .btn-group {
        justify-self: start;
    }

    .reseller-person-sections .reseller-form-section {
        gap: 16px;
    }
}

/* Separate the three operations without reducing their hit areas. */
.reseller-list #Grid .k-grid-table td .btn-group { gap: 4px; }
