/* =========================================================
   Financial widgets — interactive components for home page
   ========================================================= */

/* Common */
.fw-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.metric-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal-500);
}
.metric-sub {
  font-size: 12px;
  color: var(--charcoal-500);
}
.live-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #d44a4a;
  box-shadow: 0 0 0 4px rgba(212, 74, 74, 0.18);
  animation: live-pulse 1.6s ease-in-out infinite;
  margin-right: 8px;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(212, 74, 74, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(212, 74, 74, 0.04); }
}
.flicker-up {
  animation: flicker-up 0.5s cubic-bezier(.2,.6,.2,1);
}
@keyframes flicker-up {
  from { opacity: 0.4; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fw-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--gray-100);
  border-radius: 999px;
  outline: none;
  margin: 14px 0 18px;
}
.fw-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green-600);
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(34, 121, 50, 0.4);
}
.fw-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green-600);
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(34, 121, 50, 0.4);
}

/* =========================================================
   LiveTicker
   ========================================================= */
.fw-ticker {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  flex-direction: column;
  min-width: 260px;
}
.fw-ticker-head { display: flex; align-items: center; }
.fw-ticker-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.02em;
  color: var(--charcoal-900);
  margin: 6px 0 4px;
}

/* =========================================================
   AllocatorWidget
   ========================================================= */
.fw-allocator {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.fw-alloc-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.fw-alloc-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  color: var(--green-700);
  letter-spacing: -0.02em;
}
.fw-alloc-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 8px;
}
.fw-donut { width: 200px; height: 200px; }
.fw-alloc-list {
  display: flex; flex-direction: column;
  gap: 2px;
}
.fw-alloc-row {
  display: grid;
  grid-template-columns: 14px 1fr 50px 90px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--gray-100);
}
.fw-alloc-row:last-child { border-bottom: 0; }
.fw-alloc-dot {
  width: 12px; height: 12px; border-radius: 3px;
}
.fw-alloc-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--charcoal-900);
}
.fw-alloc-desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11.5px;
  color: var(--charcoal-500);
  margin-top: 2px;
}
.fw-alloc-pct {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal-700);
  text-align: right;
}
.fw-alloc-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--charcoal-900);
  text-align: right;
}
@media (max-width: 720px) {
  .fw-alloc-body { grid-template-columns: 1fr; }
  .fw-donut { margin: 0 auto; }
}

/* =========================================================
   KPI strip
   ========================================================= */
.fw-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.fw-kpi {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.fw-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.fw-kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--charcoal-900);
  margin-top: 4px;
  margin-bottom: 8px;
}
.fw-kpi-spark {
  display: block;
  width: 100%;
  height: 32px;
}
@media (max-width: 1100px) {
  .fw-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .fw-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   IncomeStreamsChart
   ========================================================= */
.fw-streams {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.fw-streams-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.fw-streams-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--charcoal-900);
  margin-top: 6px;
}
.fw-streams-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
}
.fw-stream-leg {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--charcoal-700);
}
.fw-stream-leg span {
  width: 10px; height: 10px; border-radius: 2px;
  display: inline-block;
}
.fw-streams-svg {
  width: 100%; height: auto;
  display: block;
}

/* =========================================================
   Pipeline
   ========================================================= */
.fw-pipeline {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.fw-pipe-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.fw-pipe-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--charcoal-900);
  margin-top: 6px;
}
.fw-pipe-conf {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; font-family: var(--font-display); font-weight: 500;
  color: var(--charcoal-700);
}
.fw-pipe-conf span { display: inline-flex; align-items: center; gap: 6px; }
.fw-pipe-conf i {
  width: 10px; height: 10px; border-radius: 2px; display: inline-block;
}
.fw-pipe-list { display: flex; flex-direction: column; gap: 6px; }
.fw-pipe-row {
  display: grid;
  grid-template-columns: 1.4fr 110px 1.2fr 70px 110px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: var(--r-sm, 8px);
  transition: background .2s;
}
.fw-pipe-row:hover { background: var(--green-50); }
.fw-pipe-client {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--charcoal-900);
  font-size: 14px;
}
.fw-pipe-amt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--charcoal-900);
}
.fw-pipe-bar {
  height: 6px; background: var(--gray-200); border-radius: 999px; overflow: hidden;
}
.fw-pipe-fill {
  height: 100%; border-radius: 999px;
  transition: width .5s cubic-bezier(.2,.6,.2,1);
}
.fw-pipe-when {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--charcoal-500);
}
.fw-pipe-pill {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  text-align: center;
}
@media (max-width: 720px) {
  .fw-pipe-row { grid-template-columns: 1fr 1fr; }
  .fw-pipe-bar, .fw-pipe-when { display: none; }
}

/* =========================================================
   Scenario planner
   ========================================================= */
.fw-scenarios {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.fw-scn-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.fw-scn-tabs { display: flex; gap: 4px; background: var(--gray-50); padding: 4px; border-radius: 8px; }
.fw-scn-tab {
  border: 0; background: transparent;
  padding: 6px 12px; border-radius: 6px;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  color: var(--charcoal-500);
  cursor: pointer;
  text-transform: capitalize;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s, color .2s;
}
.fw-scn-tab span {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block;
}
.fw-scn-tab.active {
  background: var(--white);
  color: var(--charcoal-900);
  box-shadow: var(--shadow-xs);
}
.fw-scn-svg {
  width: 100%; height: auto; display: block;
}
.fw-scn-meta {
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--charcoal-500);
}
.fw-scn-meta strong {
  color: var(--charcoal-900);
  font-family: var(--font-display);
  font-weight: 700;
}

/* =========================================================
   Tax ladder
   ========================================================= */
.fw-tax {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.fw-tax-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap;
}
.fw-tax-rate {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: #e8b53b;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.fw-tax-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--charcoal-900);
  letter-spacing: -0.02em;
}
.fw-tax-events {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px;
}
.fw-tax-event {
  display: grid;
  grid-template-columns: 60px 1fr 90px 16px 90px 90px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  font-size: 13px;
}
.fw-tax-when {
  font-family: var(--font-mono);
  color: var(--charcoal-500);
  font-size: 11px;
}
.fw-tax-src {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--charcoal-900);
}
.fw-tax-amt {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--charcoal-900);
  text-align: right;
}
.fw-tax-arrow {
  text-align: center;
  color: var(--charcoal-400);
  font-size: 16px;
}
.fw-tax-reserve {
  font-family: var(--font-display);
  font-weight: 700;
  color: #e8b53b;
  text-align: right;
}
.fw-tax-bar {
  height: 6px; background: var(--gray-200); border-radius: 999px; overflow: hidden;
}
.fw-tax-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #e8b53b, #d99a1a);
  border-radius: 999px;
  transition: width .35s cubic-bezier(.2,.6,.2,1);
}
@media (max-width: 720px) {
  .fw-tax-event { grid-template-columns: 1fr 1fr; }
  .fw-tax-arrow, .fw-tax-bar, .fw-tax-when { display: none; }
}

/* =========================================================
   Section block for widget showcase on home
   ========================================================= */
.widgets-section {
  padding: 100px 0;
}
.widgets-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  margin-top: 40px;
  align-items: start;
}
.widgets-grid-full {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 1000px) {
  .widgets-grid { grid-template-columns: 1fr; }
}
