:root {
  --ink: #17231f;
  --muted: #728078;
  --line: #e4e9e5;
  --paper: #fff;
  --canvas: #f4f6f3;
  --green: #166b4f;
  --lime: #dff45b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "DM Sans", sans-serif; }
.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 80px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 42px; }
.eyebrow, .kicker { margin: 0 0 11px; color: var(--green); font-weight: 800; font-size: 11px; letter-spacing: .16em; }
h1 { margin: 0; font: 800 clamp(36px, 5vw, 64px)/.98 "Manrope", sans-serif; letter-spacing: -.045em; }
h1 span { color: var(--green); }
.year-picker { background: var(--ink); color: #fff; border-radius: 16px; padding: 13px 17px; display: grid; gap: 3px; min-width: 156px; }
.year-picker span { color: #aab5b0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.year-picker select { appearance: none; border: 0; outline: 0; color: #fff; background: transparent; font: 700 22px "Manrope", sans-serif; cursor: pointer; }
.stats { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.card, .panel { border: 1px solid var(--line); background: var(--paper); border-radius: 20px; }
.card { padding: 25px 27px; }
.card p { color: var(--muted); margin: 0 0 18px; font-size: 13px; font-weight: 600; }
.card strong { display: block; font: 800 clamp(28px, 3vw, 42px) "Manrope", sans-serif; letter-spacing: -.04em; }
.card span { display: block; margin-top: 7px; color: #95a098; font-size: 12px; }
.total-card { background: var(--green); color: #fff; border-color: var(--green); position: relative; overflow: hidden; }
.total-card::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; background: var(--lime); right: -70px; bottom: -85px; }
.total-card p, .total-card span { color: #c0d8cf; }
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel { padding: 27px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.panel-heading h2 { margin: 0; font: 800 21px "Manrope", sans-serif; letter-spacing: -.025em; }
.chart-wrap { height: 250px; }
.client-list { display: grid; gap: 15px; }
.client { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 11px; }
.client-rank { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; background: #edf1ed; color: var(--green); font-weight: 800; font-size: 12px; }
.client-name { overflow: hidden; }
.client-name strong { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-size: 13px; }
.client-name span { color: var(--muted); font-size: 11px; }
.client-total { font-size: 13px; font-weight: 700; }
.table-panel { padding-bottom: 13px; }
.table-heading { margin-bottom: 15px; }
.table-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 0 14px; border-radius: 11px; text-decoration: none; font-size: 12px; font-weight: 700; white-space: nowrap; }
.button-light { color: var(--green); background: #edf3ef; }
.button-dark { color: #fff; background: var(--ink); }
.search { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.search input { border: 0; outline: 0; font: 13px "DM Sans"; width: 210px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: #96a099; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); }
td { padding: 17px 10px; border-bottom: 1px solid #edf0ed; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; transition: background .15s ease; }
tbody tr:hover { background: #f7f9f6; }
.right { text-align: right; }
.amount { color: var(--green); font-weight: 800; }
.customer-cell strong { display: block; }
.customer-cell small { color: var(--muted); }
.empty { border: 1px dashed #bfc9c2; padding: 80px 24px; text-align: center; border-radius: 24px; background: #fff; }
.empty-icon { display: grid; place-items: center; margin: 0 auto 18px; width: 48px; height: 48px; border-radius: 50%; background: var(--lime); font-size: 25px; }
.empty h2 { margin: 0 0 7px; font: 800 24px "Manrope"; }
.empty p { margin: 0; color: var(--muted); }
.errors { margin-top: 15px; padding: 14px 17px; border-radius: 12px; background: #fff1df; color: #80531d; font-size: 12px; }
.no-results { text-align: center; color: var(--muted); padding: 20px; }
.hidden { display: none !important; }
dialog { width: min(940px, calc(100% - 28px)); max-height: 90vh; padding: 0; border: 0; border-radius: 24px; color: var(--ink); box-shadow: 0 24px 80px #0d2b2180; }
dialog::backdrop { background: #10221ccc; backdrop-filter: blur(4px); }
.dialog-shell { padding: 30px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font: 800 28px "Manrope"; }
.icon-button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #edf1ed; cursor: pointer; color: var(--ink); font-size: 25px; }
.detail-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0 14px; }
.detail-item { padding: 14px; border-radius: 13px; background: var(--canvas); }
.detail-item span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.detail-item strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; margin-bottom: 25px; }
.data-title { font: 800 17px "Manrope"; margin: 0 0 12px; }
.data-tree { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.tree-row { display: grid; grid-template-columns: minmax(170px, 35%) 1fr; border-bottom: 1px solid #edf0ed; font-size: 12px; }
.tree-row:last-child { border-bottom: 0; }
.tree-key { padding: 9px 12px; background: #f7f9f6; color: #506058; font-weight: 700; overflow-wrap: anywhere; }
.tree-value { padding: 9px 12px; overflow-wrap: anywhere; }
.tree-section { padding: 10px 12px; background: #e9f0ec; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
@media (max-width: 800px) {
  .shell { width: min(100% - 24px, 1240px); padding-top: 30px; }
  .topbar { align-items: flex-start; gap: 25px; flex-direction: column; }
  .stats, .content-grid { grid-template-columns: 1fr; }
  .table-heading { align-items: flex-start; gap: 15px; flex-direction: column; }
  .table-actions { width: 100%; justify-content: flex-start; }
  .search, .search input { width: 100%; }
  .detail-summary { grid-template-columns: 1fr 1fr; }
  .tree-row { grid-template-columns: 1fr; }
}
