/* ═══════════════════════════════════════════════════
   WorkSphere Production — Global CSS v1.0
   Mobile-first. PWA-ready. 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: 'DM 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; outline: none; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── TOKENS ── */
:root {
  --bg:      #040912;
  --surf:    #07101E;
  --surf2:   #0C1A2E;
  --surf3:   #0F2236;
  --dim:     #1A2A40;
  --border:  rgba(255,255,255,0.06);
  --accent:  #00E5A0;
  --blue:    #4B8BF4;
  --gold:    #F0C040;
  --coral:   #FF5252;
  --purple:  #A78BFA;
  --white:   #F0F4FA;
  --muted:   #8898B0;
  --nav-h:   64px;
  --bot-h:   68px;
  --radius:  14px;
  --ease:    all 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ── LAYOUT ── */
.ws-container    { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.ws-container-sm { max-width: 640px;  margin: 0 auto; padding: 0 24px; }
.ws-container-md { max-width: 880px;  margin: 0 auto; padding: 0 24px; }

/* ── TOP NAV ── */
.ws-nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(4,9,18,0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--dim);
  display: flex; align-items: center;
  padding: 0 24px; gap: 24px;
}
.ws-nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 18px; color: var(--white);
}
.ws-nav-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #00B87A);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-nav-mark svg { width: 16px; height: 16px; }
.ws-nav-links { display: flex; gap: 24px; flex: 1; }
.ws-nav-link { font-size: 14px; font-weight: 500; color: var(--muted); transition: color .2s; }
.ws-nav-link:hover, .ws-nav-link.active { color: var(--white); }
.ws-nav-right { display: flex; gap: 10px; margin-left: auto; }

/* ── SIDEBAR ── */
.ws-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;
}
.ws-sidebar-logo {
  padding: 20px 24px; border-bottom: 1px solid var(--dim);
  display: flex; align-items: center; gap: 10px;
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 16px; color: var(--white);
}
.ws-sidebar-user {
  padding: 16px 24px; border-bottom: 1px solid var(--dim);
  display: flex; align-items: center; gap: 12px;
}
.ws-sidebar-nav { flex: 1; padding: 12px 8px; }
.ws-sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius);
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: var(--ease); margin-bottom: 2px;
  border: none; background: transparent; width: 100%; text-align: left;
}
.ws-sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.ws-sidebar-item:hover { background: var(--surf2); color: var(--white); }
.ws-sidebar-item.active {
  background: rgba(0,229,160,0.08); color: var(--accent);
  border-left: 3px solid var(--accent); padding-left: 11px;
}
.ws-sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--dim); }

/* ── BOTTOM NAV ── */
.ws-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bot-h);
  background: rgba(7,16,30,0.96);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  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;
}
.ws-bottom-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 .2s; flex: 1;
  border: none; background: transparent;
}
.ws-bottom-item svg { width: 22px; height: 22px; }
.ws-bottom-item.active { color: var(--accent); }
.ws-bottom-item:hover { color: var(--white); }

/* ── DASHBOARD ── */
.ws-dash { display: flex; min-height: 100vh; }
.ws-main {
  flex: 1; min-width: 0; padding: 24px;
  padding-bottom: calc(var(--bot-h) + 40px);
}

/* ── STAT CARDS ── */
.ws-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 32px; }
.ws-stat {
  background: var(--surf); border: 1px solid var(--dim);
  border-radius: var(--radius); padding: 20px;
  position: relative; overflow: hidden;
}
.ws-stat::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
}
.ws-stat.accent::before { background: var(--accent); }
.ws-stat.blue::before   { background: var(--blue); }
.ws-stat.gold::before   { background: var(--gold); }
.ws-stat.purple::before { background: var(--purple); }
.ws-stat-val {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 26px; margin-bottom: 4px;
}
.ws-stat-label { font-size: 12px; color: var(--muted); }
.ws-stat-change { font-size: 11px; margin-top: 6px; color: var(--muted); }

/* ── CARDS ── */
.ws-card {
  background: var(--surf); border: 1px solid var(--dim);
  border-radius: var(--radius); padding: 20px;
  transition: var(--ease);
}
.ws-card:hover { border-color: rgba(0,229,160,0.15); }
.ws-card-title {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 15px; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--dim);
  display: flex; align-items: center; justify-content: space-between;
}
.ws-card-action { font-size: 13px; font-weight: 500; color: var(--accent); }

/* ── BUTTONS ── */
.ws-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px; border-radius: var(--radius);
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 14px; transition: var(--ease); white-space: nowrap;
}
.ws-btn-primary { background: linear-gradient(135deg,var(--accent),#00C88A); color: var(--bg); }
.ws-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,229,160,.25); }
.ws-btn-blue   { background: linear-gradient(135deg,var(--blue),#3A6FD4); color: var(--white); }
.ws-btn-blue:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(75,139,244,.25); }
.ws-btn-ghost  { background: transparent; border: 1px solid var(--dim); color: var(--muted); }
.ws-btn-ghost:hover { color: var(--white); border-color: rgba(255,255,255,.2); }
.ws-btn-danger { background: rgba(255,82,82,.1); border: 1px solid rgba(255,82,82,.3); color: var(--coral); }
.ws-btn-sm     { padding: 8px 14px; font-size: 12px; border-radius: 10px; }
.ws-btn-full   { width: 100%; }
.ws-btn-lg     { padding: 15px 28px; font-size: 16px; }
.ws-btn:disabled { opacity: .5; pointer-events: none; }

/* ── FORMS ── */
.ws-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ws-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.ws-input {
  background: var(--surf2); border: 1px solid var(--dim);
  border-radius: var(--radius); padding: 13px 16px;
  font-size: max(16px,1em); color: var(--white); outline: none;
  transition: border-color .2s; width: 100%;
}
.ws-input:focus { border-color: rgba(0,229,160,.4); }
.ws-input::placeholder { color: var(--muted); }
.ws-input.error { border-color: rgba(255,82,82,.5); }
textarea.ws-input { resize: vertical; min-height: 100px; line-height: 1.6; }
select.ws-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.ws-input option { background: var(--surf2); }
.ws-form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ws-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

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

/* ── ALERTS ── */
.ws-alert { padding: 13px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; display: none; }
.ws-alert.show { display: block; margin-bottom: 16px; }
.ws-alert-error   { background: rgba(255,82,82,.1);  border: 1px solid rgba(255,82,82,.3);  color: var(--coral); }
.ws-alert-success { background: rgba(0,229,160,.1);  border: 1px solid rgba(0,229,160,.3);  color: var(--accent); }
.ws-alert-info    { background: rgba(75,139,244,.1); border: 1px solid rgba(75,139,244,.3); color: var(--blue); }
.ws-alert-gold    { background: rgba(240,192,64,.1); border: 1px solid rgba(240,192,64,.3); color: var(--gold); }

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

/* ── AVATAR ── */
.ws-av {
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-family: 'Syne', sans-serif;
  font-weight: 800; flex-shrink: 0;
  background: linear-gradient(135deg,var(--accent),#00B87A); color: var(--bg);
}
.ws-av-sm { width: 32px; height: 32px; font-size: 12px; }
.ws-av-md { width: 44px; height: 44px; font-size: 16px; }
.ws-av-lg { width: 64px; height: 64px; font-size: 22px; }
.ws-av-xl { width: 88px; height: 88px; font-size: 30px; }
.ws-av-blue { background: linear-gradient(135deg,var(--blue),#3A6FD4); color: var(--white); }

/* ── SPINNER ── */
.ws-spinner {
  display: inline-block; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: currentColor;
  animation: wsSpin .7s linear infinite;
  width: 14px; height: 14px; vertical-align: middle;
}
.ws-spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes wsSpin { to { transform: rotate(360deg); } }

/* ── LOADING ── */
.ws-loading {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999; gap: 16px;
}

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

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

/* ── EMPTY STATE ── */
.ws-empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.ws-empty-icon { font-size: 44px; margin-bottom: 16px; }
.ws-empty h3 { color: var(--white); margin-bottom: 8px; font-size: 18px; }
.ws-empty p { font-size: 14px; max-width: 300px; margin: 0 auto 20px; }

/* ── MODAL ── */
.ws-overlay {
  position: fixed; inset: 0; background: rgba(4,9,18,.85);
  backdrop-filter: blur(8px); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.ws-overlay.open { display: flex; }
.ws-modal {
  background: var(--surf); border: 1px solid var(--dim);
  border-radius: 20px; padding: 32px; width: 100%;
  max-width: 520px; max-height: 90vh; overflow-y: auto;
}
.ws-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.ws-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);
}
.ws-modal-close:hover { color: var(--white); }

/* ── PROGRESS ── */
.ws-progress { background: var(--dim); border-radius: 99px; height: 8px; overflow: hidden; }
.ws-progress-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.ws-progress-accent { background: linear-gradient(90deg,var(--accent),#00C88A); }
.ws-progress-blue   { background: linear-gradient(90deg,var(--blue),#3A6FD4); }
.ws-progress-gold   { background: linear-gradient(90deg,var(--gold),#D4A800); }

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

/* ── JOB CARD ── */
.ws-job-card {
  background: var(--surf); border: 1px solid var(--dim);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
  transition: var(--ease); cursor: pointer;
}
.ws-job-card:hover { border-color: rgba(0,229,160,.25); transform: translateY(-2px); }
.ws-job-title { font-family: 'Syne',sans-serif; font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.ws-job-meta  { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.ws-job-desc  { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ws-job-tags  { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-tag       { background: var(--surf2); color: var(--muted); border-radius: 6px; padding: 3px 10px; font-size: 11px; font-weight: 600; }

/* ── COMPLETION BANNER ── */
.ws-completion {
  background: rgba(240,192,64,.06); border: 1px solid rgba(240,192,64,.3);
  border-radius: var(--radius); padding: 16px 20px;
  display: none; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 24px;
}
.ws-completion.show { display: flex; }
.ws-ring {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne',sans-serif; font-weight: 800;
  font-size: 13px; color: var(--gold);
}

/* ── PWA BANNER ── */
#pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surf2); border-top: 1px solid var(--dim);
  padding: 16px 24px; display: none; align-items: center;
  justify-content: space-between; gap: 16px; z-index: 500;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  :root { --nav-h: 56px; }
  .ws-sidebar   { display: none; }
  .ws-bottom-nav { display: flex; }
  .ws-stats     { grid-template-columns: 1fr 1fr; }
  .ws-nav-links { display: none; }
  .ws-form-2col { grid-template-columns: 1fr; }
  .ws-container, .ws-container-sm, .ws-container-md { padding: 0 16px; }
}
@media (max-width: 480px) {
  .ws-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ws-stat { padding: 14px; }
  .ws-stat-val { font-size: 20px; }
  .ws-main { padding: 16px; }
}
@media (display-mode: standalone) {
  .ws-nav { padding-top: env(safe-area-inset-top); height: calc(var(--nav-h) + env(safe-area-inset-top)); }
  .ws-bottom-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--bot-h) + env(safe-area-inset-bottom)); }
}

/* ── UTILITY ── */
.hidden   { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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-center  { text-align: center; }
.font-bold    { font-weight: 700; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.w-full { width: 100%; }
.flex   { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
