:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080b0b;
  color: #f4f5f5;
  --bg: #080b0b;
  --sidebar: #0d1112;
  --panel: #101418;
  --line: #252c31;
  --muted: #8f989e;
  --mint: #74dcba;
  --red: #ff8f98;
  --blue: #73a7ff;
  --amber: #e4be5c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
}

.mobile-topbar,
.nav-backdrop,
.mobile-sort-controls { display: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  border-right: 1px solid #23292d;
  background: var(--sidebar);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.sidebar-brand strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #33433f;
  border-radius: 14px;
  background: #14201d;
  color: #75dfbb;
  font-size: 24px;
  font-weight: 700;
}

.eyebrow {
  margin: 0;
  color: #8a9399;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

nav { display: grid; gap: 8px; }

.nav-item {
  padding: 12px;
  border-radius: 10px;
  color: #d6d9db;
}

.nav-item.active {
  background: #17211f;
  color: #7be1be;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.user-email {
  overflow: hidden;
  color: #8a9399;
  font-size: 13px;
  text-overflow: ellipsis;
}

.content {
  width: 100%;
  max-width: 1540px;
  padding: 36px 44px 60px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

h1 { margin: 8px 0 0; font-size: 32px; }
h2 { margin: 0; font-size: 21px; }
h3 { margin: 0; font-size: 13px; }

.picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.picker-label {
  color: var(--muted);
  font-size: 13px;
}

.month-picker {
  display: grid;
  min-width: 230px;
  gap: 6px;
}

.month-input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #30383e;
  border-radius: 10px;
  outline: none;
  background: #0b1012;
  color: #eef0f1;
  color-scheme: dark;
  font-weight: 600;
  cursor: pointer;
}

.month-input:focus-visible {
  border-color: #5bc9a4;
  box-shadow: 0 0 0 3px #16352c;
}

.month-input[hidden],
.finance-form input[type="month"][hidden] { display: none; }

.month-control { position: relative; display: inline-flex; width: 100%; min-width: 0; }
.month-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #46545c;
  border-radius: 12px;
  background: #111a1f;
  color: #f4f6f7;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}
.month-trigger:hover { border-color: #6a807d; }
.month-trigger:focus-visible,
.month-clear:focus-visible,
.month-popover button:focus-visible {
  outline: 2px solid #a6dbff;
  outline-offset: 2px;
}
.month-trigger:disabled { opacity: .5; cursor: not-allowed; }
.month-trigger-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-trigger-icon { display: block; flex: none; width: 20px; height: 20px; background: #72d8b7; mask: url("calendar.2d9dcfbaf575.svg") center / contain no-repeat; }
.month-control.has-clear .month-trigger { padding-right: 48px; }
.month-clear {
  position: absolute;
  top: 50%;
  right: 38px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #aeb8bd;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.month-clear:hover { background: #29343a; color: #fff; }
.month-clear[hidden] { display: none; }

.month-popover {
  position: fixed;
  z-index: 1100;
  display: grid;
  gap: 12px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #52616b;
  border-radius: 18px;
  background: #232c32;
  box-shadow: 0 20px 45px #0009;
  color: #f4f6f7;
}
.month-popover[hidden] { display: none; }
.month-popover-year { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; }
.month-popover-year strong { font-size: 18px; text-align: center; }
.month-year-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #46545c;
  border-radius: 11px;
  background: #172127;
  color: #f4f6f7;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.month-year-arrow:disabled { opacity: .35; cursor: not-allowed; }
.month-popover-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 4px; }
.month-popover-grid button {
  min-width: 0;
  min-height: 40px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #f4f6f7;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}
.month-popover-grid button:hover:not(:disabled) { background: #31413f; }
.month-popover-grid button.selected { border-color: #98ddc6; background: #234a3d; }
.month-popover-grid button:disabled { color: #879096; cursor: not-allowed; }
.month-apply {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: #6dd5b4;
  color: #0c2220;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
}
.month-apply:hover:not(:disabled) { background: #84e0c2; }
.month-apply:disabled { opacity: .5; cursor: not-allowed; }

.select-menu {
  position: relative;
  min-width: 190px;
}

.select-menu[open] { z-index: 50; }

.select-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 46px;
  padding: 0 15px 0 17px;
  border: 1px solid #293137;
  border-radius: 12px;
  outline: none;
  background: #101518;
  color: #d9dddf;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.select-menu summary::-webkit-details-marker { display: none; }

.select-menu summary:hover {
  border-color: #3e4b50;
  background: #141b1e;
}

.select-menu summary:focus-visible,
.select-menu[open] summary {
  border-color: #5bc9a4;
  box-shadow: 0 0 0 3px #16352c;
}

.select-chevron {
  width: 9px;
  height: 9px;
  border-right: 1.5px solid #aeb6ba;
  border-bottom: 1.5px solid #aeb6ba;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .16s ease;
}

.select-menu[open] .select-chevron {
  transform: translateY(2px) rotate(225deg);
}

.select-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: max(100%, 220px);
  max-height: 330px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #303a3f;
  border-radius: 13px;
  background: #11171a;
  box-shadow: 0 18px 48px #000a;
}

.select-options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #d9dddf;
  text-decoration: none;
  white-space: nowrap;
}

.select-options a:hover,
.select-options a:focus-visible {
  outline: none;
  background: #1a2423;
  color: #f4f5f5;
}

.select-options a.selected {
  background: #182824;
  color: var(--mint);
}

.select-check {
  color: var(--mint);
  font-size: 14px;
}

.store-select { min-width: 270px; }

@media (prefers-reduced-motion: reduce) {
  .select-chevron { transition: none; }
}

.section-tabs {
  display: flex;
  grid-auto-flow: column;
  justify-content: start;
  gap: 28px;
  margin-top: 28px;
  border-bottom: 1px solid var(--line);
}

.section-tabs a {
  padding: 0 2px 13px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

.section-tabs a:hover { color: #d9dddf; }

.section-tabs a.active {
  border-color: var(--mint);
  color: var(--mint);
}

.data-line {
  margin: 22px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.data-warning {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #564929;
  border-radius: 10px;
  background: #252116;
  color: #efd184;
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  min-width: 0;
  min-height: 166px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-comparison {
  min-height: 18px;
  line-height: 1.35;
}

.metric-card strong {
  display: block;
  margin: 28px 0 18px;
  font-size: clamp(23px, 2vw, 30px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.primary-card strong { font-size: clamp(27px, 2.4vw, 36px); }
.positive { color: var(--mint) !important; }
.negative { color: var(--red) !important; }

.progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #30383d;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
}

.factor-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.factor-strip div {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.factor-strip div:last-child { border-right: 0; }

.factor-strip span {
  display: block;
  min-height: 30px;
  margin-bottom: 8px;
  color: #7f898f;
  font-size: 12px;
}

.factor-strip strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.factor-strip .metric-comparison {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 22px 24px;
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(430px, .85fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.chart-container {
  min-height: 320px;
  padding: 0 18px 20px;
  overflow-x: auto;
}

.chart-container svg {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  overflow: hidden;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 24px 12px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }

.chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 3px;
}

.legend-current { background: var(--mint); }
.legend-average {
  height: 0 !important;
  border-top: 2px dashed #667178;
  background: transparent;
}
.legend-previous { background: #667178; }
.legend-drop { background: var(--red); }
.legend-spike { background: var(--blue); }

.chart-grid { stroke: #293137; stroke-width: 1; }
.chart-axis { fill: #aebbc1; font: 12px Inter, sans-serif; }
.chart-line { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-baseline { stroke: #737d83; stroke-width: 1.5; stroke-dasharray: 7 7; opacity: .75; }
.chart-threshold { stroke-width: 1; stroke-dasharray: 4 7; opacity: .24; }
.chart-threshold.drop { stroke: var(--red); }
.chart-threshold.spike { stroke: var(--blue); }
.chart-threshold-label { font: 12px Inter, sans-serif; opacity: .9; }
.chart-threshold-label.drop { fill: var(--red); }
.chart-threshold-label.spike { fill: var(--blue); }
.chart-line-drop { stroke: var(--red); stroke-width: 3.4; stroke-linecap: round; }
.chart-line-spike { stroke: var(--blue); stroke-width: 3.4; stroke-linecap: round; }
.chart-point { fill: var(--mint); stroke: #11251f; stroke-width: 4; }
.chart-point.drop { fill: var(--red); stroke: #32191d; }
.chart-point.spike { fill: var(--blue); stroke: #152440; }
.chart-hit-target { fill: transparent; stroke: none; cursor: pointer; }
.chart-container [tabindex="0"]:focus { outline: none; }
.chart-container [tabindex="0"]:focus .chart-point { stroke: #fff; stroke-width: 6; }
.chart-container rect[tabindex="0"]:focus { stroke: #fff; stroke-width: 2; }
.chart-bar-positive { fill: #67c9a8; }
.chart-bar-negative { fill: #e67f88; }
.chart-bar-previous { fill: #75848c; }
.chart-value { fill: #d9dddf; font: 12px Inter, sans-serif; }
.chart-value.previous { fill: #b7c3c8; font-size: 12px; }
.chart-value.negative { fill: var(--red); }
.chart-empty { margin: 100px 0; color: var(--muted); text-align: center; }

.chart-readout {
  min-height: 20px;
  margin: 10px 6px 0;
  color: #cbd0d2;
  font-size: 12px;
  line-height: 1.4;
}

.stores-panel { margin-top: 0; }
.table-wrap { overflow-x: auto; }
.stores-table { min-width: 1740px; }
.stores-sticky-head {
  position: fixed;
  z-index: 55;
  overflow-x: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 18px #0008;
  pointer-events: none;
  scrollbar-width: none;
}
.stores-sticky-head table { width: max-content; table-layout: fixed; }
.stores-sticky-head th { background: var(--panel); }
.stores-sticky-head th:first-child { z-index: 2; }

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  color: #7f898f;
  font-size: 12px;
  font-weight: 600;
}

td {
  color: #d9dddf;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.store-sales-value,
.store-sales-change {
  display: block;
}

.store-sales-change {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.2;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--panel);
  text-align: left;
}

.sort-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

.sort-button::after {
  content: "↕";
  margin-left: 6px;
  color: #59636a;
}

.sort-button[data-direction="asc"]::after { content: "↑"; color: var(--mint); }
.sort-button[data-direction="desc"]::after { content: "↓"; color: var(--mint); }

.pnl-picker {
  justify-content: flex-end;
  margin-bottom: 16px;
}

.pnl-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.pnl-kpis .metric-card { min-height: 140px; }
.pnl-kpis .metric-card strong { margin-bottom: 0; }

.pnl-grid {
  display: grid;
  grid-template-columns: minmax(480px, 1.15fr) minmax(340px, .85fr);
  gap: 18px;
  align-items: start;
}

.statement-group {
  padding: 0 24px 18px;
}

.statement-group + .statement-group {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.statement-group h3 {
  margin-bottom: 8px;
  color: #7f898f;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.statement-row,
.expense-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  color: #cbd0d2;
}

.statement-row strong,
.expense-row strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.statement-row.deduction strong { color: #aeb6ba; }

.statement-row.subtotal {
  margin-top: 4px;
  border-top: 1px solid #30383d;
  font-weight: 700;
}

.statement-row.total {
  color: var(--mint);
  font-size: 18px;
  font-weight: 700;
}

.result-group { padding-bottom: 22px; }
.expense-column { display: grid; gap: 18px; }

.expense-group {
  padding: 0 24px 18px;
}

.expense-group + .expense-group {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.expense-group h3 {
  margin-bottom: 4px;
  color: #9ca5aa;
}

.expense-row {
  padding: 9px 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  display: grid;
  place-items: center;
  max-width: 760px;
  margin: 120px auto 0;
  padding: 64px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  text-align: center;
}

.empty-state h2 { margin: 20px 0 0; font-size: 24px; }
.empty-icon { color: var(--mint); font-size: 32px; }

.auth-page {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.auth-card .brand-mark { margin-bottom: 28px; }
.auth-card h1 { margin: 8px 0; }
.muted { margin: 0 0 28px; color: var(--muted); }
.auth-form { display: grid; gap: 10px; }
.auth-form label { margin-top: 8px; color: #b7bdc1; font-size: 13px; }

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #30383e;
  border-radius: 9px;
  outline: none;
  background: #0b0f11;
  color: #f4f5f5;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: #5bc9a4;
  box-shadow: 0 0 0 3px #16352c;
}

button {
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  border-radius: 9px;
  background: #72d7b2;
  color: #07100d;
  font-weight: 700;
}

.auth-form button { margin-top: 18px; }
.auth-return { margin-top: 18px; margin-bottom: 0; }

button.secondary {
  width: 100%;
  border: 1px solid #30383e;
  background: transparent;
  color: #d6d9db;
}

.error {
  margin-bottom: 18px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #351c1f;
  color: #ffafb6;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .content { padding-right: 28px; padding-left: 28px; }
  .charts-grid { grid-template-columns: 1fr; }
  .metric-card { padding-right: 16px; padding-left: 16px; }
  .pnl-grid { grid-template-columns: minmax(0, 1fr); }
}

.header-actions {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid #30383e;
  border-radius: 10px;
  color: #d6d9db;
  text-decoration: none;
  white-space: nowrap;
}

.action-link:hover,
.action-link:focus-visible {
  border-color: #4a595e;
  outline: none;
  background: #141a1d;
  color: #fff;
}

a.nav-item { text-decoration: none; }

.finance-content { max-width: 1680px; }
.editor-tabs { gap: 22px; overflow-x: auto; }
.expense-type-tabs { display: flex; gap: 8px; width: fit-content; margin-top: 18px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #101719; }
.expense-type-tabs a { min-height: 40px; padding: 10px 16px; border-radius: 9px; color: var(--muted); text-decoration: none; }
.expense-type-tabs a.active { background: #223b32; color: var(--mint); }
.editor-panel { overflow: visible; margin-top: 22px; }
.editor-heading { align-items: center; }
.editor-heading .eyebrow { margin-bottom: 7px; }
.editor-heading button.secondary { width: auto; }

.finance-form input[type="text"],
.finance-form input[type="date"],
.finance-form input[type="month"] {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #30383e;
  border-radius: 10px;
  outline: none;
  background: #0b1012;
  color: #eef0f1;
  color-scheme: dark;
}

.finance-form input:focus {
  border-color: #5bc9a4;
  box-shadow: 0 0 0 3px #16352c;
}

.finance-form input:disabled { opacity: .45; }
.money-field { max-width: 190px; text-align: right; font-variant-numeric: tabular-nums; }
.date-field { max-width: 180px; }

.editor-table th:first-child,
.editor-table td:first-child { min-width: 190px; }

.editor-table td { vertical-align: middle; }
.payroll-method-table { min-width: 640px; }
.payroll-method-table .payroll-method-select { max-width: 220px; }
.payroll-method-table th:nth-child(2),
.payroll-method-table td:nth-child(2) { text-align: left; }
.editor-table tfoot th,
.editor-table tfoot td { border-top-color: #3a444a; }

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.check-control input { accent-color: var(--red); }

.editor-grid {
  display: grid;
  gap: 14px;
  padding: 0 24px 24px;
}

.rates-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.field-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0c1114;
}

.field-card h3 { color: #e5e8e9; font-size: 16px; }
.field-card label,
.form-grid label,
.category-create label,
.reason-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #919ba1;
  font-size: 12px;
}

.field-error {
  color: var(--red);
  font-size: 10px;
  line-height: 1.35;
}

.form-select { width: 100%; min-width: 0; }
.form-select summary { min-height: 46px; background: #0b1012; }
.form-select .select-options { right: auto; left: 0; min-width: 100%; }

.select-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 8px;
  background: transparent;
  color: #d9dddf;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.select-options button:hover,
.select-options button:focus-visible {
  outline: none;
  background: #1a2423;
}

.select-options button.selected { background: #182824; color: var(--mint); }

.expense-editor-list { display: grid; }
.expense-category-heading { padding: 18px 24px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.expense-editor-row { position: relative; padding: 20px 24px; border-top: 1px solid var(--line); }
.expense-editor-row > .muted { margin: 12px 0 0; font-size: 12px; }
.expense-editor-row:focus-within { z-index: 2; }
.expense-editor-row.is-removing { background: #241719; opacity: .72; }
.expense-editor-row.is-locked input[readonly] { color: #a5adb1; cursor: default; }
.expense-editor-row.is-locked .form-select { pointer-events: none; opacity: .72; }
.finance-form [hidden] { display: none !important; }
.expense-row-title { margin-bottom: 0; }
.expense-editor-row [data-row-edit-fields],
.expense-editor-row [data-row-stop-fields] { margin-top: 16px; }
.expense-editor-row [data-row-edit-help] { margin-top: 12px; }
.stop-fields { display: flex; align-items: end; gap: 12px; }
.stop-fields label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.stop-fields input { width: 190px; }
.expense-filter { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.expense-filter select { min-width: 210px; min-height: 44px; padding: 0 40px 0 12px; border: 1px solid var(--line); border-radius: 10px; appearance: none; background: #0b1012 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23b9c5ca' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px; color: #eef0f1; }
.expense-heading-actions { display: flex; align-items: end; gap: 12px; }
.expense-add-button { width: 44px; min-width: 44px; height: 44px; padding: 0; font-size: 26px; line-height: 1; }
.expense-add-dialog { width: min(1000px, calc(100% - 32px)); max-width: none; max-height: min(90dvh, 720px); margin: auto; padding: 0; overflow-y: auto; border: 1px solid #45544d; border-radius: 18px; background: var(--panel); color: #eef0f1; box-shadow: 0 24px 70px #000b; }
.expense-add-dialog::backdrop { background: #000b; }
.expense-dialog-heading { position: relative; padding: 22px 68px 22px 24px; }
.expense-dialog-heading h2 { margin: 0; }
button.expense-dialog-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 36px; min-width: 36px; min-height: 36px; padding: 0; }
.expense-dialog-close svg { width: 16px; height: 16px; }
.expense-dialog-error { margin: 0 24px 18px; }
.expense-add-dialog .panel-form { padding: 0 24px 20px; }
.expense-add-dialog .six-columns,
.expense-add-dialog .five-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.expense-add-dialog .category-create { margin: 0 24px 20px; }
.expense-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
.expense-dialog-actions button.secondary { width: auto; }
.filter-notice { margin: 0 24px 12px; color: var(--mint); font-size: 13px; }
.rates-actions { display: flex; align-items: center; gap: 12px; }
.rates-effective-date { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.rates-effective-date .date-field { width: 180px; }
.rates-editor.is-locked input:not([type='hidden']) { pointer-events: none; color: #c4cbcc; }
.rates-assignments.is-locked .form-select { pointer-events: none; opacity: .75; }

.expense-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 0;
}

.row-actions { display: flex; gap: 9px; }
.row-actions button.secondary { width: auto; }
.remove-button {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.remove-button:hover,
.remove-button:focus-visible { color: #ffc0c4; outline: none; text-decoration: underline; }
.remove-button:disabled { cursor: default; opacity: .35; text-decoration: none; }

.form-grid { display: grid; gap: 12px; align-items: end; }
.six-columns { grid-template-columns: minmax(170px, 1.1fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(130px, .8fr) minmax(165px, 1fr) minmax(0, 1fr); }
.five-columns { grid-template-columns: 150px 1fr 1fr 150px 1fr; }
.panel-form { padding: 0 24px 24px; }
.add-panel { border-style: dashed; }
.list-order { color: var(--muted); font-size: 12px; }
.empty-inline { margin: 0; padding: 24px; color: var(--muted); }

.category-create {
  display: flex;
  align-items: end;
  gap: 16px;
  margin: 18px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0d1215;
}

.category-create label { width: 320px; }
.category-create span { padding-bottom: 13px; color: var(--muted); font-size: 12px; }

.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  display: flex;
  align-items: end;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #33423e;
  border-radius: 14px;
  background: #111817f2;
  box-shadow: 0 14px 40px #0008;
  backdrop-filter: blur(12px);
}
.save-bar.is-pristine { display: none; }
.save-reason { flex: 1; min-width: 0; }
.save-reason summary { display: none; }
.tabs-scroll-hint { display: none; }

.reason-field { flex: 1; }
.reason-field.has-error input,
.reason-field input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px #481f25;
}
.save-bar .primary { min-height: 46px; padding: 0 22px; }

.form-message {
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 13px;
}

.form-message.error { border-color: #65353b; }
.form-message.success { border-color: #295443; background: #12261f; color: var(--mint); }

.confirmation-page {
  display: grid;
  min-width: 0;
  min-height: 100vh;
  place-items: start center;
  padding: 60px 32px;
}

.confirmation-card { width: min(100%, 980px); padding: 34px; }
.confirmation-card h1 { margin-bottom: 12px; }
.confirmation-count { margin: 0 0 24px; color: var(--muted); }
.confirmation-count strong { color: #fff; }
.confirmation-list { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.confirmation-item { padding: 17px 18px; border-top: 1px solid var(--line); }
.confirmation-item:first-child { border-top: 0; }
.confirmation-item > div:first-child { display: flex; justify-content: space-between; gap: 20px; }
.confirmation-item > div:first-child span { color: var(--muted); font-size: 12px; }

.change-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.change-values i { color: #536068; font-style: normal; text-align: center; }
.change-values strong { color: var(--mint); }
.confirmation-reason { display: grid; gap: 6px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.confirmation-reason strong { color: #d9dddf; font-size: 14px; }
.confirmation-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.confirmation-actions form { margin: 0; }
.confirmation-actions .primary { min-height: 46px; }

.history-page { display: block; }
.history-card { width: min(100%, 1180px); margin: 0 auto; }
.history-tabs { margin-bottom: 22px; }
.history-list { display: grid; gap: 14px; }
.history-entry { padding: 20px; }
.history-heading { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.history-heading div { display: flex; gap: 12px; }
.history-heading strong { color: #e9ebec; font-size: 14px; }
.history-reason { margin: 14px 0; color: #c8cdcf; }
.history-item { display: grid; grid-template-columns: 240px 1fr; gap: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.history-item + .history-item { margin-top: 12px; }

@media (max-width: 1300px) {
  .six-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .five-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .rates-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .header-actions { gap: 9px; }
  .editor-tabs { gap: 16px; }
}

@media (max-width: 1023px) {
  body.nav-open { overflow: hidden; }

  .app-shell { display: block; }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(64px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
    border-bottom: 1px solid #23292d;
    background: #0d1112f2;
    backdrop-filter: blur(14px);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #f4f5f5;
    text-decoration: none;
  }

  .mobile-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 20px; }
  .mobile-brand small,
  .mobile-brand strong { display: block; }
  .mobile-brand small { color: var(--muted); font-size: 11px; }
  .mobile-brand strong { margin-top: 2px; font-size: 15px; }

  .menu-toggle {
    position: relative;
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #30383e;
    border-radius: 12px;
    background: #11171a;
  }

  .menu-toggle::before,
  .menu-toggle::after,
  .menu-toggle > span:first-child {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #dce0e1;
    content: "";
    transition: transform .16s ease, top .16s ease, opacity .16s ease;
  }

  .menu-toggle::before { top: 14px; }
  .menu-toggle > span:first-child { top: 21px; }
  .menu-toggle::after { top: 28px; }
  .nav-open .menu-toggle::before { top: 21px; transform: rotate(45deg); }
  .nav-open .menu-toggle > span:first-child { opacity: 0; }
  .nav-open .menu-toggle::after { top: 21px; transform: rotate(-45deg); }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(84vw, 320px);
    max-width: 100%;
    padding: calc(28px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    box-shadow: 18px 0 52px #000b;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }

  .nav-open .sidebar { transform: translateX(0); }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #0009;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  .nav-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
  }

  .content {
    width: 100%;
    max-width: none;
    padding: 28px max(24px, env(safe-area-inset-right)) calc(52px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  }

  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .factor-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .factor-strip div:nth-child(2) { border-right: 0; }
  .factor-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .charts-grid,
  .pnl-grid { grid-template-columns: minmax(0, 1fr); }
  .rates-grid,
  .six-columns,
  .five-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .confirmation-page { min-height: 0; padding: 28px 0; }
  .confirmation-card { width: min(100%, 980px); }
  .history-card { width: 100%; }
}

@media (max-width: 767px) {
  .content {
    padding: 22px max(16px, env(safe-area-inset-right)) calc(42px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  h1 { font-size: 27px; line-height: 1.15; }
  h2 { font-size: 19px; }

  .page-header,
  .header-actions,
  .picker-group {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header { gap: 18px; }
  .header-actions { width: 100%; gap: 12px; }
  .picker-group { gap: 7px; }
  .month-picker { width: 100%; min-width: 0; }
  .month-input { min-height: 48px; font-size: 16px; }
  .month-trigger { min-height: 48px; font-size: 16px; }
  .month-popover { padding: 16px; gap: 13px; }
  .month-popover-year { grid-template-columns: 44px 1fr 44px; }
  .month-year-arrow { width: 44px; height: 44px; }
  .month-popover-grid button { min-height: 44px; font-size: 14px; }
  .month-apply { min-height: 48px; }
  .action-link { width: 100%; min-height: 48px; }
  .select-menu,
  .store-select { width: 100%; min-width: 0; }
  .select-menu summary { min-height: 48px; }

  .select-options,
  .form-select .select-options {
    position: fixed;
    inset: auto max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    z-index: 100;
    width: auto;
    min-width: 0;
    max-height: min(62dvh, 440px);
    border-radius: 16px;
    box-shadow: 0 24px 72px #000e;
  }

  .select-options a,
  .select-options button {
    min-height: 48px;
    white-space: normal;
  }

  .section-tabs {
    gap: 20px;
    margin-right: -16px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .section-tabs::-webkit-scrollbar { display: none; }
  .section-tabs a { min-height: 44px; padding-bottom: 12px; white-space: nowrap; }
  .tabs-scroll-hint { display: block; margin: -8px 0 12px; color: #aebbc1; font-size: 12px; text-align: right; }

  .data-line { margin-top: 18px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pnl-kpis { grid-template-columns: minmax(0, 1fr); }
  .metric-card { min-height: 116px; padding: 12px; border-radius: 12px; }
  .metric-card strong, .primary-card strong { margin: 12px 0 7px; font-size: clamp(17px, 5vw, 21px); white-space: normal; overflow-wrap: anywhere; }
  .metric-card small { font-size: 11px; }

  .factor-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
  .factor-strip div { padding: 10px; }
  .factor-strip div:nth-child(odd) { border-right: 1px solid var(--line); }
  .factor-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .factor-strip div:nth-child(n+3) { border-bottom: 0; }
  .factor-strip span { min-height: 0; margin-bottom: 4px; }
  .factor-strip strong { font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
  .factor-strip .metric-comparison { margin-top: 4px; font-size: 11px; }

  .panel-heading { align-items: flex-start; padding: 18px; }
  .chart-container { min-height: 250px; padding: 0 8px 16px; }
  .chart-legend { gap: 10px 14px; padding: 0 18px 12px; }
  .chart-axis { font-size: 12px; }

  .mobile-sort-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 10px;
    padding: 0 18px 18px;
  }

  .mobile-sort-controls label { color: var(--muted); font-size: 12px; }
  .mobile-sort-controls select {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 7px;
    padding: 0 12px;
    border: 1px solid #30383e;
    border-radius: 10px;
    background: #0b1012;
    color: #eef0f1;
    font-size: 16px;
  }

  .mobile-sort-direction {
    align-self: end;
    width: 48px !important;
    min-height: 48px;
    padding: 0;
    font-size: 20px;
  }

  .table-wrap { overflow: visible; }
  .responsive-table,
  .responsive-table tbody,
  .responsive-table tfoot,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; }
  .responsive-table { min-width: 0; border-collapse: separate; }
  .responsive-table thead { display: none; }
  .responsive-table tbody { padding: 0 12px 12px; }
  .responsive-table tbody tr {
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #0c1114;
  }
  .responsive-table td,
  .responsive-table td:first-child {
    position: static;
    display: grid;
    grid-template-columns: minmax(112px, .8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    background: transparent;
    text-align: right;
    white-space: normal;
  }
  .responsive-table td:first-child { border-top: 0; }
  .responsive-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    text-align: left;
  }
  .responsive-table td[data-label="Магазин"] {
    display: block;
    color: #f2f4f4;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
  }
  .responsive-table td[data-label="Магазин"]::before { display: none; }
  .responsive-table .store-sales-change {
    grid-column: 2;
    justify-self: end;
    text-align: right;
  }
  .responsive-table input,
  .responsive-table .form-select,
  .payroll-method-table .payroll-method-select { width: 100%; max-width: none; }
  .responsive-table .money-field { max-width: none; }
  .responsive-table .remove-button { min-height: 44px; justify-self: end; }
  .responsive-table tfoot { padding: 0 12px 12px; }
  .responsive-table tfoot tr { padding: 14px; border: 1px solid #33423e; border-radius: 14px; }
  .responsive-table tfoot th { display: block; padding: 0 0 10px; border: 0; text-align: left; }
  .responsive-table tfoot td { padding: 8px 0; border: 0; }
  .responsive-table tfoot td:empty { display: none; }

  .pnl-picker { align-items: stretch; }
  .statement-group,
  .expense-group { padding-right: 18px; padding-left: 18px; }
  .statement-row,
  .expense-row { align-items: flex-start; gap: 12px; }
  .statement-row span,
  .expense-row span { min-width: 0; }
  .statement-row strong,
  .expense-row strong { flex: 0 0 auto; }

  .editor-heading,
  .expense-row-title,
  .category-create,
  .save-bar,
  .confirmation-actions,
  .history-heading,
  .history-heading div { align-items: stretch; flex-direction: column; }
  .editor-heading { gap: 14px; }
  .editor-heading button.secondary,
  .date-field,
  .row-actions button.secondary { width: 100%; max-width: none; min-height: 48px; }
  .editor-grid,
  .panel-form { padding-right: 16px; padding-left: 16px; }
  .rates-grid,
  .six-columns,
  .five-columns { grid-template-columns: minmax(0, 1fr); }
  .finance-form input[type="text"],
  .finance-form input[type="date"],
  .finance-form input[type="month"] { min-height: 48px; font-size: 16px; }
  .expense-editor-row { padding: 18px 16px; }
  .expense-row-title { gap: 12px; }
  .expense-heading-actions { display: grid; grid-template-columns: minmax(0, 1fr) 48px; width: 100%; align-items: end; }
  .expense-filter, .expense-filter select { width: 100%; min-width: 0; }
  .expense-add-button { width: 48px; min-width: 48px; height: 48px; }
  .expense-add-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .expense-dialog-heading { padding: 18px 64px 18px 16px; }
  button.expense-dialog-close { top: 8px; right: 8px; width: 44px; min-width: 44px; min-height: 44px; }
  .expense-dialog-error { margin: 0 16px 18px; }
  .expense-add-dialog .panel-form { padding: 0 16px 18px; }
  .expense-add-dialog .category-create { margin: 0 16px 18px; }
  .expense-dialog-actions { padding: 0 16px 18px; }
  .rates-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; width: 100%; }
  .rates-effective-date, .rates-effective-date input { min-width: 0; width: 100%; max-width: none; }
  .editor-heading .rates-actions button.secondary { width: auto; min-height: 48px; }
  .stop-fields { align-items: stretch; flex-direction: column; }
  .stop-fields input { width: 100%; }
  .row-actions { width: 100%; }
  .row-actions button { flex: 1; min-height: 44px; }
  .category-create { gap: 12px; padding: 16px; }
  .category-create label { width: 100%; }
  .category-create span { padding-bottom: 0; }
  .save-bar {
    bottom: calc(8px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
  }
  .save-bar.is-pristine { display: none; }
  .finance-form.has-save-bar { padding-bottom: 155px; }
  .save-reason summary { display: block; color: #c7d5d9; font-size: 12px; cursor: pointer; }
  .save-reason[open] { grid-column: 1 / -1; }
  .save-reason[open] .reason-field { margin-top: 8px; }
  .save-bar .primary { width: auto; min-height: 48px; padding: 0 12px; }
  .stores-sticky-head { display: none !important; }

  .confirmation-page { padding: 0; }
  .confirmation-card { padding: 22px 16px; }
  .confirmation-item { padding: 16px; }
  .confirmation-item > div:first-child { align-items: flex-start; flex-direction: column; gap: 5px; }
  .change-values { grid-template-columns: minmax(0, 1fr); }
  .change-values i { transform: rotate(90deg); }
  .confirmation-actions { gap: 10px; }
  .confirmation-actions form,
  .confirmation-actions button { width: 100%; }
  .history-tabs { margin-right: -16px; }
  .history-entry { padding: 16px; }
  .history-heading,
  .history-heading div { gap: 5px; }
  .history-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }

  .empty-state { margin-top: 54px; padding: 38px 18px; }
  .auth-page { padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  .auth-card { padding: 28px 22px; }
  .auth-form input, .auth-form select { min-height: 48px; font-size: 16px; }
  .auth-form button { min-height: 48px; }
}

@media (max-width: 380px) {
  .month-popover-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .expense-add-dialog .six-columns,
  .expense-add-dialog .five-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .expense-add-dialog .six-columns,
  .expense-add-dialog .five-columns { grid-template-columns: minmax(0, 1fr); }
  .rates-effective-date { display: grid; gap: 6px; white-space: normal; }
  .rates-effective-date .date-field { width: 100%; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-backdrop,
  .menu-toggle::before,
  .menu-toggle::after,
  .menu-toggle > span:first-child { transition: none; }
}

/* Keep monetary KPI values together; scale to the actual card width. */
.metric-card { container-type: inline-size; }
.metric-card strong.metric-money {
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: clamp(15px, 10cqi, 30px);
}
.primary-card strong.metric-money { font-size: clamp(15px, 11cqi, 36px); }

/* Per-point payroll conditions */
.payroll-method-value { display:inline-block; min-width:76px; vertical-align:middle; }
.payroll-edit-button { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding:10px; color:var(--accent, #70d6b4); background:transparent; border:0; border-radius:10px; vertical-align:middle; }
.payroll-edit-button:hover { background:rgba(112,214,180,.12); }
.payroll-edit-button:focus-visible { outline:2px solid var(--accent, #70d6b4); outline-offset:2px; }
.payroll-point-dialog { width:min(560px,calc(100vw - 32px)); box-sizing:border-box; }
.payroll-point-dialog .form-grid { grid-template-columns:1fr; gap:18px; }
.payroll-point-dialog select,.payroll-point-dialog input[type=month] { width:100%; min-height:48px; }

.seller-report-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:16px; align-items:end; margin:24px 0; }
.seller-report-filters label { display:grid; gap:8px; min-width:0; }
.seller-report-filters select { width:100%; min-width:0; min-height:48px; background:var(--surface, #10191e); color:inherit; border:1px solid #37494f; border-radius:12px; padding:10px 12px; font:inherit; }
@media(max-width:767px) { .seller-report-filters { grid-template-columns:1fr; } }
.payroll-point-dialog { padding:24px; }
.payroll-point-dialog .form-grid { margin:24px 0 16px; }
.payroll-point-dialog label { display:grid; gap:8px; }
.payroll-point-dialog select { appearance:none; border:1px solid #37494f; border-radius:12px; background:#10191e; color:inherit; padding:12px 16px; font:inherit; }
.payroll-point-dialog p { margin:16px 0; line-height:1.5; }
.payroll-point-dialog .expense-dialog-heading { padding:0; }
.payroll-point-dialog .expense-dialog-actions { padding:16px 0 0; }

.payroll-method-table .payroll-method-control { display:inline-flex; align-items:center; justify-content:flex-end; gap:8px; }
.payroll-method-control .payroll-method-value { min-width:0; }
.payroll-method-control .payroll-edit-button { flex:0 0 44px; }
@media (max-width:760px) {
  .payroll-method-table td[data-label="Расчёт"] { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .payroll-method-table .payroll-method-control { justify-self:end; }
}

/* Full notification text remains visible until an explicit navigation. */
.push-notice-card { width: min(100%, 680px); min-width: 0; }
.push-notice-card h1, .push-notice-body { overflow-wrap: anywhere; }
.push-notice-body { white-space: pre-wrap; line-height: 1.6; }
.push-notice-card .auth-form button, .push-notice-card [data-push-read-retry] { min-height: 48px; }
.push-notice-center { display: inline-block; margin-top: 16px; }
