/* AchieveX — profile.html styles */

/* ═══════════════════════════════════════
   DESIGN SYSTEM
═══════════════════════════════════════ */
:root {
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Sora', sans-serif;
  --blue-50:#EFF6FF; --blue-100:#DBEAFE; --blue-200:#BFDBFE;
  --blue-400:#60A5FA; --blue-500:#3B82F6; --blue-600:#2563EB;
  --blue-700:#1D4ED8; --blue-900:#1E3A8A;
  --green-500:#22C55E; --green-100:#DCFCE7;
  --amber-500:#F59E0B; --amber-100:#FEF3C7;
  --red-500:#EF4444; --red-100:#FEE2E2;
  --purple-500:#A855F7; --purple-100:#F3E8FF;
  --cyan-500:#06B6D4; --cyan-100:#CFFAFE;
  --bg:#F8F9FA; --bg2:#F1F3F4; --bg3:#E8EAED;
  --surface:#FFFFFF; --surface2:#F8F9FA; --surface3:#F1F3F4;
  --surface4:rgba(255,255,255,.92);
  --border:rgba(0,0,0,.06); --border-m:rgba(0,0,0,.10);
  --border-s:rgba(59,130,246,.18);
  --txt:#202124; --txt2:#3C4043; --txt3:#5F6368; --txt4:#9AA0A6;
  --glass:rgba(255,255,255,.88); --glass-border:rgba(255,255,255,.65);
  --primary:var(--blue-500); --primary-d:var(--blue-600); --primary-l:var(--blue-400);
  --shadow-xs:0 1px 2px rgba(60,64,67,.07),0 1px 3px rgba(60,64,67,.05);
  --shadow-sm:0 1px 3px rgba(60,64,67,.09),0 2px 8px rgba(60,64,67,.06);
  --shadow:0 2px 6px rgba(60,64,67,.10),0 4px 16px rgba(60,64,67,.07);
  --shadow-md:0 4px 12px rgba(60,64,67,.12),0 8px 32px rgba(60,64,67,.08);
  --shadow-lg:0 8px 24px rgba(60,64,67,.14),0 16px 56px rgba(60,64,67,.10);
  --shadow-xl:0 16px 48px rgba(60,64,67,.16),0 32px 80px rgba(60,64,67,.12);
  --shadow-blue:0 4px 16px rgba(59,130,246,.32),0 2px 6px rgba(59,130,246,.18);
  --r-xs:6px; --r-sm:8px; --r:12px; --r-lg:16px;
  --r-xl:20px; --r-2xl:24px; --r-3xl:32px; --r-full:9999px;
  --nav-h:60px; --side-w:240px;
  --ease:cubic-bezier(.25,.46,.45,.94);
  --ease-out:cubic-bezier(.16,1,.3,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
  --ease-google:cubic-bezier(.4,0,.2,1);
}
.dark {
  --bg:#1A1B1E; --bg2:#202124; --bg3:#2D2E31;
  --surface:#28292C; --surface2:#303134; --surface3:#3C4043;
  --surface4:rgba(40,41,44,.92);
  --border:rgba(255,255,255,.06); --border-m:rgba(255,255,255,.10);
  --glass:rgba(30,31,34,.92); --glass-border:rgba(255,255,255,.08);
  --txt:#E8EAED; --txt2:#BDC1C6; --txt3:#9AA0A6; --txt4:#5F6368;
  --shadow-xs:0 1px 3px rgba(0,0,0,.4),0 1px 4px rgba(0,0,0,.3);
  --shadow-sm:0 2px 6px rgba(0,0,0,.5),0 1px 3px rgba(0,0,0,.3);
  --shadow:0 4px 12px rgba(0,0,0,.55),0 2px 6px rgba(0,0,0,.35);
  --shadow-md:0 8px 24px rgba(0,0,0,.60),0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:0 16px 48px rgba(0,0,0,.70),0 8px 20px rgba(0,0,0,.45);
  --shadow-xl:0 24px 72px rgba(0,0,0,.75),0 12px 32px rgba(0,0,0,.50);
}

/* ═══ RESET ═══ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-tap-highlight-color:transparent}
body{
  font-family:var(--font-sans);background:var(--bg);color:var(--txt);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;overscroll-behavior:none;line-height:1.6;
  transition:background .35s var(--ease-google),color .35s var(--ease-google);
  max-width:100vw;
}
::selection{background:rgba(59,130,246,.15);color:var(--txt)}
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--bg3);border-radius:20px}
::-webkit-scrollbar-thumb:hover{background:var(--txt4)}
a{text-decoration:none;color:inherit}
ul{list-style:none}
button{font-family:inherit;cursor:pointer;border:none;background:none}
img,svg{display:block;max-width:100%}
input,textarea,select{font-family:inherit}

/* ═══ KEYFRAMES ═══ */
@keyframes fadeUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes slideDown{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
@keyframes slideUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.45}}
@keyframes loaderSlide{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
@keyframes skeleton-shine{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* ═══ PAGE LOADER ═══ */
#page-loader{
  position:fixed;inset:0;z-index:9999;background:var(--surface);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;
  transition:opacity .35s,visibility .35s;
}
#page-loader.hidden{opacity:0;visibility:hidden;pointer-events:none}
.page-loader-logo{
  width:52px;height:52px;border-radius:var(--r-lg);
  background:linear-gradient(145deg,#4F93F8,#1D4ED8);
  display:flex;align-items:center;justify-content:center;
  box-shadow:var(--shadow-blue);
}
.page-loader-bar-wrap{width:80px;height:3px;background:var(--bg3);border-radius:var(--r-full);overflow:hidden}
.page-loader-bar{height:100%;width:40%;background:var(--blue-500);border-radius:var(--r-full);animation:loaderSlide 1s ease-in-out infinite}

/* ═══ APP LAYOUT ═══ */
.app-layout{display:flex;height:100vh;height:100dvh;overflow:hidden}

/* ═══ SIDEBAR ═══ */
.sidebar{
  position:fixed;left:0;top:0;bottom:0;width:var(--side-w);
  background:var(--surface);border-right:1px solid var(--border);
  display:flex;flex-direction:column;z-index:300;
  overflow-y:auto;-webkit-overflow-scrolling:touch;
  transition:transform .32s var(--ease-out);
}
@media(max-width:1023px){.sidebar{transform:translateX(-100%);width:256px;box-shadow:var(--shadow-xl)}}
.sidebar.open{transform:translateX(0)}
.sidebar-header{
  padding:14px 12px;border-bottom:1px solid var(--border);flex-shrink:0;
  display:flex;align-items:center;justify-content:space-between;
}
.sidebar-logo{display:flex;align-items:center;gap:9px;cursor:pointer}
.sidebar-logo-mark{
  width:32px;height:32px;border-radius:var(--r-sm);
  background:linear-gradient(145deg,#4F93F8,#1D4ED8);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 8px rgba(59,130,246,.32);flex-shrink:0;
}
.sidebar-logo-name{font-family:var(--font-display);font-size:16px;font-weight:700;letter-spacing:-.04em;color:var(--txt)}
.sidebar-close{
  width:28px;height:28px;border-radius:var(--r-sm);
  background:var(--surface2);border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  color:var(--txt3);cursor:pointer;transition:all .15s;flex-shrink:0;
}
.sidebar-close:hover{background:var(--surface3);color:var(--txt)}
.sidebar-nav{flex:1;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:1px}
.sidebar-section-label{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.8px;color:var(--txt4);padding:10px 10px 4px}
.sidebar-link{
  display:flex;align-items:center;gap:11px;
  padding:10px 11px;border-radius:var(--r);
  font-size:13.5px;font-weight:500;color:var(--txt2);
  cursor:pointer;transition:all .15s;position:relative;
}
.sidebar-link:hover{background:var(--surface2);color:var(--txt)}
.sidebar-link.active{background:rgba(59,130,246,.08);color:var(--blue-600)}
.sidebar-link-icon{
  width:28px;height:28px;border-radius:var(--r-sm);
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;color:var(--txt3);transition:color .15s;
}
.sidebar-link.active .sidebar-link-icon{color:var(--blue-600)}
.sidebar-badge{
  margin-left:auto;font-size:10px;font-weight:600;
  background:var(--green-500);color:#fff;
  padding:1px 6px;border-radius:var(--r-full);flex-shrink:0;
}
.sidebar-badge.ai{background:linear-gradient(135deg,var(--blue-500),var(--purple-500))}
.sidebar-footer{padding:12px;border-top:1px solid var(--border);flex-shrink:0}
.sidebar-user{
  display:flex;align-items:center;gap:10px;
  padding:9px 10px;border-radius:var(--r);
  background:var(--surface2);border:1px solid var(--border);
  cursor:pointer;transition:background .15s;
}
.sidebar-user:hover{background:var(--surface3)}
.sidebar-avatar{
  width:32px;height:32px;border-radius:50%;
  background:linear-gradient(135deg,var(--blue-500),var(--blue-700));
  display:flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:700;color:#fff;flex-shrink:0;overflow:hidden;
}
.sidebar-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.sidebar-user-info{flex:1;min-width:0}
.sidebar-user-name{font-size:12.5px;font-weight:600;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-user-role{font-size:10px;color:var(--txt4)}
/* ═══ MAIN AREA ═══ */
.main-area{
  margin-left:var(--side-w);flex:1;
  display:flex;flex-direction:column;
  height:100vh;height:100dvh;
  transition:margin-left .32s var(--ease-out);
  overflow-x:hidden;overflow-y:hidden;min-width:0;
}
@media(max-width:1023px){.main-area{margin-left:0}}

/* ═══ TOPNAV ═══ */
.topnav{
  position:sticky;top:0;z-index:100;height:var(--nav-h);
  background:var(--surface);
  
  border-bottom:1px solid var(--border);
  box-shadow:0 1px 0 var(--border),var(--shadow-xs);
  display:flex;align-items:center;padding:0 20px;gap:12px;
  transition:background .35s var(--ease-google);flex-shrink:0;
}
.topnav-hamburger{
  width:34px;height:34px;border-radius:var(--r-sm);
  background:var(--surface2);border:1px solid var(--border);
  display:none;align-items:center;justify-content:center;
  color:var(--txt3);transition:all .18s;flex-shrink:0;
}
@media(max-width:1023px){.topnav-hamburger{display:flex}}
.topnav-hamburger:hover{background:var(--surface3);color:var(--txt)}
.topnav-actions{display:flex;align-items:center;gap:6px;margin-left:auto;flex-shrink:0}
.icon-btn{
  width:34px;height:34px;border-radius:var(--r-sm);
  background:var(--surface2);border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  color:var(--txt3);transition:all .18s;flex-shrink:0;position:relative;
}
.icon-btn:hover{background:var(--surface3);color:var(--txt)}
.icon-btn.active{background:rgba(59,130,246,.09);border-color:var(--border-s);color:var(--blue-600)}
.profile-btn{
  display:flex;align-items:center;gap:8px;
  padding:4px 10px 4px 4px;
  background:var(--surface2);border:1px solid var(--border);
  border-radius:var(--r-full);transition:all .18s;cursor:pointer;
}
.profile-btn:hover{background:var(--surface3);border-color:var(--border-m)}
.profile-avatar{
  width:26px;height:26px;border-radius:50%;
  background:linear-gradient(135deg,var(--blue-500),var(--blue-700));
  display:flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:700;color:#fff;flex-shrink:0;overflow:hidden;
}
.profile-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.profile-name{font-size:12.5px;font-weight:600;color:var(--txt)}
@media(max-width:480px){.profile-name{display:none}}
.search-wrap{flex:1;max-width:360px;position:relative;min-width:0}
.search-icon{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--txt4);pointer-events:none;display:flex;align-items:center}
.search-input{width:100%;height:34px;background:var(--surface2);border:1px solid var(--border);border-radius:var(--r);padding:0 12px 0 35px;font-size:13px;color:var(--txt);outline:none;transition:all .2s}
.search-input::placeholder{color:var(--txt4)}
.search-input:focus{background:var(--surface);border-color:var(--border-s);box-shadow:0 0 0 3px rgba(59,130,246,.10)}
.notif-dot{position:absolute;top:6px;right:6px;width:7px;height:7px;border-radius:50%;background:var(--red-500);border:1.5px solid var(--surface2);animation:pulse 2s ease-in-out infinite}
.profile-wrap{position:relative}
.profile-dropdown{position:absolute;top:calc(100% + 8px);right:0;z-index:500;min-width:200px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow-lg);overflow:hidden;opacity:0;visibility:hidden;transform:translateY(-6px);transition:opacity .18s var(--ease),transform .18s var(--ease),visibility .18s;pointer-events:none}
.profile-dropdown.open{opacity:1;visibility:visible;transform:translateY(0);pointer-events:all}
.profile-dropdown-user{padding:12px 14px;border-bottom:1px solid var(--border);background:var(--surface2)}
.profile-dropdown-uname{font-size:13px;font-weight:700;color:var(--txt)}
.profile-dropdown-email{font-size:11.5px;color:var(--txt4);margin-top:2px}
.dropdown-item{display:flex;align-items:center;gap:10px;padding:10px 14px;font-size:13px;font-weight:500;color:var(--txt2);cursor:pointer;transition:background .12s,color .12s}
.dropdown-item:hover{background:var(--surface2);color:var(--txt)}
.dropdown-item.danger{color:var(--red-500)}
.dropdown-item.danger:hover{background:rgba(239,68,68,.06)}
.dropdown-sep{height:1px;background:var(--border);margin:2px 0}
@media(max-width:640px){
  .topnav{padding:0 12px;gap:8px}
  .topnav-actions{gap:4px}
  .icon-btn{width:30px;height:30px}
  .search-wrap{max-width:none;flex:1}
}
@media(max-width:400px){.search-wrap{display:none}}

/* ═══ PAGE CONTENT ═══ */
.page-content{
  flex:1;padding:24px;
  max-width:1240px;width:100%;margin:0 auto;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
}
@media(max-width:640px){.page-content{padding:14px;padding-bottom:32px}}

/* ═══ PROFILE HEADER CARD ═══ */
.profile-header-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-xl);box-shadow:var(--shadow-xs);
  margin-bottom:16px;overflow:hidden;
}
.profile-header-banner{
  height:80px;
  background:linear-gradient(120deg,#1D4ED8 0%,#3B82F6 50%,#06B6D4 100%);
  position:relative;
}
.profile-header-body{
  padding:0 20px 20px;
  display:flex;align-items:flex-end;justify-content:space-between;
  gap:16px;flex-wrap:wrap;
}
.profile-avatar-wrap{
  display:flex;align-items:flex-end;gap:16px;margin-top:-36px;
}
.profile-avatar-lg{
  width:72px;height:72px;border-radius:var(--r-xl);
  background:linear-gradient(135deg,var(--blue-500),var(--blue-700));
  display:flex;align-items:center;justify-content:center;
  font-size:26px;font-weight:700;color:#fff;flex-shrink:0;
  box-shadow:var(--shadow-md);position:relative;
  border:3px solid var(--surface);overflow:hidden;cursor:pointer;
  transition:box-shadow .2s;
}
.profile-avatar-lg:hover{box-shadow:var(--shadow-lg)}
.profile-avatar-lg img{width:100%;height:100%;object-fit:cover;border-radius:calc(var(--r-xl) - 2px)}
.profile-avatar-overlay{
  position:absolute;inset:0;background:rgba(0,0,0,.45);
  display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity .18s;border-radius:calc(var(--r-xl) - 2px);
}
.profile-avatar-lg:hover .profile-avatar-overlay{opacity:1}
.profile-online-dot{
  position:absolute;bottom:2px;right:2px;
  width:14px;height:14px;border-radius:50%;
  background:var(--green-500);border:2.5px solid var(--surface);
  z-index:2;
}
.profile-identity{padding-top:8px}
.profile-name-display{font-family:var(--font-display);font-size:20px;font-weight:700;color:var(--txt);letter-spacing:-.04em;line-height:1.2}
.profile-username{font-size:12.5px;color:var(--txt3);margin-top:2px}
.profile-bio-display{font-size:12.5px;color:var(--txt3);margin-top:5px;max-width:420px;line-height:1.5}
.profile-badges-row{display:flex;align-items:center;gap:6px;margin-top:8px;flex-wrap:wrap}
.profile-tag{
  font-size:11px;font-weight:600;padding:3px 8px;border-radius:var(--r-full);
  display:inline-flex;align-items:center;gap:4px;
}
.profile-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-top:8px;align-self:flex-end}
@media(max-width:640px){
  .profile-header-body{padding:0 14px 16px;gap:12px}
  .profile-header-actions{width:100%}
  .profile-avatar-wrap{gap:12px}
  .profile-name-display{font-size:18px}
}

/* ═══ BUTTONS ═══ */
.btn-primary{
  height:36px;padding:0 16px;border-radius:var(--r-sm);
  font-size:13px;font-weight:600;color:#fff;
  background:linear-gradient(135deg,var(--blue-500),var(--blue-700));
  border:none;transition:all .18s;box-shadow:var(--shadow-blue);
  display:inline-flex;align-items:center;gap:6px;cursor:pointer;
}
.btn-primary:hover{transform:translateY(-1px);box-shadow:var(--shadow-md)}
.btn-primary:active{transform:scale(.97)}
@media(max-width:640px){.btn-primary{flex:1;justify-content:center}}
.btn-secondary{
  height:36px;padding:0 14px;border-radius:var(--r-sm);
  font-size:13px;font-weight:600;color:var(--txt);
  background:var(--surface);border:1px solid var(--border);
  transition:all .18s;box-shadow:var(--shadow-xs);
  display:inline-flex;align-items:center;gap:6px;cursor:pointer;
}
.btn-secondary:hover{background:var(--surface2);transform:translateY(-1px);box-shadow:var(--shadow-sm)}
@media(max-width:640px){.btn-secondary{flex:1;justify-content:center}}
.btn-back{
  width:34px;height:34px;border-radius:var(--r-sm);
  background:var(--surface2);border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  color:var(--txt3);transition:all .18s;margin-bottom:12px;cursor:pointer;
}
.btn-back:hover{background:var(--surface3);color:var(--txt)}
.btn-ghost{
  height:34px;padding:0 14px;border-radius:var(--r-sm);
  font-size:13px;font-weight:600;color:var(--txt2);
  background:transparent;border:1px solid var(--border);
  cursor:pointer;transition:all .15s;
}
.btn-ghost:hover{background:var(--surface2);border-color:var(--border-m)}

/* ═══ CARDS ═══ */
.card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-xl);box-shadow:var(--shadow-xs);
  transition:box-shadow .2s;overflow:hidden;margin-bottom:16px;
}
.card:hover{box-shadow:var(--shadow-sm)}
.card-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;border-bottom:1px solid var(--border);flex-shrink:0;
}
.card-header-left{display:flex;align-items:center;gap:10px}
.card-icon{
  width:32px;height:32px;border-radius:var(--r-sm);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.card-title{font-size:13.5px;font-weight:700;color:var(--txt);letter-spacing:-.02em}
.card-subtitle{font-size:11px;color:var(--txt4);margin-top:1px}
.card-body{padding:16px 18px}
.card-action{
  font-size:12px;font-weight:600;color:var(--blue-500);
  padding:5px 10px;border-radius:var(--r-sm);
  transition:all .15s;border:1px solid transparent;background:none;
  cursor:pointer;display:inline-flex;align-items:center;gap:4px;
}
.card-action:hover{background:rgba(59,130,246,.07);border-color:var(--border-s)}

/* ═══ STATS GRID ═══ */
.stats-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px;
}
@media(max-width:900px){.stats-grid{grid-template-columns:repeat(2,1fr)}}
.stat-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-xl);padding:14px 16px;
  box-shadow:var(--shadow-xs);transition:all .2s;
}
.stat-card:hover{box-shadow:var(--shadow-sm);transform:translateY(-1px)}
.stat-card-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.stat-card-icon{
  width:30px;height:30px;border-radius:var(--r-sm);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.stat-val{font-size:22px;font-weight:700;color:var(--txt);line-height:1;font-family:var(--font-display)}
.stat-lbl{font-size:11px;color:var(--txt4);margin-top:5px;font-weight:500}
.stat-delta{font-size:10.5px;font-weight:600;display:flex;align-items:center;gap:2px}
.stat-delta.up{color:var(--green-500)}

/* ═══ INFO GRID ═══ */
.info-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
@media(max-width:640px){.info-grid{grid-template-columns:1fr}}
.info-item-label{font-size:11px;font-weight:600;color:var(--txt4);text-transform:uppercase;letter-spacing:.5px;margin-bottom:5px}
.info-item-value{font-size:13.5px;font-weight:500;color:var(--txt)}

/* ═══ FORMS ═══ */
.form-group{margin-bottom:14px}
.form-label{font-size:12px;font-weight:600;color:var(--txt2);display:block;margin-bottom:6px}
.form-input,.form-textarea,.form-select{
  width:100%;padding:9px 11px;
  background:var(--bg);border:1px solid var(--border);
  border-radius:var(--r);font-size:13px;color:var(--txt);
  transition:all .2s;outline:none;
}
.form-input:focus,.form-textarea:focus,.form-select:focus{
  background:var(--surface);border-color:var(--border-s);
  box-shadow:0 0 0 3px rgba(59,130,246,.10);
}
.form-textarea{resize:vertical;min-height:80px;line-height:1.5}
.form-input:disabled{opacity:.55;cursor:not-allowed;background:var(--bg2)}
.form-section{margin-bottom:16px}
.form-section-title{font-size:13px;font-weight:700;color:var(--txt);margin-bottom:12px}
.form-hint{font-size:11px;color:var(--txt4);margin-top:4px}

/* ═══ ACHIEVEMENTS ═══ */
.achievement-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:10px;
}
@media(max-width:480px){.achievement-grid{grid-template-columns:repeat(auto-fill,minmax(76px,1fr))}}
.achievement-item{
  display:flex;flex-direction:column;align-items:center;
  padding:14px 8px;background:var(--bg);border:1px solid var(--border);
  border-radius:var(--r-lg);text-align:center;transition:all .2s;cursor:default;
}
.achievement-item:hover{background:var(--surface2);transform:translateY(-2px);box-shadow:var(--shadow-sm)}
.achievement-item.locked{opacity:.38;filter:grayscale(1);pointer-events:none}
.achievement-icon{
  width:36px;height:36px;margin-bottom:8px;
  display:flex;align-items:center;justify-content:center;
  border-radius:var(--r-sm);
}
.achievement-name{font-size:10.5px;font-weight:700;color:var(--txt2);line-height:1.2}
.achievement-desc{font-size:9.5px;color:var(--txt4);margin-top:3px;line-height:1.3}

/* ═══ STREAK ═══ */
.streak-bar{display:flex;gap:4px;align-items:center;flex-wrap:wrap;margin-top:4px}
.streak-day{
  width:20px;height:20px;border-radius:4px;
  background:var(--bg3);border:1px solid var(--border);transition:all .15s;
}
.streak-day.active{background:var(--amber-500);border-color:transparent}
.streak-day.today{background:var(--blue-500);border-color:transparent;box-shadow:0 0 0 2px rgba(59,130,246,.3)}

/* ═══ ACTIVITY ═══ */
.activity-item{
  display:flex;align-items:flex-start;gap:12px;
  padding:12px 0;border-bottom:1px solid var(--border);
}
.activity-item:last-child{border-bottom:none;padding-bottom:0}
.activity-icon{
  width:32px;height:32px;border-radius:var(--r-sm);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.activity-content{flex:1;min-width:0}
.activity-title{font-size:13px;font-weight:600;color:var(--txt);margin-bottom:2px;line-height:1.3}
.activity-desc{font-size:12px;color:var(--txt3);line-height:1.4}
.activity-time{font-size:11px;color:var(--txt4);margin-top:3px}

/* ═══ SETTINGS ═══ */
.settings-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 0;border-bottom:1px solid var(--border);gap:12px;
}
.settings-row:last-child{border-bottom:none}
.settings-label{font-size:13px;font-weight:600;color:var(--txt)}
.settings-sub{font-size:11px;color:var(--txt4);margin-top:2px}

/* ═══ TOGGLE ═══ */
.toggle{
  position:relative;width:40px;height:22px;
  background:var(--bg3);border:1px solid var(--border-m);
  border-radius:var(--r-full);cursor:pointer;
  transition:all .2s;display:inline-flex;align-items:center;flex-shrink:0;
}
.toggle input{display:none}
.toggle-track{
  position:absolute;width:18px;height:18px;
  background:#fff;border-radius:50%;
  left:1px;top:50%;transform:translateY(-50%);
  transition:left .2s var(--ease-spring);box-shadow:var(--shadow-xs);
}
.toggle:has(input:checked){background:var(--green-500);border-color:var(--green-500)}
.toggle:has(input:checked) .toggle-track{left:calc(100% - 19px)}

/* ═══ MODAL ═══ */
.modal-overlay{
  position:fixed;inset:0;z-index:500;
  background:rgba(0,0,0,.5);
  display:none;align-items:center;justify-content:center;padding:16px;
}
.modal-overlay.open{display:flex;animation:fadeIn .18s}
.modal{
  background:var(--surface);border-radius:var(--r-xl);
  box-shadow:var(--shadow-lg);max-width:440px;width:100%;
  max-height:90vh;max-height:90dvh;overflow-y:auto;-webkit-overflow-scrolling:touch;animation:slideDown .25s var(--ease);
}
.modal-header{
  padding:16px 18px;border-bottom:1px solid var(--border);
  font-size:15px;font-weight:700;color:var(--txt);
  display:flex;align-items:center;justify-content:space-between;gap:8px;
}
.modal-close{
  width:28px;height:28px;border-radius:var(--r-sm);
  background:var(--bg);border:none;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  color:var(--txt3);cursor:pointer;transition:all .15s;
}
.modal-close:hover{background:var(--bg3);color:var(--txt)}
.modal-body{padding:18px}
.modal-footer{
  padding:14px 18px;border-top:1px solid var(--border);
  display:flex;align-items:center;justify-content:flex-end;gap:8px;
}

/* ═══ AVATAR UPLOAD ═══ */
.avatar-upload-wrap{display:flex;align-items:center;gap:16px;margin-bottom:14px}
.avatar-upload-preview{
  width:64px;height:64px;border-radius:var(--r-lg);
  background:linear-gradient(135deg,var(--blue-500),var(--blue-700));
  display:flex;align-items:center;justify-content:center;
  font-size:22px;font-weight:700;color:#fff;flex-shrink:0;overflow:hidden;
  border:2px solid var(--border);
}
.avatar-upload-preview img{width:100%;height:100%;object-fit:cover}
.avatar-upload-actions{display:flex;flex-direction:column;gap:6px}
.avatar-upload-btn{
  height:30px;padding:0 12px;border-radius:var(--r-sm);
  font-size:12px;font-weight:600;color:var(--blue-500);
  background:rgba(59,130,246,.07);border:1px solid var(--border-s);
  cursor:pointer;transition:all .15s;display:inline-flex;align-items:center;gap:5px;
}
.avatar-upload-btn:hover{background:rgba(59,130,246,.12)}
.avatar-remove-btn{
  height:28px;padding:0 12px;border-radius:var(--r-sm);
  font-size:12px;font-weight:600;color:var(--txt4);
  background:none;border:1px solid var(--border);
  cursor:pointer;transition:all .15s;
}
.avatar-remove-btn:hover{color:var(--red-500);border-color:rgba(239,68,68,.4)}
#avatar-file-input{display:none}
.avatar-upload-progress-track{
  width:100%;height:4px;border-radius:99px;background:var(--bg3);
  overflow:hidden;margin-top:2px;
}
.avatar-upload-progress-bar{
  height:100%;width:0%;border-radius:99px;
  background:var(--blue-500);
  transition:width .2s ease;
}

/* ═══ PASSWORD ═══ */
.pwd-wrap{position:relative}
.pwd-wrap .form-input{padding-right:38px}
.pwd-toggle{
  position:absolute;right:10px;top:50%;transform:translateY(-50%);
  background:none;border:none;color:var(--txt4);cursor:pointer;
  display:flex;align-items:center;padding:4px;transition:color .15s;
}
.pwd-toggle:hover{color:var(--txt)}
.pwd-strength-wrap{margin-top:6px}
.pwd-strength-bar{height:3px;border-radius:2px;background:var(--bg3);overflow:hidden}
.pwd-strength-fill{height:100%;border-radius:2px;transition:width .3s,background .3s}
.pwd-strength-label{font-size:10.5px;margin-top:4px;font-weight:500}

/* ═══ TOAST ═══ */
.ax-toast{
  position:fixed;bottom:24px;right:24px;
  display:flex;align-items:center;gap:10px;
  padding:11px 16px;border-radius:var(--r-lg);
  font-size:13px;font-weight:500;color:#fff;
  box-shadow:var(--shadow-lg);z-index:9000;
  animation:slideUp .28s var(--ease) both;
  max-width:320px;line-height:1.4;
}
@media(max-width:480px){.ax-toast{left:16px;right:16px;bottom:16px;max-width:none}}

/* ═══ FIREBASE NOTICE ═══ */
.firebase-notice{
  background:rgba(59,130,246,.06);border:1px solid var(--border-s);
  border-radius:var(--r);padding:10px 14px;
  font-size:11.5px;color:var(--txt3);line-height:1.5;
  display:flex;align-items:flex-start;gap:8px;margin-bottom:14px;
}
.firebase-notice svg{flex-shrink:0;margin-top:1px;color:var(--blue-500)}

/* ═══ EMPTY STATE ═══ */
.empty-state{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:40px 20px;text-align:center;
}
.empty-state-icon{
  width:48px;height:48px;border-radius:var(--r-xl);
  background:var(--surface2);display:flex;align-items:center;justify-content:center;
  color:var(--txt4);margin-bottom:12px;
}
.empty-state-title{font-size:14px;font-weight:600;color:var(--txt);margin-bottom:4px}
.empty-state-desc{font-size:13px;color:var(--txt4);max-width:240px;line-height:1.5}

/* ═══ UTILS ═══ */
.hidden{display:none!important}
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mb-12{margin-bottom:12px}
.text-center{text-align:center}
.text-blue{color:var(--blue-500)}.text-green{color:var(--green-500)}
.text-amber{color:var(--amber-500)}.text-red{color:var(--red-500)}
.text-purple{color:var(--purple-500)}.text-cyan{color:var(--cyan-500)}