/* ============================================================
   WRENHAUS DASHBOARD PREVIEW v3 — Shared Styles
   All classes prefixed .wh-  |  --wh-accent set per-page
   ============================================================ */

/* ── Two-column layout ─────────────────────────────────────── */
.wh-two-col {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}
.wh-preview-col {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  align-self: start;
}

/* Cards column: 2-col grid (4 rows × 2 cards) */
.wh-two-col .built-modules {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1px !important;
  background: rgba(255,255,255,0.06) !important;
  flex-direction: unset !important;
}

/* Compact cards in two-col context — desktop only */
@media (min-width: 769px) {
  section:has(.wh-two-col) {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  section:has(.wh-two-col) .built-subhead {
    margin-bottom: 1.5rem !important;
  }
  .wh-two-col .module {
    padding: 1rem 1.25rem !important;
  }
  .wh-two-col .module-desc {
    display: none !important;
  }
}

/* ── Card states ───────────────────────────────────────────── */
.wh-card {
  cursor: pointer !important;
  transition: background 0.18s, box-shadow 0.18s !important;
}
.wh-card.active {
  background: var(--navy-mid) !important;
  box-shadow: inset 3px 0 0 var(--wh-accent) !important;
}
.wh-card:hover:not(.active) {
  background: rgba(255,255,255,0.04) !important;
}
.wh-card.active::after { transform: scaleX(0) !important; }

/* ── Preview wrapper ───────────────────────────────────────── */
.wh-preview-wrap {
  background: #F8F5EF;
  border: 1px solid #E8E1D4;
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
}
.wh-preview-header {
  background: #F0EBE0;
  border-bottom: 1px solid #E8E1D4;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wh-preview-system-name {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1E2A38;
  flex: 1;
}
.wh-preview-panel {
  padding: 8px;
  transition: opacity 150ms ease;
  min-height: 160px;
}

/* ── Live dot ──────────────────────────────────────────────── */
.wh-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5A9E72; animation: wh-pulse 2s infinite; flex-shrink: 0;
}

/* ── Status badge rows (used in preview panels) ─────────────  */
.wh-status-list { width: 100%; }
.wh-status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 0; border-bottom: 1px solid #F0EBE0;
}
.wh-status-row:last-child { border-bottom: none; }
.wh-status-name { font-family: 'Jost', sans-serif; font-size: 10px; font-weight: 300; color: #5A6472; flex: 1; padding-right: 8px; }
.wh-status-badge { font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 3px; white-space: nowrap; flex-shrink: 0; }
.wh-badge-done { background: rgba(90,158,114,0.12); color: #5A9E72; }
.wh-badge-progress { background: rgba(184,146,74,0.12); color: #B8924A; }
.wh-badge-pending { background: #F0EBE0; color: #8A9098; }
@keyframes wh-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(.85); }
}
.wh-live-label {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase; color: #5A9E72;
}

/* ── KPI row ───────────────────────────────────────────────── */
.wh-kpi-row {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 8px; margin-bottom: 8px;
}
.wh-kpi {
  background: #FDFAF5; border: 1px solid #E8E1D4;
  border-radius: 6px; padding: 6px 8px;
}
.wh-kpi-label {
  font-family: 'DM Mono', monospace; font-size: 8.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #8A9098; margin-bottom: 4px;
}
.wh-kpi-value {
  font-family: 'Cormorant Garamond', serif; font-size: 16px;
  font-weight: 400; color: var(--wh-accent); line-height: 1;
}

/* ── Chart label ───────────────────────────────────────────── */
.wh-clabel {
  font-family: 'DM Mono', monospace; font-size: 8px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #8A9098; margin-top: 12px; margin-bottom: 4px;
}

/* ── Funnel ─────────────────────────────────────────────────  */
.wh-funnel-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.wh-funnel-track { flex: 1; }
.wh-funnel-bar {
  height: 26px; background: var(--wh-accent); border-radius: 3px;
  display: flex; align-items: center; padding-left: 10px;
  width: 0; transition: width 600ms ease;
  overflow: hidden; white-space: nowrap; max-width: 100%;
}
.wh-funnel-lbl { font-family: 'Jost', sans-serif; font-size: 10px; color: #fff; font-weight: 300; }
.wh-funnel-count { font-family: 'DM Mono', monospace; font-size: 9px; color: #8A9098; min-width: 20px; text-align: right; flex-shrink: 0; }

/* ── Horizontal bar rows ───────────────────────────────────── */
.wh-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wh-bar-lbl {
  font-family: 'Jost', sans-serif; font-size: 10px; font-weight: 300;
  color: #5A6472; width: 128px; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wh-bar-track { flex: 1; height: 7px; background: #E8E1D4; border-radius: 4px; overflow: hidden; }
.wh-bar-fill { height: 100%; background: var(--wh-accent); border-radius: 4px; width: 0; transition: width 600ms ease; }
.wh-bar-count { font-family: 'DM Mono', monospace; font-size: 9px; color: #8A9098; min-width: 28px; text-align: right; flex-shrink: 0; }

/* ── Vertical bar chart ─────────────────────────────────────  */
.wh-vbar-section { display: flex; align-items: flex-end; gap: 3px; height: 52px; }
.wh-vbar-group { display: flex; align-items: flex-end; gap: 2px; flex: 1; }
.wh-vbar {
  flex: 1; border-radius: 3px 3px 0 0; height: 0;
  transition: height 600ms ease; min-width: 4px; background: var(--wh-accent);
}
.wh-vbar.muted { background: #C8C0B4; }
.wh-vbar-labels { display: flex; gap: 3px; margin-top: 4px; }
.wh-vbar-lbl {
  flex: 1; text-align: center; font-family: 'DM Mono', monospace;
  font-size: 7px; text-transform: uppercase; letter-spacing: 0.04em; color: #8A9098;
}
.wh-vbar-legend { display: flex; gap: 12px; margin-top: 8px; }
.wh-vbar-leg-item { display: flex; align-items: center; gap: 4px; }
.wh-vbar-leg-swatch { width: 8px; height: 8px; border-radius: 2px; }
.wh-vbar-leg-lbl { font-family: 'DM Mono', monospace; font-size: 8px; color: #8A9098; }

/* ── Donut ──────────────────────────────────────────────────  */
.wh-donut-row { display: flex; align-items: center; gap: 14px; }
.wh-donut-wrap { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.wh-donut {
  width: 52px; height: 52px; border-radius: 50%;
  animation: wh-donut-in 500ms ease both;
}
@keyframes wh-donut-in { from { transform:scale(0.6);opacity:0; } to { transform:scale(1);opacity:1; } }
.wh-donut-hole {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 32px; height: 32px; background: #F8F5EF;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.wh-donut-pct {
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--wh-accent); text-align: center; line-height: 1.3;
}
.wh-donut-right { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.wh-donut-legend { margin-top: 8px; }
.wh-donut-leg-item { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.wh-donut-leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wh-donut-leg-txt { font-family: 'Jost', sans-serif; font-size: 9px; font-weight: 300; color: #5A6472; }

/* ── Progress bar rows ──────────────────────────────────────  */
.wh-prog-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wh-prog-lbl {
  font-family: 'Jost', sans-serif; font-size: 9px; font-weight: 300; color: #5A6472;
  min-width: 70px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wh-prog-track { flex: 1; height: 5px; background: #E8E1D4; border-radius: 3px; overflow: hidden; }
.wh-prog-fill { height: 100%; background: var(--wh-accent); width: 0; transition: width 600ms ease 100ms; }
.wh-prog-pct { font-family: 'DM Mono', monospace; font-size: 8px; color: #8A9098; min-width: 26px; text-align: right; flex-shrink: 0; }

/* ── Kanban ─────────────────────────────────────────────────  */
.wh-kanban { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.wh-kanban-col {
  background: #FDFAF5; border: 1px solid #E8E1D4;
  border-radius: 6px; padding: 6px 8px; text-align: center;
}
.wh-kanban-num { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 400; color: var(--wh-accent); line-height: 1; }
.wh-kanban-lbl { font-family: 'DM Mono', monospace; font-size: 7.5px; letter-spacing: 0.07em; text-transform: uppercase; color: #8A9098; margin-top: 3px; }
.wh-kanban-bar { height: 3px; background: #E8E1D4; border-radius: 2px; margin-top: 7px; overflow: hidden; }
.wh-kanban-fill { height: 100%; background: var(--wh-accent); width: 0; transition: width 600ms ease 200ms; border-radius: 2px; }

/* ── Stacked proportion bar ─────────────────────────────────  */
.wh-stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; width: 0; transition: width 800ms ease; }
.wh-stack-seg { height: 100%; }
.wh-stack-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.wh-stack-leg-item { display: flex; align-items: center; gap: 5px; }
.wh-stack-leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wh-stack-leg-txt { font-family: 'Jost', sans-serif; font-size: 9px; font-weight: 300; color: #5A6472; }

/* ── Milestone track ─────────────────────────────────────────  */
.wh-ms-track { display: flex; align-items: center; }
.wh-ms-circle {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace; font-size: 8px;
}
.wh-ms-circle.done { background: var(--wh-accent); color: #fff; }
.wh-ms-circle.active { border: 2px solid var(--wh-accent); color: var(--wh-accent); background: transparent; }
.wh-ms-circle.empty { border: 2px solid #E8E1D4; color: #8A9098; background: transparent; }
.wh-ms-line { flex: 1; height: 2px; background: #E8E1D4; min-width: 8px; }
.wh-ms-line.done { background: var(--wh-accent); }

/* per-program milestone rows */
.wh-pm-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.wh-pm-lbl {
  font-family: 'Jost', sans-serif; font-size: 9px; font-weight: 300; color: #5A6472;
  width: 110px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Stat trend cards ───────────────────────────────────────  */
.wh-stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.wh-stat-card {
  background: #FDFAF5; border: 1px solid #E8E1D4;
  border-radius: 6px; padding: 6px 8px;
}
.wh-stat-name { font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; color: #8A9098; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-stat-num { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 400; color: var(--wh-accent); line-height: 1; margin-bottom: 3px; }
.wh-stat-trend { font-family: 'DM Mono', monospace; font-size: 9px; }
.wh-stat-trend.up { color: #5A9E72; }
.wh-stat-trend.dn { color: #B87055; }
.wh-stat-trend.fl { color: #8A9098; }

/* ── Sparkline cards ────────────────────────────────────────  */
.wh-spark-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.wh-spark-card {
  background: #FDFAF5; border: 1px solid #E8E1D4;
  border-radius: 6px; padding: 6px 8px;
}
.wh-spark-lbl { font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; color: #8A9098; margin-bottom: 4px; }
.wh-spark-val { font-family: 'Cormorant Garamond', serif; font-size: 16px; font-weight: 400; color: var(--wh-accent); line-height: 1; margin-bottom: 4px; }
.wh-sparkline { display: flex; align-items: flex-end; gap: 2px; height: 22px; }
.wh-spark-bar {
  flex: 1; background: var(--wh-accent); opacity: 0.65;
  border-radius: 1px 1px 0 0; height: 0;
  transition: height 500ms ease; min-width: 2px;
}

/* ── Status checklist ───────────────────────────────────────  */
.wh-check-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid #F0EBE0;
}
.wh-check-row:last-child { border-bottom: none; }
.wh-check-name { font-family: 'Jost', sans-serif; font-size: 11px; font-weight: 300; color: #5A6472; }
.wh-badge { font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.wh-badge.ok { background: rgba(90,158,114,0.12); color: #5A9E72; }
.wh-badge.prog { background: rgba(184,146,74,0.12); color: #B8924A; }
.wh-badge.pend { background: #F0EBE0; color: #8A9098; }

/* ── Heat grid (v3) ─────────────────────────────────────────  */
.wh-heat { display: grid; gap: 3px; }
.wh-heat-hdr { font-family: 'DM Mono', monospace; font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; color: #8A9098; text-align: center; padding-bottom: 3px; }
.wh-heat-row-lbl { font-family: 'Jost', sans-serif; font-size: 9px; font-weight: 300; color: #5A6472; display: flex; align-items: center; padding-right: 4px; }
.wh-heat-cell { height: 18px; border-radius: 3px; background: #F0EBE0; }
.wh-heat-cell.h { background: var(--wh-accent); }
.wh-heat-cell.m { background: color-mix(in srgb, var(--wh-accent) 42%, #E8E1D4); }
.wh-heat-cell.l { background: #E8E1D4; outline: 1px solid color-mix(in srgb, var(--wh-accent) 55%, transparent); outline-offset: -1px; }

/* ── Heat grid (v4) ─────────────────────────────────────────  */
.wh-heat-grid { display: grid; grid-template-columns: 60px repeat(6, 1fr); gap: 3px; }
.wh-heat-col-labels { display: grid; grid-template-columns: 60px repeat(6, 1fr); margin-top: 3px; }
.wh-heat-col-lbl { font-family: 'DM Mono', monospace; font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; color: #8A9098; text-align: center; }

/* ── Goal bars with milestone markers ───────────────────────  */
.wh-goal-row { margin-bottom: 10px; }
.wh-goal-hdr { display: flex; justify-content: space-between; margin-bottom: 5px; }
.wh-goal-lbl { font-family: 'Jost', sans-serif; font-size: 10px; font-weight: 300; color: #5A6472; }
.wh-goal-pct { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--wh-accent); }
.wh-goal-track-wrap { position: relative; }
.wh-goal-track { height: 8px; background: #E8E1D4; border-radius: 4px; overflow: hidden; }
.wh-goal-fill { height: 100%; background: var(--wh-accent); width: 0; transition: width 600ms ease; border-radius: 4px; }
.wh-goal-markers { position: absolute; top: 0; left: 0; right: 0; height: 8px; pointer-events: none; }
.wh-goal-marker { position: absolute; top: 50%; width: 6px; height: 6px; background: #F8F5EF; border: 1.5px solid color-mix(in srgb, var(--wh-accent) 70%, transparent); border-radius: 1px; transform: translate(-50%,-50%) rotate(45deg); }

/* ── Doc/status stat grid ───────────────────────────────────  */
.wh-doc-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.wh-doc-card { background: #FDFAF5; border: 1px solid #E8E1D4; border-radius: 6px; padding: 10px; }
.wh-doc-cat { font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; color: #8A9098; margin-bottom: 4px; }
.wh-doc-num { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 400; color: var(--wh-accent); line-height: 1; margin-bottom: 4px; }
.wh-doc-status { font-family: 'DM Mono', monospace; font-size: 8px; }
.wh-doc-status.ok { color: #5A9E72; }
.wh-doc-status.warn { color: #B8924A; }

/* ── Board / gauge bars ─────────────────────────────────────  */
.wh-gauge-row { margin-bottom: 10px; }
.wh-gauge-hdr { display: flex; justify-content: space-between; margin-bottom: 4px; }
.wh-gauge-lbl { font-family: 'Jost', sans-serif; font-size: 10px; font-weight: 300; color: #5A6472; }
.wh-gauge-val { font-family: 'DM Mono', monospace; font-size: 9px; color: #8A9098; }
.wh-gauge-track { height: 8px; background: #E8E1D4; border-radius: 4px; overflow: hidden; }
.wh-gauge-fill { height: 100%; background: var(--wh-accent); width: 0; transition: width 600ms ease; }

/* ─── Homepage dark composite dashboard ─────────────────────  */
.wh-hp-section {
  background: #1E2A38;
  padding: 5rem;
}
.wh-hp-wrap {
  background: #1E2A38;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #3D4F63;
  max-width: 900px;
  margin: 0 auto;
}
.wh-hp-header {
  background: #2D3A4A;
  border-bottom: 1px solid #3D4F63;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 8px;
}
.wh-hp-eyebrow { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.12em; color: #8A9098; flex: 1; }
.wh-hp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #3D4F63; }
.wh-hp-panel { background: #1E2A38; padding: 16px; }
.wh-hp-panel-label { font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: #5A6472; margin-bottom: 10px; }
.wh-hp-kpi-val { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 400; color: #D4AA6A; line-height: 1; }
.wh-hp-kpi-sub { font-family: 'DM Mono', monospace; font-size: 8px; color: #5A6472; margin-top: 2px; margin-bottom: 10px; }

/* dark-bg overrides inside HP panels */
.wh-hp-panel .wh-clabel { color: #5A6472; }
.wh-hp-panel .wh-funnel-bar { background: #B8924A; }
.wh-hp-panel .wh-funnel-count { color: #5A6472; }
.wh-hp-panel .wh-vbar-section { }
.wh-hp-panel .wh-vbar { background: #B8924A; }
.wh-hp-panel .wh-vbar.muted { background: #3D4F63; }
.wh-hp-panel .wh-vbar-lbl { color: #5A6472; }
.wh-hp-panel .wh-donut-hole { background: #1E2A38; }
.wh-hp-panel .wh-donut-pct { color: #D4AA6A; }
.wh-hp-panel .wh-prog-track { background: #3D4F63; }
.wh-hp-panel .wh-prog-fill { background: #B8924A; }
.wh-hp-panel .wh-prog-lbl { color: #8A9098; }
.wh-hp-panel .wh-prog-pct { color: #5A6472; }
.wh-hp-panel .wh-ms-circle.done { background: #B8924A; }
.wh-hp-panel .wh-ms-circle.active { border-color: #B8924A; color: #B8924A; }
.wh-hp-panel .wh-ms-circle.empty { border-color: #3D4F63; color: #5A6472; }
.wh-hp-panel .wh-ms-line { background: #3D4F63; }
.wh-hp-panel .wh-ms-line.done { background: #B8924A; }

/* ── Mobile responsive ──────────────────────────────────────  */
@media (max-width: 1100px) {
  .wh-two-col { grid-template-columns: 1fr; }
  .wh-preview-col { position: static; width: auto; }
}
@media (max-width: 768px) {
  .wh-kpi-row { grid-template-columns: repeat(2,1fr); }
  .wh-kanban { grid-template-columns: repeat(2,1fr); }
  .wh-stat-grid { grid-template-columns: repeat(2,1fr); }
  .wh-spark-cards { grid-template-columns: 1fr 1fr; }
  .wh-doc-grid { grid-template-columns: repeat(2,1fr); }
  .wh-hp-grid { grid-template-columns: 1fr; }
  .wh-hp-section { padding: 3rem 2rem; }
  .wh-bar-lbl { width: 82px; font-size: 9px; }
  .wh-prog-lbl { min-width: 55px; }
  .wh-donut-row { flex-direction: column; }
}
@media (max-width: 480px) {
  .wh-kpi-value { font-size: 16px; }
  .wh-kanban-num { font-size: 20px; }
  .wh-spark-cards { grid-template-columns: 1fr; }
  .wh-doc-grid { grid-template-columns: 1fr 1fr; }
}
