/* Customers Module Styles */

.customers-container {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.customers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E0E0E0;
}

.customers-header h2 {
    color: #31566D;
    margin: 0;
}

.summary-stats {
    display: flex;
    gap: 24px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    background: #F5F5F5;
    border-radius: 8px;
    min-width: 150px;
}

.summary-item span {
    font-size: 12px;
    color: #78909C;
    margin-bottom: 4px;
}

.summary-item strong {
    font-size: 20px;
    color: #31566D;
    font-weight: 600;
}

.summary-item.pending {
    background: #FFF8E1;
}

.summary-item.pending strong {
    color: #F57C00;
}

.customers-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #E0E0E0;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #424242;
}

.filter-btn:hover {
    background: #F5F5F5;
}

.filter-btn.active {
    background: linear-gradient(135deg, #c91d2b 0%, #a01621 100%);
    color: white;
    border-color: #c91d2b;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #78909C;
    z-index: 10;
    pointer-events: none;
}

.search-box input {
    flex: 1;
    padding: 10px 14px 10px 44px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-size: 14px;
    height: 42px;
}

.search-box input:focus {
    outline: none;
    border-color: #c91d2b;
    box-shadow: 0 0 0 3px rgba(201, 29, 43, 0.1);
}

.search-box .btn-primary {
    height: 42px;
    padding: 0 20px;
    border-radius: 8px;
    margin: 0;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.search-box .btn-primary:hover {
    background: #a01621;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(201, 29, 43, 0.2);
}

.customers-table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    overflow-y: hidden;
}

.customers-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.customers-table th {
    padding: 16px;
    text-align: left;
    background: #F5F5F5;
    color: #31566D;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #E0E0E0;
}

.customers-table td {
    padding: 10px;
    border-bottom: 1px solid #F0F0F0;
    font-size: 13px;
}

.customer-row:hover {
    background: #F9F9F9;
}

.customer-name {
    display: block;
    font-weight: 600;
    color: #31566D;
    font-size: 15px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.badge-outline {
    border: 1px solid #E0E0E0;
    color: #546E7A;
    background: #fcfcfc;
}

.badge-success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
}

.badge-warning {
    background: #fff8e1;
    color: #b45d00;
    border: 1px solid #ffeeba;
}

.badge-danger {
    background: #fdf2f2;
    color: #d32f2f;
    border: 1px solid #f5c6cb;
}

/* ── Action Dropdown ─────────────────────────── */
.action-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* Three-dot trigger button */
.btn-action-dots {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    padding: 0;
}

.btn-action-dots span {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #546E7A;
    transition: background 0.2s;
}

.btn-action-dots:hover {
    background: #f5f5f5;
    border-color: #c91d2b;
    box-shadow: 0 2px 8px rgba(201, 29, 43, 0.12);
}

.btn-action-dots:hover span {
    background: #c91d2b;
}

/* Dropdown panel */
.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 160px;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1100;
    max-width: 90vw;
    overflow: hidden;
    animation: dropdownFadeIn 0.15s ease;
}

.action-dropdown-menu.open {
    display: block;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown items */
.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #424242;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.action-dropdown-item svg {
    flex-shrink: 0;
    color: #78909C;
    transition: color 0.15s;
}

.action-dropdown-item:hover {
    background: #F5F5F5;
    color: #1976D2;
}

.action-dropdown-item:hover svg {
    color: #1976D2;
}

.action-item-approve:hover {
    background: #E8F5E9;
    color: #2E7D32;
}

.action-item-approve:hover svg {
    color: #2E7D32;
}

.action-item-reject:hover {
    background: #FFEBEE;
    color: #C62828;
}

.action-item-reject:hover svg {
    color: #C62828;
}

.action-item-edit:hover {
    background: #e3f2fd;
    color: #1565c0;
}

.action-item-edit:hover svg {
    color: #1565c0;
}

/* Divider between item groups */
.action-dropdown-item+.action-item-approve {
    border-top: 1px solid #F0F0F0;
    margin-top: 2px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px 0;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-large .modal-content {
    max-width: 800px;
}

.modal-xlarge .modal-content {
    max-width: 980px;
    margin: 0 auto;
}

.modal.modal-xlarge.active {
    align-items: flex-start;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: #F5F5F5;
    border: none;
    color: #c91d2b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #FFEBEE;
    color: #A01621;
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #E0E0E0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary {
    background: #c91d2b;
    color: white;
}

.btn-secondary {
    background: #F5F5F5;
    color: #424242;
}

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.empty-state {
    text-align: center;
    padding: 60px;
    color: #78909C;
}

.text-muted {
    color: #78909C;
    font-size: 12px;
}

@media (max-width: 768px) {
    .customers-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .summary-stats {
        flex-wrap: wrap;
        width: 100%;
        gap: 12px;
    }

    .summary-item {
        flex: 1;
        min-width: 140px;
        padding: 10px 14px;
    }

    .customers-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-group {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .search-box {
        min-width: 100%;
    }

    .customers-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .customers-table {
        min-width: 1000px;
    }

    .details-grid {
        grid-template-columns: 1fr !important;
    }

    .files-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Customer Details Modal Enhancements */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.details-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.details-section.full-width {
    grid-column: 1 / -1;
}

.section-title {
    color: #31566D;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #c91d2b;
    display: inline-block;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.detail-row span {
    color: #6c757d;
}

.detail-row strong {
    color: #212529;
    text-align: right;
}

.address-text {
    font-size: 13px;
    line-height: 1.5;
    color: #495057;
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-bottom: 12px;
}

.details-section h5 {
    font-size: 12px;
    text-transform: uppercase;
    color: #adb5bd;
    margin: 10px 0 5px 0;
    letter-spacing: 0.5px;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.file-card {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.file-card:hover {
    border-color: #c91d2b;
    box-shadow: 0 4px 12px rgba(201, 29, 43, 0.1);
}

.file-icon {
    width: 40px;
    height: 40px;
    background: #fdf2f2;
    color: #c91d2b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 12px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #31566D;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name {
    font-size: 11px;
    color: #6c757d;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}

.btn-file-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f3f5;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-file:hover {
    background: #0288d1;
    color: white;
}

.btn-download-file:hover {
    background: #2E7D32;
    color: white;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c91d2b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.btn-info {
    background: #e1f5fe;
    color: #0288d1;
}

.btn-info:hover {
    background: #b3e5fc;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fdfdfd;
    border-top: 1px solid #eee;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.pagination-info strong {
    color: #31566D;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-buttons .btn {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
}

.pagination-buttons .btn-outline {
    border: 1px solid #dee2e6;
    background: white;
    color: #444;
}

.pagination-buttons .btn-outline:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #c91d2b;
    color: #c91d2b;
}

.pagination-buttons .btn-primary.active {
    background: #c91d2b;
    color: white;
    border: 1px solid #c91d2b;
    cursor: default;
}

.pagination-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.pagination-ellipsis {
    color: #999;
    padding: 0 4px;
}

.edit-section {
    margin-bottom: 26px;
    padding: 18px;
    border: 1px solid #ebedf0;
    border-radius: 10px;
    background: #fcfcfc;
}

.sub-section-title {
    margin: 12px 0;
    color: #5f6b72;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #5f6b72;
}

.form-group .form-control {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    height: 40px;
    padding: 8px 12px;
    font-size: 13px;
    color: #263238;
}

.form-group .form-control.file-control {
    height: auto;
    padding: 8px;
}

.existing-file-link {
    margin-top: 4px;
    color: #1565c0;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.existing-file-link:hover {
    text-decoration: underline;
}

.form-group .form-control:focus {
    outline: none;
    border-color: #c91d2b;
    box-shadow: 0 0 0 3px rgba(201, 29, 43, 0.08);
}

.form-group .form-control.input-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    line-height: 1.3;
}

.form-message {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.form-message.error {
    display: block;
    background: #fdecef;
    color: #b42332;
    border: 1px solid #f4c2ca;
}

.form-message.success {
    display: block;
    background: #e8f7ee;
    color: #1f7a3d;
    border: 1px solid #b7e4c7;
}

.locked-input {
    background: #f5f5f5;
    color: #607d8b;
    cursor: not-allowed;
}

.checkbox-row {
    align-items: flex-start;
    justify-content: center;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #455a64;
}

.shipping-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Edit modal visual polish */
#editCustomerModal {
    align-items: flex-start;
    background: rgba(17, 24, 39, 0.45);
    padding: 12px 0 18px;
}

#editCustomerModal .modal-content {
    width: min(1100px, 96vw);
    max-width: 1100px;
    max-height: 94vh;
    border: 1px solid #e7eaee;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

#editCustomerModal .modal-header {
    padding: 14px 16px;
    background: #fbfcfe;
}

#editCustomerModal .modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #2b4c60;
}

#editCustomerModal .modal-body {
    padding: 14px;
    max-height: calc(94vh - 124px);
}

#editCustomerModal .modal-footer {
    padding: 12px 16px;
    background: #fbfcfe;
}

#editCustomerModal .edit-section {
    margin-bottom: 14px;
    padding: 12px;
}

#editCustomerModal .section-title {
    font-size: 15px;
    margin-bottom: 10px;
}

#editCustomerModal .sub-section-title {
    margin: 8px 0;
    font-size: 11px;
}

#editCustomerModal .edit-grid {
    gap: 10px 12px;
}

#editCustomerModal .form-group label {
    margin: 0;
    font-size: 11px;
}

#editCustomerModal .form-group .form-control {
    height: 34px;
    padding: 6px 10px;
    font-size: 12px;
}

#editCustomerModal .form-group .form-control.file-control {
    height: auto;
    min-height: 34px;
}

@media (max-width: 600px) {
    .pagination-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .edit-grid {
        grid-template-columns: 1fr;
    }

    #editCustomerModal .modal-content {
        width: 98vw;
        max-height: 96vh;
    }

    #editCustomerModal .modal-body {
        max-height: calc(96vh - 124px);
    }
}

/* Shipping Addresses List */
.address-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.address-item {
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.address-item.default-address {
    border-left: 4px solid #2e7d32;
    background: #f8fff9;
}

.badge-sm {
    padding: 2px 8px;
    font-size: 10px;
}

.ml-2 {
    margin-left: 8px;
}

.address-item .address-text {
    margin-bottom: 8px;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
}

.default-badge-container,
.gst-container {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-top: 4px;
}