/* ══════════════════════════════════════════════════════════════════════
   projects.css — premium redesign of the /projects dashboard, matching the
   marketing home page (home.css). Loaded AFTER dashboard.css and fully scoped
   under `.dash-pro` (a body class only projects.html sets), so the 7 other
   templates that share dashboard.css are untouched. Self-contained: it carries
   its own tokens + living background + fx helpers so it doesn't depend on
   home.css. Behavior (constellation, spotlight, tilt, magnetic) is reused from
   home.js, which is fully null-guarded on pages that lack the hero markup.
   ══════════════════════════════════════════════════════════════════════ */

.dash-pro {
  --th-ink: #eef4ff;
  --th-line: rgba(147, 197, 253, .10);
  --th-line-2: rgba(147, 197, 253, .18);
  --th-fill: rgba(96, 165, 250, .05);
  --th-fill-2: rgba(96, 165, 250, .09);
  --th-card: rgba(16, 18, 30, .55);
  --th-card-2: rgba(20, 23, 38, .72);
  --th-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --th-shadow-sm: 0 14px 40px -22px rgba(0, 0, 0, .75);
  --th-glow: rgba(96, 165, 250, .35);
  --th-ease: cubic-bezier(.22, 1, .36, 1);
  --th-ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* This page carries its own living background — retire base.html's mesh. */
.dash-pro .mesh-bg { display: none !important; }

/* ─────────────────────────────────────────────
   LIVING BACKGROUND (mirrors home.css .th-bg)
   ───────────────────────────────────────────── */
.dash-pro .th-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 640px at 78% -10%, rgba(59, 130, 246, .12), transparent 60%),
    radial-gradient(820px 560px at 4% 6%, rgba(147, 197, 253, .07), transparent 55%),
    linear-gradient(180deg, #08080e 0%, #070710 45%, #06060c 100%);
}
.dash-pro .th-bg-aurora {
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 82vh;
  background:
    conic-gradient(from 120deg at 50% 40%,
      rgba(96, 165, 250, 0) 0deg, rgba(96, 165, 250, .13) 70deg,
      rgba(59, 130, 246, .05) 150deg, rgba(147, 197, 253, .12) 240deg,
      rgba(96, 165, 250, 0) 360deg);
  filter: blur(72px);
  opacity: .5;
  animation: dpAurora 28s linear infinite;
}
@keyframes dpAurora { from { transform: rotate(0) scale(1.1); } to { transform: rotate(360deg) scale(1.1); } }
.dash-pro .th-bg-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .8; }
.dash-pro .th-bg-orb-1 { width: 500px; height: 500px; top: -12%; left: -8%;  background: rgba(96, 165, 250, .09); animation: dpOrb1 24s ease-in-out infinite; }
.dash-pro .th-bg-orb-2 { width: 440px; height: 440px; top: 30%; right: -12%; background: rgba(59, 130, 246, .07); animation: dpOrb2 30s ease-in-out infinite; }
.dash-pro .th-bg-orb-3 { width: 400px; height: 400px; bottom: -16%; left: 40%; background: rgba(147, 197, 253, .05); animation: dpOrb3 22s ease-in-out infinite; }
@keyframes dpOrb1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(55px,45px)} }
@keyframes dpOrb2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-45px,38px)} }
@keyframes dpOrb3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(38px,-36px)} }
.dash-pro .th-bg-constellation { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.dash-pro .th-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(147, 197, 253, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 197, 253, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 78%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 78%);
  opacity: .5;
}
.dash-pro .th-bg-noise {
  position: absolute; inset: 0; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dash-pro .th-bg-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(130% 100% at 50% 0%, transparent 55%, rgba(4, 4, 9, .5) 100%);
}

/* ─────────────────────────────────────────────
   FX HELPERS (spotlight + tilt) — driven by home.js
   ───────────────────────────────────────────── */
.dash-pro .th-spot { position: relative; }
.dash-pro .th-spot::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), rgba(96, 165, 250, .15), transparent 62%);
  opacity: 0;
  transition: opacity .35s var(--th-ease);
  pointer-events: none;
  z-index: 0;
}
.dash-pro .th-spot:hover::before { opacity: 1; }
.dash-pro .th-spot > * { position: relative; z-index: 1; }
.dash-pro [data-tilt] {
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* Tab entrance: replays whenever a tab becomes .active (no observer needed,
   so it survives switching between the hidden overview/projects tabs). */
.dash-pro .tab-content.active > * { animation: dpRise .55s var(--th-ease) both; }
.dash-pro .tab-content.active .overview-stat,
.dash-pro .tab-content.active .quick-action,
.dash-pro .tab-content.active .project-card {
  animation: dpRise .6s var(--th-ease) both;
}
.dash-pro .tab-content.active .overview-stat:nth-child(2) { animation-delay: .06s; }
.dash-pro .tab-content.active .overview-stat:nth-child(3) { animation-delay: .12s; }
.dash-pro .tab-content.active .quick-action:nth-child(2) { animation-delay: .05s; }
.dash-pro .tab-content.active .quick-action:nth-child(3) { animation-delay: .10s; }
.dash-pro .tab-content.active .quick-action:nth-child(4) { animation-delay: .15s; }
.dash-pro .tab-content.active .project-card:nth-child(2) { animation-delay: .05s; }
.dash-pro .tab-content.active .project-card:nth-child(3) { animation-delay: .10s; }
.dash-pro .tab-content.active .project-card:nth-child(4) { animation-delay: .15s; }
.dash-pro .tab-content.active .project-card:nth-child(5) { animation-delay: .20s; }
.dash-pro .tab-content.active .project-card:nth-child(6) { animation-delay: .25s; }
@keyframes dpRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ─────────────────────────────────────────────
   BUTTONS (premium, matches home .th-btn)
   ───────────────────────────────────────────── */
.dash-pro .th-btn {
  --th-btn-shift: 0px, 0px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 600;
  line-height: 1; letter-spacing: -.01em; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .3s var(--th-ease), box-shadow .3s var(--th-ease), background .25s var(--th-ease), border-color .25s, color .25s, filter .25s;
  transform: translate(var(--th-btn-shift));
}
.dash-pro .th-btn svg { width: 16px; height: 16px; }
.dash-pro .th-btn-sm { padding: 9px 16px; font-size: 13px; }
.dash-pro .th-btn-primary {
  color: #061021;
  background: radial-gradient(120% 160% at 30% 0%, #cfe4ff 0%, #93c5fd 34%, #60a5fa 72%, #3b82f6 100%);
  box-shadow: 0 10px 30px -10px var(--th-glow), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.dash-pro .th-btn-primary:hover { box-shadow: 0 16px 44px -12px var(--th-glow), inset 0 1px 0 rgba(255, 255, 255, .6); filter: saturate(1.05); }
.dash-pro .th-btn-primary svg { stroke: #061021; }
.dash-pro .th-btn-glass {
  color: var(--th-ink); background: var(--th-fill-2); border-color: var(--th-line-2);
  backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.dash-pro .th-btn-glass:hover { background: rgba(96, 165, 250, .14); border-color: rgba(96, 165, 250, .45); color: #fff; }

/* "New Project" CTAs — tighter corners than the shared pill default. */
.dash-pro .welcome-actions .th-btn-primary,
.dash-pro .page-header .th-btn-primary,
.dash-pro .empty-state .th-btn-primary {
  border-radius: var(--radius-lg);
}

/* ─────────────────────────────────────────────
   TOP APP-HEADER (from base.html) — lighten to let the bg breathe
   ───────────────────────────────────────────── */
.dash-pro .app-header {
  background: rgba(8, 9, 16, .55);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--th-line);
}

/* ─────────────────────────────────────────────
   SIDEBAR
   ───────────────────────────────────────────── */
.dash-pro .sidebar {
  background: linear-gradient(180deg, rgba(11, 12, 21, .72), rgba(8, 8, 14, .6));
  backdrop-filter: blur(22px) saturate(1.1);
  border-right: 1px solid var(--th-line);
}
.dash-pro .sidebar-sub {
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); opacity: .9;
}
.dash-pro .sidebar-user {
  background: var(--th-card);
  border: 1px solid var(--th-line-2);
  border-radius: 14px;
  box-shadow: var(--th-shadow-sm);
}
.dash-pro .sidebar-user .su-avatar { background: var(--gradient-1); color: #061021; box-shadow: 0 6px 18px -6px var(--th-glow); }
.dash-pro .sidebar-user .su-name { color: var(--th-ink); font-weight: 700; }
.dash-pro .sidebar-section-label { border-top-color: var(--th-line); }

.dash-pro .nav-list li,
.dash-pro .nav-list li a { color: var(--text-muted); }
.dash-pro .nav-list li {
  border-radius: 11px;
  transition: color .25s var(--th-ease), background .25s var(--th-ease), border-color .25s;
}
.dash-pro .nav-list li::before { background: var(--th-fill); border-radius: 11px; }
.dash-pro .nav-list li:hover { color: var(--th-ink); border-color: var(--th-line-2); }
/* Every nav row is now a link, so hover/active colour has to reach the <a>. */
.dash-pro .nav-list li:hover a,
.dash-pro .nav-list li.active a { color: inherit; }
.dash-pro .nav-list li.active {
  color: var(--accent2);
  border-color: rgba(96, 165, 250, .4);
  background: rgba(96, 165, 250, .06);
}
.dash-pro .nav-list li.active::before { opacity: 0; }
/* Accent bar on the active tab. */
.dash-pro .nav-list li.active::after {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--gradient-1);
  box-shadow: 0 0 12px var(--th-glow);
  z-index: 2;
}
.dash-pro .nav-list li .nav-svg { color: inherit; }
.dash-pro .sidebar-footer { border-top-color: var(--th-line); color: var(--text-muted); opacity: .8; }

/* ─────────────────────────────────────────────
   MAIN + TOPBAR
   ───────────────────────────────────────────── */
.dash-pro .main-inner { padding: 34px 30px 64px; }
.dash-pro .topbar-left h1 {
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 30px;
  background: linear-gradient(180deg, #eef4ff, #a9c8f5);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.dash-pro .topbar-left p { color: var(--text-muted); font-size: 14.5px; }
.dash-pro .topbar-search input {
  border-radius: var(--radius-pill);
  border: 1px solid var(--th-line-2);
  background: var(--th-fill);
  backdrop-filter: blur(10px);
  transition: border-color .25s var(--th-ease), box-shadow .25s var(--th-ease), background .25s;
}
.dash-pro .topbar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(96, 165, 250, .18); background: var(--th-fill-2); }
.dash-pro .topbar-avatar { background: var(--gradient-1); color: #061021; border: 1px solid var(--th-line-2); box-shadow: 0 8px 22px -8px var(--th-glow); }

/* ─────────────────────────────────────────────
   OVERVIEW — welcome hero
   ───────────────────────────────────────────── */
.dash-pro .overview-welcome {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 40px;
  background:
    radial-gradient(110% 130% at 100% -10%, rgba(96, 165, 250, .14), transparent 55%),
    linear-gradient(180deg, var(--th-card-2), var(--th-card));
  border: 1px solid var(--th-line-2);
  box-shadow: var(--th-shadow);
}
.dash-pro .overview-welcome::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.dash-pro .overview-welcome h2 {
  position: relative;
  font-size: 30px; font-weight: 700; letter-spacing: -.03em;
  color: var(--th-ink);
  margin-bottom: 10px;
}
.dash-pro .overview-welcome p { position: relative; font-size: 15px; max-width: 540px; }

/* Stat cards */
.dash-pro .overview-stat {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 22px 24px;
  background: linear-gradient(180deg, var(--th-card), rgba(12, 13, 22, .5));
  border: 1px solid var(--th-line);
  transition: transform .4s var(--th-ease), border-color .4s var(--th-ease), box-shadow .4s var(--th-ease);
}
.dash-pro .overview-stat:hover { transform: translateY(-4px); border-color: var(--th-line-2); box-shadow: var(--th-shadow); background: linear-gradient(180deg, var(--th-card-2), var(--th-card)); }
.dash-pro .overview-stat .os-svg {
  width: 42px; height: 42px; padding: 10px;
  border-radius: 12px;
  background: radial-gradient(120% 120% at 30% 20%, rgba(96, 165, 250, .22), rgba(96, 165, 250, .05));
  border: 1px solid var(--th-line-2);
  color: var(--accent2);
  margin-bottom: 14px;
}
.dash-pro .overview-stat .os-num { font-weight: 700; font-size: 30px; letter-spacing: -.02em; }
.dash-pro .overview-stat .os-label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* Quick actions */
.dash-pro .overview-quick { gap: 14px; }
.dash-pro .quick-action {
  border-radius: 16px;
  padding: 22px 16px;
  background: linear-gradient(180deg, var(--th-card), rgba(12, 13, 22, .5));
  border: 1px solid var(--th-line);
  transition: transform .35s var(--th-ease), border-color .35s var(--th-ease), box-shadow .35s var(--th-ease);
}
.dash-pro .quick-action:hover { transform: translateY(-4px); border-color: var(--th-line-2); box-shadow: var(--th-shadow-sm); background: linear-gradient(180deg, var(--th-card-2), var(--th-card)); }
.dash-pro .quick-action .qa-svg { color: var(--accent2); }
.dash-pro .quick-action .qa-label { color: var(--th-ink); }
.dash-pro .section-heading { color: var(--accent); letter-spacing: .14em; }

/* ─────────────────────────────────────────────
   PROJECTS GRID
   ───────────────────────────────────────────── */
.dash-pro .page-header h2 { font-weight: 700; letter-spacing: -.02em; color: var(--th-ink); }
.dash-pro .project-card {
  border-radius: 20px;
  padding: 24px;
  background: linear-gradient(180deg, var(--th-card), rgba(12, 13, 22, .5));
  border: 1px solid var(--th-line);
  transition: border-color .4s var(--th-ease), box-shadow .4s var(--th-ease), background .4s var(--th-ease);
}
.dash-pro .project-card:hover { border-color: var(--th-line-2); box-shadow: var(--th-shadow); background: linear-gradient(180deg, var(--th-card-2), var(--th-card)); transform: none; }
.dash-pro .project-card .pc-accent { position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 20px 20px 0 0; }
.dash-pro .project-card .pc-name { color: var(--th-ink); font-weight: 700; }
.dash-pro .project-card .pc-action {
  border-radius: 9px;
  border: 1px solid var(--th-line-2);
  background: var(--th-fill);
  color: var(--text-muted);
}
.dash-pro .project-card .pc-action:hover { background: var(--th-fill-2); border-color: rgba(96, 165, 250, .45); color: var(--accent2); }
.dash-pro .project-card .pc-stats { border-top-color: var(--th-line); }
.dash-pro .project-card .pc-stat .stat-value { color: var(--th-ink); }

/* Empty state */
.dash-pro .empty-state {
  border-radius: 24px;
  padding: 84px 24px;
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(96, 165, 250, .10), transparent 60%),
    linear-gradient(180deg, var(--th-card), rgba(12, 13, 22, .4));
  border: 1px dashed var(--th-line-2);
  transition: border-color .35s var(--th-ease), box-shadow .35s var(--th-ease);
}
.dash-pro .empty-state:hover { border-color: rgba(96, 165, 250, .45); box-shadow: var(--th-shadow); background: linear-gradient(180deg, var(--th-card-2), var(--th-card)); }
.dash-pro .empty-state .empty-svg {
  width: 58px; height: 58px; padding: 14px;
  border-radius: 16px;
  background: radial-gradient(120% 120% at 30% 20%, rgba(96, 165, 250, .18), rgba(96, 165, 250, .04));
  border: 1px solid var(--th-line-2);
  color: var(--accent2);
  opacity: 1;
}
.dash-pro .empty-state h3 { color: var(--th-ink); font-weight: 700; letter-spacing: -.02em; }

/* ─────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .dash-pro .th-bg-aurora, .dash-pro .th-bg-orb { animation: none !important; }
  .dash-pro .tab-content.active > *,
  .dash-pro .tab-content.active .overview-stat,
  .dash-pro .tab-content.active .quick-action,
  .dash-pro .tab-content.active .project-card { animation: none !important; }
  .dash-pro .overview-stat, .dash-pro .quick-action, .dash-pro .project-card, .dash-pro .th-btn { transition: none !important; }
}
