:root {
  --bg: #0b0d14;
  --bg-2: #11131c;
  --surface: #181b27;
  --surface2: #21253a;
  --border: #2e3248;
  --border-soft: rgba(108,99,255,0.16);
  --accent: #7c6cff;
  --accent-2: #ff6ea0;
  --accent-3: #43e97b;
  --accent-4: #00d4ff;
  --text: #eef0ff;
  --muted: #8089b3;
  --ig: #e1306c;
  --fb: #1877f2;
  --tt: #ff0050;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 10px 40px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 32px rgba(124, 108, 255, 0.18);
  --grad-1: linear-gradient(135deg, #7c6cff 0%, #ff6ea0 100%);
  --grad-2: linear-gradient(135deg, #00d4ff 0%, #7c6cff 100%);
  --grad-3: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --grad-bg: radial-gradient(1200px 600px at 80% -10%, rgba(124,108,255,0.18), transparent 60%),
             radial-gradient(900px 500px at -10% 100%, rgba(255,110,160,0.10), transparent 60%);
  --ease: cubic-bezier(.22,1,.36,1);
  /* legacy aliases used in earlier CSS blocks */
  --accent2: var(--accent-2);
  --accent3: var(--accent-3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  background: var(--bg);
  background-image: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Aurora background blobs */
body::before, body::after {
  content: '';
  position: fixed;
  inset: auto;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
  animation: aurora 22s ease-in-out infinite;
}
body::before { background: #7c6cff; top: -200px; right: -150px; }
body::after { background: #ff6ea0; bottom: -200px; left: -150px; animation-delay: -11s; }
.app, .login-wrap, .splash { position: relative; z-index: 1; }

@keyframes aurora {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.15); }
}

/* Entrance animations applied selectively */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,108,255,.5); }
  50%      { box-shadow: 0 0 0 14px rgba(124,108,255,0); }
}

/* ── SPLASH / LOADING ── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(ellipse at 50% 38%, #1e1b4b 0%, var(--bg) 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  transition: opacity .6s ease, visibility .6s ease;
}
.splash.hide { opacity: 0; visibility: hidden; }

.splash-logo img {
  width: 170px;
  height: 170px;
  animation: splashPulse 2s ease-in-out infinite;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.splash-text {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 500;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: .8; }
}

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 60% 30%, #1e1b4b 0%, var(--bg) 70%);
}

.login-card {
  position: relative;
  background: linear-gradient(180deg, rgba(33,37,58,.7), rgba(24,27,39,.85));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow), var(--shadow-glow);
  animation: scaleIn .6s var(--ease);
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(124,108,255,.5), transparent 40%, rgba(255,110,160,.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo .mark {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.login-logo h1 { font-size: 1.3rem; font-weight: 700; }
.login-logo span { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 400; }

.login-card h2 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card p { color: var(--muted); font-size: 0.88rem; margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }

.field input, .field select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color .2s;
}

.field input:focus, .field select:focus { border-color: var(--accent); }

.btn-primary {
  position: relative;
  width: 100%;
  background: var(--grad-1);
  background-size: 200% 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(124,108,255,.35);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background-position .6s ease;
}
.btn-primary:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 14px 30px rgba(124,108,255,.45); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s var(--ease);
}
.btn-primary:hover::after { transform: translateX(100%); }

.login-hint { text-align: center; margin-top: 20px; font-size: 0.8rem; color: var(--muted); }

/* ── LAYOUT ── */
.app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, rgba(24,27,39,.92), rgba(17,19,28,.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255,255,255,.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .35s var(--ease);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.sidebar-logo h2 { font-size: 1rem; font-weight: 700; }
.sidebar-logo small { display: block; font-size: 0.68rem; color: var(--muted); }

.sidebar-client {
  margin: 16px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.client-avatar {
  width: 36px; height: 36px;
  background: var(--grad-1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(124,108,255,.30);
  transition: transform .25s var(--ease);
}
.sidebar-client:hover .client-avatar { transform: rotate(-6deg) scale(1.08); }
.client-name { font-size: 0.83rem; font-weight: 600; }
.client-plan { font-size: 0.7rem; color: var(--muted); }

nav { flex: 1; padding: 8px 12px; }

nav a {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
  margin-bottom: 2px;
}
nav a::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 22px; border-radius: 2px;
  background: var(--grad-1);
  transition: transform .25s var(--ease);
}
nav a:hover { background: rgba(124,108,255,.08); color: var(--text); transform: translateX(2px); }
nav a.active { background: linear-gradient(90deg, rgba(124,108,255,.18), transparent); color: var(--text); }
nav a.active::before { transform: translateY(-50%) scaleY(1); }
nav a .icon { font-size: 1rem; width: 20px; text-align: center; transition: transform .2s var(--ease); }
nav a:hover .icon { transform: scale(1.15) rotate(-3deg); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.logout-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px;
  color: var(--muted);
  font-size: 0.83rem;
  cursor: pointer;
  transition: all .2s;
}
.logout-btn:hover { border-color: var(--accent2); color: var(--accent2); }

/* ── MAIN ── */
.main { margin-left: 240px; flex: 1; padding: 32px; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.topbar h1 { font-size: 1.5rem; font-weight: 700; }
.topbar p { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }

.date-range {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.83rem;
  cursor: pointer;
  outline: none;
}

/* ── SECTIONS (tabs) ── */
.section { display: none; }
.section.active { display: block; animation: fadeIn .35s var(--ease); }
.topbar { animation: fadeUp .5s var(--ease) both; }
.topbar h1 {
  background: linear-gradient(135deg, #fff 0%, #c0c5e8 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  letter-spacing: -.02em;
}

/* ── KPI GRID ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .25s var(--ease);
  animation: fadeUp .55s var(--ease) both;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(124,108,255,.35); }
.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(180px 100px at var(--mx,50%) var(--my,0%), rgba(124,108,255,.18), transparent 70%);
  opacity: 0; transition: opacity .25s var(--ease);
  pointer-events: none;
}
.kpi-card:hover::after { opacity: 1; }
.kpi-grid > *:nth-child(1) { animation-delay: .05s; }
.kpi-grid > *:nth-child(2) { animation-delay: .10s; }
.kpi-grid > *:nth-child(3) { animation-delay: .15s; }
.kpi-grid > *:nth-child(4) { animation-delay: .20s; }
.kpi-grid > *:nth-child(5) { animation-delay: .25s; }
.kpi-grid > *:nth-child(6) { animation-delay: .30s; }
.kpi-grid > *:nth-child(7) { animation-delay: .35s; }
.kpi-grid > *:nth-child(8) { animation-delay: .40s; }

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-card.ig::before { background: var(--ig); }
.kpi-card.fb::before { background: var(--fb); }
.kpi-card.tt::before { background: var(--tt); }
.kpi-card.total::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }

.kpi-platform {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.kpi-platform.ig { color: var(--ig); }
.kpi-platform.fb { color: var(--fb); }
.kpi-platform.tt { color: var(--tt); }
.kpi-platform.total { color: var(--accent); }

.kpi-value {
  font-size: 2rem; font-weight: 800; letter-spacing: -.025em;
  background: var(--grad-1);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.kpi-card.fb .kpi-value { background: linear-gradient(135deg, #1877f2, #00d4ff); -webkit-background-clip: text; background-clip: text; }
.kpi-card.ig .kpi-value { background: linear-gradient(135deg, #ff6ea0, #ffa500); -webkit-background-clip: text; background-clip: text; }
.kpi-card.tt .kpi-value { background: linear-gradient(135deg, #ff0050, #7c6cff); -webkit-background-clip: text; background-clip: text; }
.kpi-card.total .kpi-value { background: var(--grad-1); -webkit-background-clip: text; background-clip: text; }
.kpi-label { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.kpi-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 20px;
}
.kpi-delta.up { background: rgba(67,233,123,.12); color: var(--accent3); }
.kpi-delta.down { background: rgba(255,101,132,.12); color: var(--accent2); }

/* ── CHARTS ── */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.chart-card h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.chart-card p {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ── PLATFORM TABS ── */
.platform-tabs {
  display: flex; gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ptab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.ptab.active.ig { background: rgba(225,48,108,.15); border-color: var(--ig); color: var(--ig); }
.ptab.active.fb { background: rgba(24,119,242,.15); border-color: var(--fb); color: var(--fb); }
.ptab.active.tt { background: rgba(255,0,80,.15); border-color: var(--tt); color: var(--tt); }

/* ── PROJECTS ── */
.projects-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.projects-header h3 { font-size: 1rem; font-weight: 700; }

.project-list { display: flex; flex-direction: column; gap: 12px; }

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: transform .15s;
}
.project-card:hover { transform: translateX(3px); }

.project-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.project-name { font-weight: 600; font-size: 0.95rem; }
.project-client { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge.done { background: rgba(67,233,123,.15); color: var(--accent3); }
.badge.progress { background: rgba(108,99,255,.15); color: var(--accent); }
.badge.review { background: rgba(255,165,0,.15); color: #ffa500; }
.badge.todo { background: rgba(123,130,168,.15); color: var(--muted); }

.progress-bar-wrap { margin-bottom: 8px; }
.progress-bar-bg {
  background: var(--surface2);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  position: relative;
  height: 100%;
  border-radius: 10px;
  background: var(--grad-1);
  transition: width .8s var(--ease);
  overflow: hidden;
}
.progress-bar-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
}

.project-meta {
  display: flex; gap: 16px;
  font-size: 0.75rem;
  color: var(--muted);
}
.project-meta span { display: flex; align-items: center; gap: 4px; }

/* ── CALENDAR ── */
.calendar-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.calendar-header h3 { font-size: 1rem; font-weight: 700; flex: 1; }
.cal-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  transition: background .15s;
}
.cal-nav:hover { background: var(--surface2); }

.calendar-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.cal-day-name {
  padding: 10px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}
.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-cell {
  min-height: 90px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  position: relative;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other-month .cal-date { color: var(--muted); opacity: .4; }
.cal-cell.today { background: rgba(108,99,255,.07); }
.cal-date {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.cal-event {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  display: flex; align-items: center; gap: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.ig { background: rgba(225,48,108,.2); color: #f06292; }
.cal-event.fb { background: rgba(24,119,242,.2); color: #64b5f6; }
.cal-event.tt { background: rgba(255,0,80,.2); color: #ff6090; }

/* ── ADMIN ── */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.form-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 18px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 70px; }

.btn-sm {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  color: #fff;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-sm:hover { opacity: .88; }

.btn-danger {
  background: rgba(255,101,132,.15);
  border: 1px solid rgba(255,101,132,.3);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--accent2);
  font-size: 0.75rem;
  cursor: pointer;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: linear-gradient(180deg, rgba(33,37,58,.95), rgba(24,27,39,.98));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0,0,0,.4), 0 0 24px rgba(124,108,255,.25);
  z-index: 9999;
  transform: translateY(100px) scale(.9);
  opacity: 0;
  transition: all .4s var(--ease);
}
.toast.show { transform: translateY(0) scale(1); opacity: 1; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
th { text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── MOBILE ── */
.hamburger {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 20px 16px; padding-top: 60px; }
  .hamburger { display: flex; }
  .overlay.open { display: block; }
  .charts-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   CLIENT PLATFORM — Dashboard · Pagamenti · Assistenza · Guide · Profilo · Notifiche
   ═══════════════════════════════════════════════════════════════════════════ */

/* Nav group labels */
.nav-group {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  padding: 14px 12px 6px;
  opacity: .7;
}

/* Notification bell */
.bell {
  position: fixed;
  top: 22px; right: 28px;
  z-index: 90;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(33,37,58,.85), rgba(24,27,39,.95));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s var(--ease);
}
.bell:hover { transform: scale(1.1) rotate(8deg); border-color: var(--accent); box-shadow: 0 8px 28px rgba(124,108,255,.35); }
.bell:active { transform: scale(.95); }
.bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--accent2);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* Stat tiles */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-tile {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  transition: transform .3s var(--ease), border-color .3s var(--ease);
  animation: fadeUp .55s var(--ease) both;
}
.stat-tile:hover { transform: translateY(-3px); border-color: rgba(124,108,255,.3); }
.dash-grid > *:nth-child(1) { animation-delay: .05s; }
.dash-grid > *:nth-child(2) { animation-delay: .10s; }
.dash-grid > *:nth-child(3) { animation-delay: .15s; }
.dash-grid > *:nth-child(4) { animation-delay: .20s; }
.stat-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: transform .35s var(--ease);
}
.stat-tile:hover .stat-ico { transform: scale(1.12) rotate(-6deg); }
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.025em; }
.stat-label { font-size: 0.78rem; color: var(--muted); }

/* Hero card (client welcome) */
.hero-card {
  position: relative;
  background: linear-gradient(120deg, rgba(124,108,255,.18), rgba(255,110,160,.10));
  border: 1px solid rgba(124,108,255,.22);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 22px;
  overflow: hidden;
  animation: fadeUp .55s var(--ease) both;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(124,108,255,.35), transparent 60%);
  filter: blur(50px);
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}
.hero-card > * { position: relative; z-index: 1; }
.hero-status {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(67,233,123,.2);
  display: inline-block;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(67,233,123,.2); }
  50% { box-shadow: 0 0 0 7px rgba(67,233,123,0); }
}
.hero-services { display: flex; gap: 8px; flex-wrap: wrap; }
.service-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 0.76rem;
  font-weight: 500;
}

/* Two-column panels */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .25s var(--ease);
  animation: fadeUp .6s var(--ease) both;
}
.panel:hover { border-color: rgba(124,108,255,.2); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-h { font-size: 0.92rem; font-weight: 700; }
.link-btn {
  background: none; border: none; color: var(--accent);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.mini-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.mini-row:last-child { border-bottom: none; }
.mini-title { font-size: 0.85rem; font-weight: 600; flex: 1; }
.mini-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.mini-meta { font-size: 0.82rem; font-weight: 700; color: var(--accent); }
.empty-state { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 0.85rem; }

/* Payments */
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.pay-sum-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-align: center;
}
.pay-sum-val { font-size: 1.5rem; font-weight: 800; }
.pay-sum-lbl { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }

.pay-list { display: flex; flex-direction: column; gap: 12px; }
.pay-card {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius); padding: 18px 22px;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  animation: slideRight .5s var(--ease) both;
}
.pay-card:hover { transform: translateX(4px); border-color: rgba(124,108,255,.28); box-shadow: var(--shadow); }
.pay-list > *:nth-child(1) { animation-delay: .05s; }
.pay-list > *:nth-child(2) { animation-delay: .10s; }
.pay-list > *:nth-child(3) { animation-delay: .15s; }
.pay-list > *:nth-child(4) { animation-delay: .20s; }
.pay-list > *:nth-child(5) { animation-delay: .25s; }
.pay-list > *:nth-child(6) { animation-delay: .30s; }
.pay-card-main { flex: 1; min-width: 0; }
.pay-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.pay-desc { font-weight: 600; font-size: 0.92rem; }
.pay-badge { font-size: 0.7rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.pay-paid { background: rgba(67,233,123,.15); color: var(--accent3); }
.pay-pending { background: rgba(123,130,168,.18); color: var(--muted); }
.pay-due { background: rgba(255,165,0,.15); color: #ffa500; }
.pay-overdue { background: rgba(255,101,132,.15); color: var(--accent2); }
.pay-card-meta { display: flex; gap: 16px; font-size: 0.74rem; color: var(--muted); flex-wrap: wrap; }
.pay-card-side { text-align: right; flex-shrink: 0; }
.pay-amount { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.btn-pay {
  position: relative;
  background: var(--grad-3);
  border: none; border-radius: 10px; padding: 10px 18px;
  color: #06281a; font-size: 0.84rem; font-weight: 800; cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(67,233,123,.30);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
  animation: pulseGlow 2.4s ease-in-out infinite;
}
.btn-pay:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(67,233,123,.45); }
.btn-pay:active { transform: translateY(0) scale(.97); }
.pay-done-tag { font-size: 0.78rem; color: var(--accent3); font-weight: 600; }

/* Inline admin panels */
.inline-panel {
  background: rgba(108,99,255,.06);
  border: 1px solid rgba(108,99,255,.22);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.ip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ip-head h3 { font-size: 0.9rem; font-weight: 700; }
.ip-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ip-form input, .ip-form select, .ip-form textarea {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; color: var(--text);
  font-size: 0.85rem; outline: none; flex: 1; min-width: 120px;
}
.ip-form textarea, .inline-panel > textarea {
  width: 100%; min-height: 70px; resize: vertical;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; color: var(--text); font-size: 0.85rem; outline: none;
}
.sumup-row { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.sumup-row input { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--text); font-size: 0.83rem; outline: none; }

/* Tickets */
.ticket-list { display: flex; flex-direction: column; gap: 12px; }
.ticket-card {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  animation: slideRight .5s var(--ease) both;
}
.ticket-card:hover { transform: translateX(4px); border-color: rgba(124,108,255,.4); box-shadow: var(--shadow); }
.ticket-list > *:nth-child(1) { animation-delay: .05s; }
.ticket-list > *:nth-child(2) { animation-delay: .10s; }
.ticket-list > *:nth-child(3) { animation-delay: .15s; }
.ticket-list > *:nth-child(4) { animation-delay: .20s; }
.ticket-cat-ico {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.ticket-body { flex: 1; min-width: 0; }
.ticket-title { font-weight: 600; font-size: 0.92rem; }
.ticket-sub { font-size: 0.73rem; color: var(--muted); margin: 2px 0 4px; }
.ticket-preview { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-badge { font-size: 0.7rem; font-weight: 700; padding: 4px 11px; border-radius: 20px; white-space: nowrap; }
.tk-open { background: rgba(255,165,0,.15); color: #ffa500; }
.tk-work { background: rgba(108,99,255,.15); color: var(--accent); }
.tk-done { background: rgba(67,233,123,.15); color: var(--accent3); }

/* Ticket admin status bar */
.tk-admin-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 14px;
  font-size: 0.82rem; color: var(--muted);
}
.tk-status-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 14px; color: var(--muted);
  font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all .2s;
}
.tk-status-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Chat */
.chat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 52vh; overflow-y: auto; margin-bottom: 12px;
}
.chat-bubble {
  max-width: 78%; padding: 11px 15px;
  border-radius: 16px; position: relative;
  animation: scaleIn .3s var(--ease) both;
}
.chat-bubble.them { align-self: flex-start; background: var(--surface2); border-bottom-left-radius: 4px; }
.chat-bubble.me { align-self: flex-end; background: var(--grad-1); border-bottom-right-radius: 4px; box-shadow: 0 4px 16px rgba(124,108,255,.30); }
.chat-who { font-size: 0.66rem; font-weight: 700; opacity: .7; margin-bottom: 3px; }
.chat-text { font-size: 0.88rem; line-height: 1.45; }
.chat-attach { margin-top: 6px; font-size: 0.76rem; background: rgba(0,0,0,.2); border-radius: 6px; padding: 4px 8px; display: inline-block; }
.chat-time { font-size: 0.64rem; opacity: .6; margin-top: 4px; text-align: right; }
.chat-input { display: flex; gap: 10px; }
.chat-input input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 12px 18px; color: var(--text); font-size: 0.9rem; outline: none;
}
.chat-input input:focus { border-color: var(--accent); }
.chat-send {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none; color: #fff; font-size: 1.1rem; cursor: pointer; flex-shrink: 0;
  transition: transform .1s;
}
.chat-send:active { transform: scale(.92); }

/* Guides */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guide-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.guide-cat {
  display: inline-block; font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent);
  background: rgba(108,99,255,.12); padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
.guide-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.guide-content { font-size: 0.84rem; color: var(--muted); line-height: 1.7; }
.guide-video {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  color: var(--accent2); font-size: 0.82rem; font-weight: 600; text-decoration: none;
}
.guide-video:hover { text-decoration: underline; }

/* Profile */
.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.profile-card:first-child { text-align: center; }
.profile-avatar {
  width: 88px; height: 88px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--grad-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800;
  box-shadow: 0 10px 30px rgba(124,108,255,.35);
  animation: float 6s ease-in-out infinite;
}
.profile-name { font-size: 1.2rem; font-weight: 800; }
.profile-plan { font-size: 0.8rem; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.profile-services { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.profile-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Notifications */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 14px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  transition: border-color .25s var(--ease), transform .2s var(--ease);
  animation: slideRight .45s var(--ease) both;
}
.notif-item:hover { border-color: var(--accent); transform: translateX(3px); }
.notif-item.unread { background: linear-gradient(180deg, rgba(124,108,255,.12), rgba(124,108,255,.04)); border-color: rgba(124,108,255,.3); }
.notif-list > *:nth-child(1) { animation-delay: .05s; }
.notif-list > *:nth-child(2) { animation-delay: .10s; }
.notif-list > *:nth-child(3) { animation-delay: .15s; }
.notif-list > *:nth-child(4) { animation-delay: .20s; }
.notif-list > *:nth-child(5) { animation-delay: .25s; }
.notif-ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  background: var(--surface2);
}
.notif-ico.pagamento { background: rgba(255,165,0,.14); }
.notif-ico.ticket { background: rgba(108,99,255,.14); }
.notif-ico.info { background: rgba(67,233,123,.14); }
.notif-body { flex: 1; }
.notif-text { font-size: 0.86rem; font-weight: 500; }
.notif-meta { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent2); flex-shrink: 0; }

/* Responsive */
@media (max-width: 900px) {
  .dash-cols { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .pay-summary { grid-template-columns: 1fr; }
  .pay-card { flex-direction: column; align-items: stretch; }
  .pay-card-side { text-align: left; display: flex; align-items: center; justify-content: space-between; }
  .pay-amount { margin-bottom: 0; }
  .profile-form .form-row { grid-template-columns: 1fr; }
  .bell { top: 16px; right: 16px; }
  .ip-form { flex-direction: column; align-items: stretch; }
  .ip-form input, .ip-form select { width: 100%; }
}

/* ═══════════════ CRM COMMERCIALI — Contatti · Chiamate ═══════════════ */

/* Pipeline */
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.pipe-col {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 14px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .25s var(--ease), transform .2s var(--ease), background .25s var(--ease);
  animation: fadeUp .5s var(--ease) both;
}
.pipeline > *:nth-child(1) { animation-delay: .05s; }
.pipeline > *:nth-child(2) { animation-delay: .10s; }
.pipeline > *:nth-child(3) { animation-delay: .15s; }
.pipeline > *:nth-child(4) { animation-delay: .20s; }
.pipeline > *:nth-child(5) { animation-delay: .25s; }
.pipe-col:hover { transform: translateY(-4px); border-color: rgba(124,108,255,.3); }
.pipe-col.on { border-color: var(--accent); background: rgba(124,108,255,.12); box-shadow: 0 0 24px rgba(124,108,255,.20); }
.pipe-count { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.pipe-label { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

.crm-toolbar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.chip-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 16px; color: var(--muted);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all .2s;
}
.chip-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Contact cards */
.contact-list { display: flex; flex-direction: column; gap: 12px; }
.contact-card {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; gap: 14px;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  animation: fadeUp .55s var(--ease) both;
}
.contact-card:hover { transform: translateY(-3px); border-color: rgba(124,108,255,.28); box-shadow: var(--shadow); }
.contact-list > *:nth-child(1) { animation-delay: .05s; }
.contact-list > *:nth-child(2) { animation-delay: .10s; }
.contact-list > *:nth-child(3) { animation-delay: .15s; }
.contact-list > *:nth-child(4) { animation-delay: .20s; }
.contact-list > *:nth-child(5) { animation-delay: .25s; }
.contact-list > *:nth-child(6) { animation-delay: .30s; }
.contact-avatar {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; text-transform: uppercase;
}
.contact-main { flex: 1; min-width: 0; }
.contact-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.contact-name { font-weight: 700; font-size: 0.95rem; }
.contact-azienda { font-size: 0.78rem; color: var(--muted); }
.ct-badge { font-size: 0.68rem; font-weight: 700; padding: 4px 11px; border-radius: 20px; white-space: nowrap; }
.ct-nuovo { background: rgba(123,130,168,.18); color: var(--muted); }
.ct-contattato { background: rgba(108,99,255,.16); color: var(--accent); }
.ct-trattativa { background: rgba(255,165,0,.16); color: #ffa500; }
.ct-cliente { background: rgba(67,233,123,.16); color: var(--accent3); }
.ct-perso { background: rgba(255,101,132,.16); color: var(--accent2); }
.contact-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.76rem; color: var(--muted); margin-bottom: 8px; }
.contact-link { color: var(--muted); text-decoration: none; }
.contact-link:hover { color: var(--accent); }
.contact-note { font-size: 0.8rem; color: var(--text); background: var(--surface2); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mini-btn {
  border: 1px solid var(--border); background: var(--surface2);
  border-radius: 8px; padding: 7px 13px; color: var(--text);
  font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.mini-btn.primary { background: linear-gradient(135deg, var(--accent), #8b5cf6); border: none; color: #fff; }
.mini-btn.danger:hover { border-color: var(--accent2); color: var(--accent2); }
.mini-select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; color: var(--text); font-size: 0.78rem; outline: none; cursor: pointer;
}

/* Call log */
.call-list { display: flex; flex-direction: column; gap: 10px; }
.call-row {
  background: linear-gradient(180deg, rgba(33,37,58,.5), rgba(24,27,39,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; gap: 16px;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
  animation: slideRight .5s var(--ease) both;
}
.call-row:hover { transform: translateX(4px); border-color: rgba(124,108,255,.28); }
.call-list > *:nth-child(1) { animation-delay: .05s; }
.call-list > *:nth-child(2) { animation-delay: .10s; }
.call-list > *:nth-child(3) { animation-delay: .15s; }
.call-list > *:nth-child(4) { animation-delay: .20s; }
.call-list > *:nth-child(5) { animation-delay: .25s; }
.call-date { text-align: center; flex-shrink: 0; min-width: 70px; padding-right: 14px; border-right: 1px solid var(--border); }
.call-day { font-size: 0.78rem; font-weight: 700; }
.call-time { font-size: 0.72rem; color: var(--muted); }
.call-body { flex: 1; min-width: 0; }
.call-contact { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.call-az { color: var(--muted); font-weight: 400; }
.call-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.76rem; color: var(--muted); align-items: center; }
.es-badge { font-size: 0.68rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.es-good { background: rgba(67,233,123,.16); color: var(--accent3); }
.es-warn { background: rgba(255,165,0,.16); color: #ffa500; }
.es-bad { background: rgba(255,101,132,.16); color: var(--accent2); }
.es-mute { background: rgba(123,130,168,.16); color: var(--muted); }
.call-note { font-size: 0.8rem; color: var(--text); margin-top: 6px; }
.call-next { font-size: 0.76rem; color: var(--accent); margin-top: 4px; font-weight: 600; }

@media (max-width: 900px) {
  .pipeline { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════ AUTH — tabs, signup, forgot, password toggle, modal ═══════════════ */

.auth-view { animation: fadeUp .4s var(--ease); }

.role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(15,17,27,.6);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 22px;
}
.role-tab {
  padding: 10px 4px;
  border: none; background: transparent; color: var(--muted);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  border-radius: 10px;
  transition: all .25s var(--ease);
}
.role-tab:hover { color: var(--text); }
.role-tab.on {
  background: var(--grad-1);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124,108,255,.32);
}

/* Password input with toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px !important; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  width: 34px; height: 34px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  transition: background .2s, color .2s;
}
.pw-toggle:hover { background: rgba(124,108,255,.12); color: var(--text); }

/* Strength meter */
.pw-strength {
  height: 4px; background: rgba(255,255,255,.06);
  border-radius: 4px; margin-top: 6px;
  position: relative; overflow: hidden;
}
.pw-strength span {
  display: block; height: 100%; width: 0;
  background: var(--accent); border-radius: 4px;
  transition: width .3s var(--ease), background .3s var(--ease);
}
.pw-strength span::after {
  content: attr(data-label);
  position: absolute; right: 0; top: 8px;
  font-size: 0.7rem; color: var(--muted);
}

/* Auth helper row */
.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 18px; font-size: 0.82rem;
}
.check {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); cursor: pointer; user-select: none;
}
.check input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--border); border-radius: 5px;
  background: var(--surface2); cursor: pointer;
  position: relative;
  transition: all .2s var(--ease);
}
.check input:checked {
  background: var(--grad-1); border-color: transparent;
}
.check input:checked::after {
  content: '✓';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.78rem; font-weight: 800;
}

.auth-link {
  color: var(--accent); font-weight: 600; cursor: pointer;
  text-decoration: none; transition: color .2s, opacity .2s;
}
.auth-link:hover { color: var(--accent-2); }

.login-divider {
  text-align: center; margin: 22px 0 14px;
  position: relative; color: var(--muted); font-size: 0.78rem;
}
.login-divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--border);
}
.login-divider span {
  position: relative; background: var(--surface); padding: 0 12px;
}

.auth-switch { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 10px; }

.auth-note {
  margin-top: 16px; padding: 12px 14px;
  background: rgba(67,233,123,.10);
  border: 1px solid rgba(67,233,123,.3);
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.55;
  animation: fadeUp .3s var(--ease);
}
.auth-note code {
  background: rgba(0,0,0,.3); padding: 2px 8px;
  border-radius: 5px; font-weight: 600;
}

/* User toolbar (bell + profile menu) */
.user-toolbar {
  position: fixed; top: 22px; right: 28px; z-index: 90;
  display: flex; align-items: center; gap: 10px;
}
.user-toolbar .bell { position: static; }

.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(33,37,58,.85), rgba(24,27,39,.95));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  transition: transform .2s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  color: var(--text);
}
.user-trigger:hover {
  border-color: rgba(124,108,255,.4);
  box-shadow: 0 8px 28px rgba(124,108,255,.25);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad-1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 3px 10px rgba(124,108,255,.35);
}
.user-info {
  display: flex; flex-direction: column;
  text-align: left; line-height: 1.2;
}
.user-name { font-size: 0.82rem; font-weight: 700; }
.user-role { font-size: 0.68rem; color: var(--muted); }
.user-caret { color: var(--muted); margin-left: 2px; transition: transform .25s var(--ease); }
.user-menu.open .user-caret { transform: rotate(180deg); }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 220px;
  background: linear-gradient(180deg, rgba(33,37,58,.96), rgba(24,27,39,.98));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-8px) scale(.96);
  pointer-events: none;
  transition: all .25s var(--ease);
  z-index: 200;
}
.user-menu.open .user-dropdown {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.dd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--text); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s;
}
.dd-item span:first-child { font-size: 1rem; width: 22px; text-align: center; }
.dd-item:hover { background: rgba(124,108,255,.10); }
.dd-item.danger { color: var(--accent-2); }
.dd-item.danger:hover { background: rgba(255,110,160,.10); }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* Sidebar logout button now reinforces the action */
.logout-btn {
  width: 100%;
  background: linear-gradient(180deg, rgba(255,110,160,.08), rgba(255,110,160,.04));
  border: 1px solid rgba(255,110,160,.25);
  border-radius: 11px;
  padding: 11px;
  color: var(--accent-2);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.logout-btn:hover {
  background: rgba(255,110,160,.18);
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

/* Logout modal */
.modal {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(8,10,18,.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
}
.modal.show { opacity: 1; pointer-events: auto; }
.modal-card {
  background: linear-gradient(180deg, rgba(33,37,58,.92), rgba(24,27,39,.96));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  width: 100%; max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow);
  transform: scale(.92);
  transition: transform .3s var(--ease);
}
.modal.show .modal-card { transform: scale(1); }
.modal-ico {
  font-size: 3rem;
  margin-bottom: 14px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}
.modal-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.modal-text { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; }
.btn-ghost {
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px;
  color: var(--text);
  font-size: 0.88rem; font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn-danger-solid {
  flex: 1;
  background: linear-gradient(135deg, var(--accent-2), #ff8a78);
  border: none;
  border-radius: 11px;
  padding: 11px;
  color: #fff;
  font-size: 0.88rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255,110,160,.35);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
}
.btn-danger-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,110,160,.5); }

/* Mobile: collapse user info text */
@media (max-width: 900px) {
  .user-toolbar { top: 16px; right: 16px; }
  .user-info { display: none; }
  .user-trigger { padding: 5px; border-radius: 50%; }
  .user-caret { display: none; }
  .user-dropdown { min-width: 240px; }
}

/* ═══════════════ PASSWORD RECOVERY — 3-step wizard ═══════════════ */

.auth-steps {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 28px;
}
.step {
  display: flex; align-items: center; gap: 8px;
  flex: 1;
  font-size: 0.72rem;
  color: var(--muted);
  transition: color .3s var(--ease);
}
.step span {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  flex-shrink: 0;
  transition: all .3s var(--ease);
}
.step b { font-weight: 600; }
.step.on { color: var(--text); }
.step.on span {
  background: var(--grad-1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,108,255,.4);
}
.step-line {
  flex: 0 1 28px; height: 2px;
  background: var(--border);
  border-radius: 2px;
  transition: background .3s var(--ease);
}
.step.on + .step-line { background: var(--accent); }

.forgot-step { animation: fadeUp .35s var(--ease); }

/* Recovery method picker */
.recovery-method {
  margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.recovery-method-label {
  display: block;
  font-size: 0.78rem; font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.recovery-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.recovery-opt:hover { border-color: rgba(124,108,255,.4); }
.recovery-opt.selected {
  background: rgba(124,108,255,.10);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124,108,255,.08);
}
.recovery-opt input[type=radio] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color .2s;
}
.recovery-opt.selected input[type=radio] { border-color: var(--accent); }
.recovery-opt input[type=radio]:checked::after {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.recovery-opt div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.recovery-opt div span { font-size: 0.88rem; font-weight: 600; }
.recovery-opt div small { font-size: 0.74rem; color: var(--muted); }

/* OTP input boxes */
.otp-wrap {
  display: flex; gap: 8px;
  margin-bottom: 18px;
  justify-content: center;
}
.otp-digit {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 1.4rem; font-weight: 700;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  outline: none;
  transition: all .2s var(--ease);
}
.otp-digit:focus {
  border-color: var(--accent);
  background: rgba(124,108,255,.08);
  box-shadow: 0 0 0 4px rgba(124,108,255,.15);
  transform: translateY(-2px);
}
.otp-digit.filled {
  border-color: var(--accent);
  background: rgba(124,108,255,.08);
}
@keyframes otpShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.otp-timer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.otp-timer b { color: var(--text); font-family: 'SF Mono', Menlo, monospace; }

/* Demo hint box (sostituito da invio reale in produzione) */
.demo-otp {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(255,165,0,.08);
  border: 1px dashed rgba(255,165,0,.35);
  border-radius: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.demo-otp code {
  background: rgba(0,0,0,.4);
  color: #ffd700;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 0.88rem;
}

/* Password match indicator */
.pw-match {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--muted);
  min-height: 18px;
  transition: color .2s;
}
.pw-match.ok { color: var(--accent-3); }
.pw-match.err { color: var(--accent-2); }

@media (max-width: 480px) {
  .otp-digit { width: 40px; height: 50px; font-size: 1.2rem; }
  .otp-wrap { gap: 6px; }
  .step b { display: none; }
  .step-line { flex: 1; }
}

/* ═══════════════ GDPR Banner ═══════════════ */
.gdpr-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 9997;
  background: linear-gradient(180deg, rgba(33,37,58,.96), rgba(24,27,39,.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 20px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.gdpr-banner.show { opacity: 1; transform: translateY(0); }
.gdpr-content {
  display: flex; align-items: center; gap: 16px;
  max-width: 1100px; margin: 0 auto;
}
.gdpr-icon {
  font-size: 1.8rem;
  animation: float 4s ease-in-out infinite;
}
.gdpr-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.gdpr-text strong { font-size: 0.88rem; font-weight: 700; }
.gdpr-text span { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.gdpr-text a { color: var(--accent); text-decoration: none; }
.gdpr-text a:hover { text-decoration: underline; }
.gdpr-actions { flex-shrink: 0; }
.gdpr-btn {
  background: var(--grad-1);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  color: #fff;
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(124,108,255,.3);
  transition: transform .2s var(--ease);
}
.gdpr-btn:hover { transform: translateY(-2px); }

@media (max-width: 700px) {
  .gdpr-content { flex-direction: column; align-items: flex-start; text-align: left; }
  .gdpr-actions { width: 100%; }
  .gdpr-btn { width: 100%; }
}

/* ═══════════════ Iframe mode ═══════════════ */
html.in-iframe body {
  background-image: none; /* sfondo neutro, l'aurora pesa nell'iframe */
}
html.in-iframe body::before,
html.in-iframe body::after { display: none; }
html.in-iframe .splash { display: none !important; }

/* Bottone "apri a schermo intero" — solo in iframe */
.fullscreen-btn {
  position: fixed;
  bottom: 16px; left: 16px;
  z-index: 95;
  display: flex; align-items: center; gap: 8px;
  background: var(--grad-1);
  color: #fff;
  padding: 10px 16px;
  border-radius: 24px;
  font-size: 0.78rem; font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(124,108,255,.4);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
}
.fullscreen-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(124,108,255,.5); }
.fullscreen-btn span { display: inline; }
@media (max-width: 600px) {
  .fullscreen-btn span { display: none; }
}
