:root {
  color-scheme: light;
  --ink: #1c1c1c;
  --muted: #707070;
  --line: #e6e6e6;
  --soft: #f6f7f8;
  --red: #d52735;
  --red-dark: #bd1d2a;
  --red-soft: #fff0f1;
  --orange: #ea8a35;
  --yellow: #d5af39;
  --green: #3b9d75;
  --sidebar: 212px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
svg.lucide { width: 17px; height: 17px; stroke-width: 2; flex: none; }
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar { background: #1d1c1c; color: #f9f9f9; min-height: 100vh; padding: 28px 18px 22px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { padding: 0 12px; line-height: 1; }
.brand-word { display: flex; flex-direction: column; align-items: flex-start; font-size: 25px; font-weight: 900; line-height: .9; white-space: nowrap; }
.brand-word span, .mobile-brand span { color: var(--red); }
.brand-small { font-size: 11px; font-weight: 700; margin-top: 5px; color: #c7c7c7; }
.sidebar-rule { height: 1px; background: #373636; margin: 33px 12px 25px; }
.sidebar-caption { color: #8f8e8e; font-size: 10px; font-weight: 750; margin: 0 12px 12px; }
.side-nav { display: grid; gap: 4px; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 12px; text-decoration: none; border-radius: 5px; color: #bcbaba; font-size: 13px; font-weight: 600; transition: background .16s ease, color .16s ease; }
.nav-link:hover { background: #2b2929; color: #fff; }
.nav-link.is-active { background: #333030; color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.nav-link svg { width: 17px; height: 17px; }
.nav-section { min-height: 64px; line-height: 1.3; }
.nav-section span { min-width: 0; }
.nav-subnav { display: grid; gap: 2px; }
.nav-sublink { min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 42px; color: #aaa; text-decoration: none; font-size: 12px; border-radius: 5px; }
.nav-sublink:hover { background: #2b2929; color: #fff; }
.nav-sublink svg { width: 14px; height: 14px; }
.nav-button { width: 100%; border: 0; background: transparent; text-align: left; }
.logout-mobile { display: none; }
.sidebar-bottom { margin-top: auto; }
.side-foot { border-top: 1px solid #373636; margin: 15px 12px 0; padding-top: 19px; font-size: 10px; font-weight: 700; color: #777; }
.main-shell { min-width: 0; }
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: #fff; }
.topbar-title { font-size: 12px; font-weight: 700; color: #666; }
.topbar-right { display: flex; align-items: center; gap: 7px; color: #858585; font-size: 11px; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.topbar-logout { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: 8px; border: 0; background: transparent; color: #777; border-radius: 4px; }
.topbar-logout:hover { color: var(--red); background: #f7f7f7; }
.mobile-brand { display: none; flex-direction: column; align-items: flex-start; font-size: 16px; font-weight: 850; line-height: .9; white-space: nowrap; }
.mobile-brand small { margin-top: 3px; font-size: 11px; font-weight: 700; color: #ccc; }
.content { max-width: 1640px; padding: 30px 34px 48px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 25px; }
.eyebrow, .section-kicker, .drawer-kicker { color: var(--red); font-size: 10px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 27px; line-height: 1.15; margin: 8px 0 9px; font-weight: 760; }
.source-line { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.source-separator { color: #bbb; }
.head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.field-inline { display: flex; align-items: center; gap: 10px; color: #666; font-size: 11px; font-weight: 650; white-space: nowrap; }
select, input[type="search"] { height: 36px; background: #fff; color: var(--ink); border: 1px solid #d9d9d9; border-radius: 5px; outline: 0; }
select { min-width: 135px; padding: 0 30px 0 11px; }
select:hover, input[type="search"]:hover { border-color: #aaa; }
.button { height: 36px; min-width: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border-radius: 5px; border: 1px solid #dadada; background: #fff; color: #333; font-size: 12px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .12s ease; white-space: nowrap; }
.button:hover { background: #f7f7f7; border-color: #bababa; }
.button:active { transform: scale(.96); }
.button:disabled { cursor: default; opacity: .45; transform: none; }
.button-primary { background: var(--red); color: #fff; border-color: var(--red); }
.button-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.button-secondary { background: #fff; }
.icon-button { padding: 0; width: 36px; }
.button.is-loading svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.kpi-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 3px solid var(--red); border-bottom: 1px solid var(--line); background: #fafafa; }
.kpi { padding: 20px 22px 19px; min-width: 0; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi-label { font-size: 11px; color: #666; font-weight: 700; }
.kpi-value { margin-top: 11px; font-size: 24px; font-weight: 780; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-foot { min-height: 15px; margin-top: 8px; font-size: 11px; color: #777; font-variant-numeric: tabular-nums; }
.delta-up { color: #b92d35; }
.delta-down { color: #2b8c63; }

.analysis-section, .breakdown-grid, .positions-section { border-bottom: 1px solid var(--line); }
.statistics-empty { padding: 52px 0 80px; border-top: 1px solid var(--line); }
.statistics-empty h2 { margin: 8px 0; font-size: 19px; }
.statistics-empty p { margin: 0; color: var(--muted); font-size: 14px; }
.analysis-section { padding: 30px 0 27px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; margin-bottom: 20px; }
.section-head h2 { font-size: 17px; margin: 5px 0 0; font-weight: 750; }
.section-kicker { font-size: 10px; }
.section-head.compact { margin-bottom: 18px; }
.section-meta { color: #888; font-size: 11px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 19px; color: #777; font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 9px; height: 9px; display: inline-block; border-radius: 2px; }
.legend-swatch.total { background: #c6c7ca; }
.legend-swatch.frozen { background: var(--red); }
.chart-frame { width: 100%; overflow-x: auto; }
#trend-chart { display: block; min-width: 640px; width: 100%; height: auto; overflow: visible; }
.chart-label { fill: #858585; font-size: 11px; font-family: inherit; }
.chart-axis { stroke: #e8e8e8; stroke-width: 1; }
.chart-bar { cursor: pointer; transition: opacity .16s ease; }
.chart-bar:hover { opacity: .7; }
.chart-selected { fill: var(--red); }
.chart-normal { fill: #dd858b; }
.chart-total { fill: #c9cacc; }
.chart-selected-band { fill: #fff6f6; }
.trend-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.trend-line.trend-total { stroke: #777d80; }
.trend-line.trend-frozen { stroke: var(--red); }
.trend-point { cursor: pointer; }
.trend-marker { stroke: #fff; stroke-width: 2; }
.trend-marker.total { fill: #777d80; }
.trend-marker.frozen { fill: var(--red); }
.trend-point:hover .trend-marker, .trend-point.is-selected .trend-marker { stroke-width: 3; }
.trend-table-section { padding: 27px 0 30px; border-bottom: 1px solid var(--line); }
.trend-table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 13px; font-variant-numeric: tabular-nums; }
.trend-table th, .trend-table td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.trend-table th:first-child { text-align: left; }
.trend-table thead th { background: var(--soft); color: #555; font-weight: 700; font-size: 12px; }
.trend-table tbody tr { cursor: pointer; }
.trend-table tbody tr:hover { background: #f9f9f9; }
.trend-table tbody tr.is-selected { background: var(--red-soft); }
.trend-table tbody th { font-weight: 650; }

.breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; }
.breakdown-panel { padding: 26px 28px 30px 0; min-width: 0; }
.breakdown-panel + .breakdown-panel { padding-left: 28px; border-left: 1px solid var(--line); }
.manager-list { display: grid; gap: 12px; }
.manager-row { display: grid; grid-template-columns: 128px 1fr 105px; align-items: center; gap: 12px; font-size: 12px; }
.manager-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.manager-track { height: 7px; border-radius: 2px; background: #f0f0f0; overflow: hidden; }
.manager-fill { display: block; height: 100%; background: var(--red); border-radius: 2px; }
.manager-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.status-stack { display: flex; height: 17px; border-radius: 3px; overflow: hidden; background: #f1f1f1; }
.status-stack > span { display: block; height: 100%; }
.status-list { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 22px; margin-top: 19px; }
.status-item { display: flex; align-items: center; gap: 8px; font-size: 11px; min-width: 0; }
.status-item-name { color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-item-value { margin-left: auto; font-weight: 750; font-variant-numeric: tabular-nums; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-red { background: var(--red); }
.status-orange { background: var(--orange); }
.status-yellow { background: var(--yellow); }
.status-green { background: var(--green); }

.positions-section { padding: 30px 0 0; }
.positions-heading { margin-bottom: 18px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.segmented { display: flex; height: 36px; border: 1px solid #ddd; border-radius: 5px; overflow: hidden; flex: none; }
.segment { border: 0; border-right: 1px solid #ddd; background: #fff; color: #666; font-size: 11px; font-weight: 700; padding: 0 13px; white-space: nowrap; }
.segment:last-child { border-right: 0; }
.segment:hover { background: #f8f8f8; }
.segment.is-active { background: #232323; color: #fff; }
.search-wrap { position: relative; flex: 1 1 220px; min-width: 180px; }
.search-wrap svg { position: absolute; left: 11px; top: 10px; color: #999; width: 16px; height: 16px; }
.search-wrap input { width: 100%; padding: 0 11px 0 35px; font-size: 12px; }
.toolbar > select { min-width: 150px; max-width: 200px; font-size: 11px; }
.table-info { display: flex; justify-content: space-between; gap: 12px; padding: 18px 1px 10px; color: #777; font-size: 11px; }
.table-info span:last-child { font-variant-numeric: tabular-nums; }
.table-scroll { width: 100%; overflow: auto; border-top: 1px solid var(--line); }
.data-table { width: 100%; min-width: 1250px; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 11px; }
.data-table th { position: sticky; top: 0; z-index: 2; height: 39px; background: #f5f5f5; border-bottom: 1px solid #ddd; color: #616161; font-size: 10px; font-weight: 750; white-space: nowrap; padding: 0 11px; }
.data-table th[data-sort] { cursor: pointer; user-select: none; }
.data-table th[data-sort]:hover { color: #111; }
.data-table th svg { width: 11px; height: 11px; margin-left: 3px; vertical-align: -2px; color: #a0a0a0; }
.data-table td { height: 43px; border-bottom: 1px solid #ededed; padding: 7px 11px; vertical-align: middle; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: #faf7f7; }
.data-table th.article-col, .data-table td.article-col { position: sticky; left: 0; z-index: 1; background: #fff; font-weight: 750; width: 134px; min-width: 134px; }
.data-table th.article-col { z-index: 3; background: #f5f5f5; }
.data-table tbody tr:hover td.article-col { background: #faf7f7; }
.data-table td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.comment-cell { max-width: 220px; color: #666; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 10px; font-weight: 700; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--status-color); }
.empty-row td { text-align: center; color: #999; height: 90px; }
.table-footer { min-height: 56px; display: flex; align-items: center; justify-content: space-between; color: #777; font-size: 11px; }
.pager { display: flex; gap: 5px; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(10,10,10,.4); z-index: 19; }
.detail-drawer { position: fixed; z-index: 20; right: 0; top: 0; bottom: 0; width: min(470px, 100vw); overflow: auto; padding: 24px 28px 40px; background: #fff; box-shadow: -15px 0 50px rgba(0,0,0,.12); transform: translateX(103%); transition: transform .22s cubic-bezier(.2,0,0,1); }
.detail-drawer.is-open { transform: translateX(0); }
.drawer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.drawer-title { font-size: 20px; line-height: 1.25; margin: 0 0 6px; }
.drawer-article { color: #777; font-size: 12px; font-weight: 700; margin-bottom: 20px; }
.drawer-status { margin: 0 0 25px; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; }
.drawer-label { display: block; color: #888; font-size: 10px; font-weight: 650; margin-bottom: 6px; }
.drawer-number { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.drawer-section { margin-top: 25px; }
.drawer-section h3 { font-size: 12px; margin-bottom: 14px; }
.expense-row { display: grid; grid-template-columns: 76px 1fr 68px; align-items: center; gap: 10px; font-size: 11px; margin-bottom: 10px; }
.expense-track { height: 7px; background: #eee; border-radius: 2px; overflow: hidden; }
.expense-fill { height: 100%; background: var(--red); display: block; }
.expense-value { text-align: right; font-variant-numeric: tabular-nums; }
.note-box { background: #f6f6f6; border-left: 3px solid #d3d3d3; padding: 12px 13px; margin-top: 11px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.note-box.current { border-color: #9bc3df; }
.note-box.previous { border-color: #e2c962; }
.note-box .drawer-label { margin-bottom: 5px; }
.edit-fields { display: grid; gap: 11px; margin-top: 12px; }
.edit-fields input, .edit-fields textarea { width: 100%; border: 1px solid #d9d9d9; border-radius: 5px; background: #fff; padding: 9px 10px; font-size: 12px; color: var(--ink); }
.edit-fields textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.edit-fields .button { justify-self: start; }
.auth-screen { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #1d1c1c; padding: 20px; }
.auth-panel { width: min(400px, 100%); background: #fff; border-top: 4px solid var(--red); padding: 30px; box-shadow: 0 18px 55px rgba(0,0,0,.2); }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; font-size: 28px; font-weight: 900; line-height: .9; }
.auth-brand span { color: var(--red); }
.auth-brand small { margin-top: 6px; font-size: 18px; font-weight: 700; line-height: 1; }
.auth-kicker { font-size: 10px; font-weight: 800; color: #888; margin-top: 7px; }
.auth-panel h2 { font-size: 23px; margin: 29px 0 20px; }
.form-field { display: grid; gap: 6px; color: #555; font-size: 11px; font-weight: 700; }
.form-field input, .form-field select { width: 100%; min-height: 38px; border: 1px solid #d9d9d9; border-radius: 5px; padding: 7px 10px; font-size: 13px; color: var(--ink); background: #fff; }
.auth-panel form { display: grid; gap: 15px; }
.auth-submit { margin-top: 5px; width: 100%; height: 40px; }
.form-error { min-height: 16px; color: #b6202d; font-size: 11px; line-height: 1.4; }
.modal-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.48); display: grid; place-items: center; padding: 16px; }
.users-dialog { width: min(620px, 100%); max-height: min(720px, calc(100vh - 32px)); overflow: auto; background: #fff; border-top: 4px solid var(--red); padding: 24px; box-shadow: 0 18px 55px rgba(0,0,0,.2); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.dialog-head h2 { font-size: 18px; margin: 5px 0 0; }
.users-list { display: grid; }
.user-row { display: grid; grid-template-columns: minmax(80px, 1fr) 140px auto; align-items: center; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.user-name { font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.user-login { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.user-row select { min-width: 0; width: 100%; }
.user-actions { display: flex; gap: 5px; }
.user-actions .button { width: 32px; min-width: 32px; height: 32px; padding: 0; }
.user-password { grid-column: 1 / -1; width: 100%; min-height: 35px; border: 1px solid #d9d9d9; border-radius: 5px; padding: 7px 10px; font-size: 12px; }
.section-access { display: flex; flex-wrap: wrap; gap: 8px 16px; grid-column: 1 / -1; border: 0; padding: 0; margin: 0; font-size: 13px; }
.section-access legend { color: #555; font-weight: 700; margin-bottom: 6px; }
.section-access label { display: inline-flex; align-items: center; gap: 5px; }
.section-access input { accent-color: var(--red); }
.user-row .manager-assignment { grid-column: 1 / -1; }
.manager-link { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.manager-link a { color: var(--red-dark); }
.create-user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 21px; }
.create-user-form h3 { grid-column: 1 / -1; font-size: 13px; margin: 0; }
.create-user-form .login-preview { grid-column: 1 / -1; }
.login-preview input { background: var(--soft); color: #555; }
.create-user-form .password-field { grid-column: 1 / -1; }
.password-controls { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 38px); gap: 6px; align-items: center; }
.password-controls input { min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.password-controls .button { min-width: 38px; width: 38px; height: 38px; padding: 0; }
.created-credentials { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.created-username { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.password-result { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 6px; }
.password-result input { min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.password-result .button { width: 38px; min-width: 38px; height: 38px; padding: 0; }
.create-user-form .button { align-self: end; }
.toast { position: fixed; bottom: 22px; right: 22px; z-index: 30; max-width: min(400px, calc(100vw - 36px)); background: #202020; color: #fff; padding: 12px 16px; border-radius: 5px; font-size: 12px; line-height: 1.4; box-shadow: 0 8px 28px rgba(0,0,0,.15); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #ab2130; }

@media (max-width: 1180px) {
  .breakdown-grid { grid-template-columns: 1fr; }
  .breakdown-panel { padding-right: 0; }
  .breakdown-panel + .breakdown-panel { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .kpi-value { font-size: 21px; }
}
@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { min-height: 0; height: 56px; padding: 0 16px; flex-direction: row; align-items: center; justify-content: space-between; position: sticky; z-index: 10; }
  .brand { padding: 0; }
  .brand-word { font-size: 20px; }
  .sidebar-rule, .sidebar-caption, .sidebar-bottom { display: none; }
  .brand-small { font-size: 9px; margin-top: 2px; }
  .side-nav { display: flex; gap: 2px; }
  .nav-link { min-height: 38px; padding: 0 10px; font-size: 11px; }
  .nav-link svg { width: 15px; height: 15px; }
  .nav-section { width: 40px; justify-content: center; }
  .nav-section span { display: none; }
  .nav-subnav { display: flex; }
  .nav-sublink { width: 40px; min-height: 38px; justify-content: center; padding: 0; }
  .nav-sublink span { display: none; }
  .nav-sublink:first-child { display: none; }
  .logout-mobile { display: flex; }
  .topbar { display: none; }
  .content { padding: 22px 20px 38px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .head-actions { justify-content: flex-start; }
  .kpi-band { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .sidebar { padding: 0 12px; }
  .side-nav { gap: 0; }
  .nav-link span { display: none; }
  .nav-link, .nav-section, .nav-sublink { width: 34px; min-height: 34px; justify-content: center; padding: 0; }
  .content { padding: 18px 15px 28px; }
  h1 { font-size: 23px; }
  .page-head { gap: 18px; }
  .head-actions { width: 100%; }
  .field-inline { flex: 1; }
  .field-inline select { flex: 1; min-width: 0; }
  .button-primary span { display: none; }
  .kpi { padding: 16px 14px; }
  .kpi-label { font-size: 10px; }
  .kpi-value { font-size: 19px; }
  .chart-legend { gap: 10px; font-size: 10px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-head.compact { flex-direction: row; }
  .manager-row { grid-template-columns: 100px 1fr 85px; gap: 8px; font-size: 11px; }
  .status-list { gap: 10px; }
  .positions-heading { flex-direction: row; align-items: center; }
  .positions-heading .button span { display: none; }
  .toolbar .segmented, .search-wrap { width: 100%; flex: 1 1 100%; }
  .segment { flex: 1; }
  .toolbar > select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .detail-drawer { padding: 20px 18px 34px; }
  .auth-panel { padding: 24px; }
  .users-dialog { padding: 18px; }
  .user-row { grid-template-columns: minmax(70px, 1fr) 120px auto; gap: 5px; }
  .create-user-form { grid-template-columns: 1fr; }
  .create-user-form h3 { grid-column: 1; }
}

.lw-dashboard { margin-top: 16px; }
.lw-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lw-periods { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; width: max-content; }
.lw-period { border: 0; border-right: 1px solid var(--line); background: #fff; color: #555; padding: 10px 16px; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
.lw-period:last-child { border-right: 0; }
.lw-period:hover { background: #f6f6f6; }
.lw-period.is-active { background: #d52735; color: #fff; font-weight: 700; }
.lw-source { display: inline-flex; align-items: center; gap: 7px; color: #555; text-decoration: none; font-size: 13px; white-space: nowrap; }
.lw-source:hover { color: #d52735; }
.lw-source svg { width: 15px; height: 15px; }
.lw-snapshot-note { color: #777; font-size: 12px; margin: 12px 0 22px; }
.lw-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lw-kpi { min-width: 0; padding: 22px 18px; border-right: 1px solid var(--line); }
.lw-kpi:first-child { padding-left: 0; }
.lw-kpi:last-child { border-right: 0; }
.lw-kpi-label { font-size: 12px; font-weight: 700; color: #666; text-transform: uppercase; }
.lw-kpi-value { margin-top: 10px; font-size: 27px; line-height: 1.1; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw-kpi-detail { margin-top: 8px; font-size: 12px; color: #777; }
.lw-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.lw-panel { min-width: 0; padding: 28px 0; }
.lw-grid .lw-panel:first-child { padding-right: 30px; border-right: 1px solid var(--line); }
.lw-grid .lw-panel:last-child { padding-left: 30px; }
.lw-legend { display: flex; gap: 14px; color: #777; font-size: 12px; }
.lw-legend span { display: inline-flex; gap: 6px; align-items: center; }
.lw-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lw-dot.actual { background: #d52735; }.lw-dot.plan { background: #255d9b; }
.lw-chart svg { display: block; width: 100%; height: auto; max-height: 300px; margin-top: 16px; overflow: visible; }
.lw-chart text { fill: #8a8a8a; font-size: 13px; font-family: inherit; }
.lw-axis { stroke: #aaa; stroke-width: 1; }.lw-gridline { stroke: #e5e5e5; stroke-width: 1; }
.lw-line-plan, .lw-line-actual { fill: none; stroke-linejoin: round; stroke-linecap: round; stroke-width: 3; }
.lw-line-plan { stroke: #255d9b; }.lw-line-actual { stroke: #d52735; }
.lw-point-plan { fill: #fff; stroke: #255d9b; stroke-width: 2; }.lw-point-actual { fill: #fff; stroke: #d52735; stroke-width: 2; }
.lw-chart-caption { color: #666; font-size: 12px; margin-top: 4px; }
.lw-assets { display: flex; justify-content: space-between; gap: 10px; padding: 18px 0; border-bottom: 1px solid var(--line); color: #666; font-size: 13px; }
.lw-assets strong { color: #222; font-size: 17px; font-variant-numeric: tabular-nums; }
.lw-balance-row { padding-top: 16px; }
.lw-balance-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.lw-balance-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw-track { height: 5px; background: #eee; margin-top: 8px; }
.lw-track span { display: block; height: 100%; background: #d52735; }
.lw-balance-row:nth-child(3) .lw-track span { background: #255d9b; }.lw-balance-row:nth-child(4) .lw-track span { background: #e0a42b; }
.lw-table-panel { padding-top: 27px; }
.lw-table-scroll { overflow-x: auto; margin-top: 18px; }
.lw-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.lw-table th, .lw-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.lw-table th:first-child, .lw-table td:first-child { text-align: left; }
.lw-table thead th { color: #777; font-weight: 600; }
.lw-table tbody tr { cursor: pointer; }.lw-table tbody tr:hover, .lw-table tbody tr.is-selected { background: #fff2f3; }
.lw-table tbody tr:focus-visible { outline: 2px solid #d52735; outline-offset: -2px; }
@media (max-width: 1050px) { .lw-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }.lw-kpi:nth-child(2) { border-right: 0; }.lw-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.lw-kpi:nth-child(3) { padding-left: 0; }.lw-grid { grid-template-columns: 1fr; }.lw-grid .lw-panel:first-child { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line); }.lw-grid .lw-panel:last-child { padding-left: 0; } }
@media (max-width: 560px) { .lw-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }.lw-period { padding: 9px 12px; }.lw-kpi { padding: 17px 10px; }.lw-kpi-value { font-size: 20px; }.lw-kpi-detail { font-size: 11px; }.lw-assets { flex-wrap: wrap; }.lw-chart svg { max-height: 220px; } }

.lw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; margin-bottom: 8px; }
.lw-tab { flex: 0 0 auto; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #666; padding: 13px 14px 11px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.lw-tab:hover { color: #222; background: #f7f7f7; }
.lw-tab.is-active { color: #d52735; border-bottom-color: #d52735; font-weight: 700; }
.lw-detail-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 25px 0 23px; border-bottom: 1px solid var(--line); }
.lw-detail-intro h2 { margin: 6px 0 0; font-size: 26px; line-height: 1.2; }
.lw-hero-value { text-align: right; font-size: 27px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw-hero-value small { display: block; color: #777; font-size: 12px; font-weight: 400; margin-top: 5px; }
.lw-context { color: #777; font-size: 13px; line-height: 1.5; margin: 13px 0 0; }
.lw-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.lw-detail-panel { min-width: 0; padding: 27px 0 30px; }
.lw-detail-grid .lw-detail-panel:first-child { border-right: 1px solid var(--line); padding-right: 30px; }
.lw-detail-grid .lw-detail-panel:last-child { padding-left: 30px; }
.lw-detail-panel h2 { font-size: 19px; margin: 5px 0 18px; line-height: 1.25; }
.lw-full-panel { border-bottom: 1px solid var(--line); }
.lw-bars { display: grid; gap: 15px; }
.lw-bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 13px; }
.lw-bar-label span { color: #555; min-width: 0; overflow-wrap: anywhere; }
.lw-bar-label strong { color: #222; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw-bar-track { height: 6px; background: #ebebeb; margin-top: 6px; }
.lw-bar-track span { display: block; height: 100%; background: #d52735; }
.lw-bar-row:nth-child(even) .lw-bar-track span { background: #255d9b; }
.lw-detail-panel .lw-table-scroll { margin-top: 4px; }
.lw-turnover { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.lw-turnover > div { padding: 15px 18px; border-right: 1px solid var(--line); min-width: 0; }
.lw-turnover > div:first-child { padding-left: 0; }.lw-turnover > div:last-child { border-right: 0; }
.lw-turnover span { display: block; color: #666; font-size: 12px; line-height: 1.3; }
.lw-turnover strong { display: block; margin-top: 7px; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw-turnover > div:nth-child(1) strong { color: #27815f; }.lw-turnover > div:nth-child(2) strong { color: #ac741a; }.lw-turnover > div:nth-child(3) strong { color: #d52735; }
.lw-clients-table th:nth-child(-n+4), .lw-clients-table td:nth-child(-n+4) { text-align: left; }
.lw-clients-table td:nth-child(2) { min-width: 200px; white-space: normal; }
@media (max-width: 1100px) { .lw-detail-grid { grid-template-columns: 1fr; }.lw-detail-grid .lw-detail-panel:first-child { border-right: 0; border-bottom: 1px solid var(--line); padding-right: 0; }.lw-detail-grid .lw-detail-panel:last-child { padding-left: 0; } }
@media (max-width: 620px) { .lw-detail-intro { align-items: flex-start; flex-direction: column; gap: 12px; }.lw-detail-intro h2 { font-size: 22px; }.lw-hero-value { text-align: left; font-size: 22px; white-space: normal; }.lw-tab { padding: 11px 12px 9px; font-size: 13px; }.lw-detail-panel h2 { font-size: 17px; }.lw-turnover { grid-template-columns: repeat(2, minmax(0, 1fr)); }.lw-turnover > div { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 0; }.lw-turnover strong { font-size: 14px; } }
