/* файл: clients.css
   стили для страницы управления клиентами и карточки клиента
   ============================================ */

.clients-view {
    /* padding: 1rem 0; */
}

.clients-search {
    min-width: 350px;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 0.1fr));
    gap: 1rem;
}

.client-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.client-card-login {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.client-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.client-login {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.client-card-details {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.client-phones {
    margin-bottom: 0.25rem;
    color: var(--text);
}

.client-cargo-count, .client-china-transfers-count {
    color: var(--text-muted);
}

.client-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.cargo-link-item {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cargo-link-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.cargo-link-item a:hover {
    text-decoration: underline;
}

.cargo-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cargo-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    background: var(--background-alt);
}

.phones-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.phone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border);
}

.delete-phone-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--error);
    padding: 0 0.25rem;
    transition: transform 0.1s;
}

.delete-phone-btn:hover {
    transform: scale(1.1);
}

.clients-header {
    display: flex;
    justify-content: start;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.client-address,
.client-email {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    word-break: break-word;
    line-height: 1.3;
}

.client-email {
    color: var(--primary);
}

.client-social {
    color: var(--text-muted);
}

.action-bar-clients {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 0.5rem;
    /* margin: 1rem 1rem 0 4.1rem; */
}

/* ===== ДОБАВЛЕННЫЕ СТИЛИ ДЛЯ КАРТОЧКИ КЛИЕНТА ===== */
.client-card-view {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* === Грид-сетка для карточки клиента === */

/* Сетка для двух колонок: первая 200px, вторая 100px */
.client-grid {
    display: grid;
    grid-template-columns: 200px 100px;
    gap: 1rem;
    align-items: start;
}

/* === Грид-сетка для карточки клиента с независимыми настройками строк === */

/* Строка 1: Имя / Компания + Логин */
.client-grid-row1 {
    display: grid;
    grid-template-columns: 300px 170px;
    /* Имя 200px, Логин 100px */
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

/* Строка 4: Соц. сети + Email */
.client-grid-row4 {
    display: grid;
    grid-template-columns: 235px 235px;
    /* Соц. сети 250px, Email 150px – меняйте отдельно */
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

/* Для элементов, занимающих всю ширину (телефоны, адрес, история) */
.client-grid-full {
    grid-column: span 2;
}

.qr-codes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.qr-code-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--background-alt);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    transition: transform 0.2s;
}

.qr-code-item:hover {
    transform: scale(1.02);
}

.qr-thumb {
    max-width: 80px;
    max-height: 80px;
    border-radius: 35px;
    cursor: pointer;
    object-fit: cover;
}

.qr-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.social-badge {
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.social-icon-item {
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 4px;
    background: var(--background-alt);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
}

.social-icon-item:hover {
    transform: scale(1.1);
    background: var(--primary-light);
    border-color: var(--primary);
}

.client-social-icon {
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 4px;
    background: var(--background-alt, #f8fafc);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light, #e2e8f0);
}

.client-social-icon:hover {
    transform: scale(1.1);
    background: var(--primary-light, #e0f2fe);
    border-color: var(--primary, #3b82f6);
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .client-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .client-grid-full {
        grid-column: span 1;
    }

    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .client-grid-row1,
    .client-grid-row4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}
















/* Модалка создания клиента */

/* ----- Переменные для гибкой настройки ----- */
:root {
    --profile-col-width: 1fr;
    --address-col-width: 1fr;
}

/* ----- Сетка модального окна ----- */
.add-client-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.add-client-top-row {
    display: grid;
    grid-template-columns: var(--profile-col-width) var(--address-col-width);
    gap: 0.8rem;
    align-items: start;
}

/* Карточка */
.field-card {
    background: #f8fafc;
    border-radius: 0.8rem;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-card h4 {
    margin: 0 0 0.2rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.field-card label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #475569;
    display: block;
    margin-bottom: 0.1rem;
}

/* Поля ввода */
.modern-input,
.modern-select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    background: white;
    box-sizing: border-box;
    transition: border 0.15s;
    margin-bottom: 0.3rem;
}

.modern-input:focus,
.modern-select:focus {
    border-color: #f97316;
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

/* Сетка внутри адреса */
.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

/* Блок QR */
.qr-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.6rem;
    padding: 0.5rem;
    background: #f9fafb;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.field-hint {
    font-size: 0.7rem;
    color: #64748b;
}

/* Общие стили модалки */
.modal-content {
    max-width: 95vw;
    overflow-y: auto;
    max-height: 90vh;
}

.modal-header {
    padding: 0.8rem 1.2rem 0.2rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}






/* Карточка клиента для пользователя */

/* ----- переменные для сетки ----- */
:root {
    --profile-col-width: 1fr;
    --address-col-width: 1fr;
}

.client-view-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.client-top-row {
    display: grid;
    grid-template-columns: var(--profile-col-width) var(--address-col-width);
    gap: 0.8rem;
    align-items: start;
}

/* ----- карточка ----- */
.field-card {
    background: #f8fafc;
    border-radius: 0.8rem;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-card h4 {
    margin: 0 0 0.2rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.field-card label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #475569;
    display: block;
    margin-bottom: 0.1rem;
}

/* ----- поля ввода ----- */
.modern-input,
.modern-select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    background: white;
    box-sizing: border-box;
    transition: border 0.15s;
    margin-bottom: 0.3rem;
}

.modern-input:focus,
.modern-select:focus {
    border-color: #f97316;
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

.modern-input:disabled,
.modern-select:disabled {
    background: #f3f4f6;
    opacity: 0.7;
}

/* ----- адресная сетка ----- */
.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* ----- телефоны и QR ----- */
.phones-list {
    margin-bottom: 0.3rem;
}

.phone-item {
    padding: 0.2rem 0;
    font-size: 0.85rem;
}

.qr-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.6rem;
    padding: 0.5rem;
    background: #f9fafb;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.qr-upload-area select {
    width: auto;
    margin-bottom: 0;
}

.qr-upload-area button {
    font-size: 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.3rem 0.6rem;
    border-radius: 8rem;
    cursor: pointer;
}

.field-hint {
    font-size: 0.7rem;
    color: #64748b;
}

/* ----- история грузов ----- */
.cargo-list {
    max-height: 200px;
    overflow-y: auto;
}

.cargo-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

.cargo-link-item:last-child {
    border-bottom: none;
}

.cargo-link {
    text-decoration: none;
    color: #2563eb;
    font-weight: 500;
}

.cargo-date,
.cargo-status {
    font-size: 0.75rem;
    color: #64748b;
}

.client-social-icons {
    margin-top: 0.5rem;
}