/* VINAR Dashboard — SaaSable-inspired SaaS admin layout */

.dash-pro {
  --t1: var(--text-1);
  --t2: var(--text-2);
  --t3: var(--text-3);
  --violet: var(--brand-primary);
  --violet-dim: var(--brand-primary-dim);
  padding-bottom: 100px;
}

@media (min-width: 1024px) {
  .dash-pro { padding-bottom: 32px; }
}

/* ── Page header ───────────────────────────────────────────────────── */
.dash-pro-header {
  padding: 20px 0 8px;
}

.dash-pro-header .dash-breadcrumb {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 6px;
}

.dash-pro-header .dash-breadcrumb strong {
  color: var(--text-2);
  font-weight: 600;
}

.dash-pro-header h1 {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.dash-pro-header .dash-sub {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 4px;
}

.dash-pro-header .label-sc {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  opacity: 0.85;
  margin-bottom: 8px;
}

/* ── Alert banner ──────────────────────────────────────────────────── */
.dash-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, #ef4444 8%, var(--s1));
  border: 1px solid color-mix(in srgb, #ef4444 25%, var(--border));
}

.dash-alert[hidden] { display: none !important; }

.dash-alert-text {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.45;
}

.dash-alert-dismiss {
  border: none;
  background: var(--s2);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── KPI stat row (SaaSable pattern) ───────────────────────────────── */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .dash-kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.dash-kpi-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 96px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-md);
}

.dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-kpi-icon svg {
  width: 20px;
  height: 20px;
}

.dash-kpi-icon--score { background: var(--teal-dim); color: var(--teal); }
.dash-kpi-icon--streak { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.dash-kpi-icon--phase { background: var(--brand-primary-dim); color: var(--brand-primary); }
.dash-kpi-icon--hd { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

.dash-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.dash-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.dash-kpi-sub {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Main bento grid ─────────────────────────────────────────────── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 1024px) {
  .dash-main-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
  }
}

.dash-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.dash-score-card {
  padding: 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.dash-score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--teal));
}

.dash-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Score ring */
.dash-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
}

.dash-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dash-score-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -1px;
}

.ring-track { fill: none; stroke: var(--s2); stroke-width: 10; }
.ring-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.4s ease;
}

.dash-sparkline {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 36px;
  margin-top: 8px;
}

.sbar {
  display: inline-block;
  width: 5px;
  border-radius: 2px 2px 0 0;
  transition: height 0.7s ease;
  vertical-align: bottom;
  min-height: 3px;
}

/* Identity */
.dash-identity {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-identity-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--s2);
  color: var(--text-3);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.dash-identity-link:hover {
  background: var(--brand-primary-dim);
  color: var(--brand-primary);
}

/* Phase */
.phase-wrap {
  border-radius: var(--r-lg) !important;
  padding: 16px 18px !important;
  margin-bottom: 0 !important;
}

.phase-morning {
  border-color: rgba(251, 191, 36, 0.25) !important;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), var(--s1)) !important;
}

.phase-midday {
  border-color: rgba(249, 115, 22, 0.22) !important;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.07), var(--s1)) !important;
}

.phase-evening {
  border-color: rgba(139, 92, 246, 0.22) !important;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.07), var(--s1)) !important;
}

/* Archetype badges — light theme */
.badge-gold   { background: rgba(245,158,11,.12); color: #b45309; border: 1px solid rgba(245,158,11,.25); }
.badge-red    { background: rgba(239,68,68,.1);  color: #dc2626; border: 1px solid rgba(239,68,68,.22); }
.badge-green  { background: rgba(16,185,129,.1); color: #059669; border: 1px solid rgba(16,185,129,.22); }
.badge-blue   { background: rgba(59,130,246,.1); color: #2563eb; border: 1px solid rgba(59,130,246,.22); }
.badge-orange { background: rgba(249,115,22,.1); color: #ea580c; border: 1px solid rgba(249,115,22,.22); }
.badge-purple { background: rgba(139,92,246,.1); color: #7c3aed; border: 1px solid rgba(139,92,246,.22); }
.badge-default{ background: var(--s2); color: var(--text-2); border: 1px solid var(--border); }

/* Daily insight */
.dash-insight-card {
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--teal-dim), color-mix(in srgb, var(--brand-primary) 6%, var(--s1)));
  border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--border));
  box-shadow: var(--shadow-sm);
}

.dash-insight-card textarea,
.dash-insight-card select {
  width: 100%;
  background: var(--s1);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--text-1);
  font-size: 13px;
  font-family: inherit;
}

.dash-insight-card button[type="button"]#daily-insight-submit {
  border: none;
  background: var(--brand-primary);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  min-height: 44px;
}

/* Quick actions — SaaSable icon tiles */
.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dash-qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .dash-qa-grid { grid-template-columns: repeat(6, 1fr); }
}

.dash-qa {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 88px;
}

.dash-qa:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.dash-qa-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-qa-icon svg { width: 20px; height: 20px; }

.dash-qa-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
}

/* Insights carousel */
.dash-insights-panel {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.dash-insight-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-dim);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

.dash-insight-badge.hidden { display: none; }

#insights-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

/* Skeleton */
.sk {
  background: linear-gradient(90deg, var(--s2) 25%, var(--s3) 50%, var(--s2) 75%);
  background-size: 200% 100%;
  animation: dash-sh 1.5s ease-in-out infinite;
  border-radius: var(--r-lg);
}

@keyframes dash-sh {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mobile bottom nav */
.dash-bnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--s1) 94%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
  display: flex;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 50;
}

@media (min-width: 1024px) {
  .dash-bnav { display: none; }
}

.dash-bnav .ni {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 6px;
  text-decoration: none;
  color: var(--text-3);
  min-height: 48px;
}

.dash-bnav .ni.active { color: var(--brand-primary); }

.dash-bnav .ni svg { width: 22px; height: 22px; stroke-width: 1.8; }

.dash-bnav .ni-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Animations */
@keyframes dash-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-u0 { animation: dash-up 0.4s ease both; }
.dash-u1 { animation: dash-up 0.4s 0.06s ease both; opacity: 0; }
.dash-u2 { animation: dash-up 0.4s 0.12s ease both; opacity: 0; }
.dash-u3 { animation: dash-up 0.4s 0.18s ease both; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .dash-u0, .dash-u1, .dash-u2, .dash-u3 { animation: none; opacity: 1; }
}

/* ════════════════════════════════════════════════════
   WIZARD STEPPER + BENTO BOARD
   ════════════════════════════════════════════════════ */

.dash-wizard-shell {
  margin-bottom: 16px;
}

.dash-wizard {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
}

.dash-wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dash-wizard-head-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.dash-wizard-head-progress {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.dash-wizard-track {
  height: 6px;
  background: var(--s2);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 14px;
}

.dash-wizard-track-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--teal));
  border-radius: var(--r-full);
  transition: width 0.45s ease;
}

.dash-wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 640px) {
  .dash-wizard-steps {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .dash-wizard-step {
    flex: 0 0 42%;
    scroll-snap-align: start;
  }
}

.dash-wizard-step-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--s2);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.dash-wizard-step-link:hover {
  border-color: var(--border-md);
  background: var(--s1);
}

.dash-wizard-step.is-active .dash-wizard-step-link {
  border-color: var(--brand-primary);
  background: var(--brand-primary-dim);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.dash-wizard-step.is-done .dash-wizard-step-link {
  border-color: color-mix(in srgb, var(--teal) 35%, var(--border));
  background: color-mix(in srgb, var(--teal) 8%, var(--s1));
}

.dash-wizard-step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--s1);
  border: 2px solid var(--border-md);
  color: var(--text-3);
  flex-shrink: 0;
}

.dash-wizard-step.is-done .dash-wizard-step-indicator {
  background: var(--teal-dim);
  border-color: var(--teal);
  color: var(--teal);
}

.dash-wizard-step.is-active .dash-wizard-step-indicator {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--s1);
}

.dash-wizard-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-1);
  text-align: center;
  line-height: 1.3;
}

.dash-wizard-step-meta {
  font-size: 10px;
  color: var(--text-3);
}

/* Bento board */
.dash-bento-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.dash-bento-cell {
  min-width: 0;
}

.dash-bento-cell--wide {
  grid-column: 1 / -1;
}

.dash-bento-cell--wizard {
  grid-column: 1 / -1;
}

.dash-bento-cell--score {
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .dash-bento-board {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
  }

  .dash-bento-cell--wizard {
    grid-column: span 7;
    grid-row: span 2;
  }

  .dash-bento-cell--score {
    grid-column: span 5;
    grid-row: span 2;
  }

  .dash-bento-cell--kpi {
    grid-column: span 3;
  }

  .dash-bento-board .dash-bento-cell--kpi:nth-child(n+3) {
    grid-column: span 4;
  }
}

/* Wizard hero panel (inside bento) */
.dash-wizard-hero {
  height: 100%;
  min-height: 220px;
  padding: 22px 20px 20px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--brand-primary-dim), color-mix(in srgb, var(--teal) 10%, var(--s1)));
  border: 1px solid var(--border-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.dash-wizard-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--teal));
}

.dash-wizard-hero.is-complete::before {
  background: var(--teal);
}

.dash-wizard-hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-wizard-hero-step,
.dash-wizard-hero-eta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}

.dash-wizard-hero-eta {
  color: var(--teal);
  background: var(--teal-dim);
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.dash-wizard-hero-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin: 0 0 8px;
}

.dash-wizard-hero-title {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.35;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.dash-wizard-hero-sub {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0 0 16px;
  max-width: 42ch;
}

.dash-wizard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.dash-wizard-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--brand-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-violet);
}

.dash-wizard-hero-cta--ghost {
  background: var(--s1);
  color: var(--text-1);
  border: 1px solid var(--border-md);
  box-shadow: none;
}

.dash-score-theme,
.dash-score-streak {
  font-size: 13px;
  color: var(--text-2);
  margin: 4px 0 0;
}

.dash-bento-cell--kpi.dash-kpi-card,
.dash-bento-cell--kpi.dash-identity,
.dash-bento-cell--kpi.phase-wrap {
  margin-bottom: 0;
  min-height: 120px;
}

.dash-bento-cell--kpi.dash-identity {
  position: relative;
  padding: 16px 18px 44px;
  display: block;
}

.dash-bento-hd-link {
  position: absolute;
  right: 14px;
  bottom: 14px;
}

.dash-bento-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 768px) {
  .dash-bento-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-bento-cell--wide.dash-insights-panel {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .dash-wizard-track-fill { transition: none; }
}

/* ════════════════════════════════════════════════════
   WARM ELEGANT FOUNDATION — display-font headers + softer cards
   ════════════════════════════════════════════════════ */

.dash-pro-header h1,
.dash-wizard-hero-title,
.dash-score-num {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
}

.dash-pro-header h1 {
  font-weight: 600;
}

/* Warmer, quieter card resting state with a gentle lift on hover */
.dash-card,
.dash-kpi-card,
.dash-insights-panel {
  transition: box-shadow var(--ease-slow), border-color var(--ease-slow), transform var(--ease);
}

.dash-card:hover,
.dash-insights-panel:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-md);
  transform: translateY(-1px);
}

/* Reveal entry pairs with scroll-reveal.css (dashboard, entry only) */
.dash-bento-cell[data-reveal] {
  will-change: opacity, transform;
}
