/*
 * Payment Centre on a lead (/admin/leads/{id}/payments). The summary reuses
 * the My Profile strip (axis-profile.css); this adds the segmented bar and
 * its key, the payments list and the Add a payment card. Brand tokens only;
 * left to right and right to left; nothing is marked important.
 */

.axis-pay {
    display: grid;
    gap: 16px;
}

/* Summary strip extras */

.axis-pay-summary .axis-profile-who .axis-profile-status {
    font-size: 13px;
    font-weight: 500;
}

.axis-pay-summary .axis-profile-facts .axis-pay-paid {
    color: var(--crm-success, #2e7d32);
}

.axis-pay-summary .axis-profile-facts .axis-pay-note {
    color: var(--crm-text-muted, #55677a);
    font-size: 12px;
    font-weight: 400;
}

.axis-pay-bar {
    display: flex;
    flex-basis: 100%;
    gap: 2px;
    height: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: var(--crm-border, #e5eae7);
}

.axis-pay-bar span {
    min-width: 4px;
}

.axis-pay-bar .is-done { background: var(--crm-success, #2e7d32); }
.axis-pay-bar .is-waiting { background: var(--crm-warning, #b26a00); }
.axis-pay-bar .is-neutral { background: var(--crm-neutral, #8a99a3); }

.axis-pay-key {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin: -6px 0 0;
    padding: 0;
    list-style: none;
    color: var(--crm-text-muted, #55677a);
    font-size: 12px;
}

.axis-pay-key li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.axis-pay-key li::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--crm-neutral, #8a99a3);
}

.axis-pay-key .is-done::before { background: var(--crm-success, #2e7d32); }
.axis-pay-key .is-waiting::before { background: var(--crm-warning, #b26a00); }

.axis-pay-lower {
    flex-basis: 100%;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
}

/* Info status (finance or approved commission) */

.axis-pay .axis-profile-status.is-info { color: var(--crm-info, #1565c0); }
.axis-pay .axis-profile-status.is-info::before { background: var(--crm-info, #1565c0); }
.axis-pay .axis-profile-status.is-neutral { color: var(--crm-text-muted, #55677a); }

/* Payments and Add a payment */

.axis-pay-main {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}

.axis-pay-card {
    border: 1px solid var(--crm-border, #e5eae7);
    border-radius: 12px;
    background: var(--crm-surface, #fff);
    overflow: hidden;
}

.axis-pay-card > header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--crm-border, #e5eae7);
}

.axis-pay-card > header h2 {
    margin: 0;
    color: var(--crm-text, #0f1f2e);
    font-size: 15px;
    font-weight: 600;
}

.axis-pay-card > header p {
    margin: 2px 0 0;
    color: var(--crm-text-muted, #55677a);
    font-size: 13px;
}

.axis-pay-empty {
    margin: 0;
    padding: 18px 20px;
    color: var(--crm-text-muted, #55677a);
    font-size: 14px;
}

.axis-pay-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.axis-pay-table th {
    padding: 10px 20px;
    color: var(--crm-text-muted, #55677a);
    font-size: 12px;
    font-weight: 500;
    text-align: start;
}

.axis-pay-table td {
    padding: 12px 20px;
    border-top: 1px solid var(--crm-border, #e5eae7);
    color: var(--crm-text, #0f1f2e);
    vertical-align: top;
}

.axis-pay-table td:first-child {
    white-space: nowrap;
}

.axis-pay-amount {
    font-weight: 600;
    white-space: nowrap;
}

.axis-pay-details,
.axis-pay-notes {
    display: block;
}

.axis-pay-details {
    color: var(--crm-text-muted, #55677a);
}

.axis-pay-notes {
    margin-top: 2px;
    color: var(--crm-text, #0f1f2e);
    overflow-wrap: anywhere;
}

.axis-pay-form {
    display: grid;
    gap: 16px;
    padding: 18px 20px 20px;
}

.axis-pay-form > .fi-btn {
    justify-self: start;
}

@media (max-width: 1100px) {
    .axis-pay-main {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .axis-pay-table th,
    .axis-pay-table td {
        padding-inline: 14px;
    }
}
