.finance-section {
  position: relative;
  background:
    radial-gradient(circle at 84% 20%, rgba(177, 138, 90, .16), transparent 30%),
    radial-gradient(circle at 10% 90%, rgba(70, 101, 109, .18), transparent 28%),
    linear-gradient(135deg, #0c1318 0%, #111b22 52%, #0b1115 100%);
  isolation: isolate;
}

.finance-section::before,
.finance-section::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
}

.finance-section::before {
  opacity: .12;
  background-image:
    linear-gradient(rgba(247, 245, 240, .2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 245, 240, .2) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(120deg, rgba(0, 0, 0, .8), transparent 74%);
}

.finance-section::after {
  opacity: .28;
  background: linear-gradient(90deg, transparent 0 6%, rgba(177, 138, 90, .22) 6% 6.08%, transparent 6.08% 100%);
}

.finance-section__glow {
  position: absolute;
  z-index: -1;
  width: 620px;
  height: 620px;
  right: -220px;
  bottom: 12%;
  border: 1px solid rgba(177, 138, 90, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(177, 138, 90, .025), 0 0 0 84px rgba(177, 138, 90, .02);
}

.finance-section .container {
  position: relative;
  z-index: 1;
}

.finance-section .section-head {
  margin-bottom: 78px;
}

.finance-intro {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 86px;
  align-items: end;
}

.finance-intro h2 {
  max-width: 660px;
  margin: 0;
  font-size: clamp(42px, 4.7vw, 66px);
  line-height: .94;
}

.finance-intro h2 > span {
  white-space: nowrap;
}

.finance-intro > p {
  max-width: 500px;
  margin: 0 0 7px;
  color: rgba(247, 245, 240, .76);
  font-size: 21px;
  line-height: 1.4;
}

.finance-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 68px 0 74px;
}

.finance-scope li {
  position: relative;
  min-height: 82px;
  padding: 19px 22px 19px 48px;
  border: 1px solid rgba(247, 245, 240, .17);
  background: linear-gradient(115deg, rgba(247, 245, 240, .075), rgba(247, 245, 240, .02));
  color: rgba(247, 245, 240, .78);
  font-size: 14px;
  line-height: 1.45;
  transition: border-color .25s, background .25s, transform .25s;
}

.finance-scope li:hover {
  border-color: rgba(177, 138, 90, .72);
  background: linear-gradient(115deg, rgba(177, 138, 90, .16), rgba(247, 245, 240, .03));
  transform: translateY(-2px);
}

.finance-scope li::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 25px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(177, 138, 90, .08);
}

.finance-scope li:nth-child(4) {
  grid-column: 1 / -1;
  order: -1;
  min-height: 98px;
  padding-right: 34px;
  background: linear-gradient(115deg, rgba(177, 138, 90, .18), rgba(247, 245, 240, .04));
}

.finance-scope li:nth-child(4)::before {
  top: 30px;
}

.finance-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr);
  gap: 14px;
}

.finance-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(247, 245, 240, .16);
  background: rgba(18, 28, 35, .74);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .14);
}

.finance-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, .04), transparent 32%, rgba(177, 138, 90, .04));
}

.finance-panel__top,
.pnl-head,
.finance-table-head,
.finance-model-top,
.metric-group,
.period-grid,
.period-row {
  position: relative;
  z-index: 1;
}

.finance-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 15px;
  border-bottom: 1px solid rgba(247, 245, 240, .14);
}

.finance-panel__kicker {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.finance-panel__mark {
  color: rgba(247, 245, 240, .42);
  font-size: 15px;
}

.finance-panel__mark--green {
  color: #9aad7a;
  text-shadow: 0 0 14px rgba(154, 173, 122, .6);
}

.finance-model-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  padding: 20px;
  border-bottom: 1px solid rgba(247, 245, 240, .14);
}

.finance-model-top div {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 18px;
  align-items: center;
  min-height: 39px;
  color: rgba(247, 245, 240, .62);
  font-size: 10px;
  line-height: 1.25;
}

.finance-model-top i,
.finance-row i,
.pnl-row i,
.period-row i {
  display: block;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(177, 138, 90, .55), rgba(247, 245, 240, .16));
  opacity: .74;
}

.finance-model-top i {
  height: 5px;
}

.finance-table-head {
  display: grid;
  grid-template-columns: minmax(200px, 2.2fr) repeat(5, minmax(38px, .55fr));
  gap: 10px;
  padding: 12px 20px;
  background: rgba(177, 138, 90, .18);
  color: rgba(247, 245, 240, .8);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.finance-table {
  padding: 0 20px 16px;
}

.finance-row {
  display: grid;
  grid-template-columns: minmax(200px, 2.2fr) repeat(5, minmax(38px, .55fr));
  gap: 10px;
  align-items: center;
  min-height: 29px;
  border-bottom: 1px solid rgba(247, 245, 240, .08);
  color: rgba(247, 245, 240, .54);
  font-size: 10px;
}

.finance-row span,
.finance-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-row b {
  color: rgba(247, 245, 240, .84);
  font-weight: 500;
}

.finance-row--major {
  min-height: 36px;
  border-color: rgba(177, 138, 90, .26);
}

.finance-row--total {
  margin-top: 9px;
  border-top: 1px solid rgba(177, 138, 90, .45);
  border-bottom: 0;
  color: var(--white);
}

.finance-row--total b {
  color: var(--accent);
}

.finance-dashboard__side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.finance-panel--metrics,
.finance-panel--pnl,
.finance-panel--periods {
  padding-bottom: 16px;
}

.metric-group {
  display: grid;
  gap: 7px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid rgba(247, 245, 240, .12);
}

.metric-group strong {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .14em;
  font-weight: 500;
}

.metric-group span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: rgba(247, 245, 240, .7);
  font-size: 11px;
  line-height: 1.25;
}

.metric-group span::after {
  content: "";
  flex: 0 0 38px;
  align-self: center;
  height: 5px;
  border-radius: 2px;
  background: rgba(177, 138, 90, .52);
}

.metric-group--last {
  border-bottom: 0;
  padding-bottom: 2px;
}

.pnl-head {
  display: flex;
  justify-content: space-between;
  padding: 13px 20px;
  background: rgba(177, 138, 90, .18);
  color: rgba(247, 245, 240, .84);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.pnl-list {
  position: relative;
  z-index: 1;
  padding: 3px 20px 8px;
}

.pnl-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 25px;
  border-bottom: 1px solid rgba(247, 245, 240, .08);
  color: rgba(247, 245, 240, .58);
  font-size: 10px;
}

.pnl-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-row i {
  flex: 0 0 48px;
  height: 6px;
}

.pnl-row--strong {
  min-height: 32px;
  color: rgba(247, 245, 240, .86);
  border-bottom-color: rgba(177, 138, 90, .24);
}

.pnl-row--strong i {
  background: linear-gradient(90deg, rgba(154, 173, 122, .62), rgba(247, 245, 240, .16));
}

.finance-panel--periods {
  grid-column: 1 / -1;
}

.period-grid,
.period-row {
  display: grid;
  grid-template-columns: minmax(290px, 2fr) repeat(3, minmax(90px, 1fr));
  gap: 18px;
  align-items: center;
}

.period-grid {
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(247, 245, 240, .14);
}

.period-label {
  color: rgba(247, 245, 240, .55);
  font-size: 9px;
  letter-spacing: .16em;
  text-align: right;
  text-transform: uppercase;
}

.period-row {
  min-height: 43px;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(247, 245, 240, .08);
  color: rgba(247, 245, 240, .7);
  font-size: 11px;
  line-height: 1.3;
}

.period-row i {
  justify-self: end;
  width: 62px;
}

@media (max-width: 980px) {
  .finance-intro {
    gap: 42px;
  }

  .finance-dashboard {
    grid-template-columns: 1fr;
  }

  .finance-dashboard__side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .finance-section .section-head {
    margin-bottom: 54px;
  }

  .finance-intro {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .finance-intro > p {
    font-size: 18px;
  }

  .finance-scope {
    grid-template-columns: 1fr;
    margin: 48px 0 54px;
  }

  .finance-scope li:nth-child(4) {
    grid-column: auto;
  }

  .finance-intro h2 > span {
    white-space: normal;
  }

  .finance-dashboard__side {
    grid-template-columns: 1fr;
  }

  .finance-model-top {
    grid-template-columns: 1fr;
  }

  .finance-table-head,
  .finance-row {
    grid-template-columns: minmax(170px, 2fr) repeat(5, minmax(30px, .45fr));
    gap: 7px;
  }

  .finance-table-head,
  .finance-row,
  .period-row {
    font-size: 9px;
  }

  .finance-table-head,
  .finance-table,
  .period-grid,
  .period-row,
  .pnl-head,
  .pnl-list,
  .metric-group,
  .finance-panel__top {
    padding-left: 13px;
    padding-right: 13px;
  }

  .period-grid,
  .period-row {
    grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(45px, 1fr));
    gap: 8px;
  }

  .period-row i {
    width: 35px;
  }
}

@media (max-width: 480px) {
  .finance-table-head > :nth-child(n + 4),
  .finance-row > :nth-child(n + 4) {
    display: none;
  }

  .finance-table-head,
  .finance-row {
    grid-template-columns: minmax(170px, 1fr) 48px 52px;
  }

  .finance-model-top div {
    grid-template-columns: 1fr 54px;
  }

  .period-grid,
  .period-row {
    grid-template-columns: minmax(155px, 1fr) repeat(3, 42px);
  }
}

/* Mobile: financial tables become self-contained cards without horizontal scrolling. */
@media (max-width: 700px) {
  .finance-table-head,
  .finance-panel--periods .period-grid {
    display: none;
  }

  .finance-table {
    display: grid;
    gap: 8px;
    padding: 12px 13px 16px;
  }

  .finance-row,
  .finance-row--major,
  .finance-row--total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    min-height: 0;
    padding: 13px;
    border: 1px solid rgba(247, 245, 240, .12);
    background: rgba(247, 245, 240, .035);
  }

  .finance-row span,
  .finance-row b {
    grid-column: 1 / -1;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    color: rgba(247, 245, 240, .78);
    line-height: 1.35;
  }

  .finance-row b {
    color: rgba(247, 245, 240, .92);
  }

  .finance-row i,
  .finance-row--major i,
  .finance-row--total i {
    display: block;
    position: relative;
    width: auto;
    height: 28px;
    border-radius: 0;
    background: none;
    opacity: 1;
  }

  .finance-row i::before {
    content: "Период";
    position: absolute;
    inset: 0 0 auto;
    color: rgba(247, 245, 240, .42);
    font-size: 8px;
    letter-spacing: .1em;
    line-height: 1;
    text-transform: uppercase;
  }

  .finance-row i:first-of-type::before {
    content: "Итого";
  }

  .finance-row i::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 5px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(177, 138, 90, .55), rgba(247, 245, 240, .16));
  }

  .finance-row--major,
  .finance-row--total {
    border-color: rgba(177, 138, 90, .28);
  }

  .finance-row--total {
    margin-top: 0;
    border-top: 1px solid rgba(177, 138, 90, .45);
  }

  .finance-panel--periods {
    padding-bottom: 13px;
  }

  .finance-panel--periods .period-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    min-height: 0;
    margin: 8px 13px 0;
    padding: 13px;
    border: 1px solid rgba(247, 245, 240, .12);
    background: rgba(247, 245, 240, .035);
    font-size: 10px;
  }

  .finance-panel--periods .period-row span {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .finance-panel--periods .period-row i {
    position: relative;
    justify-self: stretch;
    width: auto;
    height: 28px;
    border-radius: 0;
    background: none;
  }

  .finance-panel--periods .period-row i::before {
    content: "Период";
    position: absolute;
    inset: 0 0 auto;
    color: rgba(247, 245, 240, .42);
    font-size: 8px;
    letter-spacing: .1em;
    line-height: 1;
    text-transform: uppercase;
  }

  .finance-panel--periods .period-row i::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 5px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(177, 138, 90, .55), rgba(247, 245, 240, .16));
  }
}
