/* =========================
   CUSTOMERS PAGE
========================= */

.customers-page {
    min-height: calc(100vh - 100px);
}


/* HEADER */

.customers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 24px;
}

.customers-header h3 {
    font-size: 21px;
}

.customers-header p {
    margin-top: 5px;

    color: var(--text-soft);
    font-size: 13px;
}


/* =========================
   STATS
========================= */

.customers-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 20px;
}

.customer-stat {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 20px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);
}

.customer-stat__icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 12px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 18px;
}

.customer-stat > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 5px;

    min-width: 0;
}

.customer-stat span {
    color: var(--text-soft);
    font-size: 12px;
}

.customer-stat strong {
    font-size: 23px;
}


/* =========================
   CARD
========================= */

.customers-card {
    padding: 0;
    overflow: hidden;
}


/* =========================
   TOOLBAR
========================= */

.customers-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 18px;

    border-bottom: 1px solid var(--border);
}

.customers-search {
    width: min(380px, 100%);

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 13px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 10px;
}

.customers-search i {
    color: var(--text-light);
}

.customers-search input {
    width: 100%;

    border: none;
    outline: none;

    background: transparent;
    color: var(--text);
}

.customers-search input::placeholder {
    color: var(--text-light);
}

.customers-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customers-select {
    min-height: 40px;

    padding: 0 12px;

    background: var(--surface-soft);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 10px;

    outline: none;
}


/* =========================
   TABLE
========================= */

.customers-table {
    width: 100%;
    border-collapse: collapse;
}

.customers-table th,
.customers-table td {
    padding: 15px 18px;

    text-align: left;
    white-space: nowrap;

    border-bottom: 1px solid var(--border);
}

.customers-table th {
    color: var(--text-soft);

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.customers-table td {
    font-size: 13px;
}

.customers-table tbody tr {
    transition: background 0.2s ease;
}

.customers-table tbody tr:hover {
    background: var(--surface-soft);
}

.customers-table tbody tr:last-child td {
    border-bottom: none;
}


/* CUSTOMER */

.customer-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.customer-avatar {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 11px;
    font-weight: 700;
}

.customer-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.customer-info strong {
    font-size: 12px;
}

.customer-info span {
    color: var(--text-soft);
    font-size: 10px;
}


/* =========================
   STATUS
========================= */

.customer-status {
    display: inline-flex;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}

.customer-status.active {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.customer-status.new {
    background: rgba(37, 99, 235, 0.12);
    color: #3b82f6;
}

.customer-status.inactive {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-soft);
}


/* =========================
   ACTION
========================= */

.view-customer-button {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: var(--surface-soft);
    color: var(--text-soft);

    transition: 0.2s ease;
}

.view-customer-button:hover {
    background: var(--primary-soft);
    color: var(--primary);
}


/* =========================
   EMPTY
========================= */

.customers-empty {
    min-height: 280px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 30px;

    text-align: center;
}

.customers-empty[hidden] {
    display: none;
}

.customers-empty i {
    margin-bottom: 8px;

    color: var(--text-light);
    font-size: 34px;
}

.customers-empty span {
    color: var(--text-soft);
    font-size: 12px;
}


/* =========================
   PAGINATION
========================= */

.customers-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 16px 18px;

    border-top: 1px solid var(--border);

    color: var(--text-soft);
    font-size: 12px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-button {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: var(--surface-soft);
    color: var(--text);
}

.pagination-button:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.pagination-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#customersCurrentPage {
    min-width: 42px;

    text-align: center;

    color: var(--text);
    font-weight: 700;
}


/* =========================
   MODAL
========================= */

.customer-modal {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    opacity: 0;
    visibility: hidden;

    z-index: 2000;

    transition: 0.2s ease;
}

.customer-modal.open {
    opacity: 1;
    visibility: visible;
}

.customer-modal__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(2, 6, 23, 0.68);

    backdrop-filter: blur(3px);
}

.customer-modal__content {
    position: relative;

    width: min(560px, 100%);

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.28);

    transform: translateY(10px);

    transition: transform 0.2s ease;
}

.customer-modal.open .customer-modal__content {
    transform: translateY(0);
}

.customer-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 20px;

    border-bottom: 1px solid var(--border);
}

.modal-customer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-customer__avatar {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 12px;
    font-weight: 700;
}

.modal-customer span {
    color: var(--text-soft);
    font-size: 11px;
}

.modal-customer h3 {
    margin-top: 3px;
    font-size: 18px;
}

.customer-modal__body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 20px;

    padding: 22px;
}

.customer-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.customer-detail span {
    color: var(--text-soft);
    font-size: 11px;
}

.customer-detail strong {
    font-size: 13px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {

    .customers-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .customers-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .customers-search {
        width: 100%;
    }

    .customers-filters {
        width: 100%;
    }

    .customers-select {
        flex: 1;
    }
}


@media (max-width: 768px) {

    .customers-header {
        align-items: stretch;
        flex-direction: column;
    }

    .customers-header .button {
        align-self: flex-start;
    }

    .customers-table {
        min-width: 800px;
    }
}


@media (max-width: 520px) {

    .customers-stats {
        grid-template-columns: 1fr;
    }

    .customers-header .button {
        width: 100%;
    }

    .customers-filters {
        flex-direction: column;
    }

    .customers-select {
        width: 100%;
    }

    .customers-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .customer-modal__body {
        grid-template-columns: 1fr;
    }
}