/* Financials page */
.page-financials .fin-toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 241, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(12, 51, 40, 0.08);
}
.fin-toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.fin-years {
  display: flex;
  gap: 0.5rem;
}
.fin-year {
  appearance: none;
  border: 1px solid rgba(12, 51, 40, 0.15);
  background: #fff;
  color: #0c3328;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fin-year.is-active {
  background: #0c3328;
  color: #f4f0e8;
  border-color: #0c3328;
}
.fin-year:hover:not(.is-active) {
  border-color: #c4a35a;
}
.fin-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.fin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1.15rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fin-btn--outline {
  background: #fff;
  border-color: rgba(12, 51, 40, 0.2);
  color: #0c3328;
}
.fin-btn--outline:hover { border-color: #c4a35a; }
.fin-btn--solid {
  background: #0c3328;
  color: #f4f0e8;
}
.fin-btn--solid:hover { background: #071f19; }
.fin-btn--gold {
  background: #c4a35a;
  color: #071f19;
}
.fin-btn--outline-light {
  background: transparent;
  border-color: rgba(244, 240, 232, 0.35);
  color: #f4f0e8;
}
.fin-btn--outline-light:hover { border-color: #c4a35a; color: #c4a35a; }

.fin-kpi-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .fin-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .fin-kpi-grid { grid-template-columns: repeat(6, 1fr); }
}
.fin-kpi-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(12, 51, 40, 0.08);
  border-radius: 0.75rem;
  padding: 1.15rem 1.1rem;
  box-shadow: 0 4px 16px rgba(12, 51, 40, 0.04);
}
.fin-kpi-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c4a35a;
  margin: 0;
}
.fin-kpi-card__value {
  margin: 0.4rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: #0c3328;
  line-height: 1.15;
}
.fin-kpi-card__meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: rgba(20, 36, 29, 0.6);
}
.fin-kpi-card__meta .up { color: #1a7a4c; }
.fin-kpi-card__meta .down { color: #b45309; }

.fin-chart-wrap {
  background: #fff;
  border: 1px solid rgba(12, 51, 40, 0.08);
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.fin-segment-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .fin-segment-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .fin-segment-cards { grid-template-columns: repeat(4, 1fr); }
}
.fin-seg-card {
  background: #fff;
  border: 1px solid rgba(12, 51, 40, 0.08);
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow: hidden;
  position: relative;
}
.fin-seg-card__bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.fin-seg-card__name {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0c3328;
}
.fin-seg-card__val {
  margin: 0.35rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  color: #0c3328;
}
.fin-seg-card__meta {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: rgba(20, 36, 29, 0.6);
}

.fin-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(12, 51, 40, 0.08);
  border-radius: 0.75rem;
  background: #fff;
}
.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.fin-table th,
.fin-table td {
  padding: 0.75rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid rgba(12, 51, 40, 0.06);
}
.fin-table th {
  background: #0c3328;
  color: #f4f0e8;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.fin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fin-table tr.is-bold td { font-weight: 600; color: #0c3328; }
.fin-table tr.is-highlight td {
  background: rgba(196, 163, 90, 0.12);
  font-weight: 700;
  color: #0c3328;
}
.fin-table tbody tr:hover td { background: rgba(12, 51, 40, 0.03); }

.fin-entity-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.fin-entity-tab {
  appearance: none;
  border: 1px solid rgba(12, 51, 40, 0.15);
  background: #fff;
  color: #0c3328;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}
.fin-entity-tab.is-active {
  background: #0c3328;
  color: #f4f0e8;
  border-color: #0c3328;
}
.fin-entity-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .fin-entity-grid { grid-template-columns: repeat(5, 1fr); }
}

.fin-ratio-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .fin-ratio-grid { grid-template-columns: repeat(4, 1fr); }
}
.fin-ratio-card {
  background: #fff;
  border: 1px solid rgba(12, 51, 40, 0.08);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
}
.fin-ratio-card__label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c4a35a;
}
.fin-ratio-card__value {
  margin: 0.5rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  color: #0c3328;
}

@media print {
  header, footer, .fin-toolbar, .fin-downloads, .php-burger { display: none !important; }
  body { background: #fff; }
  .page-section { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .fin-table-wrap, .fin-kpi-card, .fin-seg-card { break-inside: avoid; }
}

.fin-charts-row {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .fin-charts-row {
    grid-template-columns: 1fr 1.4fr;
  }
  .fin-chart-box--wide {
    grid-column: 1 / -1;
  }
}
.fin-chart-box {
  background: #fff;
  border: 1px solid rgba(12, 51, 40, 0.08);
  border-radius: 0.75rem;
  padding: 1.35rem 1.25rem 1.1rem;
  box-shadow: 0 4px 16px rgba(12, 51, 40, 0.04);
}
.fin-chart-box__title {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c4a35a;
}
.fin-chart-box__canvas {
  position: relative;
  min-height: 220px;
}
.fin-chart-box--wide .fin-chart-box__canvas {
  min-height: 260px;
}

/* =========================================================
   DARK THEME — mirrors the light-mode rules above so none
   of the finance UI is left stuck in light colors.
   ========================================================= */
[data-theme="dark"] .page-financials .fin-toolbar {
  background: rgba(7, 24, 18, 0.92);
  border-bottom-color: rgba(196, 163, 90, 0.18);
}
[data-theme="dark"] .fin-year {
  background: #14291f;
  border-color: rgba(196, 163, 90, 0.3);
  color: #f4f0e8;
}
[data-theme="dark"] .fin-year.is-active {
  background: #c4a35a;
  color: #071f19;
  border-color: #c4a35a;
}
[data-theme="dark"] .fin-year:hover:not(.is-active) { border-color: #c4a35a; }

[data-theme="dark"] .fin-btn--outline {
  background: #14291f;
  border-color: rgba(196, 163, 90, 0.3);
  color: #f4f0e8;
}
[data-theme="dark"] .fin-btn--solid { background: #c4a35a; color: #071f19; }
[data-theme="dark"] .fin-btn--solid:hover { background: #e6c982; }

[data-theme="dark"] .fin-kpi-card,
[data-theme="dark"] .fin-chart-wrap,
[data-theme="dark"] .fin-seg-card,
[data-theme="dark"] .fin-table-wrap,
[data-theme="dark"] .fin-ratio-card,
[data-theme="dark"] .fin-chart-box,
[data-theme="dark"] .fin-entity-tab {
  background: #14291f;
  border-color: rgba(196, 163, 90, 0.22);
}
[data-theme="dark"] .fin-kpi-card__value,
[data-theme="dark"] .fin-seg-card__name,
[data-theme="dark"] .fin-seg-card__val,
[data-theme="dark"] .fin-ratio-card__value,
[data-theme="dark"] .fin-entity-tab,
[data-theme="dark"] .fin-table tr.is-bold td,
[data-theme="dark"] .fin-table tr.is-highlight td {
  color: #f4f0e8;
}
[data-theme="dark"] .fin-kpi-card__meta,
[data-theme="dark"] .fin-seg-card__meta {
  color: rgba(244, 240, 232, 0.65);
}
[data-theme="dark"] .fin-kpi-card__meta .up { color: #4fd896; }
[data-theme="dark"] .fin-kpi-card__meta .down { color: #e3a85c; }

[data-theme="dark"] .fin-entity-tab.is-active {
  background: #c4a35a;
  color: #071f19;
  border-color: #c4a35a;
}

[data-theme="dark"] .fin-table th { background: #0c3328; color: #f4f0e8; }
[data-theme="dark"] .fin-table th,
[data-theme="dark"] .fin-table td { border-bottom-color: rgba(196, 163, 90, 0.14); }
[data-theme="dark"] .fin-table tr.is-highlight td { background: rgba(196, 163, 90, 0.16); }
[data-theme="dark"] .fin-table tbody tr:hover td { background: rgba(244, 240, 232, 0.04); }

[data-theme="dark"] .fin-chart-box__title,
[data-theme="dark"] .fin-kpi-card__label,
[data-theme="dark"] .fin-ratio-card__label { color: #e6c982; }
