/* ============================================================
   USER PROFILE MODAL — kartu "Lihat Profil" (read-only).
   Dipakai lintas halaman (Chat, navbar, Pengaturan). Theme-aware
   via token var(--...) yang sama dengan style.css / theme-dark.css.
============================================================ */

.upm-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .2s ease;
}
.upm-overlay.show { opacity: 1; }

.upm-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    transform: translateY(12px) scale(.98);
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
}
.upm-overlay.show .upm-card { transform: translateY(0) scale(1); }

.upm-close {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 2;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    color: #fff; font-size: 22px; line-height: 1;
    cursor: pointer; transition: background .15s;
}
.upm-close:hover { background: rgba(255, 255, 255, .38); }

.upm-cover {
    height: 96px;
    background: linear-gradient(120deg, var(--primary), #60a5fa 55%, #a78bfa);
}
.upm-head {
    display: flex;
    justify-content: center;
    margin-top: -46px;
}
.upm-avatar {
    position: relative;
    width: 96px; height: 96px;
    border-radius: 50%;
    border: 4px solid var(--surface);
    background-color: var(--surface-2); background-size: cover; background-position: center;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .2);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 700; color: #fff;
}
.upm-avatar:not(.has-img) { background-image: linear-gradient(135deg, var(--primary), var(--primary-hover)); }
.upm-avatar.has-img { cursor: zoom-in; }
.upm-avatar-dot {
    position: absolute; right: 5px; bottom: 5px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #22c55e; border: 3px solid var(--surface);
}

.upm-body { padding: 14px 24px 24px; text-align: center; }
.upm-name-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.upm-name-row h2 { font-size: 21px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.upm-you {
    font-size: 11px; font-weight: 600; color: var(--primary);
    background: rgba(37, 99, 235, .12); padding: 2px 9px; border-radius: 999px;
}

.upm-tags { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.upm-role-badge {
    font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
    background: rgba(37, 99, 235, .1); color: var(--primary);
}
.upm-role-badge.owner          { background: #eff6ff; color: #1d4ed8; }
.upm-role-badge.financemanager { background: #ecfeff; color: #0e7490; }
.upm-role-badge.finance        { background: #f0fdf4; color: #15803d; }
.upm-role-badge.gudang         { background: #fff7ed; color: #c2410c; }
.upm-role-badge.admin          { background: var(--surface-3); color: var(--text-light); }
.upm-role-badge.member         { background: #f1f5f9; color: #475569; }
.upm-role-badge.sestocreteam   { background: #fdf2f8; color: #be185d; }
.upm-jabatan {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; font-weight: 500; color: var(--text-light);
}
.upm-jabatan i { color: var(--primary); font-size: 15px; }
.upm-presence {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; color: #16a34a;
}
.upm-presence i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }

.upm-bio {
    margin-top: 14px;
    font-size: 13px; line-height: 1.6; color: var(--text-light);
    white-space: pre-wrap;
    padding: 12px 14px;
    background: var(--surface-2);
    border-radius: 12px;
}

.upm-rows { margin-top: 16px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.upm-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.upm-row:last-child { border-bottom: none; }
.upm-row-ico {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--primary); font-size: 17px;
}
.upm-row-main { display: flex; flex-direction: column; min-width: 0; }
.upm-row-label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-light); font-weight: 600; }
.upm-row-val { font-size: 13.5px; color: var(--text); font-weight: 500; word-break: break-word; }
.upm-row-val a { color: var(--primary); text-decoration: none; }
.upm-row-val a:hover { text-decoration: underline; }

.upm-edit-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 44px; margin-top: 18px;
    border-radius: 12px; border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff; font-family: "Poppins", sans-serif; font-size: 13.5px; font-weight: 600;
    text-decoration: none; box-shadow: 0 4px 14px rgba(37, 99, 235, .22);
    transition: transform .18s, box-shadow .18s;
}
.upm-edit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 99, 235, .3); }

/* Loading / error state */
.upm-state {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 200px; padding: 30px;
    font-size: 14px; color: var(--text-light);
}
.upm-state-err { flex-direction: column; color: var(--danger); }
.upm-state-err i { font-size: 34px; }
.upm-spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid var(--surface-3); border-top-color: var(--primary);
    animation: upm-spin .8s linear infinite;
}
@keyframes upm-spin { to { transform: rotate(360deg); } }

/* Lightbox foto profil ukuran penuh */
.upm-lightbox {
    position: fixed; inset: 0; z-index: 4100;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .85); cursor: zoom-out;
}
.upm-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 8px 32px #000; }

@media (max-width: 480px) {
    .upm-card { max-width: 100%; }
}