.customers-rates {
    width: 100%;
    max-width: 100%;
    padding: 32px 40px;
    background-color: #f8fafc;
    box-sizing: border-box;
}

.customers-rates-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 22px;
}

.customers-rates-title {
    font-size: 22px;
    font-weight: 600;
    color: #0f172a;
}

.customers-rates-subtitle {
    font-size: 14px;
    color: #64748b;
}

.customers-rates-filters label {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
    display: block;
}

.customers-rates-filters .Select {
    margin-top: 6px;
}

.customers-rates-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    background-color: #f8fafc;
    border: 1px dashed #cbd5f5;
    border-radius: 12px;
    margin-top: 12px;
    letter-spacing: 0.2px;
}

.customers-rates-table-container {
    margin-top: 4px;
    width: 100%;
    min-height: 450px;
    background: #ffffff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.ag-theme-alpine {
    --ag-font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ag-font-size: 13px;
    --ag-background-color: #ffffff;
    --ag-header-background-color: #f1f5f9;
    --ag-odd-row-background-color: #f8fafc;
    --ag-border-color: #e2e8f0;
    --ag-row-border-color: #e2e8f0;
    --ag-header-foreground-color: #0f172a;
    --ag-foreground-color: #0f172a;
    --ag-selected-row-background-color: #dbeafe;
    --ag-row-hover-color: #f1f5f9;
}

.ag-header-cell-label {
    font-weight: 600;
    color: #334155;
}

.ag-row-hover {
    background-color: #f1f5f9 !important;
}

.ag-row {
    border-bottom: 1px solid #f1f5f9;
}

.ag-header {
    border-bottom: 1px solid #e2e8f0;
}

.ag-paging-panel {
    border-top: 1px solid #e2e8f0;
    padding-top: 6px;
    font-size: 12px;
    color: #475569;
}

.ag-root-wrapper {
    border-radius: 10px;
    overflow: hidden;
}

.VirtualizedSelectMenu,
.Select-menu-outer {
    z-index: 2000 !important;
}

.Select,
.Select-control,
.Select-menu-outer,
.Select-option,
.Select-placeholder,
.Select-value,
.Select-input input {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.Select-menu-outer {
    border-radius: 12px;
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
    overflow: hidden;
}

.Select-option {
    padding: 7px 10px;
    font-size: 13px;
    color: #0f172a;
}

.Select-option.is-focused {
    background-color: #f1f5f9;
}

.Select-option.is-selected {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 500;
}

.customers-rates-filters .Select-control {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    min-height: 42px;
    padding: 2px 8px;
    transition: all 0.2s ease;
}

.customers-rates-filters .Select-control:hover {
    border-color: #94a3b8;
}

.customers-rates-filters
.is-focused:not(.is-open)
> .Select-control {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.customers-rates-filters .Select-placeholder {
    color: #94a3b8;
    font-size: 14px;
}

.customers-rates-filters .Select-value {
    background-color: #e0e7ff;
    border-radius: 8px;
    padding: 2px 8px;
    margin: 3px 4px 3px 0;
    font-size: 13px;
    color: #1e3a8a;
}

.customers-rates-filters .Select-value-icon {
    color: #475569;
}

.customers-rates-filters .Select-value-icon:hover {
    color: #1e293b;
}

.customers-rates:has(.Select-menu-outer)
.customers-rates-table-container {
    filter: blur(4px);
    opacity: 0.6;
    pointer-events: none;
}

.customers-rates-table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.export-btn-rates {
    background-color: #0f172a;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.export-btn-rates:hover {
    background-color: #0a288b;
}

.reset-btn {
    background-color: #0f172a;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.reset-btn:hover {
    background-color: #0a288b;
}

.customers-rates-filters .Select,
.customers-rates-filters .Select * {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.customers-rates-filters .Select-control {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
}

.customers-rates-filters .Select-control {
    min-height: 44px;
}

.cell-edited,
.row-edited {
    background-color: #ffedd5 !important;
    color: #9a3412;
}

.cell-saved,
.row-saved {
    background-color: #dcfce7 !important;
    color: #14532d;
}

/* Truncate dropdown option text */
.customers-rates-filters .Select-option {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 8px 12px;
    height: auto;
    line-height: 1.4;
}

/* Handle multi-select tags */
.customers-rates-filters .Select-value {
    max-width: 100%;
    display: flex;
    align-items: center;
    background-color: #dbeafe;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    font-size: 12px;
}

.customers-rates-filters .Select-value-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

/* Dropdown container with flex wrap for multiple selections */
.customers-rates-filters .Select-input {
    max-width: 100%;
}

/* Multi-select wrapper */
.customers-rates-filters .Select--multi {
    flex-wrap: wrap;
}

.customers-rates-filters .Select-multi-value-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Horizontal layout for filter dropdowns */
.customers-rates-filters-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.customers-rates-filters {
    flex: 1;
    width: 100%;
    max-width: none;
    margin-bottom: 15px;
}

@media (max-width: 1200px) {
    .customers-rates-filters-row {
        flex-wrap: wrap;
    }
}

.customer-type-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.customer-type-group input[type="radio"] {
    display: none;
}

.customer-type-group label {
    width: 100%;
    margin: 0;
    cursor: pointer;
}

.customer-type-group label span {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 54px;

    border-radius: 12px;
    border: 1px solid #e2e8f0;

    background: #ffffff;
    color: #334155;

    font-size: 15px;
    font-weight: 600;

    transition: all 0.18s ease;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04);
}

.customer-type-group label:hover span {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-1px);
}

.customer-type-group input[type="radio"]:checked + span {
    background: #2563eb;
    color: white;
    border-color: #2563eb;

    box-shadow:
        0 6px 18px rgba(37, 99, 235, 0.22);
}

.customer-type-group input[type="radio"]:checked + span:hover {
    background: #1d4ed8;
}

.edit-rules-modal-body {
    padding: 24px;
}

.edit-rules-modal-body > label {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.edit-rules-bulk-actions {
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fafafa;
}

#reset-rate-customer-type {
    background: #2563eb;
    border: none;
    border-radius: 10px;

    padding: 10px 20px;

    font-size: 14px;
    font-weight: 600;

    transition: all 0.18s ease;
}

#reset-rate-customer-type:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.edit-rules-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.edit-rules-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    min-width: 420px;
    max-width: 500px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.edit-rules-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.edit-rules-modal-header h4 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.edit-rules-modal-header p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    text-transform: capitalize;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

/* ===== MODAL BODY ===== */
.edit-rules-modal-body {
    padding: 28px 24px 24px;
}

.edit-rules-modal-body > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 11px;
}

.edit-rules-modal-body .rc-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.edit-rules-modal-body .rc-radio-wrapper {
    display: flex !important;
    align-items: center;
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 18px;
    color: #475569;
}

.edit-rules-modal-body .rc-radio-wrapper:hover {
    border-color: #cbd5f5;
    background: #f8fafc;
    transform: translateX(2px);
}

.edit-rules-modal-body .rc-radio-wrapper-checked {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1e40af;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.edit-rules-modal-body .rc-radio-wrapper-checked:hover {
    background: #dbeafe;
    border-color: #1d4ed8;
}

.edit-rules-modal-body .rc-radio {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.edit-rules-modal-body .rc-radio-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #cbd5f5;
    background: white;
    position: relative;
    transition: all 0.2s ease;
}

.edit-rules-modal-body .rc-radio-wrapper-checked .rc-radio-inner {
    border-color: #2563eb;
    background: #2563eb;
}

.edit-rules-modal-body .rc-radio-wrapper-checked .rc-radio-inner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.edit-rules-bulk-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
}

.edit-rules-bulk-actions button {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#reset-rate-customer-type {
    background: #2563eb;
    color: white;
}

#reset-rate-customer-type:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

@media (max-width: 600px) {
    .edit-rules-modal {
        min-width: 90vw;
        max-width: 90vw;
    }
}