/* ===== ЭКРАН «КАРТОЧКА ПОЛЬЗОВАТЕЛЯ» ===== */

.user-lookup-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 4px 4px 40px;
}

.ul-search-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.ul-search-field {
    flex: 1;
    min-width: 260px;
    margin: 0;
}

.ul-search-field input {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
}

.ul-empty {
    text-align: center;
    padding: 72px 24px;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ul-empty i {
    font-size: 42px;
    color: #667eea;
    margin-bottom: 16px;
}

.ul-empty h3 {
    margin: 0 0 8px;
    color: #2c3e50;
}

.ul-deleted-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fff4e5;
    border: 1px solid #f0ad4e;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    color: #664d03;
}

.ul-deleted-banner i {
    font-size: 22px;
    margin-top: 2px;
    color: #d97706;
}

.ul-deleted-banner strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.ul-deleted-banner p {
    margin: 0;
    line-height: 1.45;
}

.user-lookup-container .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    color: #495057;
}

.ul-hero {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 24px;
    align-items: start;
}

.ul-hero-photo {
    width: 160px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    background: #f1f3f5;
    cursor: zoom-in;
}

.ul-hero-placeholder {
    width: 160px;
    height: 200px;
    border-radius: 12px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 48px;
}

.ul-hero-meta h2 {
    margin: 0 0 8px;
    font-size: 26px;
    color: #2c3e50;
}

.ul-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ul-id-row code {
    background: #f1f3f5;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
}

.ul-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ul-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef2ff;
    color: #3d4ea0;
}

.ul-badge.ok { background: #d4edda; color: #155724; }
.ul-badge.warn { background: #fff3cd; color: #856404; }
.ul-badge.danger { background: #f8d7da; color: #721c24; }
.ul-badge.muted { background: #e9ecef; color: #495057; }

.ul-kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 20px;
    margin: 0;
}

.ul-kv div {
    font-size: 14px;
    color: #2c3e50;
}

.ul-kv span {
    display: block;
    color: #7f8c8d;
    font-size: 12px;
    margin-bottom: 2px;
}

.ul-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ul-photos img,
.ul-card-photos img {
    width: 110px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    background: #f1f3f5;
}

.ul-section-count {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.ul-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ul-mm-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 14px;
    background: #fafbfc;
}

.ul-mm-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.ul-card-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ul-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ul-table th,
.ul-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #eef1f4;
    vertical-align: top;
}

.ul-table th {
    color: #6c757d;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ul-chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ul-chat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ul-chat-row:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.ul-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef2ff;
    flex-shrink: 0;
}

.ul-chat-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #eef2ff;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ul-chat-main {
    flex: 1;
    min-width: 0;
}

.ul-chat-name {
    font-weight: 600;
    color: #2c3e50;
}

.ul-chat-preview {
    color: #6c757d;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ul-chat-meta {
    text-align: right;
    font-size: 12px;
    color: #868e96;
    flex-shrink: 0;
}

.ul-muted {
    color: #868e96;
    font-size: 14px;
    margin: 0;
}

.ul-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.ul-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.ul-modal-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 14px;
    width: min(720px, calc(100% - 32px));
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.ul-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #eef1f4;
}

.ul-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.ul-modal-subtitle {
    margin: 4px 0 0;
    color: #6c757d;
    font-size: 13px;
}

.ul-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.ul-modal-footer {
    padding: 10px 18px 16px;
    border-top: 1px solid #eef1f4;
}

.ul-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ul-msg {
    max-width: 82%;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f1f3f5;
    color: #2c3e50;
}

.ul-msg.own {
    align-self: flex-end;
    background: #eef2ff;
}

.ul-msg-meta {
    font-size: 11px;
    color: #868e96;
    margin-bottom: 4px;
}

.ul-msg img {
    max-width: 220px;
    border-radius: 8px;
    display: block;
    cursor: zoom-in;
}

.ul-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.ul-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
}

@media (max-width: 720px) {
    .ul-hero {
        grid-template-columns: 1fr;
    }
}
