﻿.customers-page {
    width: 100%;
    height: 100dvh;
    padding: 20px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    overflow: hidden;
    background: radial-gradient(circle at top left, rgba(20, 184, 166, .14), transparent 34%), radial-gradient(circle at bottom right, rgba(37, 99, 235, .09), transparent 34%), linear-gradient(135deg, #f8fafc 0%, #eef3f8 100%);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #0f172a;
}

.customers-header {
    min-height: 92px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid rgba(219, 229, 239, .95);
    border-radius: 24px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.customers-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.customers-heading-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    font-size: 24px;
    box-shadow: inset 0 0 0 1px rgba(109, 40, 217, .08);
}

.customers-heading h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -.8px;
}

.customers-heading p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

    .customers-heading p strong {
        color: #0f766e;
        font-weight: 950;
    }

.back-pos-btn {
    min-height: 48px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    box-shadow: 0 12px 24px rgba(15, 118, 110, .2);
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

    .back-pos-btn:hover {
        transform: translateY(-1px);
        filter: brightness(.98);
        box-shadow: 0 16px 28px rgba(15, 118, 110, .24);
    }

.customers-toolbar {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    align-items: center;
    gap: 12px;
}

.customer-search-box {
    min-width: 0;
    height: 58px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #dbe5ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
    transition: border-color .16s ease, box-shadow .16s ease;
}

    .customer-search-box:focus-within {
        border-color: #0f766e;
        box-shadow: 0 0 0 4px rgba(15, 118, 110, .1), 0 12px 26px rgba(15, 23, 42, .06);
    }

    .customer-search-box > span {
        font-size: 20px;
    }

    .customer-search-box input {
        width: 100%;
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        color: #0f172a;
        font-size: 16px;
        font-weight: 850;
    }

        .customer-search-box input::placeholder {
            color: #94a3b8;
            opacity: 1;
        }

.clear-search-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 21px;
    line-height: 1;
    font-weight: 900;
}

    .clear-search-btn:hover {
        background: #fee2e2;
        color: #b91c1c;
    }

.customers-summary {
    height: 58px;
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #dbe5ef;
    border-radius: 18px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

    .customers-summary span {
        color: #64748b;
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
        letter-spacing: .6px;
    }

    .customers-summary strong {
        margin-top: 2px;
        color: #0f766e;
        font-size: 19px;
        line-height: 1;
        font-weight: 950;
    }

.customers-content {
    min-height: 0;
    overflow: hidden;
}

.customer-grid {
    height: 100%;
    min-height: 0;
    padding: 2px 5px 18px 2px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    grid-auto-rows: 104px;
    align-content: start;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .38) transparent;
}

    .customer-grid::-webkit-scrollbar {
        width: 8px;
    }

    .customer-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .customer-grid::-webkit-scrollbar-thumb {
        border: 2px solid transparent;
        border-radius: 999px;
        background: rgba(100, 116, 139, .34);
        background-clip: padding-box;
    }

        .customer-grid::-webkit-scrollbar-thumb:hover {
            background: rgba(71, 85, 105, .5);
            background-clip: padding-box;
        }

.customer-card {
    width: 100%;
    min-width: 0;
    height: 104px;
    padding: 14px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 19px;
    background: rgba(255, 255, 255, .94);
    color: #0f172a;
    text-align: left;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

    .customer-card:hover {
        transform: translateY(-2px);
        border-color: rgba(15, 118, 110, .5);
        background: #fff;
        box-shadow: 0 14px 28px rgba(15, 23, 42, .09);
    }

    .customer-card:focus-visible {
        outline: 3px solid rgba(20, 184, 166, .25);
        outline-offset: 2px;
    }

.customer-avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #ccfbf1, #e0f2fe);
    color: #0f766e;
    font-size: 16px;
    font-weight: 950;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .05);
}

.customer-info {
    min-width: 0;
}

.customer-name {
    display: -webkit-box;
    overflow: hidden;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 950;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.customer-code {
    margin-top: 5px;
    color: #0f766e;
    font-size: 12px;
    line-height: 1;
    font-weight: 950;
}

.customer-city {
    min-width: 0;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .customer-city span {
        flex: 0 0 auto;
        font-size: 12px;
    }

.customer-arrow {
    color: #94a3b8;
    font-size: 24px;
    font-weight: 700;
    transition: transform .14s ease, color .14s ease;
}

.customer-card:hover .customer-arrow {
    transform: translateX(2px);
    color: #0f766e;
}

.empty-box {
    height: 100%;
    min-height: 260px;
    padding: 30px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 9px;
    border: 1px dashed #cbd5e1;
    border-radius: 22px;
    background: rgba(255, 255, 255, .74);
    color: #64748b;
    text-align: center;
}

    .empty-box > span:not(.loading-spinner) {
        font-size: 36px;
    }

    .empty-box strong {
        color: #334155;
        font-size: 16px;
        font-weight: 950;
    }

    .empty-box small {
        font-size: 13px;
        font-weight: 750;
    }

    .empty-box button {
        min-height: 42px;
        margin-top: 5px;
        padding: 0 16px;
        border: 0;
        border-radius: 12px;
        background: #0f766e;
        color: #fff;
        font-size: 13px;
        font-weight: 900;
    }

.error-box {
    border-color: #fecaca;
    background: rgba(254, 226, 226, .7);
}

    .error-box strong {
        color: #991b1b;
    }

.loading-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid #dbe5ef;
    border-top-color: #0f766e;
    border-radius: 50%;
    animation: customer-spin .8s linear infinite;
}

@keyframes customer-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1200px) {
    .customer-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 760px) {
    .customers-page {
        height: auto;
        min-height: 100dvh;
        padding: 12px;
        grid-template-rows: auto auto auto;
        overflow: visible;
    }

    .customers-header {
        align-items: stretch;
        flex-direction: column;
        border-radius: 20px;
    }

    .back-pos-btn {
        width: 100%;
    }

    .customers-toolbar {
        grid-template-columns: 1fr;
    }

    .customers-summary {
        display: none;
    }

    .customers-content {
        overflow: visible;
    }

    .customer-grid {
        height: auto;
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        overflow: visible;
    }

    .customer-card {
        height: auto;
        min-height: 96px;
    }
}
.customer-row.keyboard-selected,
.customer-option.keyboard-selected {
    border-color: #14b8a6 !important;
    background: #ecfdf5 !important;
    box-shadow: inset 4px 0 0 #0f766e;
}
