/* ═══════════════════════════════════════════════════
   WorkSphere Production — Global Design System v1.0
   PWA. Mobile-first. Real product.
═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--white);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px; line-height: 1.6;
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

:root {
  --bg:      #040912;
  --surf:    #07101E;
  --surf2:   #0C1A2E;
  --surf3:   #0F2236;
  --dim:     #213249;
  --accent:  #00E5A0;
  --blue:    #4B8BF4;
  --gold:    #F0C040;
  --coral:   #FF5252;
  --purple:  #A78BFA;
  --white:   #F0F4FA;
  --muted:   #8898B0;
  --border:  rgba(255,255,255,0.06);
  --nav-height: 64px;
  --bottom-nav-height: 68px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px;
  --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px;
  --ease: all 0.22s cubic-bezier(0.4,0,0.2,1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-accent: 0 8px 28px rgba(0,229,160,0.25);
  --shadow-blue: 0 8px 28px rgba(75,139,244,0.25);
}

/* ── TYPOGRAPHY ── */
h1,h2,h3,h4 { font-family:'Young Serif',serif; font-weight:400; line-height:1.15; letter-spacing:-0.01em; }
h1 { font-size:clamp(28px,5vw,56px); }
h2 { font-size:clamp(22px,4vw,40px); }
h3 { font-size:clamp(18px,3vw,26px); }
h4 { font-size:18px; }
p  { color:var(--muted); line-height:1.75; }
.text-accent { color:var(--accent); }
.text-blue   { color:var(--blue); }
.text-gold   { color:var(--gold); }
.text-coral  { color:var(--coral); }
.text-muted  { color:var(--muted); }
.text-white  { color:var(--white); }
.text-sm     { font-size:13px; }
.text-xs     { font-size:11px; }
.font-bold   { font-weight:700; }
.uppercase   { text-transform:uppercase; letter-spacing:1px; }

/* ── LAYOUT ── */
.container    { max-width:1200px; margin:0 auto; padding:0 var(--space-lg); }
.container-sm { max-width:640px;  margin:0 auto; padding:0 var(--space-lg); }
.container-md { max-width:880px;  margin:0 auto; padding:0 var(--space-lg); }
.flex         { display:flex; }
.flex-center  { display:flex; align-items:center; justify-content:center; }
.flex-between { display:flex; align-items:center; justify-content:space-between; }
.flex-col     { display:flex; flex-direction:column; }
.gap-sm { gap:var(--space-sm); }
.gap-md { gap:var(--space-md); }
.gap-lg { gap:var(--space-lg); }

/* ── CARDS ── */
.card {
  background:var(--surf); border:1px solid var(--dim);
  border-radius:var(--radius-lg); padding:var(--space-lg);
  transition:var(--ease);
}
.card:hover { border-color:rgba(0,229,160,0.15); }
.card-accent { border-color:rgba(0,229,160,0.2); }
.card-blue   { border-color:rgba(75,139,244,0.2); }
.card-gold   { border-color:rgba(240,192,64,0.2); }

/* ── BUTTONS ── */
.btn {
  display:inline-flex; align-items:center; justify-content:center;
  gap:var(--space-sm); padding:13px 24px;
  border-radius:var(--radius-md);
  font-family:'Plus Jakarta Sans',sans-serif; font-weight:700;
  font-size:15px; transition:var(--ease);
  white-space:nowrap; border:none; cursor:pointer;
}
.btn-primary { background:var(--accent); color:var(--bg); }
.btn-primary:hover { background:#2CF0B3; }
.btn-primary:active { transform:translateY(0); }
.btn-secondary { background:var(--surf2); border:1px solid var(--dim); color:var(--white); }
.btn-secondary:hover { border-color:rgba(255,255,255,0.15); background:var(--surf3); }
.btn-ghost { background:transparent; border:1px solid var(--dim); color:var(--muted); }
.btn-ghost:hover { color:var(--white); border-color:rgba(255,255,255,0.2); }
.btn-blue { background:var(--blue); color:var(--white); }
.btn-blue:hover { background:#5E99F7; }
.btn-danger { background:rgba(255,82,82,0.1); border:1px solid rgba(255,82,82,0.3); color:var(--coral); }
.btn-danger:hover { background:rgba(255,82,82,0.2); }
.btn-sm  { padding:8px 16px; font-size:13px; border-radius:var(--radius-sm); }
.btn-lg  { padding:16px 32px; font-size:17px; border-radius:var(--radius-lg); }
.btn-full { width:100%; }
.btn:disabled { opacity:0.5; pointer-events:none; }

/* ── FORMS ── */
.form-group  { display:flex; flex-direction:column; gap:6px; margin-bottom:var(--space-md); }
.form-label  { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; }
.form-input  {
  background:var(--surf2); border:1px solid var(--dim);
  border-radius:var(--radius-md); padding:13px 16px;
  font-size:max(16px,1em); color:var(--white);
  outline:none; transition:border-color 0.2s; width:100%;
}
.form-input:focus { border-color:rgba(0,229,160,0.4); }
.form-input::placeholder { color:var(--muted); }
.form-input.error { border-color:rgba(255,82,82,0.5); }
textarea.form-input { resize:vertical; min-height:100px; line-height:1.6; }
select.form-input {
  appearance:none; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238898B0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 16px center; padding-right:40px;
}
select.form-input option { background:var(--surf2); }
.form-hint  { font-size:12px; color:var(--muted); margin-top:4px; }
.form-grid  { display:grid; grid-template-columns:1fr 1fr; gap:var(--space-md); }

/* ── BADGES ── */
.badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:var(--radius-full); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; }
.badge-accent { background:rgba(0,229,160,0.1);  color:var(--accent); border:1px solid rgba(0,229,160,0.2); }
.badge-blue   { background:rgba(75,139,244,0.1);  color:var(--blue);   border:1px solid rgba(75,139,244,0.2); }
.badge-gold   { background:rgba(240,192,64,0.1);  color:var(--gold);   border:1px solid rgba(240,192,64,0.2); }
.badge-coral  { background:rgba(255,82,82,0.1);   color:var(--coral);  border:1px solid rgba(255,82,82,0.2); }
.badge-purple { background:rgba(167,139,250,0.1); color:var(--purple); border:1px solid rgba(167,139,250,0.2); }
.badge-muted  { background:var(--surf2); color:var(--muted); border:1px solid var(--dim); }

/* ── ALERTS ── */
.alert { padding:14px 18px; border-radius:var(--radius-md); font-size:14px; font-weight:500; display:none; }
.alert.show { display:flex; align-items:center; gap:10px; }
.alert-error   { background:rgba(255,82,82,0.1);  border:1px solid rgba(255,82,82,0.3);  color:var(--coral); }
.alert-success { background:rgba(0,229,160,0.1);  border:1px solid rgba(0,229,160,0.3);  color:var(--accent); }
.alert-info    { background:rgba(75,139,244,0.1); border:1px solid rgba(75,139,244,0.3); color:var(--blue); }
.alert-gold    { background:rgba(240,192,64,0.1); border:1px solid rgba(240,192,64,0.3); color:var(--gold); }

/* ── DIVIDERS ── */
.divider { height:1px; background:var(--dim); margin:var(--space-lg) 0; }
.divider-text { display:flex; align-items:center; gap:var(--space-md); color:var(--muted); font-size:13px; margin:var(--space-lg) 0; }
.divider-text::before,.divider-text::after { content:''; flex:1; height:1px; background:var(--dim); }

/* ── AVATAR ── */
.avatar { border-radius:50%; display:flex; align-items:center; justify-content:center; font-family:'Young Serif',serif; font-weight:800; flex-shrink:0; background:var(--accent); color:var(--bg); }
.avatar-sm { width:32px; height:32px; font-size:12px; }
.avatar-md { width:44px; height:44px; font-size:16px; }
.avatar-lg { width:64px; height:64px; font-size:22px; }
.avatar-xl { width:88px; height:88px; font-size:30px; }
.avatar-blue { background:var(--blue); color:var(--white); }

/* ── SPINNER ── */
.spinner { display:inline-block; border-radius:50%; border:2px solid rgba(255,255,255,0.15); border-top-color:var(--accent); animation:spin 0.7s linear infinite; }
.spinner-sm { width:14px; height:14px; }
.spinner-md { width:24px; height:24px; border-width:3px; }
.spinner-lg { width:40px; height:40px; border-width:4px; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── SHIMMER ── */
.shimmer { background:linear-gradient(90deg,var(--surf) 25%,var(--surf2) 50%,var(--surf) 75%); background-size:200% 100%; animation:shimmer 1.4s infinite; border-radius:var(--radius-md); }
@keyframes shimmer { to { background-position:-200% 0; } }

/* ── SKILLS ── */
.skills-wrap { display:flex; flex-wrap:wrap; gap:6px; background:var(--surf2); border:1px solid var(--dim); border-radius:var(--radius-md); padding:10px 12px; min-height:52px; cursor:text; transition:border-color 0.2s; }
.skills-wrap:focus-within { border-color:rgba(0,229,160,0.4); }
.skill-tag { background:rgba(0,229,160,0.12); color:var(--accent); border-radius:6px; padding:4px 10px; font-size:13px; font-weight:600; display:flex; align-items:center; gap:6px; }
.skill-tag button { background:none; border:none; color:var(--accent); cursor:pointer; font-size:16px; padding:0; line-height:1; transition:color 0.15s; }
.skill-tag button:hover { color:var(--coral); }
.skill-input { background:none; border:none; outline:none; color:var(--white); font-size:max(16px,1em); min-width:120px; flex:1; padding:2px 0; }

/* ── TOP NAV ── */
.top-nav { position:sticky; top:0; z-index:200; height:var(--nav-height); background:#040912; border-bottom:1px solid var(--dim); display:flex; align-items:center; padding:0 var(--space-lg); gap:var(--space-lg); }
.nav-logo { display:flex; align-items:center; gap:10px; font-family:'Young Serif',serif; font-weight:800; font-size:18px; color:var(--white); }
.nav-logo-mark { width:34px; height:34px; border-radius:8px; background:var(--accent); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.nav-links { display:flex; align-items:center; gap:var(--space-lg); flex:1; }
.nav-link { font-size:14px; font-weight:500; color:var(--muted); transition:color 0.2s; }
.nav-link:hover,.nav-link.active { color:var(--white); }
.nav-right { display:flex; align-items:center; gap:var(--space-sm); margin-left:auto; }

/* ── BOTTOM NAV ── */
.bottom-nav { position:fixed; bottom:0; left:0; right:0; height:var(--bottom-nav-height); background:#07101E; border-top:1px solid var(--dim); display:none; align-items:center; justify-content:space-around; padding-bottom:env(safe-area-inset-bottom); z-index:200; }
.bottom-nav-item { display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 16px; color:var(--muted); font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; transition:color 0.2s; flex:1; }
.bottom-nav-item svg { width:22px; height:22px; }
.bottom-nav-item.active { color:var(--accent); }
.bottom-nav-item:hover { color:var(--white); }

/* ── SIDEBAR ── */
.sidebar { width:240px; min-height:100vh; flex-shrink:0; background:var(--surf); border-right:1px solid var(--dim); display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow-y:auto; }
.sidebar-logo { padding:var(--space-lg); border-bottom:1px solid var(--dim); display:flex; align-items:center; gap:10px; font-family:'Young Serif',serif; font-weight:800; font-size:16px; color:var(--white); }
.sidebar-user { padding:var(--space-md) var(--space-lg); border-bottom:1px solid var(--dim); display:flex; align-items:center; gap:12px; }
.sidebar-nav { flex:1; padding:var(--space-md) var(--space-sm); }
.sidebar-nav-item { display:flex; align-items:center; gap:12px; padding:10px 14px; border-radius:var(--radius-md); color:var(--muted); font-size:14px; font-weight:500; transition:var(--ease); margin-bottom:2px; cursor:pointer; }
.sidebar-nav-item svg { width:18px; height:18px; flex-shrink:0; }
.sidebar-nav-item:hover { background:var(--surf2); color:var(--white); }
.sidebar-nav-item.active { background:rgba(0,229,160,0.08); color:var(--accent); border-left:3px solid var(--accent); }
.sidebar-footer { padding:var(--space-md) var(--space-sm); border-top:1px solid var(--dim); }

/* ── DASHBOARD ── */
.dashboard-layout { display:flex; min-height:100vh; }
.dashboard-main { flex:1; min-width:0; padding:var(--space-lg); padding-bottom:calc(var(--bottom-nav-height) + var(--space-lg)); }
.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:var(--space-md); margin-bottom:var(--space-xl); }
.stat-card { background:var(--surf); border:1px solid var(--dim); border-radius:var(--radius-lg); padding:var(--space-lg); position:relative; overflow:hidden; }
.stat-card .stat-val { font-family:'Young Serif',serif; font-weight:800; font-size:28px; margin-bottom:4px; }
.stat-card .stat-label { font-size:13px; color:var(--muted); }
.stat-card .stat-change { font-size:12px; font-weight:600; margin-top:6px; }
.stat-card::after { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; }
.stat-card.accent::after { background:var(--accent); }
.stat-card.blue::after   { background:var(--blue); }
.stat-card.gold::after   { background:var(--gold); }
.stat-card.purple::after { background:var(--purple); }
.section-title { font-family:'Young Serif',serif; font-weight:700; font-size:16px; margin-bottom:var(--space-md); display:flex; align-items:center; justify-content:space-between; }
.section-title a { font-size:13px; font-weight:500; color:var(--accent); }

/* ── PROGRESS ── */
.progress-wrap { background:var(--dim); border-radius:99px; height:8px; overflow:hidden; }
.progress-fill { height:100%; border-radius:99px; transition:width 0.4s ease; }
.progress-accent { background:var(--accent); }
.progress-blue   { background:var(--blue); }
.progress-gold   { background:var(--gold); }

/* ── EMPTY STATE ── */
.empty-state { text-align:center; padding:var(--space-2xl) var(--space-lg); color:var(--muted); }
.empty-state-icon { font-size:48px; margin-bottom:var(--space-md); }
.empty-state h3 { color:var(--white); margin-bottom:var(--space-sm); font-size:18px; }
.empty-state p { font-size:14px; max-width:320px; margin:0 auto var(--space-lg); }

/* ── MODAL ── */
.modal-overlay { position:fixed; inset:0; background:rgba(4,9,18,0.9); z-index:1000; display:none; align-items:center; justify-content:center; padding:var(--space-lg); }
.modal-overlay.open { display:flex; }
.modal { background:var(--surf); border:1px solid var(--dim); border-radius:var(--radius-xl); padding:var(--space-xl); width:100%; max-width:520px; max-height:90vh; overflow-y:auto; position:relative; }
.modal-close { width:32px; height:32px; border-radius:50%; background:var(--surf2); border:1px solid var(--dim); color:var(--muted); font-size:18px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:var(--ease); }
.modal-close:hover { color:var(--white); }

/* ── TOAST ── */
#toast-container { position:fixed; bottom:calc(var(--bottom-nav-height) + 16px); left:50%; transform:translateX(-50%); display:flex; flex-direction:column; gap:8px; z-index:9999; width:min(400px,calc(100vw - 32px)); }
.toast { padding:14px 18px; border-radius:var(--radius-md); font-size:14px; font-weight:500; display:flex; align-items:center; gap:10px; animation:toastIn 0.3s ease; box-shadow:var(--shadow-md); }
.toast-success { background:rgba(0,229,160,0.15); border:1px solid rgba(0,229,160,0.4); color:var(--accent); }
.toast-error   { background:rgba(255,82,82,0.15);  border:1px solid rgba(255,82,82,0.4);  color:var(--coral); }
.toast-info    { background:rgba(75,139,244,0.15); border:1px solid rgba(75,139,244,0.4); color:var(--blue); }
@keyframes toastIn { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* ── NOTIF DOT ── */
.notif-dot { width:8px; height:8px; border-radius:50%; background:var(--coral); border:2px solid var(--surf); position:absolute; top:0; right:0; }

/* ── RESPONSIVE ── */
@media(max-width:768px){
  :root { --nav-height:56px; }
  .sidebar { display:none; }
  .bottom-nav { display:flex; }
  .dashboard-layout { flex-direction:column; }
  .dashboard-main { padding:var(--space-md); padding-bottom:calc(var(--bottom-nav-height) + 80px); }
  .stat-grid { grid-template-columns:1fr 1fr; }
  .form-grid { grid-template-columns:1fr; }
  .nav-links { display:none; }
  .container,.container-sm,.container-md { padding:0 var(--space-md); }
}
@media(max-width:480px){
  .stat-grid { grid-template-columns:1fr 1fr; gap:var(--space-sm); }
  .stat-card { padding:var(--space-md); }
  .stat-card .stat-val { font-size:22px; }
}
@media(display-mode:standalone){
  body { padding-top:env(safe-area-inset-top); }
  .top-nav { padding-top:env(safe-area-inset-top); height:calc(var(--nav-height) + env(safe-area-inset-top)); }
  .bottom-nav { padding-bottom:env(safe-area-inset-bottom); height:calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
}

/* ── UTILITIES ── */
.hidden { display:none !important; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.w-full { width:100%; }
.mt-sm { margin-top:var(--space-sm); }
.mt-md { margin-top:var(--space-md); }
.mt-lg { margin-top:var(--space-lg); }
.mb-md { margin-bottom:var(--space-md); }
.mb-lg { margin-bottom:var(--space-lg); }
.cursor-pointer { cursor:pointer; }

/* ── TYPE + ICONS ── */
*{font-synthesis:none}
body{font-feature-settings:"tnum" 0; letter-spacing:0}
i[data-ic]{display:inline-flex;font-style:normal;vertical-align:-0.18em;line-height:1}
.ic{width:1.15em;height:1.15em;flex-shrink:0}
.bottom-nav-item .ic,.bottom-nav-item svg{width:22px;height:22px}
.empty-state-icon{display:flex;justify-content:center;color:var(--muted);opacity:.8}
.empty-state-icon .ic{width:1.1em;height:1.1em}
.btn i[data-ic]{vertical-align:middle}
.reveal{opacity:0;transform:translateY(14px);transition:opacity .6s ease,transform .6s ease}
.reveal.in{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){.reveal{opacity:1;transform:none;transition:none}}
