/*
 * customers.css
 *
 * Customers view: search + New customer toolbar, customer cards and the
 * profile sheet (Assign to sale, Edit). The sheet reuses .detail-side from
 * transactions.css for its phone bottom-sheet behaviour.
 */

.customers-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.customers-toolbar .search {
    flex: 1 1 320px;
}

.customers-toolbar__add {
    min-height: 72px;
    padding: 0 26px;
    border-radius: var(--r-26);
}

.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.customer-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 0;
    border-radius: var(--r-24);
    background: var(--surface);
    text-align: left;
    transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
    .customer-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(20, 22, 27, .07);
    }

    .customer-card.is-selected:hover {
        box-shadow: inset 0 0 0 2px var(--accent), 0 12px 28px rgba(20, 22, 27, .07);
    }
}

.customer-card:active {
    transform: scale(.98);
}

.customer-card.is-selected {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.customer-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.customer-card__top .avatar {
    width: 48px;
    height: 48px;
    font-size: var(--fs-lead);
}

.customer-card__top .chip {
    padding: 4px 10px;
}

.customer-card__name-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.customer-card__name {
    font-size: var(--fs-lead);
    font-weight: 800;
}

.customer-card__place {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-secondary);
    color: var(--muted);
}

.customer-card__contact {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    font-size: var(--fs-secondary);
    color: var(--text-2);
}

.customer-card__email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Profile sheet ---------- */

.profile-sheet {
    position: relative;
    gap: 16px;
}

.profile-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-head__avatar {
    width: 76px;
    height: 76px;
    font-size: var(--fs-title);
}

.profile-head__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-head__name {
    font-size: var(--fs-title);
    overflow-wrap: anywhere;
}

.profile-head__country {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
}

.profile-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.profile-facts .soft__value {
    font-weight: 700;
}

.profile-actions {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

@media (max-width: 767px) {
    .customers-toolbar__add {
        min-height: 60px;
        flex: 1 1 100%;
    }
}
