/* dashboard.css — command dashboard (visual layer) */

/* Dashboard must fully hide when another view is active (prevents pipeline stacking below calendar). */
#viewDashboard.dash-v2:not(.active) {
  display: none !important;
}

/* Match .view.active flex column layout when dashboard is the sole active view. */
#viewDashboard.dash-v2.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px 20px;
  background: linear-gradient(180deg, #eef4f8 0%, var(--bg) 140px);
}

.dash-hero {
  position: sticky;
  top: 0;
  z-index: 30;
  display: block;
  flex-shrink: 0;
  background: linear-gradient(125deg, #dbeafe 0%, #ecfdf5 42%, var(--white) 78%);
  border: none;
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.dash-hero-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--teal), var(--teal-dark));
}
.dash-hero-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 16px 20px;
}
.dash-hero-copy {
  flex: 1;
  min-width: 0;
}
.dash-hero h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.dash-hero-sub.dash-hero-quote {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
  font-style: normal;
  max-width: 36em;
  min-height: 1.5em;
  border-left: 3px solid rgba(8, 145, 178, 0.4);
  padding-left: 12px;
}
.dash-hero-catchup {
  flex-shrink: 0;
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  border: 1px solid rgba(8, 145, 178, 0.12);
}

.dash-focus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}
.dash-goals-card {
  position: relative;
  min-width: 0;
  padding: 16px 18px 14px 22px;
  margin-bottom: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #f0fdfa 0%, var(--white) 55%, #f8fafc 100%);
  border-color: rgba(8, 145, 178, 0.14);
  box-shadow: 0 2px 12px rgba(8, 145, 178, 0.08);
}
.dash-goals-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), #22d3ee);
  border-radius: 12px 0 0 12px;
}
.dash-income-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.dash-goals-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dash-income-pct {
  font-size: 12px;
  font-weight: 800;
  color: var(--teal-dark);
  background: rgba(8, 145, 178, 0.12);
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: -0.02em;
}
.dash-income-amounts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 12px;
}
.dash-income-current {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.dash-income-of {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}
.dash-income-of strong {
  color: var(--navy);
  font-weight: 700;
}
.dash-gci-bar-track {
  height: 10px;
  background: rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}
.dash-gci-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0e7490, var(--teal), #5eead4);
  border-radius: 8px;
  transition: width 0.35s ease;
  box-shadow: 0 0 8px rgba(8, 145, 178, 0.35);
}
.dash-income-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  padding: 6px 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 8px;
}
.dash-income-chip-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
}
.dash-income-chip-of {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
}
.dash-income-chip-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-left: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dash-pace-box {
  font-size: 13px;
  line-height: 1.45;
  color: var(--navy);
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(8, 145, 178, 0.06);
  border: 1px solid rgba(8, 145, 178, 0.1);
}
.dash-pace-box.behind {
  color: #9a3412;
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.2);
}
.dash-income-log {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(30, 41, 59, 0.08);
}
.dash-income-log-hint {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}
.dash-cruz-link {
  display: inline-block;
  margin-top: 0;
  font-size: 12px;
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 600;
}
.dash-cruz-link:hover {
  text-decoration: underline;
}
.dash-goals-empty {
  font-size: 14px;
  color: #64748b;
  line-height: 1.45;
}
.dash-btn-log-closing {
  display: inline-block;
  margin-top: 0;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: var(--teal-dark);
  background: rgba(8, 145, 178, 0.1);
  border: 1px solid rgba(8, 145, 178, 0.28);
  border-radius: 8px;
  cursor: pointer;
}
.dash-btn-log-closing:hover {
  background: rgba(8, 145, 178, 0.16);
}
.dash-thermo-wrap {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-width: 72px;
}
.dash-thermo-card {
  background: linear-gradient(180deg, var(--white) 0%, #fafcfd 100%);
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 100%;
}
.dash-thermo-tube {
  width: 44px;
  height: 130px;
  background: #e2e8f0;
  border-radius: 22px;
  margin: 0 auto 8px;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(30, 41, 59, 0.1);
}
.dash-thermo-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, #e74c3c, #f39c12, #2ecc71);
  border-radius: 0 0 20px 20px;
  transition: height 0.5s ease;
}
.dash-thermo-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.dash-thermo-label {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dash-thermo-muted .dash-thermo-pct {
  font-size: 18px;
  color: #94a3b8;
}
.dash-focus-row .dash-needs-you {
  margin-bottom: 0;
  min-width: 0;
}
.dash-needs-empty {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.dash-pulse-section {
  margin-bottom: 12px;
  padding: 14px 14px 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(30, 41, 59, 0.06);
  border-radius: 14px;
}
.dash-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dash-team-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.dash-team-link {
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  font-weight: 600;
}
.dash-team-link:hover {
  color: var(--teal-dark);
}
.dash-pulse-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.dash-pulse-card {
  background: linear-gradient(180deg, var(--white) 0%, #f8fafc 100%);
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 12px;
  padding: 12px 10px 10px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}
.dash-pulse-card:nth-child(1) { border-top: 3px solid #0891b2; }
.dash-pulse-card:nth-child(2) { border-top: 3px solid #0d9488; }
.dash-pulse-card:nth-child(3) { border-top: 3px solid #1e40af; }
.dash-pulse-card:nth-child(4) { border-top: 3px solid #d97706; }
.dash-pulse-card:nth-child(5) { border-top: 3px solid #7c3aed; }
.dash-pulse-card:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 145, 178, 0.35);
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.12);
}
.dash-pulse-card.has-items {
  background: linear-gradient(180deg, #f0fdfa 0%, var(--white) 100%);
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.1);
}
.dash-pulse-card.alert {
  background: linear-gradient(180deg, #fff7ed 0%, var(--white) 100%);
  border-color: rgba(230, 126, 34, 0.35);
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.12);
}
.dash-pulse-card.idle {
  opacity: 0.92;
}
.dash-pulse-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 6px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.dash-pulse-name-line {
  font-size: 12px;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--navy);
}
.dash-pulse-name {
  font-weight: 700;
}
.dash-name-initial {
  font-size: 14px;
  font-weight: 800;
  color: var(--teal-dark);
}
.dash-pulse-job {
  font-weight: 500;
  color: #64748b;
}
.dash-pulse-dual {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}
.dash-pulse-dual-item {
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  background: rgba(8, 145, 178, 0.06);
  border-radius: 8px;
}
.dash-pulse-dual-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.dash-pulse-dual-lbl {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}
.dash-pulse-status.dash-pulse-attn {
  color: #c2410c;
  font-weight: 600;
}
.dash-pulse-metric {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.dash-pulse-metric.text-metric {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.dash-pulse-status {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.3;
}
.dash-pulse-detail {
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.4;
  padding-top: 6px;
  border-top: 1px solid rgba(30, 41, 59, 0.08);
}

.dash-lower-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.dash-lower-grid .dash-biz-pulse {
  margin-bottom: 0;
}
.dash-needs-you h3,
.dash-focus-row .dash-needs-you h3,
.dash-biz-pulse h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--navy);
}
.dash-needs-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.dash-needs-row:hover {
  background: rgba(8, 145, 178, 0.06);
}
.dash-needs-row:last-child {
  border-bottom: none;
}
.dash-needs-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}
.dash-needs-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}
.dash-needs-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.dash-needs-footer {
  margin-top: 8px;
  font-size: 12px;
}
.dash-dash-link {
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 600;
}

.dash-biz-pulse {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-biz-card {
  background: var(--white);
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.dash-biz-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.dash-pipeline-counts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.dash-pipeline-stat {
  font-size: 11px;
  color: #64748b;
}
.dash-pipeline-stat strong {
  display: block;
  font-size: 17px;
  color: var(--navy);
  margin-bottom: 2px;
}
.dash-biz-row {
  font-size: 12px;
  padding: 6px 4px;
  color: var(--navy);
  cursor: pointer;
  border-radius: 6px;
  line-height: 1.35;
}
.dash-biz-row:hover {
  color: var(--teal-dark);
  background: rgba(8, 145, 178, 0.06);
}
.dash-biz-link {
  font-size: 12px;
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 600;
  margin-top: 6px;
  display: inline-block;
}

.dash-v2 .dash-card {
  padding: 12px 14px;
  margin-bottom: 0;
  background: var(--white);
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.dash-calendar-compact {
  max-height: min(480px, 55vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dash-cal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.dash-cal-header h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--navy);
  flex: 1;
  min-width: 0;
}
.dash-cal-range-select {
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--navy);
  background: var(--white);
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  max-width: 100%;
  cursor: pointer;
}
.dash-cal-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.dash-cal-week-strip[data-days="5"] {
  grid-template-columns: repeat(5, 1fr);
}
.dash-cal-week-day {
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(30, 41, 59, 0.06);
}
.dash-cal-week-day.is-today {
  background: rgba(8, 145, 178, 0.1);
  border-color: rgba(8, 145, 178, 0.25);
}
.dash-cal-week-day.has-events .dash-cal-week-count {
  color: var(--teal-dark);
  font-weight: 700;
}
.dash-cal-week-dow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.03em;
}
.dash-cal-week-dom {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.dash-cal-week-count {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}
.dash-cal-list-wrap {
  flex: 1;
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
}
.dash-cal-day-group {
  margin-bottom: 10px;
}
.dash-cal-day-head {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 0 4px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.08);
  margin-bottom: 4px;
}
.dash-cal-empty {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  padding: 8px 0;
}

@media (max-width: 768px) {
  #viewDashboard.dash-v2.active {
    padding: 16px;
  }
  .dash-hero-body {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-hero-catchup {
    align-self: flex-end;
  }
  .dash-focus-row {
    grid-template-columns: 1fr;
  }
  .dash-income-current {
    font-size: 22px;
  }
  .dash-thermo-wrap {
    justify-content: center;
  }
  .dash-thermo-card {
    flex-direction: row;
    gap: 14px;
    padding: 12px 16px;
    width: 100%;
    max-width: 100%;
  }
  .dash-thermo-tube {
    width: 40px;
    height: 100px;
    margin: 0;
    flex-shrink: 0;
  }
  .dash-cal-week-strip {
    gap: 4px;
  }
  .dash-cal-week-dom {
    font-size: 14px;
  }
  .dash-cal-range-select {
    width: 100%;
    flex: 1 1 100%;
  }
  .dash-pulse-section {
    padding: 12px;
  }
  .dash-pulse-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .dash-lower-grid {
    grid-template-columns: 1fr;
  }
}
