fix(khira): complete enterprise overhaul for profile settings and unified modal dialog system
This commit is contained in:
+245
-111
@@ -247,9 +247,27 @@ function fld(n,l,o={}){
|
||||
const rad=(n,items,cur)=>`<div class="rg">${items.map(([v,l])=>`<label><input type="radio" name="${n}" value="${esc(v)}"${v===cur?' checked':''}><span>${esc(l)}</span></label>`).join('')}</div>`;
|
||||
|
||||
function dlg(o){
|
||||
const d=$('#dlg');d.className=o.wide?'wide':'';
|
||||
d.innerHTML=`<form class="dc" novalidate><h3>${o.title}</h3>${o.sub?`<p class="sub">${o.sub}</p>`:''}<div class="db">${o.body}</div><div class="da"><button type="button" class="tb" data-x>Cancel</button>${o.alt?`<button type="button" class="tb" data-alt>${o.alt[0]}</button>`:''}<button class="fb">${o.ok}</button></div></form>`;
|
||||
const d=$('#dlg');
|
||||
d.className = 'app-modal-dialog' + (o.wide ? ' wide' : '');
|
||||
d.innerHTML = `<form class="dc" novalidate>
|
||||
<div class="dh">
|
||||
<div class="dh-titles">
|
||||
<h3>${o.title}</h3>
|
||||
${o.sub ? `<p class="sub">${o.sub}</p>` : ''}
|
||||
</div>
|
||||
<button type="button" class="ib" data-x aria-label="Close">${ic('close', 16)}</button>
|
||||
</div>
|
||||
<div class="db">${o.body}</div>
|
||||
<div class="da">
|
||||
${o.alt ? `<button type="button" class="btn-alt" data-alt>${o.alt[0]}</button>` : ''}
|
||||
<button type="button" class="tb" data-x>Cancel</button>
|
||||
<button class="fb">${o.ok || 'Save'}</button>
|
||||
</div>
|
||||
</form>`;
|
||||
const f=d.querySelector('form');
|
||||
f.querySelectorAll('[data-x]').forEach(btn => {
|
||||
btn.onclick = () => { if(d.open) d.close(); };
|
||||
});
|
||||
if(o.alt)f.querySelector('[data-alt]').onclick=o.alt[1];
|
||||
if(o.init)o.init(f);
|
||||
f.onsubmit=async e=>{
|
||||
@@ -2234,131 +2252,247 @@ function adminRollbackDB(){
|
||||
|
||||
/* ── Profile & Avatar Selector ── */
|
||||
function profile(){
|
||||
const cur=S.u;
|
||||
const isAdm=cur.username==='admin'||cur.role==='team_lead'||cur.role==='lead';
|
||||
let curType=cur.avatar_type||'emoji';
|
||||
let curEmoji=cur.avatar||'👤';
|
||||
let curImgUrl=cur.profile_image||'';
|
||||
const cur = S.u;
|
||||
let curImgUrl = cur.profile_image || '';
|
||||
let curType = curImgUrl ? 'image' : (cur.avatar_type || 'initials');
|
||||
let curColor = cur.avatar_color || getUserColor(cur.username);
|
||||
|
||||
const updatePreview=()=>{
|
||||
const prevWrap=$('#avPreview');
|
||||
if(!prevWrap)return;
|
||||
const tempUser={...cur,avatar_type:curType,avatar:curEmoji,profile_image:curImgUrl};
|
||||
prevWrap.innerHTML=avHtml(tempUser,88);
|
||||
const getPreviewHtml = (imgUrl, color, name) => {
|
||||
if (imgUrl) {
|
||||
return `<div class="profile-avatar-wrap">
|
||||
<img src="${esc(imgUrl)}" alt="${esc(name || cur.name || '')}" class="profile-avatar-img">
|
||||
</div>`;
|
||||
}
|
||||
const inits = getInitials(name || cur.name || cur.username);
|
||||
return `<div class="profile-avatar-wrap" style="background:${color};color:#ffffff">
|
||||
<span class="profile-avatar-initials">${inits}</span>
|
||||
</div>`;
|
||||
};
|
||||
|
||||
const colors = [
|
||||
{ name: 'Blue', hex: '#3b82f6' },
|
||||
{ name: 'Emerald', hex: '#10b981' },
|
||||
{ name: 'Indigo', hex: '#6366f1' },
|
||||
{ name: 'Amber', hex: '#f59e0b' },
|
||||
{ name: 'Rose', hex: '#f43f5e' },
|
||||
{ name: 'Purple', hex: '#8b5cf6' },
|
||||
{ name: 'Cyan', hex: '#06b6d4' },
|
||||
{ name: 'Slate', hex: '#475569' }
|
||||
];
|
||||
|
||||
dlg({
|
||||
title:'Profile Settings',
|
||||
sub:`@${cur.username} · ${cur.role_display}`,
|
||||
wide:1,
|
||||
body:`
|
||||
<div class="av-section">
|
||||
<div class="av-preview" id="avPreview"></div>
|
||||
<div class="seg av-tabs" id="avModeTabs">
|
||||
<button type="button" class="${curType==='emoji'?'on':''}" data-avm="emoji">Choose Avatar</button>
|
||||
<button type="button" class="${curType==='image'?'on':''}" data-avm="image">Upload Photo</button>
|
||||
</div>
|
||||
<div id="paneEmoji" class="av-pane" ${curType==='image'?'hidden':''}>
|
||||
<div class="av-grid" id="avGrid">
|
||||
${isAdm?`<button type="button" class="av-opt av-opt-admin ${curEmoji==='A'?'on':''}" data-emoji="A" title="Official Team Lead Avatar">${adminSvgA}</button>`:''}
|
||||
${EMOJIS.map(e=>`<button type="button" class="av-opt ${curEmoji===e&&curEmoji!=='A'?'on':''}" data-emoji="${e}">${e}</button>`).join('')}
|
||||
title: 'Account & Profile Settings',
|
||||
sub: `@${cur.username} · ${cur.role_display}`,
|
||||
wide: 1,
|
||||
body: `
|
||||
<div class="profile-card-hero">
|
||||
<div id="profileAvatarPreview">${getPreviewHtml(curImgUrl, curColor, cur.name)}</div>
|
||||
<div class="profile-hero-info">
|
||||
<h4>${esc(cur.name || cur.username)}</h4>
|
||||
<div class="profile-tags-row">
|
||||
<span class="chip-role">${esc(cur.role_display)}</span>
|
||||
<span class="mono" style="font-size:12px;color:var(--text-muted)">@${esc(cur.username)}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="paneImage" class="av-pane" ${curType==='emoji'?'hidden':''}>
|
||||
<div class="av-upload-box">
|
||||
<input type="file" id="avFileInput" accept="image/*" class="hidden">
|
||||
<label for="avFileInput" class="upload-btn">${ic('upload',16)} Choose Image File</label>
|
||||
<p class="sub" style="font-size:11px;margin-top:6px">PNG, JPG or WebP. Max 5MB.</p>
|
||||
<div class="profile-avatar-actions">
|
||||
<input type="file" id="profileFileInput" accept="image/png,image/jpeg,image/webp" style="display:none">
|
||||
<button type="button" class="action-chip primary" id="btnUploadPhoto">
|
||||
${ic('upload', 14)} <span>Upload Photo</span>
|
||||
</button>
|
||||
<button type="button" class="action-chip" id="btnUseInitials">
|
||||
${ic('refresh', 14)} <span>Use Initials</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
${fld('name','Full name',{req:1,v:cur.name})}
|
||||
<input type="hidden" name="avatar_type" id="hidAvType" value="${curType}">
|
||||
<input type="hidden" name="avatar" id="hidAvEmoji" value="${curEmoji}">
|
||||
<input type="hidden" name="profile_image" id="hidAvImg" value="${curImgUrl}">
|
||||
|
||||
<div class="profile-palette-section" id="initialsColorSection" ${curImgUrl ? 'hidden' : ''}>
|
||||
<label class="section-micro-label">Initials Avatar Accent Color</label>
|
||||
<div class="color-swatches-grid">
|
||||
${colors.map(c => `
|
||||
<button type="button" class="color-swatch-btn ${curColor === c.hex ? 'active' : ''}" data-color="${c.hex}" style="--swatch:${c.hex}" title="${c.name}"></button>
|
||||
`).join('')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="profile-fields-grid">
|
||||
<div class="profile-form-group">
|
||||
<label>Full Name</label>
|
||||
<input type="text" name="name" id="profNameInp" value="${esc(cur.name || '')}" placeholder="Your full name" required>
|
||||
</div>
|
||||
|
||||
<div class="profile-form-group">
|
||||
<label>Username</label>
|
||||
<div class="input-with-lock">
|
||||
<input type="text" value="@${esc(cur.username)}" readonly disabled>
|
||||
<span class="lock-icon" title="Username cannot be altered">${ic('lock', 14)}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="profile-form-group">
|
||||
<label>Role & Access Level</label>
|
||||
<input type="text" value="${esc(cur.role_display)}" readonly disabled>
|
||||
</div>
|
||||
|
||||
<div class="profile-form-group">
|
||||
<label>Organization</label>
|
||||
<input type="text" value="Khira Engineering & Telemetry" readonly disabled>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="profile-security-accordion">
|
||||
<div class="security-accordion-header" id="btnToggleSecurity">
|
||||
<div style="display:flex;align-items:center;gap:8px">
|
||||
${ic('lock', 16)}
|
||||
<strong>Change Password</strong>
|
||||
</div>
|
||||
<span style="font-size:12px;color:var(--text-muted)">Optional</span>
|
||||
</div>
|
||||
<div class="security-accordion-body" id="securityBody" hidden>
|
||||
<div class="profile-fields-grid" style="margin-top:12px">
|
||||
<div class="profile-form-group" style="grid-column:1/-1">
|
||||
<label>Current Password</label>
|
||||
<input type="password" name="current_password" placeholder="Required to set a new password" autocomplete="current-password">
|
||||
</div>
|
||||
<div class="profile-form-group">
|
||||
<label>New Password</label>
|
||||
<input type="password" name="new_password" placeholder="Minimum 6 characters" autocomplete="new-password">
|
||||
</div>
|
||||
<div class="profile-form-group">
|
||||
<label>Confirm New Password</label>
|
||||
<input type="password" name="confirm_password" placeholder="Repeat new password" autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="profile_image" id="hidProfImg" value="${esc(curImgUrl)}">
|
||||
<input type="hidden" name="avatar_color" id="hidProfColor" value="${esc(curColor)}">
|
||||
<input type="hidden" name="avatar_type" id="hidProfType" value="${esc(curType)}">
|
||||
`,
|
||||
ok:'Save Changes',
|
||||
alt:['Sign out',async()=>{await api('/khira/api/auth/logout','POST');localStorage.removeItem('khira_active_user');location.reload()}],
|
||||
init:f=>{
|
||||
updatePreview();
|
||||
const tabs=f.querySelectorAll('#avModeTabs button');
|
||||
const paneE=f.querySelector('#paneEmoji');
|
||||
const paneI=f.querySelector('#paneImage');
|
||||
const hidType=f.querySelector('#hidAvType');
|
||||
const hidEmoji=f.querySelector('#hidAvEmoji');
|
||||
const hidImg=f.querySelector('#hidAvImg');
|
||||
ok: 'Save Changes',
|
||||
alt: ['Sign out', async () => {
|
||||
await api('/khira/api/auth/logout', 'POST');
|
||||
localStorage.removeItem('khira_session_token');
|
||||
localStorage.removeItem('khira_active_user');
|
||||
location.reload();
|
||||
}],
|
||||
init: f => {
|
||||
const prev = f.querySelector('#profileAvatarPreview');
|
||||
const fileInp = f.querySelector('#profileFileInput');
|
||||
const btnUp = f.querySelector('#btnUploadPhoto');
|
||||
const btnInits = f.querySelector('#btnUseInitials');
|
||||
const hidImg = f.querySelector('#hidProfImg');
|
||||
const hidColor = f.querySelector('#hidProfColor');
|
||||
const hidType = f.querySelector('#hidProfType');
|
||||
const nameInp = f.querySelector('#profNameInp');
|
||||
const colorSec = f.querySelector('#initialsColorSection');
|
||||
|
||||
tabs.forEach(btn=>{
|
||||
btn.onclick=()=>{
|
||||
tabs.forEach(b=>b.classList.remove('on'));
|
||||
btn.classList.add('on');
|
||||
curType=btn.dataset.avm;
|
||||
hidType.value=curType;
|
||||
if(curType==='emoji'){
|
||||
paneE.hidden=false;paneI.hidden=true;
|
||||
}else{
|
||||
paneE.hidden=true;paneI.hidden=false;
|
||||
}
|
||||
updatePreview();
|
||||
const refreshPreview = () => {
|
||||
prev.innerHTML = getPreviewHtml(curImgUrl, curColor, nameInp.value);
|
||||
colorSec.hidden = !!curImgUrl;
|
||||
};
|
||||
|
||||
nameInp.addEventListener('input', refreshPreview);
|
||||
|
||||
btnUp.onclick = () => fileInp.click();
|
||||
|
||||
btnInits.onclick = () => {
|
||||
curImgUrl = '';
|
||||
curType = 'initials';
|
||||
hidImg.value = '';
|
||||
hidType.value = 'initials';
|
||||
refreshPreview();
|
||||
toast('Switched to initials avatar');
|
||||
};
|
||||
|
||||
f.querySelectorAll('.color-swatch-btn').forEach(b => {
|
||||
b.onclick = () => {
|
||||
f.querySelectorAll('.color-swatch-btn').forEach(btn => btn.classList.remove('active'));
|
||||
b.classList.add('active');
|
||||
curColor = b.dataset.color;
|
||||
hidColor.value = curColor;
|
||||
refreshPreview();
|
||||
};
|
||||
});
|
||||
|
||||
f.querySelectorAll('.av-opt').forEach(opt=>{
|
||||
opt.onclick=()=>{
|
||||
f.querySelectorAll('.av-opt').forEach(b=>b.classList.remove('on'));
|
||||
opt.classList.add('on');
|
||||
curEmoji=opt.dataset.emoji;
|
||||
hidEmoji.value=curEmoji;
|
||||
curType='emoji';
|
||||
hidType.value='emoji';
|
||||
updatePreview();
|
||||
};
|
||||
});
|
||||
|
||||
const fileInp=f.querySelector('#avFileInput');
|
||||
if(fileInp){
|
||||
fileInp.onchange=async()=>{
|
||||
const file=fileInp.files[0];
|
||||
if(!file)return;
|
||||
const fd=new FormData();
|
||||
fd.append('file',file);
|
||||
try{
|
||||
toast('Uploading avatar photo...');
|
||||
const un=S.u?.username||ls('khira_active_user');
|
||||
const tok=ls('khira_session_token');
|
||||
const upHeaders={'X-Khira-User':un};
|
||||
if(tok)upHeaders['Authorization']='Bearer '+tok;
|
||||
const upRes=await fetch('/khira/api/upload',{method:'POST',headers:upHeaders,credentials:'same-origin',body:fd});
|
||||
const upJson=await upRes.json();
|
||||
const url=upJson.url||upJson.attachment?.url;
|
||||
if(url){
|
||||
curImgUrl=url;
|
||||
hidImg.value=curImgUrl;
|
||||
curType='image';
|
||||
hidType.value='image';
|
||||
tabs.forEach(b=>b.classList.toggle('on',b.dataset.avm==='image'));
|
||||
paneE.hidden=true;paneI.hidden=false;
|
||||
updatePreview();
|
||||
toast('Avatar uploaded');
|
||||
}
|
||||
}catch(err){
|
||||
console.error('Failed to upload avatar',err);
|
||||
toast('Failed to upload image','err');
|
||||
fileInp.onchange = async () => {
|
||||
const file = fileInp.files[0];
|
||||
if (!file) return;
|
||||
const fd = new FormData();
|
||||
fd.append('file', file);
|
||||
try {
|
||||
toast('Uploading avatar photo...');
|
||||
const un = S.u?.username || ls('khira_active_user');
|
||||
const tok = ls('khira_session_token');
|
||||
const upHeaders = { 'X-Khira-User': un };
|
||||
if (tok) upHeaders['Authorization'] = 'Bearer ' + tok;
|
||||
const upRes = await fetch('/khira/api/upload', {
|
||||
method: 'POST',
|
||||
headers: upHeaders,
|
||||
credentials: 'same-origin',
|
||||
body: fd
|
||||
});
|
||||
const upJson = await upRes.json();
|
||||
const url = upJson.url || upJson.attachment?.url;
|
||||
if (url) {
|
||||
curImgUrl = url;
|
||||
curType = 'image';
|
||||
hidImg.value = url;
|
||||
hidType.value = 'image';
|
||||
refreshPreview();
|
||||
toast('Avatar uploaded successfully');
|
||||
} else {
|
||||
toast(upJson.error || 'Failed to upload image', 'err');
|
||||
}
|
||||
};
|
||||
}
|
||||
} catch (err) {
|
||||
toast('Failed to upload image', 'err');
|
||||
}
|
||||
};
|
||||
|
||||
// Toggle Security accordion
|
||||
const toggleBtn = f.querySelector('#btnToggleSecurity');
|
||||
const secBody = f.querySelector('#securityBody');
|
||||
toggleBtn.onclick = () => {
|
||||
secBody.hidden = !secBody.hidden;
|
||||
};
|
||||
},
|
||||
go:async v=>{
|
||||
const r=await api('/khira/api/auth/profile','PUT',{
|
||||
name:v.name,
|
||||
avatar_type:v.avatar_type,
|
||||
avatar:v.avatar,
|
||||
profile_image:v.profile_image
|
||||
});
|
||||
if(r._f){toast(r.error||'Failed to update profile','err');return false}
|
||||
S.u=r.user||{...S.u,...v};
|
||||
go: async v => {
|
||||
// Validate password if supplied
|
||||
if (v.new_password) {
|
||||
if (!v.current_password) {
|
||||
toast('Please enter your current password to set a new password', 'err');
|
||||
return false;
|
||||
}
|
||||
if (v.new_password.length < 6) {
|
||||
toast('New password must be at least 6 characters', 'err');
|
||||
return false;
|
||||
}
|
||||
if (v.new_password !== v.confirm_password) {
|
||||
toast('New passwords do not match', 'err');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const payload = {
|
||||
name: v.name,
|
||||
avatar_type: v.avatar_type || curType,
|
||||
avatar: cur.avatar || '👤',
|
||||
profile_image: v.profile_image
|
||||
};
|
||||
if (v.new_password) {
|
||||
payload.current_password = v.current_password;
|
||||
payload.new_password = v.new_password;
|
||||
}
|
||||
|
||||
const r = await api('/khira/api/auth/profile', 'PUT', payload);
|
||||
if (r._f) {
|
||||
toast(r.error || 'Failed to update profile', 'err');
|
||||
return false;
|
||||
}
|
||||
|
||||
S.u = r.user || { ...S.u, ...payload };
|
||||
updateMe(S.u);
|
||||
toast('Profile updated');
|
||||
toast('Profile updated successfully');
|
||||
await refresh();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/khira/styles.css?v=10">
|
||||
<link rel="stylesheet" href="/khira/styles.css?v=11">
|
||||
<script>try{document.documentElement.dataset.theme=localStorage.khira_theme||'dark'}catch(e){}</script>
|
||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit" async defer></script>
|
||||
</head>
|
||||
@@ -447,6 +447,6 @@
|
||||
<dialog id="sheet" class="app-drawer-sheet"></dialog>
|
||||
<dialog id="dlg" class="app-modal-dialog"></dialog>
|
||||
<div class="snack" id="snack" role="status"></div>
|
||||
<script src="/khira/app.js?v=10" defer></script>
|
||||
<script src="/khira/app.js?v=11" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+475
-8
@@ -2150,22 +2150,489 @@ button {
|
||||
z-index: 60;
|
||||
}
|
||||
|
||||
/* Generic Modal Dialog */
|
||||
/* ══════════════════════════════════════════════════════════════════════════════
|
||||
Modal Dialog Framework & Unified Form System
|
||||
══════════════════════════════════════════════════════════════════════════════ */
|
||||
.app-modal-dialog {
|
||||
margin: auto;
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: 10px;
|
||||
border-radius: 12px;
|
||||
background: var(--bg-surface);
|
||||
color: var(--text-primary);
|
||||
box-shadow: var(--shadow-lg);
|
||||
padding: 24px;
|
||||
max-width: 540px;
|
||||
width: 90vw;
|
||||
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-subtle);
|
||||
padding: 0;
|
||||
width: min(540px, 94vw);
|
||||
max-height: 88vh;
|
||||
overflow: hidden;
|
||||
outline: none;
|
||||
z-index: 80;
|
||||
}
|
||||
|
||||
.app-modal-dialog.wide {
|
||||
width: min(720px, 95vw);
|
||||
}
|
||||
|
||||
.app-modal-dialog::backdrop {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
backdrop-filter: blur(2px);
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
/* Dialog Shell (Form) */
|
||||
.dc {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
max-height: 88vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Dialog Header */
|
||||
.dh {
|
||||
padding: 18px 24px;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
background: var(--bg-surface);
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.dh-titles h3 {
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.01em;
|
||||
margin: 0;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.dh-titles .sub {
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/* Dialog Body */
|
||||
.db {
|
||||
padding: 24px;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
/* Dialog Actions Footer */
|
||||
.da {
|
||||
padding: 16px 24px;
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
background: var(--bg-canvas);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Buttons in Dialog */
|
||||
.fb {
|
||||
height: 34px;
|
||||
padding: 0 16px;
|
||||
border-radius: 6px;
|
||||
background: var(--primary);
|
||||
color: #ffffff;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.fb:hover {
|
||||
background: var(--primary-hover);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.fb:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.tb {
|
||||
height: 34px;
|
||||
padding: 0 14px;
|
||||
border-radius: 6px;
|
||||
background: var(--bg-surface-elevated);
|
||||
color: var(--text-secondary);
|
||||
border: 1px solid var(--border-default);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.tb:hover {
|
||||
background: var(--bg-surface-hover);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--border-hover);
|
||||
}
|
||||
|
||||
.btn-alt {
|
||||
height: 34px;
|
||||
padding: 0 14px;
|
||||
border-radius: 6px;
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
color: #f87171;
|
||||
border: 1px solid rgba(239, 68, 68, 0.25);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
margin-right: auto;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.btn-alt:hover {
|
||||
background: rgba(239, 68, 68, 0.2);
|
||||
color: #ef4444;
|
||||
border-color: rgba(239, 68, 68, 0.4);
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════════
|
||||
Form Control Standards (.fld, .grp, .rg)
|
||||
══════════════════════════════════════════════════════════════════════════════ */
|
||||
.fld {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fld span {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.fld input,
|
||||
.fld select,
|
||||
.fld textarea {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
border-radius: 6px;
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border-default);
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-sans);
|
||||
font-size: 13px;
|
||||
outline: none;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.fld input:focus,
|
||||
.fld select:focus,
|
||||
.fld textarea:focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 2px var(--primary-subtle);
|
||||
}
|
||||
|
||||
.fld textarea {
|
||||
height: auto;
|
||||
min-height: 80px;
|
||||
padding: 10px 12px;
|
||||
resize: vertical;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.fld select {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fld.mono input,
|
||||
.fld.mono textarea {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* Radio Group (.rg) */
|
||||
.rg {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
background: var(--bg-canvas);
|
||||
padding: 4px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
}
|
||||
|
||||
.rg label {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.rg label input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.rg label span {
|
||||
width: 100%;
|
||||
padding: 6px 12px;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.rg label input[type="radio"]:checked + span {
|
||||
background: var(--bg-surface-elevated);
|
||||
color: var(--text-primary);
|
||||
font-weight: 600;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
/* Fieldset groups (.grp) */
|
||||
.grp {
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════════
|
||||
Enterprise Profile & Account Settings
|
||||
══════════════════════════════════════════════════════════════════════════════ */
|
||||
.profile-card-hero {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
padding: 18px 20px;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.profile-avatar-wrap {
|
||||
width: 76px;
|
||||
height: 76px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 2px solid var(--border-default);
|
||||
box-shadow: var(--shadow-md);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.profile-avatar-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.profile-avatar-initials {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
font-family: var(--font-sans);
|
||||
}
|
||||
|
||||
.profile-hero-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.profile-hero-info h4 {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.profile-tags-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.profile-avatar-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.profile-palette-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px 16px;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.section-micro-label {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.color-swatches-grid {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.color-swatch-btn {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
background: var(--swatch);
|
||||
border: 2px solid transparent;
|
||||
cursor: pointer;
|
||||
transition: transform 0.15s ease, border-color 0.15s ease;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.color-swatch-btn:hover {
|
||||
transform: scale(1.15);
|
||||
}
|
||||
|
||||
.color-swatch-btn.active {
|
||||
border-color: #ffffff;
|
||||
box-shadow: 0 0 0 2px var(--swatch);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.profile-fields-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.profile-fields-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-form-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.profile-form-group label {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.profile-form-group input {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
border-radius: 6px;
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border-default);
|
||||
color: var(--text-primary);
|
||||
font-size: 13px;
|
||||
outline: none;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.profile-form-group input:focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 2px var(--primary-subtle);
|
||||
}
|
||||
|
||||
.profile-form-group input:disabled,
|
||||
.profile-form-group input[readonly] {
|
||||
background: var(--bg-canvas);
|
||||
color: var(--text-secondary);
|
||||
border-color: var(--border-subtle);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.input-with-lock {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.input-with-lock input {
|
||||
padding-right: 32px;
|
||||
}
|
||||
|
||||
.input-with-lock .lock-icon {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
color: var(--text-muted);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Security & Password Accordion */
|
||||
.profile-security-accordion {
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 8px;
|
||||
background: var(--bg-card);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.security-accordion-header {
|
||||
padding: 12px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
background: var(--bg-card);
|
||||
transition: background 0.15s ease;
|
||||
}
|
||||
|
||||
.security-accordion-header:hover {
|
||||
background: var(--bg-surface-hover);
|
||||
}
|
||||
|
||||
.security-accordion-header strong {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.security-accordion-body {
|
||||
padding: 0 16px 16px 16px;
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
|
||||
Reference in New Issue
Block a user