/* Shared profile editor: scoped to protect the conversation layouts. */
#profile-editor-modal {
    --editor-bg: var(--bg-sidebar, var(--bg-card, #fff));
    --editor-panel: var(--bg-main, var(--bg-input, #f5f7fa));
    --editor-text: var(--text-main, #203047);
    --editor-muted: var(--text-muted, #65748a);
    --editor-border: var(--border-color, #e2e8f0);
    --editor-accent: var(--accent-text, var(--primary-color, #00bfa5));
    --editor-soft: color-mix(in srgb, var(--primary-color, #00bfa5) 9%, var(--editor-bg));
    height: var(--client-viewport-height, 100dvh); padding: 24px; background: #0c142780; backdrop-filter: blur(6px);
}
#profile-editor-modal * { box-sizing: border-box; }
#profile-editor-modal .custom-editor-dialog { width: 1080px; max-width: 100%; height: min(90dvh, 870px); max-height: 100%; display: flex; flex-direction: column; border: 1px solid var(--editor-border); border-radius: 20px; overflow: hidden; color: var(--editor-text); background: var(--editor-bg); box-shadow: 0 24px 90px #00000030; }
.profile-editor-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px; border-bottom: 1px solid var(--editor-border); }
.profile-editor-eyebrow { color: var(--editor-muted); font-size: 8px; font-weight: 600; letter-spacing: 1.6px; }
#profile-editor-title { margin: 5px 0 6px; font-size: 20px; letter-spacing: -.6px; color: var(--editor-text); }
.profile-editor-header p { margin: 0; font-size: 11px; line-height: 1.6; color: var(--editor-muted); }
#profile-editor-modal .editor-close-btn { position: static; margin: 0; width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--editor-border); border-radius: 10px; color: var(--editor-muted); background: var(--editor-bg); }
#profile-editor-modal .editor-close-btn:hover { color: var(--editor-text); background: var(--editor-panel); }
.profile-editor-content { display: flex; flex: 1; min-height: 0; overflow: hidden; }
#profile-editor-modal .custom-editor-sidebar { width: 368px; min-width: 0; flex-shrink: 0; padding: 24px; overflow-y: auto; background: var(--editor-bg); border-right: 1px solid var(--editor-border); scrollbar-width: thin; scrollbar-color: var(--editor-border) transparent; }
#profile-editor-modal .custom-config-section { margin-bottom: 25px; }
#profile-editor-modal .section-heading-label { color: var(--editor-text); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; display: block; margin-bottom: 10px; }
.profile-photo-control { display: flex; align-items: center; gap: 14px; }
.profile-avatar-choose { position: relative; width: 64px; height: 64px; flex: 0 0 64px; padding: 0; border: 1px solid var(--editor-border); border-radius: 18px; background: var(--editor-panel); cursor: pointer; }
.profile-avatar-choose img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-avatar-choose > span { position: absolute; bottom: -4px; right: -5px; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--editor-bg); border-radius: 8px; background: var(--editor-soft); color: var(--editor-accent); font-size: 13px; }
.profile-photo-control strong { font-size: 10px; font-weight: 600; }
.profile-photo-control p, .profile-field-help { margin: 6px 0 10px; font-size: 10px; line-height: 1.7; color: var(--editor-muted); }
#profile-editor-modal .profile-upload-action { border: 1px solid var(--editor-border); border-radius: 7px; background: var(--editor-bg); color: var(--editor-accent); padding: 5px 9px; font-size: 10px; cursor: pointer; }
#profile-editor-modal .display-name-styler-box { border: 1px solid var(--editor-border); border-radius: 10px; background: var(--editor-panel); }
#profile-editor-modal .name-styler-input { width: 100%; height: 42px; padding: 10px 12px; background: transparent; color: var(--editor-text); font-size: 13px; }
#profile-editor-modal .font-selection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
#profile-editor-modal .font-chip-btn { position: relative; min-width: 0; min-height: 46px; padding: 8px 6px; border: 1px solid var(--editor-border); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--editor-bg); color: var(--editor-text); box-shadow: none; cursor: pointer; }
#profile-editor-modal .font-chip-btn:hover { background: var(--editor-panel); border-color: var(--editor-border); }
#profile-editor-modal .font-chip-btn.active { background: var(--editor-soft); border-color: var(--editor-accent); color: var(--editor-accent); }
.font-choice-label { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
.font-choice-check { position: absolute; top: 3px; right: 3px; font-size: 9px; display: none; }
.font-chip-btn.active .font-choice-check { display: block; }
#profile-editor-modal .section-heading-row { align-items: center; gap: 12px; margin-bottom: 10px; }
#profile-editor-modal .section-heading-row .section-heading-label { margin-bottom: 0; }
#profile-editor-modal .btn-text-danger { color: #b54747; font-size: 11px; }
body.dark-mode #profile-editor-modal .btn-text-danger, :root[data-client-theme="dark"] #profile-editor-modal .btn-text-danger { color: #e28383; }
#profile-editor-modal .banner-customizer-box { display: flex; flex-direction: column; gap: 12px; }
#profile-editor-modal .banner-upload-slot { order: -1; flex: 0 0 96px; position: relative; width: 100%; height: 96px; border: 1px solid var(--editor-border); border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; background: var(--editor-soft); }
#profile-editor-modal .slot-banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; background-position: center; background-size: cover; }
.banner-upload-caption { position: absolute; bottom: 8px; left: 8px; padding: 5px 8px; font: 9px 'Plus Jakarta Sans', sans-serif; color: #fff; background: #111827a8; border-radius: 6px; }
#profile-editor-modal .slot-badge-action { position: absolute; bottom: 8px; right: 8px; color: var(--editor-text); background: var(--editor-bg); border: 1px solid var(--editor-border); width: 26px; height: 26px; border-radius: 8px; }
#profile-editor-modal .banner-color-pickers { width: 100%; gap: 16px; }
#profile-editor-modal .color-picker-item { flex-direction: row; align-items: center; gap: 7px; }
#profile-editor-modal .color-picker-item input { width: 32px; height: 28px; border: 1px solid var(--editor-border); border-radius: 7px; padding: 2px; background: var(--editor-panel); }
#profile-editor-modal .color-picker-label { font-size: 9px; color: var(--editor-muted); }
#profile-editor-modal .bio-editor-textarea { width: 100%; min-height: 95px; padding: 12px; font-size: 12px; line-height: 1.8; background: var(--editor-panel); color: var(--editor-text); border: 1px solid var(--editor-border); border-radius: 10px; }
.profile-presence-options { padding: 0; border: 0; margin: 0; }
.profile-presence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#profile-editor-modal .profile-presence-grid button { min-height: 40px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--editor-border); border-radius: 9px; color: var(--editor-text); background: var(--editor-bg); font: 11px 'Plus Jakarta Sans', sans-serif; cursor: pointer; }
#profile-editor-modal .profile-presence-grid button[aria-pressed="true"] { border-color: var(--editor-accent); background: var(--editor-soft); }
#profile-editor-modal .custom-preview-column.split-view-mode { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 36px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 16px; background: var(--editor-panel); scrollbar-width: thin; scrollbar-color: var(--editor-border) transparent; }
#profile-editor-modal .preview-badge-header { margin: 0; flex-shrink: 0; width: 100%; max-width: 420px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--editor-muted); text-transform: none; font-size: 10px; letter-spacing: 0; }
#profile-editor-modal .preview-badge-header i { color: var(--editor-accent); }
#profile-editor-modal .split-profile-card { display: block; width: 100%; max-width: 420px; flex-shrink: 0; min-height: 0; border: 1px solid var(--editor-border); border-radius: 18px; overflow: hidden; background: var(--editor-bg); box-shadow: 0 6px 22px #00000006; }
#profile-editor-modal .profile-card-left-poster { display: none; }
#profile-editor-modal .profile-card-right-info { width: 100%; min-width: 0; background: var(--editor-bg); border-radius: 0; }
#profile-editor-modal .card-info-banner-wrap { height: 145px; }
#profile-editor-modal .card-info-banner-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
#profile-editor-modal .card-info-avatar-overlap { margin: -29px 0 0; padding: 0 22px; }
#profile-editor-modal .avatar-ring-box { width: 66px; height: 66px; }
#profile-editor-modal .avatar-ring-box img { width: 66px; height: 66px; border: 4px solid var(--editor-bg); }
#profile-editor-modal .avatar-online-dot { border-color: var(--editor-bg); }
#profile-editor-modal .avatar-online-dot.profile-presence-dot { width: 14px; height: 14px; }
#profile-editor-modal .card-info-body { padding: 15px 22px 22px; }
#profile-editor-modal .card-info-header-row { align-items: flex-start; gap: 12px; }
#profile-editor-modal .card-info-header-row h3 { color: var(--editor-text); margin-bottom: 5px; }
#profile-editor-modal .card-handle-text { color: var(--editor-muted); font-size: 11px; }
#profile-editor-modal .card-roles-badges { margin: 12px 0; }
#profile-editor-modal .role-badge-chip { border-color: var(--editor-border); background: var(--editor-panel); color: var(--editor-muted); font-size: 9px; }
#profile-editor-modal .card-bio-paragraph { color: var(--editor-muted); font-size: 12px; line-height: 1.8; margin: 10px 0 0; max-height: 110px; overflow-y: auto; overflow-wrap: anywhere; white-space: pre-wrap; }
.profile-dock-preview-wrap { width: 100%; max-width: 420px; flex-shrink: 0; }
.profile-dock-caption { display: block; color: var(--editor-muted); margin: 3px 0 12px; font-size: 8px; letter-spacing: 1.3px; font-weight: 600; }
.profile-dock-preview { position: relative; isolation: isolate; display: flex; align-items: center; gap: 12px; min-height: 139px; padding: 74px 18px 18px; border: 1px solid var(--editor-border); border-radius: 14px; overflow: hidden; background: var(--editor-bg); }
#profile-dock-banner { position: absolute; inset: 0 0 auto; height: 89px; z-index: -1; }
#profile-dock-banner img { width: 100%; height: 100%; object-fit: cover; }
#profile-dock-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 35%, var(--editor-bg)); }
.profile-dock-avatar { width: 43px; height: 43px; object-fit: cover; border: 3px solid var(--editor-bg); border-radius: 12px; flex-shrink: 0; }
.profile-dock-copy { min-width: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
#profile-dock-name { color: var(--editor-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-dock-copy .presence-badge { font-size: 10px; }
.profile-dock-edit { color: var(--editor-muted); font-size: 13px; }
.profile-editor-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 74px; padding: 15px 24px; border-top: 1px solid var(--editor-border); background: var(--editor-bg); }
#profile-editor-modal .feedback-notification { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; font-size: 11px; line-height: 1.6; }
.profile-editor-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
#profile-editor-modal #cancel-profile-edit { min-height: 41px; padding: 10px 17px; border: 1px solid var(--editor-border); border-radius: 9px; background: transparent; color: var(--editor-muted); font: 11px 'Plus Jakarta Sans', sans-serif; cursor: pointer; }
#profile-editor-modal #save-profile-btn { width: auto; margin: 0; min-height: 41px; padding: 10px 18px; border: 1px solid var(--editor-accent); border-radius: 9px; background: var(--editor-soft); color: var(--editor-accent); font: 600 11px 'Plus Jakarta Sans', sans-serif; box-shadow: none; cursor: pointer; }
#profile-editor-modal #save-profile-btn:disabled { opacity: .5; cursor: wait; }
#profile-editor-modal :focus-visible { outline: 2px solid var(--editor-accent); outline-offset: 3px; }
.attendance-workspace .profile-section { min-height: 146px; padding: 72px 18px 18px; grid-template-columns: 44px 1fr 18px; column-gap: 11px; overflow: hidden; }
.attendance-workspace .profile-banner { inset: 0 0 auto; height: 91px; opacity: 1; background: var(--primary-color); }
.attendance-workspace .profile-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.attendance-workspace .profile-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 35%, var(--bg-sidebar)); }
.attendance-workspace .profile-section .profile-pic { width: 44px; height: 44px; border: 3px solid var(--bg-sidebar); border-radius: 12px; }
.attendance-workspace .profile-section h2 { color: var(--text-main); }
[data-presence="online"] { --presence-color: #22c55e; --presence-text: #166534; }
[data-presence="inativo"] { --presence-color: #eab308; --presence-text: #7a5e00; }
[data-presence="indisponivel"] { --presence-color: #ef4444; --presence-text: #b42323; }
[data-presence="offline"] { --presence-color: #94a3b8; --presence-text: #56606f; }
.dark-mode [data-presence="online"] { --presence-text: #86efac; }
.dark-mode [data-presence="inativo"] { --presence-text: #fde047; }
.dark-mode [data-presence="indisponivel"] { --presence-text: #fca5a5; }
.dark-mode [data-presence="offline"] { --presence-text: #b2bfce; }
.profile-presence-dot, .user-status-dot[data-presence], #profile-editor-modal .avatar-online-dot[data-presence] { background: var(--presence-color, #22c55e); }
.profile-presence-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.presence-badge { color: var(--presence-text, #166534); }
.presence-badge::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 5px; vertical-align: 1px; border-radius: 50%; background: var(--presence-color, #22c55e); }
#profile-editor-modal .status-greeting-pill { color: var(--presence-text); background: color-mix(in srgb, var(--presence-color) 11%, transparent); border-radius: 7px; padding: 5px 8px; font-size: 9px; white-space: nowrap; }
.attendance-workspace .status-badge[data-presence] { color: var(--presence-text); background: transparent; }
.attendance-workspace .status-badge[data-presence]::before { background: var(--presence-color); }
.member-status-dot.status-indisponivel, .user-status-dot.status-indisponivel { background: #ef4444; }
@media (max-width: 740px) {
    #profile-editor-modal { padding: calc(12px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom)); }
    #profile-editor-modal .custom-editor-dialog { width: 100%; height: 100%; border-radius: 16px; }
    .profile-editor-header { padding: 17px 18px; gap: 10px; }
    #profile-editor-title { font-size: 17px; }
    .profile-editor-header p { font-size: 10px; }
    .profile-editor-content { flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
    #profile-editor-modal .custom-editor-sidebar { width: 100%; padding: 20px; border-right: 0; overflow: visible; flex-shrink: 0; }
    #profile-editor-modal .name-styler-input, #profile-editor-modal .bio-editor-textarea { font-size: 16px; }
    #profile-editor-modal .custom-preview-column.split-view-mode { width: 100%; padding: 22px 20px; overflow: visible; flex-shrink: 0; border-top: 1px solid var(--editor-border); }
    #profile-editor-modal .card-info-banner-wrap { height: 122px; }
    #profile-editor-modal .card-info-body { padding: 15px 18px 20px; }
    #profile-editor-modal .card-info-header-row { flex-wrap: wrap; gap: 10px; }
    .profile-editor-footer { padding: 12px 14px; min-height: 68px; flex-wrap: wrap; gap: 10px; }
    #profile-editor-modal .feedback-notification { flex-basis: 100%; }
    .profile-editor-actions { width: 100%; margin: 0; }
    #profile-editor-modal #cancel-profile-edit, #profile-editor-modal #save-profile-btn { flex: 1; }
}
