.customer-management-tools {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.customer-management-tool {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color, #dfe3e8);
    border-radius: 12px;
    background: var(--card-background, #fff);
    color: var(--font-heading-color, #20252b);
    text-align: left;
    cursor: pointer;
}

.customer-management-tool:hover { border-color: var(--primary-color, #7b3ff2); }
.customer-management-tool > span:first-child { display: grid; gap: 0.2rem; }
.customer-management-tool small { color: #68727d; font-weight: 400; }
.customer-management-tool-status {
    flex: 0 0 auto;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #f1f3f5;
    color: #59636e;
    font-size: 0.78rem;
    font-weight: 700;
}
.customer-management-tool-status.is-active { background: #e8f6ed; color: #1c7c3f; }

.customer-benefits-admin {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--border-color, #dfe3e8);
    border-radius: 12px;
    background: var(--card-background, #fff);
}

.benefit-lookup-form,
.benefit-percent-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.benefit-percent-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.benefit-customer-results {
    display: grid;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.benefit-customer-result {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    width: 100%;
    padding: 0.8rem 1rem;
    text-align: left;
    border: 1px solid var(--border-color, #dfe3e8);
    border-radius: 10px;
    background: #fff;
    color: #20252b;
    cursor: pointer;
}

.benefit-customer-result:hover:not(:disabled) { border-color: var(--primary-color, #7b3ff2); }
.benefit-customer-result:disabled { opacity: 0.6; cursor: not-allowed; }
.benefit-customer-result small { width: 100%; color: #a12622; }

.benefit-grant-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #dfe3e8);
}

.benefit-history-scroll { overflow-x: auto; }
.benefit-history-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.benefit-history-table th,
.benefit-history-table td { padding: 0.7rem; border-bottom: 1px solid #e6e9ed; text-align: left; vertical-align: top; }
.benefit-history-table th { font-size: 0.82rem; color: #59636e; }
.benefit-status { font-weight: 700; }
.benefit-status--available { color: #1c7c3f; }
.benefit-status--reserved { color: #9a6700; }
.benefit-status--used { color: #59636e; }
.benefit-status--expired { color: #a12622; }
.benefit-status--revoked { color: #8b2635; }
.benefit-audit-summary {
    display: block;
    max-width: 260px;
    margin-top: 0.25rem;
    color: #68727d;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.35;
}
.benefit-history-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; min-width: 145px; }
.benefit-action-button {
    padding: 0.4rem 0.65rem;
    border: 1px solid currentColor;
    border-radius: 7px;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.benefit-action-button--edit { color: #5c35b5; }
.benefit-action-button--revoke { color: #a12622; }
.benefit-action-button:hover { background: #f7f5fb; }
.benefit-actions-unavailable { color: #7a838d; font-size: 0.76rem; }
.benefit-empty-state { color: #68727d; }

.loyalty-settings-modal-content,
.benefit-admin-modal-content {
    position: relative;
    width: min(92vw, 620px);
    max-width: 620px;
    max-height: 90vh;
    padding: 1.25rem;
    border-radius: 12px;
    overflow-y: auto;
}

.loyalty-settings-modal-content { max-width: 680px; }
.benefit-revoke-modal-content { max-width: 520px; }
.modal-close-button--button {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #f1f3f5;
    color: #3c4650;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
}
.loyalty-settings-modal-content h2,
.benefit-admin-modal-content h2 { margin: 0 3rem 1rem 0; padding: 0 0 0.8rem; }
.loyalty-reset-section {
    padding: 0.85rem;
    border: 1px solid #f1c8cd;
    border-radius: 10px;
    background: #fff8f8;
}
.loyalty-reset-section h4 { margin-top: 0; color: #8b2635; }
.benefit-mutation-reason {
    padding: 0.8rem;
    border: 1px solid #e4daf9;
    border-radius: 10px;
    background: #faf8ff;
}
.benefit-revoke-summary { font-weight: 700; color: #3c4650; }

.customer-benefits-cart {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border: 1px solid #d9d0f5;
    border-radius: 10px;
    background: #faf8ff;
}

.customer-benefits-cart h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.customer-benefits-cart > p { margin: 0 0 0.65rem; font-size: 0.82rem; color: #59636e; }
.customer-benefit-choice { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.55rem; padding: 0.55rem 0; border-top: 1px solid #e8e1fa; cursor: pointer; }
.customer-benefit-choice input { margin-top: 0.2rem; }
.customer-benefit-choice strong,
.customer-benefit-choice small { grid-column: 2; }
.customer-benefit-choice small { color: #65707b; line-height: 1.35; }
.customer-benefit-choice.is-ineligible { opacity: 0.62; cursor: not-allowed; }
#customer-benefit-discount-display { color: #1c7c3f; font-weight: 700; }
#totals-container #customer-benefit-discount-display.hidden { display: none; }
.professional-customer-benefits { margin-block: 0.85rem; }
.professional-customer-benefits .benefit-empty-state { margin: 0.4rem 0 0; }
.professional-customer-benefits + .customer-benefit-discount-row,
.customer-benefit-discount-row { color: #1c7c3f; font-weight: 700; }

@media (max-width: 640px) {
    .benefit-lookup-form,
    .benefit-percent-fields { grid-template-columns: 1fr; }
    .customer-management-tool { align-items: flex-start; flex-direction: column; }
    .loyalty-settings-modal-content,
    .benefit-admin-modal-content { width: 94vw; max-height: 94vh; padding: 1rem; }
}
