/* CSS Variables for consistency */
:root {
    --primary-color: #28313b;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    --cell-min-width: 50px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--light-bg);
    color: #212529;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    padding: 16px;
}

/* Main container */
.container-fluid {
    max-width: 1920px;
    margin: 0 auto;
}

/* Heading */
h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--dark-bg);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

h1 i {
    font-size: 20px;
    color: var(--primary-color);
}

/* Filter section */
.filters {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.filters .form-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.filters .form-control {
    font-size: 13px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.filters .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.2);
}

/* Customer table */
.customer-list-section {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-container {
    overflow-x: auto;
    max-height: calc(100vh - 300px);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.customer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.customer-table th,
.customer-table td {
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
    padding: 12px;
    font-size: 13px;
}

.customer-table th {
    background: var(--light-bg);
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 500;
}

.customer-table td {
    background: #fff;
}

.customer-table tr:hover {
    background-color: #f1f3f5;
}

/* Sort buttons */
.sort-btn {
    padding: 2px;
    color: var(--primary-color);
    vertical-align: middle;
}

.sort-btn:hover {
    color: var(--success-color);
}

.sort-btn.active {
    color: var(--primary-color);
    font-weight: bold;
}

/* Modal */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background-color: var(--primary-color);
    color: #fff;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    padding: 16px;
}

.modal-header .modal-title {
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 20px;
}

.modal-body h6 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal-body p {
    font-size: 13px;
    margin-bottom: 8px;
}

.modal-body .table {
    font-size: 13px;
}

.modal-body .form-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.modal-body .form-control {
    font-size: 13px;
    padding: 8px;
    border-radius: 8px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn,
.modal-body .btn {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
}

/* Loading indicator */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    z-index: 9999;
    align-items: center;
    gap: 8px;
}

.loading.show {
    display: flex;
}

.spinner-border {
    width: 20px;
    height: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding: 8px;
    }

    h1 {
        font-size: 20px;
    }

    .filters .row {
        flex-direction: column;
    }

    .filters .col-md-4 {
        width: 100%;
    }

    .customer-table th,
    .customer-table td {
        padding: 8px;
        font-size: 12px;
    }

    .modal-dialog {
        margin: 8px;
    }
}

@media (max-width: 576px) {
    .modal-body {
        padding: 16px;
    }

    .modal-footer .btn,
    .modal-body .btn {
        width: 100%;
        margin-bottom: 8px;
    }
}