:root {
  color-scheme: dark;
  --bg: #0b0c16;
  --surface: #131622;
  --surface-2: #131622;
  --line: #1f2335;
  --muted: #8b949e;
  --text: #f4f7fb;
  --blue: #7a7cff;
  --cyan: #13bed5;
  --green: #00c497;
  --pink: #ff4da6;
  --amber: #f5b83b;
  --red: #ff5a68;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(122, 124, 255, 0.15), transparent 45rem), 
    radial-gradient(circle at 0% 100%, rgba(138, 92, 246, 0.12), transparent 45rem),
    #0b0c16;
  color: var(--text);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1380px, calc(100% - 32px));
  margin: 16px auto;
}

.dashboard {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.topbar,
.brand,
.metrics,
.panel-title,
.month-row,
.category-row,
.modal-header,
.modal-summary,
.needle-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b0c16;
  --surface: #131622;
  --surface-2: #131622;
  --line: #1f2335;
  --muted: #8b949e;
  --text: #f4f7fb;
  --blue: #7a7cff;
  --cyan: #13bed5;
  --green: #00c497;
  --pink: #ff4da6;
  --amber: #f5b83b;
  --red: #ff5a68;
  --radius: 16px;
  font-family: 'Plus Jakarta Sans', Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(122, 124, 255, 0.15), transparent 45rem), 
    radial-gradient(circle at 0% 100%, rgba(138, 92, 246, 0.12), transparent 45rem),
    #0b0c16;
  color: var(--text);
}

.brand {
  gap: 16px;
  min-width: 0;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: var(--line);
  border-color: var(--muted);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  line-height: 1.15;
  font-weight: 800;
  color: #ffffff;
}

.brand p,
.panel-title span,
#modal-kicker {
  color: var(--muted);
  font-size: 0.82rem;
}

.year-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.year-tabs button,
.icon-btn {
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.year-tabs button {
  min-width: 58px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 800;
  transition: all 0.2s ease;
}

.year-tabs button.active {
  background: #5a52e6;
  color: white;
  box-shadow: 0 10px 24px rgba(90, 82, 230, 0.4);
}

.metrics {
  gap: 20px;
  margin-bottom: 24px;
}

.metric {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.metric:hover {
  transform: translateY(-2px);
  border-color: rgba(90, 82, 230, 0.25);
}

.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.medal {
  background: rgba(122, 124, 255, 0.1);
  color: #7a7cff;
}

.average {
  background: rgba(0, 196, 151, 0.1);
  color: #00c497;
}

.globe {
  background: rgba(245, 184, 59, 0.1);
  color: #f5b83b;
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.metric strong {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  font-weight: 800;
  color: #7a7cff;
  line-height: 1.1;
}

.metric:nth-child(2) strong {
  color: #00c497;
}

.metric:nth-child(3) strong {
  color: #ffffff;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.panel {
  min-height: 312px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.panel-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-title h2 {
  font-size: 0.94rem;
  text-transform: uppercase;
}

.month-list,
.category-list,
.insights {
  display: grid;
  gap: 14px;
}

.month-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.2s ease;
}

.month-row:hover {
  opacity: 0.85;
}

.month-name {
  width: 86px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
}

.bar-track {
  position: relative;
  flex: 1;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #161925;
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: linear-gradient(90deg, #5a52e6, #7a7cff);
}

.month-value {
  width: 108px;
  color: #00c497;
  text-align: right;
  font-weight: 800;
  font-size: 0.88rem;
  font-family: 'Outfit', sans-serif;
}

.month-row.empty {
  opacity: 0.35;
}

.insight {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.insight:last-child {
  border-bottom: 0;
}

.insight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.insight-icon.best {
  background: rgba(0, 196, 151, 0.1);
  color: #00c497;
}

.insight-icon.projection {
  background: rgba(122, 124, 255, 0.1);
  color: #7a7cff;
}

.insight-icon.forecast {
  background: rgba(245, 184, 59, 0.1);
  color: #f5b83b;
}

.insight-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.insight-label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
}

.insight-value {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.category-label {
  width: 102px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffffff;
}

.category-row .bar-fill {
  background: var(--category-color, var(--cyan));
}

.category-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 100px;
  line-height: 1.25;
}

.cat-amount {
  font-weight: 800;
  font-size: 0.88rem;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
}

.cat-pct {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
}

.daily-panel {
  min-height: 170px;
  margin-top: 24px;
}

.daily-panel .panel-title strong {
  color: var(--green);
}

.daily-chart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--days, 31), 1fr);
  align-items: end;
  gap: 4px;
  height: 112px;
  padding-top: 10px;
  border-bottom: 1px solid var(--line);
}

.daily-bar {
  min-height: 3px;
  height: calc(var(--h) * 1%);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #6971ff, rgba(105, 113, 255, 0.18));
}

.daily-bar.weekend {
  background: linear-gradient(180deg, var(--amber), rgba(245, 184, 59, 0.18));
}

.daily-bar.holiday {
  background: linear-gradient(180deg, var(--red), rgba(255, 90, 104, 0.18));
}

.month-modal {
  width: min(1180px, calc(100% - 28px));
  max-height: min(92vh, 900px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
}

.month-modal::backdrop {
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  padding: 22px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(17, 25, 42, 0.98), rgba(10, 16, 29, 0.98)),
    #101827;
}

.modal-header {
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.6rem;
  line-height: 1;
}

.modal-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.modal-summary article,
.timeline-card,
.detail-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141c2b;
}

.modal-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.modal-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 1.18rem;
}

.wave-card,
.timeline-card {
  margin-bottom: 18px;
}

.wave-card {
  padding: 18px;
  border: 1px solid rgba(72, 89, 126, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(21, 31, 52, 0.94), rgba(13, 20, 35, 0.94)),
    #141c2b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.compact-title {
  margin-bottom: 8px;
}

.compact-title strong {
  color: var(--green);
}

#modal-wave {
  display: block;
  width: 100%;
  height: clamp(230px, 34vh, 330px);
  overflow: visible;
}

.wave-axis {
  stroke: rgba(129, 144, 168, 0.22);
  stroke-width: 1;
}

.wave-line {
  fill: none;
  stroke: url(#waveStroke);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 16px rgba(104, 104, 255, 0.25));
}

.wave-area {
  fill: url(#waveFill);
}

.wave-dot {
  fill: #111827;
  stroke: #7a7cff;
  stroke-width: 4;
}

.wave-dot.weekend {
  stroke: var(--amber);
}

.wave-dot.holiday {
  stroke: var(--red);
}

.wave-selected-dot {
  fill: var(--text);
  stroke: var(--green);
  stroke-width: 5;
}

.wave-needle {
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(0, 196, 151, 0.65));
}

.wave-band-weekend {
  fill: rgba(245, 184, 59, 0.08);
}

.wave-band-holiday {
  fill: rgba(255, 90, 104, 0.11);
}

.wave-label,
.wave-value-label {
  fill: #9aa8bd;
  font-size: 22px;
  font-weight: 800;
}

.wave-value-label {
  fill: var(--green);
  font-size: 24px;
}

.needle-row {
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 800;
}

#day-output {
  color: var(--green);
}

#day-slider {
  width: 100%;
  accent-color: var(--blue);
}

.selected-day {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.selected-day strong {
  color: var(--green);
}

.calendar-grid,
.day-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 7px;
  margin-bottom: 18px;
}

.weekday,
.day-cell {
  min-height: 54px;
  border-radius: var(--radius);
}

.weekday {
  display: none;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.day-cell {
  padding: 8px;
  border: 1px solid var(--line);
  background: #121a28;
  cursor: pointer;
}

.day-cell.blank {
  display: none;
}

.day-cell.weekend {
  border-color: rgba(245, 184, 59, 0.55);
  background: rgba(245, 184, 59, 0.13);
}

.day-cell.holiday {
  border-color: rgba(255, 90, 104, 0.7);
  background: rgba(255, 90, 104, 0.16);
}

.day-cell.selected {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.day-num {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 900;
  font-size: 0.82rem;
}

.day-value {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
}

.holiday-name {
  display: block;
  margin-top: 5px;
  color: #ffd8dd;
  font-size: 0.72rem;
}

.details-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
}

.detail-panel {
  min-height: 220px;
}

.detail-panel h3 {
  margin-bottom: 12px;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.mini-category,
.item-entry {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(129, 144, 168, 0.12);
}

.mini-category:last-child,
.item-entry:last-child {
  border-bottom: 0;
}

.mini-category div,
.item-entry div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mini-category span,
.item-entry span {
  color: var(--muted);
  font-size: 0.8rem;
}

.item-entry a {
  color: #92dcff;
  font-weight: 800;
  text-decoration: none;
}

.item-entry a:hover {
  text-decoration: underline;
}

@media (max-width: 1060px) {
  .metrics,
  .panel-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .metrics,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .metric {
    flex: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1380px);
    margin: 9px auto;
  }

  .dashboard,
  .modal-card {
    padding: 14px;
  }

  .month-row,
  .category-row {
    grid-template-columns: 1fr;
  }

  .month-name,
  .category-label,
  .month-value,
  .category-value {
    width: auto;
  }

  .modal-summary {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-grid {
    gap: 5px;
  }

  .day-cell {
    min-height: 64px;
    padding: 7px;
  }
}
