/* ============================================================
   Dashboard mock styles
   ============================================================ */

.dash-frame {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--gray-100);
  overflow: hidden;
  width: 100%;
}

.dash-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f7f8fa;
  border-bottom: 1px solid var(--gray-100);
}
.dash-dots {
  display: flex;
  gap: 6px;
}
.dash-dots span {
  width: 11px; height: 11px; border-radius: 50%;
  background: #e1e5ec;
}
.dash-dots span:nth-child(1) { background: #f0a3a3; }
.dash-dots span:nth-child(2) { background: #f0d49a; }
.dash-dots span:nth-child(3) { background: #a3d6a7; }

.dash-url {
  flex: 1;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--charcoal-500);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
  margin: 0 auto;
}
.dash-lock { color: var(--green-600); }
.dash-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}

.dash-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 560px;
}

.dash-side {
  border-right: 1px solid var(--gray-100);
  padding: 18px 14px;
  background: #fcfcfd;
}
.dash-side-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 14px;
}
.dash-nav-section {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--charcoal-400);
  padding: 8px;
  margin-top: 4px;
}
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--charcoal-700);
  font-family: var(--font-display);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.dash-nav-item:hover { background: var(--gray-50); }
.dash-nav-item.active {
  background: var(--green-50);
  color: var(--green-700);
}
.dash-nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gray-300);
}
.dash-nav-item.active .dash-nav-dot { background: var(--green-500); }

.dash-main {
  padding: 24px 28px 28px;
  background: var(--offwhite);
}

.dash-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--gray-200);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--charcoal-700);
  font-weight: 500;
}
.dash-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(46, 145, 67, 0.18);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.dash-grid > .runway-card { grid-column: span 2; }
.dash-grid > .reserve-ring-card { grid-row: span 1; }
.dash-grid > .buckets-card { grid-column: span 2; }
.dash-grid > .ai-card { grid-column: span 1; }

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

/* ===== Metric card ===== */
.metric-card,
.runway-card,
.reserve-ring-card,
.ai-card,
.buckets-card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-xs);
}
.metric-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.metric-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: var(--charcoal-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.metric-trend {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gray-50);
  color: var(--charcoal-500);
}
.metric-trend.up { background: var(--green-50); color: var(--green-700); }
.metric-trend.down { background: #fef0f0; color: #b03a3a; }
.metric-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--charcoal-900);
  line-height: 1.1;
}
.metric-sub {
  font-size: 12px;
  color: var(--charcoal-500);
  margin-top: 2px;
}
.metric-spark {
  width: 100%;
  height: 36px;
  margin-top: 12px;
  display: block;
}

/* ===== Reserve ring ===== */
.reserve-ring-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.reserve-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--charcoal-900);
  margin-top: 2px;
}
.reserve-ring-wrap {
  display: flex; align-items: center; gap: 18px;
}
.reserve-ring {
  width: 140px; height: 140px; flex-shrink: 0;
}
.reserve-legend {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12.5px;
  color: var(--charcoal-700);
}
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.legend-row .dot.operating { background: var(--green-600); }
.legend-row .dot.tax { background: var(--charcoal-800); }
.legend-row .dot.growth { background: var(--green-200); }
.legend-row .dot.owner { background: var(--green-400); }

/* ===== Runway ===== */
.runway-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 8px;
}
.runway-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--charcoal-900);
  margin-top: 2px;
}
.runway-tabs {
  display: flex; gap: 2px;
  background: var(--gray-50);
  padding: 3px;
  border-radius: 8px;
}
.runway-tab {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--charcoal-500);
  cursor: pointer;
}
.runway-tab.active {
  background: #fff;
  color: var(--charcoal-900);
  box-shadow: var(--shadow-xs);
}
.runway-svg { width: 100%; height: auto; display: block; }

/* ===== AI card ===== */
.ai-card {
  background: linear-gradient(160deg, #fff 0%, var(--green-50) 100%);
  border-color: var(--green-100);
}
.ai-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff;
  border: 1px solid var(--green-100);
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  color: var(--green-700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ai-message {
  font-size: 14px;
  color: var(--charcoal-800);
  line-height: 1.55;
  margin-bottom: 14px;
}
.ai-message strong { color: var(--charcoal-900); font-weight: 700; }
.ai-actions { display: flex; gap: 8px; }

/* ===== Buckets ===== */
.bucket-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 12px;
}
.bucket-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.bucket-name {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--charcoal-800);
}
.bucket-dot {
  width: 9px; height: 9px; border-radius: 2px;
}
.bucket-bar {
  width: 100%; height: 8px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}
.bucket-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(.2,.6,.2,1);
}
.bucket-amount {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--charcoal-900);
  font-size: 13px;
}

/* ===== Logo arrow animation ===== */
.logo-arrow-anim {
  animation: arrowBreak 2.4s ease-in-out infinite;
  transform-origin: 32px 18px;
}
@keyframes arrowBreak {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .dash-side { display: none; }
  .dash-body { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid > .runway-card,
  .dash-grid > .buckets-card { grid-column: span 2; }
}
@media (max-width: 640px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid > .runway-card,
  .dash-grid > .buckets-card { grid-column: span 1; }
  .dash-main { padding: 18px; }
}

/* ============================================================
   Interactive dashboard states
   ============================================================ */

/* Sidebar nav — clickable */
.dash-nav-item {
  cursor: pointer;
  user-select: none;
}
.dash-nav-item:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
}

/* Runway chart — interactive scrubber */
.runway-svg-interactive {
  cursor: ew-resize;
  touch-action: none;
}
.runway-tab {
  cursor: pointer;
}
.runway-value {
  transition: color .25s;
}
.runway-card .metric-sub {
  transition: color .25s;
}
.runway-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--charcoal-400);
  letter-spacing: 0.02em;
}
.runway-hint-icon {
  font-size: 12px;
  color: var(--green-600);
  font-weight: 700;
}
.runway-scrub { animation: runwayScrubIn .15s ease-out; }
@keyframes runwayScrubIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* AI card — applied + reasoning states */
.ai-card.ai-applied {
  background: linear-gradient(160deg, var(--green-50) 0%, #fff 100%);
  border-color: var(--green-300);
}
.ai-message-success {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--green-700);
}
.ai-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.ai-reasoning {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--green-100);
  border-radius: 8px;
  animation: aiReasoningIn .35s cubic-bezier(.2,.6,.2,1);
}
@keyframes aiReasoningIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-reasoning-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--charcoal-900);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ai-reasoning-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-reasoning-list li {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--charcoal-700);
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
}
.ai-reasoning-list li::before {
  content: "·";
  position: absolute;
  left: 4px;
  top: -2px;
  color: var(--green-600);
  font-weight: 700;
  font-size: 16px;
}
.ai-rb {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--charcoal-900);
}

/* Buckets — clickable rows + detail panel */
.bucket-row {
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background .2s, transform .2s;
}
.bucket-row:hover {
  background: var(--gray-50);
}
.bucket-row.active {
  background: var(--green-50);
}
.bucket-list.has-active .bucket-row:not(.active) {
  opacity: 0.45;
}
.bucket-row:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 1px;
}
.bucket-detail {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  animation: bucketDetailIn .3s cubic-bezier(.2,.6,.2,1);
}
@keyframes bucketDetailIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bucket-detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--charcoal-900);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.bucket-detail-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--charcoal-500);
  font-weight: 400;
  margin-left: auto;
}
.bucket-detail-text {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--charcoal-700);
  line-height: 1.5;
}


/* ===== Live activity card ===== */
.activity-card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: 14px;
  padding: 16px 16px 12px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.activity-live {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--green-700);
  background: var(--green-50);
  border-radius: 999px;
  padding: 3px 8px 3px 7px;
}
.activity-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 0 var(--green-500);
  animation: liveDotPulse 1.6s ease-in-out infinite;
}
@keyframes liveDotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,145,67,.6); }
  50%      { box-shadow: 0 0 0 5px rgba(46,145,67,0); }
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.activity-item {
  position: relative;
  padding: 9px 8px 9px 10px;
  margin: 0 -8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}
.activity-item:hover {
  background: var(--gray-50);
}
.activity-item.is-new {
  background: linear-gradient(90deg, rgba(46,145,67,.06) 0%, rgba(46,145,67,0) 100%);
}
.activity-item.is-new::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--green-500);
  animation: activityNewPulse 1.6s ease-in-out infinite;
}
@keyframes activityNewPulse {
  0%, 100% { opacity: 1;   transform: scaleY(1); }
  50%      { opacity: .55; transform: scaleY(.85); }
}
.activity-item-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
}
.activity-bullet {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.activity-item.is-new .activity-bullet {
  box-shadow: 0 0 0 4px rgba(46,145,67,.12);
}
.activity-item-text { min-width: 0; }
.activity-item-src {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--charcoal-900);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-item-tag {
  color: var(--charcoal-500);
  font-weight: 500;
}
.activity-item-time {
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--charcoal-500);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.activity-item-amt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--green-700);
  font-variant-numeric: tabular-nums;
}
.activity-split {
  margin-top: 9px;
  padding-left: 17px;
  animation: activitySplitIn .35s cubic-bezier(.2,.6,.2,1);
}
@keyframes activitySplitIn {
  from { opacity: 0; transform: translateY(-4px); max-height: 0; }
  to   { opacity: 1; transform: translateY(0);    max-height: 80px; }
}
.activity-split-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--gray-100);
}
.activity-split-seg {
  height: 100%;
  transition: width .4s cubic-bezier(.2,.6,.2,1);
}
.activity-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
}
.activity-split-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--charcoal-700);
  font-variant-numeric: tabular-nums;
}
.activity-split-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.activity-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--gray-100);
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--charcoal-500);
}
.activity-foot-icon {
  display: inline-flex;
  width: 14px; height: 14px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 10px;
  font-weight: 700;
}
