#analytics-page .analytics-controls { padding: 24px; margin-bottom: 24px; }
.analytics-context { display: flex; flex-wrap: wrap; align-items: end; gap: 20px; }
.analytics-owner-field { min-width: 230px; max-width: 380px; flex: 1; }
.analytics-scope-note { margin: 16px 0 24px; line-height: 1.6; }
.analytics-period-form { display: flex; flex-wrap: wrap; align-items: start; gap: 20px; }
.analytics-period-form > .field { width: 230px; }
.analytics-custom-period { display: flex; flex-wrap: wrap; align-items: start; gap: 16px; }
.analytics-custom-period > .field { width: 180px; }
.analytics-custom-period > .btn { margin-top: 27px; }
.analytics-period-error { flex-basis: 100%; margin: 0; }
.analytics-period-error:empty { display: none; }
.analytics-owner-field[hidden], .analytics-custom-period[hidden], #analytics-comparison[hidden], #analytics-operations[hidden] { display: none; }
.analytics-period-caption { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.analytics-period-caption strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.analytics-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.analytics-stat { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; padding: 23px; min-width: 0; }
.analytics-stat > span { font-size: 13px; color: var(--muted); }
.analytics-stat > strong { font-size: clamp(21px,2vw,30px); line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.analytics-stat > small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.analytics-money { white-space: nowrap; }
.analytics-stat.emphasized { background: var(--ink); border-color: var(--ink); color: #fff; }
.analytics-stat.emphasized > span, .analytics-stat.emphasized > small { color: #c7d7ca; }
.analytics-main-panel { padding: 24px; }
.analytics-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.analytics-section-heading { margin-bottom: 20px; }
.analytics-section-heading h2, .analytics-cost-breakdown h3, .analytics-empty h2 { margin: 0 0 8px; text-wrap: balance; }
.analytics-section-heading p, .analytics-explanation, .analytics-journal-caption p { margin: 0; line-height: 1.6; text-wrap: pretty; }
.analytics-table-scroll { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.analytics-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 12px; text-align: left; font-variant-numeric: tabular-nums; }
.analytics-table th, .analytics-table td { padding: 17px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.analytics-table tr:last-child > * { border-bottom: 0; }
.analytics-table thead { background: #f7f9f5; color: var(--muted); }
.analytics-table thead th { font-size: 11px; font-weight: 500; white-space: normal; }
.analytics-table thead button { border: 0; padding: 0; text-align: left; color: inherit; font: inherit; background: transparent; cursor: pointer; }
.analytics-table tbody th { min-width: 150px; max-width: 210px; font-weight: 500; }
.analytics-table tbody td { white-space: nowrap; }
.analytics-table small { display: block; font-size: 10px; line-height: 1.5; font-weight: 400; color: var(--muted); margin-top: 7px; white-space: normal; }
.analytics-property-link { border: 0; background: transparent; padding: 0; color: var(--green); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.analytics-property-link:hover { text-decoration: underline; }
.analytics-net { font-weight: 700; color: var(--green); }
.analytics-table .negative { color: #ac5145; }
.analytics-valuation { margin-top: 8px; font-size: 11px; }
.analytics-table .analytics-stale-value { color: #9a6a2e; }
.analytics-explanation { margin-top: 18px; max-width: 1000px; }
.analytics-cost-breakdown { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 700px; }
.analytics-cost-item { margin-top: 18px; }
.analytics-cost-item > div:first-child { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; margin-bottom: 9px; }
.analytics-cost-item strong { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analytics-cost-track { height: 7px; background: #edf1e7; border-radius: 8px; overflow: hidden; }
.analytics-cost-track > span { display: block; height: 100%; background: #83a969; border-radius: 8px; }
.analytics-operation-filters { display: grid; grid-template-columns: 1.1fr .8fr 1fr 1.1fr; gap: 16px; margin-bottom: 22px; }
.analytics-journal-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.analytics-journal-caption strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.analytics-journal { min-width: 750px; }
.analytics-journal tbody td:last-child { white-space: normal; }
.analytics-operation-note { display: block; min-width: 150px; max-width: 320px; overflow-wrap: anywhere; white-space: pre-line; }
.analytics-pagination { display: flex; justify-content: end; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 20px; color: var(--muted); font-size: 12px; }
.analytics-empty { padding: 35px 15px; text-align: center; }
.analytics-empty p { line-height: 1.6; margin-bottom: 0; }
@media (max-width: 1150px) {
  .analytics-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .analytics-operation-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  #analytics-page .analytics-controls, .analytics-main-panel { padding: 18px; }
  .analytics-summary-grid { gap: 10px; }
  .analytics-stat { padding: 16px; gap: 10px; }
  .analytics-stat > strong { font-size: 22px; }
  .analytics-stat > span { font-size: 11px; }
  .analytics-stat > small { font-size: 10px; }
  .analytics-context, .analytics-period-form, .analytics-custom-period { display: grid; width: 100%; gap: 15px; }
  .analytics-period-form > .field, .analytics-custom-period > .field, .analytics-owner-field { width: 100%; min-width: 0; max-width: none; }
  .analytics-custom-period > .btn { margin-top: 0; justify-self: start; }
  .analytics-context .workspace-switch { display: flex; }
  .analytics-context .workspace-switch > button { flex: 1; }
  .analytics-operation-filters { grid-template-columns: minmax(0,1fr); }
  .analytics-pagination { justify-content: space-between; }
}
@media (max-width: 430px) {
  .analytics-summary-grid { grid-template-columns: minmax(0,1fr); }
}
.analytics-monthly-panel { padding: 24px; margin-bottom: 24px; min-width: 0; }
.analytics-monthly-legend { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.analytics-monthly-legend > span { display: inline-flex; align-items: center; gap: 9px; }
.analytics-monthly-legend i { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--green); }
.analytics-monthly-legend i.costs { border-color: #d69a52; border-top-style: dashed; }
.analytics-monthly-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.analytics-monthly-svg { display: block; width: 100%; min-width: 780px; height: 290px; }
.analytics-monthly-svg.compact { min-width: 540px; }
.analytics-monthly-area { fill: #75a864; fill-opacity: .1; }
.analytics-monthly-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.analytics-monthly-line.net { stroke: var(--green); }
.analytics-monthly-line.costs { stroke: #d69a52; stroke-dasharray: 5 5; }
.analytics-monthly-point { transition: none; }
.analytics-monthly-point.costs { fill: #d69a52; }
.analytics-monthly-note { margin: 16px 0 0; line-height: 1.65; max-width: 1000px; text-wrap: pretty; }
@media (max-width: 600px) {
  .analytics-monthly-panel { padding: 18px; }
  .analytics-monthly-controls { gap: 10px; }
  .analytics-monthly-controls > span { order: -1; flex-basis: 100%; }
}
