:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #16161f;
  --surface3: #1c1c28;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #f0eee8;
  --text2: #9896a0;
  --text3: #8a8899;
  --accent: #c8ff57;
  --accent-dim: rgba(200,255,87,0.12);
  --accent-glow: rgba(200,255,87,0.25);
  --red: #ff5757;
  --blue: #57b4ff;
  --purple: #b057ff;
  --orange: #ff9d57;
  --radius: 14px;
  --radius-sm: 8px;
  --role-developer: #b057ff;
  --role-designer: #ff5757;
  --role-musician: #ff9d57;
  --role-visual: #c8ff57;
  --role-writer: #57b4ff;
  --role-strategist: #e0e0e0;
  --role-director: #57ffe0;
  --role-scientist: #ff57b4;
  --role-finance: #57ffb4;
  --role-architect: #ffd557;
  --role-other: #9896a0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* NOISE OVERLAY */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; opacity: .4;
}

/* NAV */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 62px;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 20px;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 8px;
}
.nav-logo .dot { color: var(--accent); }
.nav-center { display: flex; gap: 6px; }
.nav-link {
  padding: 6px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text2);
  text-decoration: none; transition: all .2s; cursor: pointer;
  border: none; background: none;
  font-family: 'Instrument Sans', sans-serif;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active { color: var(--text); background: var(--surface3); }
.nav-right { display: flex; align-items: center; gap: 10px; }

/* BADGE NOTIFICHE */
.nav-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: white;
  border-radius: 50%; width: 16px; height: 16px;
  font-size: 10px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 8px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .2s;
  border: none; text-decoration: none;
}
.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.btn-accent {
  background: var(--accent); color: #0a0a0f;
  font-weight: 600;
}
.btn-accent:hover { background: #d4ff6a; transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Pulsante Salva Interessi */
.btn-save { background: transparent; border: 1px solid var(--border2); color: var(--text2); padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 600; transition: 0.2s; font-family: 'Instrument Sans', sans-serif;}
.btn-save:hover { border-color: var(--accent); color: var(--text); }
.btn-save.saved { background: rgba(255,157,87,0.1); border-color: rgba(255,157,87,0.3); color: var(--orange); }

/* HERO */
.hero {
  position: relative; z-index: 1;
  padding: 90px 32px 80px;
  text-align: center;
  max-width: 900px; margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-dim); border: 1px solid rgba(200,255,87,0.2);
  color: var(--accent); padding: 5px 14px; border-radius: 100px;
  font-size: 12px; font-weight: 500; letter-spacing: .5px;
  margin-bottom: 32px;
}
.hero-eyebrow::before {
  content: ''; width: 5px; height: 5px;
  background: var(--accent); border-radius: 50%;
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1}50%{opacity:.3} }

.hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 800; line-height: 1.0;
  letter-spacing: -2.5px; color: var(--text);
  margin-bottom: 24px;
}
.hero h1 .line2 { color: var(--text3); }
.hero h1 .highlight {
  color: var(--accent);
  position: relative; display: inline-block;
}
.hero-sub {
  font-size: 17px; color: var(--text2);
  max-width: 520px; margin: 0 auto 40px;
  line-height: 1.75; font-weight: 300;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 10px; }

.hero-glow {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(200,255,87,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* STATS */
.stats-bar {
  position: relative; z-index: 1;
  display: flex; justify-content: center; gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
/* SEARCH */
.search-wrap {
  position: relative; z-index: 1;
  padding: 40px 32px 0;
  max-width: 1100px; margin: 0 auto;
}
.search-row {
  display: flex; gap: 10px; align-items: center;
}
.search-box {
  flex: 1; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 10px; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-box input {
  flex:1; padding: 13px 16px; background: transparent;
  border: none; outline: none; color: var(--text);
  font-family: 'Instrument Sans', sans-serif; font-size: 14px;
}
.search-box input::placeholder { color: var(--text3); }
.search-icon { padding: 0 14px; color: var(--text3); font-size: 16px; }
.search-btn {
  padding: 10px 18px; margin: 4px;
  background: var(--accent); color: #0a0a0f;
  border: none; border-radius: 7px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.search-btn:hover { background: #d4ff6a; }

/* CATEGORIES */
.cats-wrap {
  position: relative; z-index: 1;
  padding: 24px 32px 0;
  max-width: 1100px; margin: 0 auto;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.cats-label { font-size: 12px; color: var(--text3); font-weight: 500; margin-right: 4px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all .2s;
}
.cat-pill:hover { border-color: var(--border2); color: var(--text); }
.cat-pill.active {
  background: var(--accent-dim); border-color: rgba(200,255,87,0.3);
  color: var(--accent);
}

/* MAIN LAYOUT */
.main {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 40px 32px 100px;
  display: grid; grid-template-columns: 1fr 300px; gap: 32px;
}

/* PROJECTS */
.projects-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.projects-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.projects-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.sort-select {
  padding: 7px 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text2); font-family: 'Instrument Sans', sans-serif;
  font-size: 12px; outline: none; cursor: pointer;
}

.projects-list { display: flex; flex-direction: column; gap: 16px; }

/* PROJECT CARD */
.pcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  animation: fadeUp .35s both;
  position: relative; overflow: hidden;
}
.pcard::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  opacity: 0; transition: opacity .3s;
}
.pcard:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.pcard:hover::before { opacity: 1; }
.pcard.featured {
  background: linear-gradient(135deg, #13131e 0%, #0f0f1a 100%);
  border-color: rgba(200,255,87,0.2);
}
.pcard.featured:hover { border-color: rgba(200,255,87,0.4); box-shadow: 0 8px 40px rgba(200,255,87,0.08); }

@keyframes fadeUp {
  from { opacity:0; transform:translateY(14px); }
  to { opacity:1; transform:translateY(0); }
}

.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pcard-author { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 700; color: #0a0a0f; flex-shrink: 0;
}
.author-name { font-size: 13px; font-weight: 500; color: var(--text); }
.author-date { font-size: 11px; color: var(--text3); margin-top: 1px; }
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600;
}
.status-badge::before { content:''; width:5px; height:5px; border-radius:50%; }
.s-open { background: rgba(87,255,133,0.1); color: #57ff85; }
.s-open::before { background: #57ff85; }
.s-progress { background: rgba(255,157,87,0.1); color: var(--orange); }
.s-progress::before { background: var(--orange); }
.s-closed { background: rgba(255,87,87,0.1); color: var(--red); }
.s-closed::before { background: var(--red); }
.s-completed { background: rgba(87,180,255,0.1); color: var(--blue); }
.s-completed::before { background: var(--blue); }

.featured-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 8px; display: flex; align-items: center; gap: 5px;
}
.pcard-title {
  font-family: 'Syne', sans-serif;
  font-size: 19px; font-weight: 700;
  color: var(--text); margin-bottom: 8px;
  letter-spacing: -0.4px; line-height: 1.25;
}
.pcard-desc {
  font-size: 13px; color: var(--text2);
  line-height: 1.7; margin-bottom: 14px;
  font-weight: 300;
}
.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag {
  padding: 3px 10px; border-radius: 6px;
  background: var(--surface3); color: var(--text3);
  font-size: 11px; font-weight: 500; border: 1px solid var(--border);
}
.pcard-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.pcard-stats { display: flex; gap: 16px; }
.pstat { font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 4px; }
.pcard-action .btn-accent { padding: 7px 14px; font-size: 12px; border-radius: 7px; }
.pcard-cover {
  width: calc(100% + 44px);
  margin: -22px -22px 18px -22px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.scard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.scard-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}

.trending-list { display: flex; flex-direction: column; gap: 12px; }
.titem { display: flex; gap: 12px; cursor: pointer; padding: 8px; border-radius: 8px; transition: background .2s; }
.titem:hover { background: var(--surface2); }
.trank {
  font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800;
  color: var(--border2); line-height: 1; min-width: 20px;
}
.ttitle { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.tmeta { font-size: 11px; color: var(--text3); margin-top: 2px; }

.how-steps { display: flex; flex-direction: column; gap: 14px; }
.hstep { display: flex; gap: 12px; align-items: flex-start; }
.hnum {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  border: 1px solid rgba(200,255,87,0.2);
}
.htext strong { font-size: 12px; font-weight: 600; color: var(--text); display: block; margin-bottom: 2px; }
.htext span { font-size: 11px; color: var(--text3); line-height: 1.5; }

/* ── MODAL ── */
.overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(5,5,10,0.8); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; visibility: hidden; pointer-events: none; transition: all .25s;
}
.overlay.open { opacity: 1; visibility: visible; pointer-events: all; }
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 20px; width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  transform: translateY(20px) scale(.97);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.overlay.open .modal { transform: translateY(0) scale(1); }
.modal-head {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 14px; justify-content: space-between; align-items: flex-start;
}
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface3); border: none; cursor: pointer;
  color: var(--text2); font-size: 16px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .2s;
}
.modal-close:hover { background: var(--border2); color: var(--text); }
.modal-body { padding: 22px 24px 26px; }
.modal-title {
  font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800;
  letter-spacing: -.5px; line-height: 1.2;
}
.modal-author-row { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; }
.modal-author-row span { font-size: 12px; color: var(--text3); }
.modal-desc { font-size: 14px; color: var(--text2); line-height: 1.75; margin: 14px 0 16px; font-weight: 300; }
.msec-title {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text3); margin-bottom: 10px;
}
.collab-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.citem {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
}
.citem-left { display: flex; align-items: center; gap: 10px; }
.cname { font-size: 13px; font-weight: 500; }
.crole { font-size: 11px; color: var(--text3); }
.cstatus {
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 100px;
}
.cs-accepted { background: rgba(87,255,133,0.1); color: #57ff85; }
.cs-pending { background: rgba(255,157,87,0.1); color: var(--orange); }

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text2); }
.form-input, .form-textarea, .form-select {
  padding: 10px 14px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); font-family: 'Instrument Sans', sans-serif;
  font-size: 13px; outline: none; transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-textarea { min-height: 85px; }
.form-select option { background: var(--surface2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-note { font-size: 11px; color: var(--text3); margin-top: 8px; display: flex; align-items: center; gap: 5px; }

/* PAGE VIEWS */
.page { display: none; }
.page.active { display: block; }

/* SUPER PROFILO / DASHBOARD */
.profile-hero {
  position: relative; z-index: 1;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 40px 32px;
}
.profile-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: flex-end; gap: 24px; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800;
  color: #0a0a0f; flex-shrink: 0;
}
.profile-name {
  font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800;
  letter-spacing: -.8px;
}
.profile-bio { font-size: 14px; color: var(--text2); margin-top: 6px; font-weight: 300; }
.profile-content { max-width: 1100px; margin: 0 auto; padding: 36px 32px 80px; display: grid; grid-template-columns: 1fr 320px; gap: 32px; position: relative; z-index: 1; }
.dash-section-title { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 16px; }

.dash-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.kpi {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.kpi-val { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -1px; }
.kpi-label { font-size: 12px; color: var(--text3); margin-top: 4px; }

.proposal-list { display: flex; flex-direction: column; gap: 10px; }
.prop-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
}
.prop-avatar { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #0a0a0f; flex-shrink: 0; }
.prop-name { font-size: 13px; font-weight: 500; }
.prop-role { font-size: 11px; color: var(--text3); margin-top: 1px; }
.prop-msg { font-size: 12px; color: var(--text2); margin-top: 6px; line-height: 1.5; }
.prop-actions { display: flex; gap: 7px; margin-top: 10px; }
.btn-accept { background: rgba(87,255,133,0.12); color: #57ff85; border: 1px solid rgba(87,255,133,0.2); font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 6px; cursor: pointer; transition: background .2s; font-family: 'Instrument Sans', sans-serif; }
.btn-accept:hover { background: rgba(87,255,133,0.22); }
.btn-decline { background: rgba(255,87,87,0.08); color: var(--red); border: 1px solid rgba(255,87,87,0.15); font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 6px; cursor: pointer; transition: background .2s; font-family: 'Instrument Sans', sans-serif; }
.btn-decline:hover { background: rgba(255,87,87,0.18); }

/* MESSAGES PAGE */
.messages-wrap { max-width: 1100px; margin: 0 auto; padding: 36px 32px 80px; display: grid; grid-template-columns: 280px 1fr; gap: 0; position: relative; z-index: 1; min-height: calc(100vh - 62px); }
.msg-list { border-right: 1px solid var(--border); padding-right: 0; }
.msg-list-head { padding: 0 20px 16px; font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; }
.msg-item {
  padding: 14px 20px; cursor: pointer; transition: background .2s;
  border-left: 2px solid transparent;
}
.msg-item:hover { background: var(--surface2); }
.msg-item.active { background: var(--surface2); border-left-color: var(--accent); }
.msg-item-name { font-size: 13px; font-weight: 500; }
.msg-item-preview { font-size: 11px; color: var(--text3); margin-top: 2px; }
.msg-item-time { font-size: 10px; color: var(--text3); float: right; }
.msg-unread {
  display: inline-flex; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); color: #0a0a0f;
  font-size: 9px; font-weight: 700; align-items: center; justify-content: center;
  float: right; margin-top: 2px;
}
.chat-area { padding: 0 0 0 28px; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.chat-head-name { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; }
.chat-head-project { font-size: 12px; color: var(--text3); }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.cmsg { max-width: 75%; }
.cmsg.me { align-self: flex-end; }
.cmsg-bubble {
  padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.6;
}
.cmsg.them .cmsg-bubble { background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 12px 12px 12px 4px; }
.cmsg.me .cmsg-bubble { background: var(--accent); color: #0a0a0f; font-weight: 500; border-radius: 12px 12px 4px 12px; }
.cmsg-time { font-size: 10px; color: var(--text3); margin-top: 4px; padding: 0 4px; }
.cmsg.me .cmsg-time { text-align: right; }
.chat-input-row { display: flex; gap: 10px; }
.chat-input {
  flex: 1; padding: 11px 16px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); font-family: 'Instrument Sans', sans-serif;
  font-size: 13px; outline: none; transition: border-color .2s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send {
  padding: 11px 18px; border-radius: 10px;
  background: var(--accent); color: #0a0a0f;
  border: none; font-family: 'Instrument Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.chat-send:hover { background: #d4ff6a; }

/* BETA POPUP */
.beta-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.beta-overlay.open { opacity: 1; pointer-events: all; }
.beta-box {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 64px 60px; width: 100%; max-width: 680px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  text-align: center;
}
.beta-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-dim); border: 1px solid rgba(200,255,87,0.25);
  color: var(--accent); padding: 5px 14px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: .8px;
  text-transform: uppercase; margin-bottom: 18px;
}
.beta-title {
  font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800;
  color: var(--text); letter-spacing: -.5px; margin-bottom: 14px;
}
.beta-text {
  font-size: 15px; color: var(--text2); line-height: 1.8;
  margin-bottom: 28px; font-weight: 300;
}
.beta-text strong { color: var(--text); font-weight: 500; }
.beta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 10px;
  background: var(--accent); color: #0a0a0f;
  border: none; font-family: 'Instrument Sans', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.beta-btn:hover { background: #d4ff6a; }

/* AUTH MODAL */
.auth-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.auth-overlay.open { opacity: 1; pointer-events: all; }
.auth-box {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 56px 56px; width: 100%; max-width: 620px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.auth-logo {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 26px;
  color: var(--text); margin-bottom: 8px;
}
.auth-logo span { color: var(--accent); }
.auth-subtitle { font-size: 14px; color: var(--text3); margin-bottom: 32px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--surface); border-radius: 8px; padding: 4px; }
.auth-tab {
  flex: 1; padding: 8px; border-radius: 6px; font-size: 13px; font-weight: 500;
  color: var(--text3); cursor: pointer; border: none; background: transparent;
  font-family: 'Instrument Sans', sans-serif; transition: all .2s;
}
.auth-tab.active { background: var(--surface3); color: var(--text); }
.auth-input {
  width: 100%; padding: 11px 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); font-family: 'Instrument Sans', sans-serif;
  font-size: 14px; outline: none; margin-bottom: 12px;
  transition: border-color .2s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--text3); }
.auth-btn {
  width: 100%; padding: 12px; border-radius: 8px;
  background: var(--accent); color: #0a0a0f;
  border: none; font-family: 'Instrument Sans', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .2s; margin-top: 4px;
}
.auth-btn:hover { background: #d4ff6a; }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-error { font-size: 12px; color: var(--red); margin-top: 8px; text-align: center; min-height: 18px; }
.auth-note { font-size: 11px; color: var(--text3); text-align: center; margin-top: 14px; }
.auth-close { float: right; background: none; border: none; color: var(--text3); font-size: 18px; cursor: pointer; margin-top: -4px; }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transform: translateY(16px); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none; max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }

.role-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}
.role-primary-name {
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}

/* SCROLL DOWN */
.scroll-down-wrapper {
  position: absolute;
  bottom: 40px;
  right: 40px;
  cursor: pointer;
  animation: bounce 2s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.scroll-down-dot {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.scroll-down-arrow {
  color: var(--bg);
  font-size: 24px;
  font-weight: bold;
  user-select: none;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* UTILITY CLASSES */
.dash-section-title-accent { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--accent); }
.info-box { background: var(--surface3); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 12px; color: var(--text3); }
.modal-label { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); margin-bottom: 8px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); font-size: 13px; }
.flex-wrap-gap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* NOTA CONDIVISA */
.shared-note-card { background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px; padding: 14px 16px; }
.shared-note-card.confirmed { border-color: var(--accent-glow); background: rgba(200,255,87,0.04); }
.shared-note-card.rejected { opacity: 0.45; }
.note-disclaimer { font-size: 11px; color: var(--text3); line-height: 1.6; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border2); font-weight: 300; }
.note-pending-badge { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); margin-left: 5px; vertical-align: middle; position: relative; top: -1px; }

/* MOBILE */
@media (max-width: 768px) {
  nav { padding: 0 16px; }
  .nav-center { display: none; }
  .hero { padding: 50px 20px 40px; }
  .hero h1 { font-size: 38px; }
  .stats-bar { flex-wrap: wrap; }
  .main { grid-template-columns: 1fr; padding: 24px 16px 60px; }
  /* FASE 7: Sidebar mobile 🟡 (reso visibile su mobile) */
  .sidebar { display: flex; order: -1; margin-top: 0; margin-bottom: 24px; flex-direction: row; flex-wrap: wrap; gap: 16px; }
  .sidebar .scard { flex: 1; min-width: 280px; }
  .search-wrap, .cats-wrap { padding-left: 16px; padding-right: 16px; }
  .profile-content { grid-template-columns: 1fr; }
  .messages-wrap { grid-template-columns: 1fr; }
  .msg-list { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 20px; }
  .chat-area { padding: 0; }
  .dash-kpis { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .profile-inner { flex-direction: column; align-items: flex-start; }
}

/* MOBILE MENU — hamburger + drawer */

/* Hamburger: nascosto su desktop */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 16px; height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: background .2s;
}
.menu-toggle:hover span { background: var(--text); }

/* Drawer: nascosto di default */
.mobile-nav-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10,10,15,0.96);
  backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity .25s ease;
}
.mobile-nav-wrapper.active {
  opacity: 1;
}

/* Contenuto interno del drawer */
.mobile-nav-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  padding: 24px;
}

/* Pulsante chiusura × */
.mobile-nav-close {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 22px;
  width: 40px; height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s;
  line-height: 1;
}
.mobile-nav-close:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }

/* Link del drawer */
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.mobile-nav-links .nav-link {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text2);
  padding: 12px 24px;
  border-radius: 12px;
  width: 100%;
  text-align: center;
  transition: color .2s, background .2s;
}
.mobile-nav-links .nav-link:hover,
.mobile-nav-links .nav-link.active {
  color: var(--text);
  background: var(--surface2);
}

#navAvatarMobile { display: none; }

/* Mostra hamburger e nascondi nav-right su mobile */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .nav-right { display: none; }
  .mobile-nav-wrapper { display: block; pointer-events: none; }
  .mobile-nav-wrapper.active { pointer-events: all; }
  #navAvatarMobile:not(:empty) { display: flex; align-items: center; }
}
