/* DASHBOARD — v3 Stripe DNA */
.dash-body {
  background: var(--bg-soft);
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.dash-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  background: white;
  border: 1px solid var(--green);
  border-radius: var(--r-3);
  color: var(--ink);
  font-size: 14px;
  max-width: 480px;
  z-index: 200;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}
.dash-toast.show { transform: translateX(0); }
.dash-toast svg { color: var(--green); flex-shrink: 0; }
.dash-toast > div { display: flex; flex-direction: column; gap: 2px; }
.dash-toast strong { color: var(--ink); }
.dash-toast span { color: var(--ink-muted); font-size: 13px; }
.dash-toast-close {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dash-sidebar {
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.dash-sidebar .logo { margin-bottom: 2rem; padding: 0 0.5rem; }

.dash-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--r-2);
  transition: all 0.15s ease;
  font-weight: 500;
}
.dash-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.dash-nav a.active { background: var(--purple-soft); color: var(--purple); }
.dash-nav svg { flex-shrink: 0; }

.dash-account {
  padding: 0.75rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}
.dash-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.dash-account-info { display: flex; flex-direction: column; min-width: 0; }
.dash-account-info strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-account-info span {
  color: var(--ink-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-main { padding: 2.5rem 3rem; overflow-x: hidden; }

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.dash-title {
  font-size: 2.25rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.dash-meta { color: var(--ink-soft); margin: 0; font-size: 14.5px; }

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.dash-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-xs);
}
.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--tpl-accent, var(--purple));
}

.dash-card-thumb {
  position: relative;
  aspect-ratio: 612/792;
  background: #fafaf9;
  overflow: hidden;
}
.dash-card-svg { width: 100%; height: 100%; }
.dash-card-svg svg { width: 100%; height: 100%; }

.dash-card-mini-wm {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  transform: rotate(-25deg) scale(1.5);
  transform-origin: center;
  z-index: 2;
}
.dash-card-mini-wm span {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(99, 91, 255, 0.06);
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.dash-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(10, 37, 64, 0.85) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}
.dash-card:hover .dash-card-overlay { opacity: 1; }
.dash-card-overlay .btn { width: 100%; }

.dash-card-meta {
  padding: 1rem 1.125rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.dash-card-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--tpl-accent, var(--purple));
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  font-weight: 600;
}
.dash-card-title {
  font-size: 14.5px;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.dash-card-foot {
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  gap: 0.4rem;
}
.dash-match { color: var(--green); font-weight: 600; }
.dash-card-status {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.dash-card-status.locked {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
}
.dash-card-status.unlocked {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #a7f3d0;
}

.dash-upgrade {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border: 1px solid rgba(99, 91, 255, 0.2);
  border-radius: var(--r-5);
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}
.dash-upgrade::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99,91,255,0.15), transparent 60%);
  pointer-events: none;
}
.dash-up-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--purple);
  color: white;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.dash-up-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 300;
  color: var(--ink);
  margin: 0 0 1rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.dash-up-sub { color: var(--ink-soft); line-height: 1.6; margin: 0 0 1.5rem; max-width: 52ch; }
.dash-up-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 14px;
  color: var(--ink-soft);
}
.dash-up-features li { display: flex; align-items: center; gap: 0.5rem; }
.dash-up-features li::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%23009f6b' d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm5.3 7.7-6 6a1 1 0 0 1-1.4 0l-3-3a1 1 0 1 1 1.4-1.4L9 11.6l5.3-5.3a1 1 0 1 1 1.4 1.4z'/></svg>");
  background-repeat: no-repeat;
}

.dash-up-visual { position: relative; height: 260px; display: flex; align-items: center; justify-content: center; }
.dash-up-thumb {
  position: absolute;
  width: 130px;
  aspect-ratio: 612/792;
  background: #fafaf9;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: rotate(calc((var(--i) - 2.5) * 6deg)) translateY(calc((var(--i) - 2.5) * 4px));
  transition: transform 0.3s ease;
}
.dash-up-thumb svg { width: 100%; height: 100%; }
.dash-up-thumb:nth-child(1) { z-index: 1; left: 0; }
.dash-up-thumb:nth-child(2) { z-index: 2; left: 14%; }
.dash-up-thumb:nth-child(3) { z-index: 3; left: 28%; }
.dash-up-thumb:nth-child(4) { z-index: 4; left: 42%; }
.dash-up-thumb:nth-child(5) { z-index: 5; left: 56%; }
.dash-up-thumb:nth-child(6) { z-index: 6; left: 70%; }
.dash-upgrade:hover .dash-up-thumb {
  transform: rotate(calc((var(--i) - 2.5) * 8deg)) translateY(calc((var(--i) - 2.5) * 8px));
}

.dash-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.24s ease;
}
.dash-modal.open { opacity: 1; }
.dash-modal-bg { position: absolute; inset: 0; background: rgba(10, 37, 64, 0.6); backdrop-filter: blur(8px); }
.dash-modal-content { position: relative; max-width: 1100px; width: 100%; max-height: 92vh; }
.dash-modal-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: var(--shadow);
}
.dash-modal-close:hover { color: var(--purple); border-color: var(--purple); }
.dash-modal-inner {
  background: white;
  border-radius: var(--r-5);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-height: 92vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.dash-modal-paper {
  position: relative;
  background: #fafaf9;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 612/792;
  max-height: 80vh;
}
.dash-modal-paper > div:first-child { width: 100%; height: 100%; }
.dash-modal-paper svg { width: 100%; height: 100%; }
.dash-modal-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.dash-modal-title {
  font-size: 1.875rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  line-height: 1.1;
}
.dash-score-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--bg-soft);
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  margin: 0.5rem 0 1rem;
}
.dash-pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.dash-price-card {
  padding: 1.25rem;
  border-radius: var(--r-3);
  background: white;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.dash-price-card-best {
  background: linear-gradient(180deg, #f5f3ff, white);
  border: 2px solid var(--purple);
  position: relative;
}
.dash-price-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  background: var(--purple);
  color: white;
  border-radius: 4px;
  align-self: flex-start;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.dash-price-name {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 600;
}
.dash-price-amt {
  font-size: 2.25rem;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.dash-price-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 13.5px;
  color: var(--ink-soft);
}

@media (max-width: 980px) {
  .dash-body { grid-template-columns: 1fr; }
  .dash-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1rem;
    overflow-x: auto;
  }
  .dash-sidebar .logo { margin-bottom: 0; }
  .dash-nav { flex-direction: row; flex: 1; gap: 0; }
  .dash-account { border-top: 0; margin-top: 0; border-left: 1px solid var(--border); padding-left: 1rem; }
  .dash-main { padding: 1.5rem; }
  .dash-upgrade { grid-template-columns: 1fr; padding: 1.5rem; }
  .dash-up-visual { display: none; }
  .dash-modal-inner { grid-template-columns: 1fr; padding: 1rem; overflow-y: auto; }
  .dash-pricing { grid-template-columns: 1fr; }
}
@media (max-width: 600px) { .dash-card-overlay { opacity: 1; } }

/* ============================================================
   DASHBOARD — MOBILE OPTIMIZATION (v7.2)
   ============================================================ */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; gap: 1rem; }
  .dash-stats { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
}
@media (max-width: 640px) {
  .dash-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .dash-stats { grid-template-columns: 1fr; }
  .dash-card { padding: 1.25rem; }
}
