:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-soft: #fbfcfb;
  --line: #dce1dc;
  --text: #1f241f;
  --muted: #647064;
  --green: #22684c;
  --red: #a23c3c;
  --blue: #2f5e8c;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
}

body.auth-checking .sidebar,
body.auth-checking main {
  visibility: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

button:hover {
  border-color: #aeb8ae;
}

.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.sidebar {
  padding: 22px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.brand {
  display: grid;
  gap: 5px;
  margin-bottom: 20px;
}

.brand-title {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}

.brand-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.user-context {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 8px;
}

.brand-studio {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.logout-link {
  justify-self: start;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
}

.logout-link:hover {
  color: var(--green-dark);
}

body[data-readonly="true"] #openDeal,
body[data-readonly="true"] #openIncome,
body[data-readonly="true"] #openExpense,
body[data-readonly="true"] .delete-button,
body[data-readonly="true"] [data-pay-deal],
body[data-readonly="true"] [data-refund-deal],
body[data-readonly="true"] [data-edit-deal],
body[data-readonly="true"] [data-delete-deal],
body[data-readonly="true"] [data-delete-income],
body[data-readonly="true"] [data-delete-expense],
body[data-readonly="true"] #pageManualPayrollButton,
body[data-readonly="true"] #recalculatePayrollButton,
body[data-readonly="true"] #createBackupNow,
body[data-readonly="true"] #checkAutoBackups {
  display: none !important;
}

.period {
  display: grid;
  gap: 10px;
}

.period-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.period-preset {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.period-preset:hover,
.period-preset:focus-visible {
  background: transparent;
  color: var(--blue);
  outline: none;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

.field-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(162, 60, 60, 0.14);
}

textarea {
  min-height: 76px;
  resize: vertical;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav:hover {
  background: #f2f7f4;
  border-color: #c7d5ca;
}

.nav span {
  min-width: 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: currentColor;
  opacity: 0.72;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav.active {
  background: #e5f1eb;
  border-color: #a9d3bc;
  color: var(--green);
  font-weight: 700;
}

.nav:hover .nav-icon,
.nav.active .nav-icon {
  opacity: 1;
}

.nav.active .nav-icon {
  transform: translateX(1px);
}

main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

p {
  color: var(--muted);
}

.actions,
.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
}

.section-actions {
  justify-content: flex-start;
}

.income-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.expense-toolbar {
  display: grid;
  gap: 12px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.two-filters {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.report-filters {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.income-toolbar label,
.filters label {
  min-width: 220px;
}

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.compact-cards {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.cash-flow-cards {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.cash-flow-cards .card {
  padding: 10px 12px;
}

.cash-flow-cards .card span {
  margin-bottom: 6px;
  font-size: 12px;
}

.cash-flow-cards .card strong {
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cash-flow-cards .card small {
  font-size: 12px;
}

.working-capital-cards {
  grid-template-columns: repeat(auto-fit, minmax(115px, 160px));
  justify-content: start;
}

.balance-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.balance-section {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.balance-section h3 {
  margin: 0;
  font-size: 16px;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.balance-row span,
.balance-input-row {
  color: var(--muted);
}

.balance-row strong {
  font-size: 20px;
}

.balance-total {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.balance-input-row {
  display: grid;
  gap: 6px;
}

.balance-input-row input {
  min-height: 40px;
  font-size: 18px;
  font-weight: 700;
}

.balance-result {
  background: #fbfdfc;
}

.balance-status {
  font-weight: 800;
}

.balance-chart {
  display: grid;
  gap: 10px;
}

.balance-chart svg {
  width: 100%;
  max-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.balance-chart-axis {
  stroke: var(--line);
  stroke-width: 2;
}

.balance-chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.balance-chart-arrow {
  fill: var(--green);
}

.balance-chart-point {
  fill: var(--green);
  stroke: white;
  stroke-width: 2;
}

.balance-chart-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.balance-snapshot-date {
  width: 170px;
  min-width: 170px;
  white-space: nowrap;
}

.report-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-tabs button {
  border-color: var(--green);
  color: var(--green);
  font-weight: 700;
}

.report-tabs button.active {
  background: var(--green);
  color: white;
}

.report-grid {
  align-items: start;
}

.yearly-report .scroll-table table {
  min-width: 1500px;
}

.yearly-table th,
.yearly-table td {
  white-space: nowrap;
}

.yearly-table .group-head th {
  background: #f6fbf8;
  color: var(--text);
  text-align: center;
  border-bottom-color: var(--green-soft);
}

.yearly-table .total-row td {
  font-weight: 800;
  background: #f6fbf8;
}

.yearly-table .yearly-share-row td {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #fbfdfc;
}

.yearly-table th.yearly-col-revenue-total,
.yearly-table td.yearly-col-revenue-total,
.yearly-table .total-row td.yearly-col-revenue-total,
.yearly-table .yearly-share-row td.yearly-col-revenue-total {
  background: #eaf5ff;
  font-weight: 800;
}

.yearly-table th.yearly-col-expense-total,
.yearly-table td.yearly-col-expense-total,
.yearly-table .total-row td.yearly-col-expense-total,
.yearly-table .yearly-share-row td.yearly-col-expense-total {
  background: #fff0f0;
  font-weight: 800;
}

.yearly-table th.yearly-col-profit,
.yearly-table td.yearly-col-profit,
.yearly-table th.yearly-col-margin-percent,
.yearly-table td.yearly-col-margin-percent,
.yearly-table .total-row td.yearly-col-profit,
.yearly-table .total-row td.yearly-col-margin-percent,
.yearly-table .yearly-share-row td.yearly-col-profit,
.yearly-table .yearly-share-row td.yearly-col-margin-percent {
  background: #edf9f0;
  font-weight: 800;
}

.report-control-summary {
  margin-bottom: 0;
}

.report-control-summary .summary-control-total strong {
  display: grid;
  gap: 2px;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.report-control-summary .summary-control-total strong span {
  color: inherit;
  font-size: inherit;
}

.card,
.panel,
.table-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card {
  padding: 16px;
}

.card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.card strong {
  font-size: 24px;
}

.summary-card {
  grid-column: span 2;
}

.summary-list {
  display: grid;
  gap: 6px;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.summary-list strong {
  font-size: 16px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.account-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.account-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.account-card small {
  color: var(--muted);
}

.account-control-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6fbf8;
}

.account-control-summary > div {
  display: grid;
  gap: 6px;
}

.account-control-summary span,
.account-control-summary small {
  color: var(--muted);
  font-size: 13px;
}

.account-control-summary strong {
  font-size: 20px;
}

.account-control-summary small {
  grid-column: 1 / -1;
}

.summary-control-total strong {
  font-size: 24px;
}

.actual-balance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.actual-balance-row label {
  margin-bottom: 0;
}

.actual-balance-row input {
  border-color: #f2a23a;
  color: #c26612;
  font-size: 20px;
  font-weight: 700;
  background: #fff8ed;
}

.actual-balance-row input::placeholder {
  color: #cf8a42;
  font-weight: 700;
}

.actual-balance-row input:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16);
  outline: none;
}

.actual-balance-row button {
  min-height: 38px;
}

.actual-balance-message {
  min-height: 16px;
}

.control-shortage {
  color: var(--red);
}

.control-balanced {
  color: var(--green);
}

.control-surplus {
  color: #2563eb;
}

.panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin-bottom: 0;
}

.payroll-panel {
  min-width: 0;
}

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

.table-box {
  overflow: auto;
}

.scroll-table {
  min-width: 0;
}

.table-scroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 16px;
  margin-bottom: 6px;
}

.table-scroll-top > div {
  height: 1px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.amount {
  text-align: right;
  white-space: nowrap;
}

.row-actions {
  width: 1%;
  white-space: nowrap;
}

.deal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.deal-actions button {
  flex: 0 0 auto;
}

.deal-pay-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
}

.deal-pay-button.needs-payment {
  border-color: #e4b46d;
  background: #fff4df;
  color: #8a4d00;
  font-weight: 700;
}

.deal-pay-button.needs-payment:hover {
  background: #ffe9c0;
  border-color: #d79a3a;
}

.deal-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
}

.deal-icon-button:hover {
  color: var(--green);
  border-color: #b9c9bd;
  background: #f4faf6;
}

.button-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attention-row {
  background: #fff1f1;
}

.delete-button {
  min-height: 32px;
  border-color: #e4b7b7;
  color: var(--red);
  padding: 5px 10px;
}

.deal-icon-button.delete-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
}

.deal-icon-button.delete-button:hover {
  color: var(--red);
  border-color: #d99b9b;
  background: #fff7f7;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.muted {
  color: var(--muted);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f4faf6;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.calendar-head h2 {
  margin: 0;
  text-transform: capitalize;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 8px;
  border-radius: 0;
  border-color: var(--line);
  background: var(--surface);
  text-align: left;
}

.calendar-day.today {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.calendar-day.empty-day {
  background: var(--surface-soft);
  cursor: default;
}

.calendar-day > span {
  font-weight: 700;
}

.calendar-shifts {
  display: grid;
  gap: 4px;
}

.calendar-shift {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #e5f1eb;
  color: var(--green);
  font-size: 12px;
}

.calendar-shift small,
.calendar-admin-row small {
  color: var(--muted);
}

.calendar-admin-row {
  justify-content: flex-start;
  color: var(--text);
}

.table-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.list {
  display: grid;
  gap: 8px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.list-row small {
  color: var(--muted);
  white-space: nowrap;
}

.chart-panel {
  min-width: 0;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
}

.bar-row-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row-head strong {
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2ee;
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
}

.donut-layout {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut-chart {
  position: relative;
  width: 138px;
  aspect-ratio: 1;
  border-radius: 50%;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.donut-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-row strong,
.donut-legend-row small {
  white-space: nowrap;
}

.donut-legend-row small {
  color: var(--muted);
}

.chart-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.daily-revenue-panel {
  margin-top: 24px;
}

.daily-revenue-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.daily-revenue-head h2 {
  margin-bottom: 4px;
}

.daily-revenue-head p {
  margin: 0;
  color: var(--muted);
}

.daily-revenue-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.daily-revenue-summary span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  white-space: nowrap;
}

.daily-revenue-summary strong {
  color: var(--text);
}

.daily-revenue-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

.daily-revenue-chart {
  display: grid;
  gap: 7px;
  min-height: 220px;
  align-items: end;
  padding: 8px 2px 0;
}

.daily-revenue-day {
  display: grid;
  grid-template-rows: 170px 24px;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.daily-revenue-bar-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.daily-revenue-bar {
  width: min(100%, 28px);
  min-height: 0;
  border-radius: 8px 8px 0 0;
  background: var(--green);
}

.daily-revenue-bar.negative-bar {
  background: var(--red);
}

.daily-revenue-day span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.income-composition-panel {
  margin-top: 24px;
}

.income-composition-panel > .muted {
  margin-top: -6px;
}

.income-composition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.composition-section {
  min-width: 0;
}

.composition-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.compact-bar-chart {
  gap: 10px;
}

.compact-bar-chart .bar-row {
  gap: 5px;
}

.compact-bar-chart small {
  color: var(--muted);
  font-size: 12px;
}

.compact-empty {
  min-height: 120px;
}

.chart-separated-total {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.chart-separated-total span {
  color: var(--muted);
  font-size: 12px;
}

.chart-separated-total strong {
  color: var(--red);
  font-size: 15px;
}

.dashboard-footer {
  display: flex;
  justify-content: center;
  padding: 20px 0 6px;
}

.text-link {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 6px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--green);
  border-color: transparent;
}

.methodology-modal {
  display: grid;
  gap: 14px;
}

.methodology-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.methodology-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
}

.methodology-list li {
  padding-left: 4px;
}

.methodology-list strong,
.methodology-list span {
  display: block;
}

.methodology-list strong {
  color: var(--text);
  margin-bottom: 2px;
}

.methodology-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.methodology-status {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.directories {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
}

dialog {
  width: min(680px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgba(24, 28, 24, 0.38);
}

.modal-card {
  padding: 18px;
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-head {
  margin-bottom: 14px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.icon {
  width: 36px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.checkbox-row input {
  width: auto;
  min-height: 0;
}

.warning {
  color: var(--red);
}

.warning-box {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e4b7b7;
  border-radius: 8px;
  background: #fff7f7;
  color: var(--red);
}

.wide {
  grid-column: 1 / -1;
}

.disabled {
  opacity: 0.62;
}

.hidden {
  display: none;
}

.quick-client,
.deal-items-head {
  margin-top: 14px;
}

.quick-client {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.quick-client h3,
.deal-items-head h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.field-actions {
  display: grid;
  align-content: start;
  gap: 6px;
  margin-bottom: 12px;
}

.field-actions span {
  color: var(--muted);
  font-size: 13px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deal-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deal-items {
  display: grid;
  gap: 12px;
}

.deal-item-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.deal-item-main,
.deal-item-sub {
  display: grid;
  gap: 10px;
  align-items: end;
}

.deal-item-main {
  grid-template-columns: minmax(130px, 0.75fr) minmax(190px, 1fr) minmax(190px, 1fr);
}

.deal-item-sub {
  grid-template-columns: minmax(110px, 0.65fr) minmax(90px, 0.55fr) minmax(110px, 0.65fr) minmax(150px, 0.9fr) auto;
}

.deal-item-row label,
.deal-item-sub label,
.deal-item-main label {
  margin-bottom: 0;
}

.error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--red);
}

.login-page {
  display: block;
  background: var(--surface-soft);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 22px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(20, 34, 28, 0.12);
}

.login-brand {
  display: grid;
  gap: 5px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form h1 {
  margin: 0;
}

.login-form button {
  width: 100%;
}

@media (max-width: 920px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cards,
  .account-grid,
  .account-control-summary,
  .grid,
  .directories,
  .filters,
  .form-grid,
  .balance-form-grid,
  .income-composition-grid,
  .deal-item-main,
  .deal-item-sub {
    grid-template-columns: 1fr;
  }

  .summary-card {
    grid-column: auto;
  }

  .topbar {
    display: grid;
  }
}
