:root {
  color-scheme: light;
  --bg: #ede4d7;
  --panel: #fffaf3;
  --line: #d9cec0;
  --text: #252722;
  --muted: #59665c;
  --accent: #f46c40;
  --accent-dark: #b85636;
  --warn: #9f6a43;
  --chrome: #202720;
  --chrome-dark: #151412;
  --chrome-soft: #323b35;
  --chrome-line: rgba(205, 194, 176, 0.22);
  --chrome-hot: #59665c;
  --brand-warm: #cdc2b0;
  --brand-paper: #e9e3dd;
  --brand-surface: #f4efe8;
  --brand-green-soft: rgba(89, 102, 92, 0.14);
  --brand-partial: #fff0cf;
}

@font-face {
  font-family: "Akrobat";
  src: url("/assets/fonts/Akrobat-Regular.otf") format("opentype");
  font-weight: 400;
}

@font-face {
  font-family: "Akrobat";
  src: url("/assets/fonts/Akrobat-SemiBold.otf") format("opentype");
  font-weight: 680;
}

@font-face {
  font-family: "Akrobat";
  src: url("/assets/fonts/Akrobat-ExtraBold.otf") format("opentype");
  font-weight: 800;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font: 15px/1.25 Akrobat, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  width: 100%;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  overflow: hidden;
  background: var(--chrome);
  color: #fff;
  border-bottom: 1px solid #0f130f;
}

.login-mode .app-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.login-mode .brand-row {
  grid-template-columns: 1fr;
}

.login-mode .icon-strip,
.login-mode .top-status,
.login-mode .topbar,
.login-mode .pager {
  display: none;
}

.brand-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(142px, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: stretch;
  gap: 8px;
  padding: 4px 10px;
  background: linear-gradient(180deg, #202720, var(--chrome-dark));
  min-width: 0;
  max-width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  min-width: 0;
}

.brand-logo {
  width: 28px;
  height: 38px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1;
}

.brand small {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.brand small,
.mini-stat span {
  color: #b8c2cc;
}

.top-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: #cbd5de;
  font-size: 12px;
  min-width: 0;
  max-width: 420px;
  overflow: hidden;
}

.top-status span {
  flex: 0 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-status b {
  flex: 1 1 auto;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(233, 227, 221, 0.12);
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-switch {
  min-width: 0;
}

.session-switch select {
  max-width: 230px;
  height: 30px;
  border: 1px solid rgba(233, 227, 221, 0.22);
  border-radius: 4px;
  background: rgba(233, 227, 221, 0.12);
  color: #fff;
  padding: 0 8px;
}

.session-switch option {
  color: #1f241f;
}

.icon-strip {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.icon-strip button,
.week-arrow,
.week-setup,
.mark-button,
.mini-icon,
.pin-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid #303030;
  background: transparent;
  color: #aeb6bd;
  cursor: pointer;
  font-weight: 700;
  position: relative;
}

.icon-strip button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-strip button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 20;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 7px 9px;
  border-radius: 4px;
  background: #111;
  color: #fff;
  box-shadow: 0 8px 18px rgb(0 0 0 / 28%);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}

.icon-strip button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  z-index: 21;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #111;
  opacity: 0;
  pointer-events: none;
}

.icon-strip button:hover::after,
.icon-strip button:hover::before,
.icon-strip button:focus-visible::after,
.icon-strip button:focus-visible::before {
  opacity: 1;
}

.icon-strip button:hover,
.icon-strip button.active,
.week-arrow:hover,
.week-setup:hover,
.mark-button:hover,
.mini-icon:hover,
.pin-button:hover {
  background: rgba(244, 108, 64, 0.22);
  color: #fff;
}

.finance-strip {
  display: flex;
  align-items: stretch;
  min-height: 34px;
  min-width: 0;
  max-width: 100vw;
  background: var(--chrome);
  border-top: 1px solid var(--chrome-line);
}

.week-label {
  min-width: 165px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 12px 0 8px;
  border: 0;
  border-right: 1px solid var(--chrome-line);
  background: transparent;
  color: #d5dde4;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.week-label:hover,
.week-label:focus-visible {
  background: rgba(244, 108, 64, 0.18);
  color: #fff;
  outline: none;
}

.module-label {
  display: none;
  align-items: center;
  min-width: 178px;
  flex: 0 0 auto;
  padding: 0 12px;
  border-left: 1px solid var(--chrome-line);
  border-right: 1px solid var(--chrome-line);
  background: #323b35;
  color: #f0f4f7;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tabs {
  flex: 1;
  display: flex;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  overflow-x: auto;
}

.tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #e6ebef;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}

.tabs button:hover,
.tabs button.active {
  background: #59665c;
  border-color: var(--chrome-line);
}

.tabs b {
  display: none;
}

.tabs span {
  white-space: nowrap;
}

.subnav {
  display: grid;
  grid-template-columns: auto auto auto minmax(20px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 12px;
  background: #f7f8f9;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.subnav button {
  min-height: 26px;
  border: 0;
  background: transparent;
  color: #394753;
  padding: 0 8px;
  cursor: pointer;
}

.subnav button:hover {
  color: var(--accent-dark);
}

.mini-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  background: #eef2f4;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
}

.workspace {
  min-width: 0;
  width: 100%;
  max-width: 100vw;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  min-height: 0;
  height: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 33px;
  padding: 4px 10px;
  background: var(--brand-surface);
  border-bottom: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.topbar > div {
  flex: 1;
  min-width: 0;
}

.topbar .topbar-toggle {
  flex: 0 0 auto;
}

.topbar.is-collapsed {
  min-height: 26px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.topbar.is-collapsed p {
  display: none;
}

.topbar.is-collapsed h1 {
  font-size: 13px;
}

.topbar h1,
.topbar p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h1 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.primary,
.pager button,
dialog button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  min-height: 26px;
}

.primary:hover {
  background: var(--accent-dark);
}

.actionbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 4px 8px;
  background: #efe6da;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.actionbar .mark-button,
.actionbar .mini-icon,
.actionbar .pin-button {
  width: 27px;
  height: 27px;
  border-left: 1px solid var(--line);
  color: #59665c;
}

.action-left,
.action-right,
.quick-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.action-left {
  flex: 1;
  overflow-x: auto;
}

.action-right {
  justify-content: end;
  min-width: 0;
  overflow-x: auto;
}

.soft-button,
.add-button,
.quick-filters button {
  min-height: 27px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.add-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.quick-filters {
  overflow-x: auto;
  padding-left: 2px;
}

.quick-filters button {
  border-color: transparent;
  background: transparent;
  color: #59665c;
}

.quick-filters button.active {
  background: rgba(244, 108, 64, 0.12);
  border-color: rgba(244, 108, 64, 0.34);
  color: var(--text);
}

.inline-search {
  width: min(190px, 24vw);
  min-width: 120px;
}

.inline-search input {
  min-height: 27px;
  border-radius: 2px;
}

.view-button.active {
  background: rgba(89, 102, 92, 0.12);
}

body.filters-collapsed .filters {
  display: none !important;
}

body.workspace-expanded .app-header {
  display: none;
}

body.workspace-expanded {
  grid-template-rows: minmax(0, 1fr);
}

.mini-icon {
  color: #59665c;
  border-left: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.bottom-summary {
  min-height: 43px;
  z-index: 2;
}

.inline-summary {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.metric {
  background: var(--panel);
  padding: 6px 10px;
}

.metric.is-empty {
  background: #f4efe8;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric b {
  display: block;
  margin-top: 1px;
  font-size: 14px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) 150px 170px 160px 150px minmax(150px, 1fr) 145px 145px 110px;
  gap: 7px;
  padding: 7px 8px;
  background: #f8f2eb;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
}

label {
  min-width: 0;
}

label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
}

.combo-wrap {
  position: relative;
}

.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 30;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(0 0 0 / 18%);
}

.combo-list[hidden] {
  display: none;
}

.combo-list button {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-bottom: 1px solid #eadfd2;
  background: #fff;
  color: var(--text);
  padding: 6px 9px;
  text-align: left;
  cursor: pointer;
}

.combo-list button:hover,
.combo-list button.active {
  background: rgba(244, 108, 64, 0.12);
}

.combo-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.check {
  display: flex;
  align-items: end;
  gap: 8px;
  padding-bottom: 7px;
}

.check input {
  width: 16px;
  min-height: 16px;
}

.check span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  background: var(--panel);
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.table-wrap.detail-view td {
  max-width: 420px;
  white-space: normal;
  line-height: 1.25;
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
}

body[data-table="bills"] table,
body[data-table="orders"] table {
  min-width: 1180px;
}

tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: #efe6da;
  border-top: 1px solid #d8c8b6;
  border-right: 1px solid #e6d7c7;
  font-weight: 700;
}

tfoot td.is-label {
  color: #4e564f;
  font-weight: 600;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #323b35;
  border-bottom: 1px solid #202720;
  border-right: 1px solid rgba(233, 227, 221, 0.18);
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
  color: #fff;
}

th.select-col,
td.select-col {
  width: 30px;
  max-width: 30px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}

th.select-col input,
td.select-col input {
  width: 14px;
  min-height: 14px;
}

th.actions-col,
td.actions-col {
  width: 156px;
  min-width: 156px;
  max-width: 156px;
  text-align: right;
  position: sticky;
  right: 0;
}

td.actions-col {
  background: inherit;
  padding: 3px 6px;
  white-space: nowrap;
}

td.actions-col button {
  width: 30px;
  height: 30px;
  margin-left: 3px;
  border: 1px solid #d8c9b8;
  border-radius: 7px;
  background: #fffaf3;
  color: #53635a;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(61, 51, 40, 0.06);
}

td.actions-col .action-btn {
  background: #fffaf3;
  border-color: #d8c9b8;
  color: #53635a;
}

td.actions-col .action-btn--approve {
  background: #f4fbf0;
  border-color: #b7d4aa;
  color: #4f8946;
}

td.actions-col .action-btn--money {
  background: #f4fbf0;
  border-color: #b7d4aa;
  color: #4f8946;
}

td.actions-col .action-btn--reject {
  background: #fff7f3;
  border-color: #edcfc5;
  color: #b85d3f;
}

td.actions-col .action-btn--cancel {
  background: #fff7f3;
  border-color: #edcfc5;
  color: #b85d3f;
}

td.actions-col .action-btn--delete {
  background: #fff7f3;
  border-color: #edcfc5;
  color: #b85d3f;
  font-size: 20px;
  font-weight: 400;
}

td.actions-col .action-btn--ghost {
  background: #fffaf3;
  border-color: #d8c9b8;
  color: #53635a;
}

td.actions-col .action-btn--select {
  background: #f4fbf0;
  border-color: #b7d4aa;
  color: #4f8946;
}

td.actions-col .action-btn.is-muted {
  filter: none;
  opacity: 1;
}

td.actions-col button:hover {
  border-color: #bda98f;
  background: #fff6e9;
}

td.actions-col .action-btn {
  cursor: pointer;
}

th button {
  width: 100%;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 0 8px;
  cursor: pointer;
}

th button.asc::after {
  content: " ↑";
}

th button.desc::after {
  content: " ↓";
}

td {
  max-width: 260px;
  padding: 5px 8px;
  border-bottom: 1px solid #eadfd2;
  border-right: 1px solid #f0e7dc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

body[data-table="bills"] th,
body[data-table="bills"] td,
body[data-table="orders"] th,
body[data-table="orders"] td {
  padding-left: 6px;
  padding-right: 6px;
  font-size: 13px;
}

body[data-table="bills"] td,
body[data-table="orders"] td {
  max-width: 170px;
}

body[data-table="bills"] th.select-col,
body[data-table="bills"] td.select-col,
body[data-table="orders"] th.select-col,
body[data-table="orders"] td.select-col {
  width: 26px;
  max-width: 26px;
  padding-left: 4px;
  padding-right: 4px;
}

body[data-table="bills"] th.actions-col,
body[data-table="bills"] td.actions-col,
body[data-table="orders"] th.actions-col,
body[data-table="orders"] td.actions-col {
  width: 152px;
  min-width: 152px;
  max-width: 152px;
}

body[data-table="bills"] th:nth-child(2),
body[data-table="bills"] td:nth-child(2),
body[data-table="orders"] th:nth-child(2),
body[data-table="orders"] td:nth-child(2) {
  width: 58px;
  max-width: 58px;
}

body[data-table="bills"] th:nth-child(3),
body[data-table="bills"] td:nth-child(3) {
  width: 132px;
  max-width: 132px;
}

body[data-table="bills"] th:nth-child(4),
body[data-table="bills"] td:nth-child(4),
body[data-table="bills"] th:nth-child(5),
body[data-table="bills"] td:nth-child(5) {
  width: 88px;
  max-width: 88px;
}

body[data-table="bills"] th:nth-child(6),
body[data-table="bills"] td:nth-child(6) {
  width: 150px;
  max-width: 150px;
}

body[data-table="bills"] th:nth-child(7),
body[data-table="bills"] td:nth-child(7) {
  width: 92px;
  max-width: 92px;
}

body[data-table="bills"] th:nth-child(8),
body[data-table="bills"] td:nth-child(8) {
  width: 132px;
  max-width: 132px;
}

body[data-table="bills"] th:nth-child(9),
body[data-table="bills"] td:nth-child(9) {
  width: 94px;
  max-width: 94px;
}

body[data-table="bills"] th:nth-child(10),
body[data-table="bills"] td:nth-child(10) {
  width: 98px;
  max-width: 98px;
}

body[data-table="bills"] th:nth-child(11),
body[data-table="bills"] td:nth-child(11),
body[data-table="bills"] th:nth-child(12),
body[data-table="bills"] td:nth-child(12),
body[data-table="bills"] th:nth-child(13),
body[data-table="bills"] td:nth-child(13) {
  width: 88px;
  max-width: 88px;
}

body[data-table="bills"] th:nth-child(14),
body[data-table="bills"] td:nth-child(14) {
  width: 98px;
  max-width: 98px;
}

body[data-table="bills"] th:nth-child(15),
body[data-table="bills"] td:nth-child(15) {
  width: 136px;
  max-width: 136px;
}

body[data-table="bills"] th:nth-child(16),
body[data-table="bills"] td:nth-child(16) {
  width: 116px;
  max-width: 116px;
}

body[data-table="orders"] th:nth-child(3),
body[data-table="orders"] td:nth-child(3) {
  width: 124px;
  max-width: 124px;
}

body[data-table="orders"] th:nth-child(4),
body[data-table="orders"] td:nth-child(4) {
  width: 84px;
  max-width: 84px;
}

body[data-table="orders"] th:nth-child(5),
body[data-table="orders"] td:nth-child(5) {
  width: 168px;
  max-width: 168px;
}

body[data-table="orders"] th:nth-child(6),
body[data-table="orders"] td:nth-child(6) {
  width: 122px;
  max-width: 122px;
}

body[data-table="orders"] th:nth-child(7),
body[data-table="orders"] td:nth-child(7) {
  width: 126px;
  max-width: 126px;
}

body[data-table="orders"] th:nth-child(8),
body[data-table="orders"] td:nth-child(8) {
  width: 110px;
  max-width: 110px;
}

body[data-table="orders"] th:nth-child(9),
body[data-table="orders"] td:nth-child(9) {
  width: 92px;
  max-width: 92px;
}

body[data-table="orders"] th:nth-child(10),
body[data-table="orders"] td:nth-child(10) {
  width: 98px;
  max-width: 98px;
}

body[data-table="orders"] th:nth-child(11),
body[data-table="orders"] td:nth-child(11) {
  width: 92px;
  max-width: 92px;
}

body[data-table="orders"] th:nth-child(12),
body[data-table="orders"] td:nth-child(12),
body[data-table="orders"] th:nth-child(13),
body[data-table="orders"] td:nth-child(13),
body[data-table="orders"] th:nth-child(14),
body[data-table="orders"] td:nth-child(14) {
  width: 84px;
  max-width: 84px;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr {
  cursor: default;
}

tbody tr:nth-child(even) {
  background: #fbf7f0;
}

tbody tr:hover {
  background: rgba(244, 108, 64, 0.09);
}

.pager {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.pager-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

#resultInfo {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

dialog {
  width: min(920px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

pre {
  margin: 0;
  padding: 14px;
  height: calc(100% - 52px);
  overflow: auto;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#formDialog {
  width: min(1180px, calc(100vw - 32px));
  height: auto;
  max-height: min(860px, calc(100vh - 32px));
}

#formDialog.compact-dialog {
  width: min(760px, calc(100vw - 80px));
  max-height: min(620px, calc(100vh - 80px));
}

#formBody {
  padding: 14px;
  overflow: auto;
  max-height: calc(100vh - 96px);
}

#formDialog.compact-dialog #formBody {
  padding: 10px 12px 12px;
  max-height: calc(100vh - 128px);
}

#formDialog.compact-dialog header {
  min-height: 44px;
  padding: 0 12px;
}

#formDialog.compact-dialog #formTitle {
  font-size: 15px;
}

#formDialog.compact-dialog .modal-form {
  gap: 8px;
  font-size: 13px;
}

#formDialog.compact-dialog .income-rule-note {
  padding: 8px 10px;
  font-size: 12px;
}

#formDialog.compact-dialog .income-rule-stage summary {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

#formDialog.compact-dialog .work-table th,
#formDialog.compact-dialog .work-table td {
  padding: 6px 8px;
  font-size: 12px;
}

#formDialog.compact-dialog .work-table strong,
#formDialog.compact-dialog .work-table b {
  font-size: 12px;
}

#formDialog.compact-dialog .income-rule-edit-table input[type="number"] {
  width: 88px;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

#formDialog.compact-dialog .modal-actions {
  gap: 8px;
  padding-top: 2px;
}

#formDialog.compact-dialog .modal-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

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

.modal-form label {
  position: relative;
  overflow: visible;
}

.modal-form .combo-list {
  z-index: 1000;
}

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

.week-picker-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(89, 102, 92, 0.18);
  border-radius: 6px;
  background: rgba(251, 247, 240, 0.82);
}

.week-picker-box label {
  margin: 0;
}

.week-picker-box button {
  min-width: 120px;
}

.employee-open {
  display: grid;
  gap: 3px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.employee-open:hover strong {
  color: var(--accent-dark);
}

.employee-editor {
  min-height: min(720px, calc(100vh - 150px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.editor-tabs {
  display: flex;
  justify-content: center;
  gap: 38px;
  border-bottom: 1px solid var(--line);
  margin: -14px -14px 18px;
  padding-top: 2px;
}

.editor-tabs button {
  min-width: 170px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 680;
}

.editor-tabs button.active {
  color: var(--muted);
  border-bottom-color: var(--chrome-hot);
}

.editor-pane {
  display: none;
  min-height: 0;
  overflow: auto;
}

.editor-pane.active {
  display: grid;
}

.editor-pane[data-editor-pane="general"] {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px 14px;
  align-content: start;
}

.editor-pane[data-editor-pane="general"] label {
  display: contents;
}

.editor-pane[data-editor-pane="general"] label > span {
  align-self: center;
  justify-self: end;
  color: var(--text);
  font-size: 18px;
}

.editor-pane[data-editor-pane="general"] input,
.editor-pane[data-editor-pane="general"] select {
  min-height: 44px;
  border: 1px solid #d2d2d2;
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  font-size: 18px;
}

.editor-pane[data-editor-pane="general"] .wide {
  display: contents;
}

.editor-pane[data-editor-pane="rights"] {
  display: none;
}

.editor-pane[data-editor-pane="rights"].active {
  display: block;
}

.permission-tree {
  padding: 4px 0 14px;
  font-size: 18px;
}

.permission-node {
  margin: 5px 0;
}

.permission-node summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  list-style: none;
  cursor: pointer;
}

.permission-node summary::-webkit-details-marker {
  display: none;
}

.permission-node[open] > summary .twisty {
  transform: rotate(90deg);
}

.permission-node .twisty {
  width: 18px;
  color: var(--text);
  transition: transform 0.15s ease;
}

.permission-node label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.permission-node input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--chrome-hot);
}

.employee-editor input[type="checkbox"],
.settings-table input[type="checkbox"] {
  accent-color: var(--chrome-hot);
}

.permission-children {
  margin-left: 28px;
}

.level-2 .permission-children,
.level-3 .permission-children {
  margin-left: 32px;
}

.editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px -14px -14px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.editor-footer button {
  min-width: 140px;
  min-height: 40px;
  font-size: 16px;
}

.login-surface {
  min-height: calc(100vh - 126px);
  display: grid;
  place-items: center;
  padding: 48px 16px;
  background:
    linear-gradient(135deg, rgba(29, 42, 32, 0.92), rgba(45, 63, 50, 0.84)),
    var(--bg);
}

.login-card {
  width: min(460px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid rgba(205, 194, 176, 0.72);
  border-radius: 8px;
  background: rgba(250, 247, 241, 0.98);
  box-shadow: 0 22px 54px rgb(0 0 0 / 26%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--brand);
}

.login-brand img {
  width: 52px;
  height: 52px;
  filter: invert(20%) sepia(14%) saturate(620%) hue-rotate(70deg) brightness(88%);
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 28px;
  line-height: 1;
}

.login-brand span {
  margin-top: 4px;
  font-size: 18px;
  color: var(--muted);
}

.login-card h2 {
  margin: 4px 0 0;
  font-size: 26px;
}

.login-lead {
  margin: -4px 0 4px;
  color: var(--muted);
  line-height: 1.42;
}

.login-card label {
  display: grid;
  gap: 6px;
}

.login-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 12px;
  background: #fff;
  font-size: 18px;
}

.login-card button.primary {
  min-height: 46px;
  margin-top: 2px;
}

.login-card p {
  font-size: 13px;
}

.login-note {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .brand-row,
  .actionbar {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .finance-strip {
    overflow: hidden;
  }

  .module-label {
    display: none;
  }

  .week-label {
    min-width: auto;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

  .workspace {
    height: 100%;
    min-height: 0;
  }

  .action-left,
  .action-right {
    justify-content: start;
  }

  .inline-search {
    width: min(220px, 48vw);
  }
}

.work-surface {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #ede4d7;
  min-height: 100%;
  min-width: 0;
  width: 100%;
}

.work-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
  overflow: auto;
}

.module-surface {
  min-height: 100%;
}

.module-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.module-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.module-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.home-week-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(89, 102, 92, 0.16);
  border-radius: 6px;
  background: rgba(251, 247, 240, 0.86);
}

.home-week-line strong {
  color: var(--ink);
}

.home-week-line span {
  color: var(--muted);
}

.home-week-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 180px auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.home-filter-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.home-filter-row input,
.home-filter-row select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffaf2;
  color: var(--text);
  padding: 0 9px;
}

.home-filter-row button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.home-table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}

.home-col-id {
  width: 46px;
}

.home-col-status {
  width: 126px;
}

.home-col-title {
  width: 20%;
}

.home-col-description,
.home-col-expense,
.home-col-object {
  width: 18%;
}

.home-col-money {
  width: 96px;
}

.home-col-actions {
  width: 104px;
}

.home-table th,
.home-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-table .id-col,
.home-table th:first-child,
.home-table td:first-child {
  width: 46px;
  padding-left: 6px;
  padding-right: 6px;
  text-align: center;
}

.home-table th:nth-child(2),
.home-table td:nth-child(2) {
  width: 126px;
}

.home-table th:last-child,
.home-table td:last-child {
  width: 104px;
  padding-left: 4px;
  padding-right: 4px;
}

.home-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.home-row-actions .action-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #d8c9b8;
  border-radius: 7px;
  background: #fffaf3;
  color: #53635a;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(61, 51, 40, 0.06);
}

.home-row-actions .action-btn--delete {
  border-color: #edcfc5;
  background: #fff7f3;
  color: #b85d3f;
  font-size: 20px;
  font-weight: 400;
}

.company-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.company-action-row small {
  color: var(--muted);
}

.company-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.7fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(89, 102, 92, 0.16);
  border-radius: 6px;
  background: rgba(251, 247, 240, 0.82);
}

.company-filter-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.company-filter-row input,
.company-filter-row select {
  min-height: 34px;
}

@media (max-width: 900px) {
  .company-filter-row {
    grid-template-columns: 1fr;
  }
}

.settings-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(244, 108, 64, 0.28);
  border-radius: 6px;
  background: rgba(244, 108, 64, 0.08);
  color: var(--muted);
}

.settings-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.access-cell {
  min-width: 300px;
}

.access-cell label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 8px 6px 0;
  white-space: nowrap;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.fund-director-toggle {
  justify-content: flex-start;
  gap: 10px;
}

.fund-director-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.history-timeline {
  display: grid;
  gap: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  align-items: start;
}

.history-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 999px;
  background: #5d8b60;
  box-shadow: 0 0 0 3px rgba(93, 139, 96, 0.12);
}

.history-content {
  padding: 10px 12px;
  border: 1px solid #e6ded2;
  border-radius: 10px;
  background: #fffdf9;
}

.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.history-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.history-meta {
  margin-top: 4px;
  color: #4f6351;
  font-size: 13px;
}

.history-note {
  margin-top: 6px;
  color: #3d463e;
  font-size: 13px;
  line-height: 1.45;
}

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

.report-split-grid h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  min-width: 0;
}

.module-grid button {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.module-grid button:hover {
  border-color: var(--accent);
  background: #f4fbf8;
}

.module-grid b,
.module-grid span {
  display: block;
}

.module-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.home-actions-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
}

.compact-table th,
.compact-table td {
  padding: 7px 10px;
}

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

.empty-module p {
  margin: 0;
}

.work-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: 0;
}

.directive-surface {
  gap: 12px;
}

.directive-toolbar {
  border-radius: 0;
}

.directive-flow {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.directive-stage {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.directive-lock-note {
  border: 1px solid rgba(191, 143, 0, 0.25);
  background: #fff7d6;
  color: #775d00;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.directive-lock-note.inline {
  margin-top: -2px;
}

.directive-flow-panel,
.directive-approvals-panel {
  display: grid;
  gap: 12px;
}

.directive-panel-heading {
  display: grid;
  gap: 4px;
  padding: 2px 2px 0;
}

.directive-panel-heading h2 {
  margin: 0;
  font-size: 21px;
  color: var(--text);
}

.directive-panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.directive-section-title,
.directive-fund-title {
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  min-width: 0;
}

.directive-section-title[role="button"],
.directive-fund-title[role="button"] {
  cursor: pointer;
}

.directive-section-title {
  background: linear-gradient(180deg, #faf5ee, #f2eade);
}

.directive-fund-title {
  background: linear-gradient(180deg, rgba(89, 102, 92, 0.18), rgba(89, 102, 92, 0.1));
}

.directive-section-title b,
.directive-fund-title b {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  color: #39453b;
}

.directive-section-title strong,
.directive-fund-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.directive-toggle-arrow {
  color: #63705f;
  font-size: 15px;
}

.directive-residual-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: #fffaf3;
}

.directive-residual-row strong {
  display: block;
  color: var(--text);
}

.directive-residual-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.directive-residual-row b {
  white-space: nowrap;
  font-size: 15px;
}

.directive-residual-row.is-zero {
  border-color: rgba(121, 188, 129, 0.45);
  background: #f2faef;
}

.directive-residual-row.is-diff {
  border-color: rgba(211, 91, 74, 0.42);
  background: #fff2ee;
}

.directive-residual-row button {
  min-height: 30px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  padding: 0 10px;
  font-weight: 800;
  cursor: pointer;
}

.directive-collapse-body.is-hidden {
  display: none;
}

.directive-block-title {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(89, 102, 92, 0.18), rgba(89, 102, 92, 0.1));
}

.directive-block-title strong {
  font-size: 18px;
  color: var(--text);
}

.directive-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  background: var(--panel);
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.directive-table th {
  position: sticky;
  top: 0;
  background: #323b35;
  border-bottom: 1px solid #202720;
  color: #fff;
}

.directive-table td {
  max-width: 520px;
  background: #fffaf3;
}

.income-stage-table th:nth-child(2),
.income-stage-table td:nth-child(2) {
  width: 170px;
}

.income-stage-table th:nth-child(3),
.income-stage-table td:nth-child(3) {
  width: 78px;
}

.fund-stage-table th:nth-child(1),
.fund-stage-table td:nth-child(1) {
  width: 34px;
}

.fund-stage-table th:nth-child(3),
.fund-stage-table td:nth-child(3),
.fund-stage-table th:nth-child(4),
.fund-stage-table td:nth-child(4),
.fund-stage-table th:nth-child(5),
.fund-stage-table td:nth-child(5) {
  width: 150px;
}

.fund-stage-table th:nth-child(6),
.fund-stage-table td:nth-child(6) {
  width: 78px;
}

.directive-table small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.compact-directive-dialog {
  gap: 12px;
}

.directive-fund-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.directive-fund-meta > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffaf3;
}

.directive-fund-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.directive-fund-meta strong {
  font-size: 14px;
}

.directive-fund-edit-table input {
  width: 120px;
  min-height: 30px;
}

.doc-icon {
  display: inline-block;
  width: 24px;
  color: #66716a;
}

.directive-actions {
  width: 74px;
  min-width: 74px;
  text-align: right;
  white-space: nowrap;
}

.directive-actions button {
  width: 28px;
  height: 26px;
  margin-left: 3px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f4efe8;
  color: var(--text);
  font-weight: 800;
}

.directive-actions button:first-child {
  background: #5d8b60;
  border-color: #5d8b60;
  color: #fff;
}

.directive-total td {
  font-weight: 800;
  background: #efe6da;
}

.approve-calculated,
.reset-calculated {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
}

.directive-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
}

.directive-select-all input {
  margin: 0;
}

.approve-calculated {
  background: #5d8b60;
  border-color: #547f57;
  color: #fff;
}

.reset-calculated {
  margin-left: 5px;
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.approve-calculated[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.muted-num {
  color: #59665c;
}

.directive-bottom-grid {
  align-items: start;
}

.directive-approval-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.directive-approval-tabs button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.directive-approval-tabs button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.directive-approval-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.directive-search {
  min-width: min(360px, 100%);
  display: grid;
  gap: 4px;
}

.directive-search input {
  min-height: 34px;
}

.directive-approval-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.directive-approval-content {
  overflow-x: auto;
}

.directive-approval-table th,
.directive-approval-table td {
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.2;
  vertical-align: top;
}

.directive-approval-table th {
  white-space: nowrap;
}

.directive-approval-table strong {
  font-size: 12px;
}

.directive-approval-table small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.15;
}

.directive-approval-table td:nth-child(1) {
  width: 56px;
}

.directive-approval-table td:nth-child(5),
.directive-approval-table td:nth-child(6),
.directive-approval-table td:nth-child(9) {
  white-space: nowrap;
}

.directive-approve-input {
  width: 92px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: right;
  font-size: 12px;
}

.directive-inline-control {
  width: 100%;
  min-width: 92px;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: rgba(255, 250, 243, 0.72);
  color: var(--text);
  font: inherit;
}

.directive-inline-control:hover,
.directive-inline-control:focus {
  border-color: var(--line);
  background: #fff;
  outline: none;
}

.link-cell-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #286f8f;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.link-cell-button:hover {
  text-decoration: underline;
}

.directive-approval-table .row-actions-compact {
  white-space: nowrap;
}

.directive-approval-table .row-actions-compact button {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid #d8c9b8;
  border-radius: 7px;
  background: #fffaf3;
  color: #53635a;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(61, 51, 40, 0.06);
}

.directive-approval-table .row-actions-compact .is-success,
.directive-approval-table .row-actions-compact .action-btn--approve,
.directive-approval-table .row-actions-compact .action-btn--select {
  border-color: #b7d4aa;
  background: #f4fbf0;
  color: #4f8946;
}

.directive-approval-table .row-actions-compact .is-danger,
.directive-approval-table .row-actions-compact .action-btn--cancel,
.directive-approval-table .row-actions-compact .action-btn--delete {
  border-color: #edcfc5;
  background: #fff7f3;
  color: #b85d3f;
}

.directive-approval-table .row-actions-compact .is-money,
.directive-approval-table .row-actions-compact .action-btn--money {
  border-color: #b7d4aa;
  background: #f4fbf0;
  color: #4f8946;
}

.directive-approval-table .row-actions-compact .action-btn--ghost {
  border-color: #d8c9b8;
  background: #fffaf3;
  color: #53635a;
}

.directive-approval-table .row-actions-compact .action-btn--delete {
  font-size: 20px;
  font-weight: 400;
}

.directive-approval-table tr.is-approved-row td {
  background: #eef8ea;
}

.work-table tr.is-approved-row td,
.cash-table tr.is-approved-row td {
  background: #eef8ea;
}

.work-table tr.is-rejected-row td,
.cash-table tr.is-rejected-row td {
  background: #fde8e3;
}

.work-table tr.is-partial-row td,
.cash-table tr.is-partial-row td {
  background: var(--brand-partial);
}

.expense-categories-table select {
  min-height: 30px;
  font-size: 12px;
}

.expense-categories-table {
  table-layout: fixed;
  width: 100%;
}

.expense-operations-table {
  table-layout: fixed;
  width: 100%;
}

.expense-categories-panel.is-collapsed .expense-categories-body {
  display: none;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-collapse-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8f2eb;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.accent-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.table-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.table-link:hover {
  text-decoration: underline;
}

.expense-operation-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.expense-operation-filters label {
  min-width: 0;
}

.expense-operation-filters label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.expense-operation-filters input,
.expense-operation-filters select {
  min-height: 30px;
  font-size: 12px;
}

.expense-filter-actions {
  display: flex;
  align-items: end;
}

.expense-filter-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

.expense-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #f8f2eb;
  color: var(--muted);
  font-size: 12px;
}

.expense-load-more button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.expense-categories-table td,
.expense-operations-table td {
  vertical-align: top;
}

.expense-categories-table th,
.expense-categories-table td,
.expense-operations-table th,
.expense-operations-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-category-groups {
  display: grid;
  gap: 10px;
}

.expense-category-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.expense-category-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  background: #efe6da;
  cursor: pointer;
}

.expense-category-group summary strong {
  font-size: 14px;
}

.expense-category-group summary span {
  color: var(--muted);
  font-size: 12px;
}

.expense-category-group table {
  border-top: 1px solid var(--line);
}

.expense-categories-table small,
.expense-operations-table small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.15;
}

.expense-categories-table th:nth-child(1),
.expense-categories-table td:nth-child(1) {
  width: 34px;
  white-space: nowrap;
}

.expense-categories-table th:nth-child(2),
.expense-categories-table td:nth-child(2) {
  width: 58px;
  white-space: nowrap;
}

.expense-categories-table th:nth-child(3),
.expense-categories-table td:nth-child(3) {
  width: 74px;
  white-space: nowrap;
}

.expense-categories-table th:nth-child(4),
.expense-categories-table td:nth-child(4) {
  width: 28%;
}

.expense-categories-table th:nth-child(5),
.expense-categories-table td:nth-child(5) {
  width: 13%;
}

.expense-categories-table th:nth-child(6),
.expense-categories-table td:nth-child(6) {
  width: 14%;
}

.expense-categories-table th:nth-child(7),
.expense-categories-table td:nth-child(7) {
  width: 20%;
}

.expense-categories-table th:nth-child(8),
.expense-categories-table td:nth-child(8) {
  width: 76px;
  white-space: nowrap;
}

.expense-categories-table th:nth-child(9),
.expense-categories-table td:nth-child(9) {
  width: 106px;
  white-space: nowrap;
}

.expense-category-editor {
  grid-template-columns: 1fr;
}

.expense-editor-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.expense-editor-tabs button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #efe6da;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.expense-editor-tabs button.is-active {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.expense-editor-pane {
  display: none;
}

.expense-editor-pane.is-active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.expense-access-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

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

.expense-operations-table th:nth-child(1),
.expense-operations-table td:nth-child(1) {
  width: 34px;
  white-space: nowrap;
}

.expense-operations-table th:nth-child(2),
.expense-operations-table td:nth-child(2) {
  width: 58px;
  white-space: nowrap;
}

.expense-operations-table th:nth-child(3),
.expense-operations-table td:nth-child(3) {
  width: 88px;
  white-space: nowrap;
}

.expense-operations-table th:nth-child(4),
.expense-operations-table td:nth-child(4) {
  width: 13%;
}

.expense-operations-table th:nth-child(5),
.expense-operations-table td:nth-child(5) {
  width: 16%;
}

.expense-operations-table th:nth-child(6),
.expense-operations-table td:nth-child(6) {
  width: 12%;
}

.expense-operations-table th:nth-child(7),
.expense-operations-table td:nth-child(7) {
  width: 9%;
}

.expense-operations-table th:nth-child(8),
.expense-operations-table td:nth-child(8) {
  width: 10%;
}

.expense-operations-table th:nth-child(9),
.expense-operations-table td:nth-child(9) {
  width: 10%;
}

.expense-operations-table th:nth-child(10),
.expense-operations-table td:nth-child(10) {
  width: 9%;
}

.expense-operations-table th:nth-child(11),
.expense-operations-table td:nth-child(11) {
  width: 10%;
}

.expense-operations-table th:nth-child(12),
.expense-operations-table td:nth-child(12) {
  width: 82px;
  white-space: nowrap;
}

.expense-operations-table th:nth-child(13),
.expense-operations-table td:nth-child(13) {
  width: 92px;
  white-space: nowrap;
}

.week-control-grid {
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  align-items: stretch;
}

.close-panel header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.close-panel p {
  margin: -6px 0 0;
  color: var(--muted);
}

.close-state {
  border: 1px solid #d7a58f;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff2eb;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.close-state.ready {
  border-color: #79bc81;
  background: #eaf7ec;
  color: #235b31;
}

.week-checklist {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.week-checklist li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  background: #fff;
}

.week-checklist li > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.week-checklist .is-ok > span {
  background: #79bc81;
  color: #fff;
}

.week-checklist .is-wait > span {
  background: #f4d8c8;
  color: #8a3a18;
}

.week-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.week-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  cursor: pointer;
}

.week-actions .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.week-actions .week-action-lock.is-open {
  border-color: #6fb267;
  background: #79bc81;
  color: #fff;
  font-weight: 800;
}

.week-actions .week-action-lock.is-locked {
  border-color: #b94c3f;
  background: #d35b4a;
  color: #fff;
  font-weight: 800;
}

.week-actions .week-action-supplier {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.week-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.control-summary {
  display: grid;
  gap: 7px;
}

.control-surface {
  display: grid;
  gap: 18px;
}

.control-register-panel,
.control-summary-panel,
.control-operations-panel {
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  border-color: rgba(89, 102, 92, 0.18);
  box-shadow: 0 10px 24px rgba(32, 39, 32, 0.06);
}

.manajet-strip {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(89, 102, 92, 0.98), rgba(72, 83, 74, 0.98));
  color: #fff;
  font-size: 16px;
  font-weight: 680;
  letter-spacing: 0.005em;
  line-height: 1;
}

.control-strip-add {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.manajet-cash-table thead th,
.manajet-ops-table thead th {
  background: #465046;
  color: #f8f5ef;
  font-weight: 700;
  border-right: 1px solid rgba(233, 227, 221, 0.18);
}

.manajet-cash-table td strong,
.manajet-ops-table td strong {
  font-weight: 700;
}

.manajet-cash-table td small {
  display: block;
  margin-top: 4px;
  color: #6c7d8d;
}

.manajet-cash-input {
  min-width: 130px;
  min-height: 32px;
  border: 1px solid #d4c3b1;
  border-radius: 4px;
  padding: 0 8px;
  font: inherit;
}

.control-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.object-row-actions {
  min-width: 112px;
  width: 112px;
  max-width: 112px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.object-table {
  width: 100%;
  table-layout: fixed;
}

.object-table th:nth-child(1),
.object-table td:nth-child(1) {
  width: 72px;
  max-width: 72px;
}

.object-table th:nth-child(2),
.object-table td:nth-child(2) {
  width: 30%;
}

.object-table th:nth-child(3),
.object-table td:nth-child(3) {
  width: 36%;
}

.object-table th:nth-child(4),
.object-table td:nth-child(4) {
  width: 126px;
  max-width: 126px;
}

.object-table th:nth-child(5),
.object-table td:nth-child(5) {
  width: 112px;
  max-width: 112px;
}

body:not(.workspace-expanded) .object-table th,
body:not(.workspace-expanded) .object-table td {
  padding-left: 6px;
  padding-right: 6px;
}

body:not(.workspace-expanded) .object-table td {
  font-size: 13px;
}

body:not(.workspace-expanded) .object-row-actions {
  gap: 4px;
}

.object-linker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.object-add-counterparty {
  min-width: 104px;
  min-height: 32px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.object-add-counterparty:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.control-icon-btn {
  min-width: 34px;
  min-height: 32px;
  border-radius: 7px;
  border: 1px solid #d8c9b8;
  background: #fffaf3;
  color: #59665c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 1px 0 rgba(61, 51, 40, 0.06);
}

.control-icon-btn:hover {
  border-color: #bda98f;
  background: #fff6e9;
}

.control-icon-btn.is-delete {
  border-color: #edcfc5;
  background: #fff7f3;
  color: #b85636;
}

.control-hidden-input {
  display: none;
}

.static-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.static-chip small {
  color: var(--muted);
  font-size: 11px;
}

.chip-remove-btn {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(184, 86, 54, 0.18);
  border-radius: 6px;
  background: #fff7f3;
  color: #b85636;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  flex: 0 0 auto;
}

.chip-remove-btn:hover {
  background: rgba(184, 86, 54, 0.12);
}

.object-counterparty-list {
  display: grid;
  gap: 8px;
}

.object-counterparty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.object-counterparty-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.object-counterparty-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.object-counterparty-text small {
  color: var(--muted);
  font-size: 11px;
}

.manajet-control-summary {
  gap: 0;
}

.control-summary-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f7f2eb, #f2ebe2);
  color: #6d736a;
  font-size: 13px;
}

.control-summary-caption span,
.control-summary-caption b {
  padding: 0 12px;
}

.control-summary-caption b {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: #59665c;
  color: #f8f5ef;
  font-size: 13px;
}

.control-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
}

.control-summary-row span,
.control-summary-row b {
  padding: 0 12px;
}

.control-summary-row b {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.control-summary-row.total {
  font-weight: 800;
  background: rgba(205, 194, 176, 0.14);
}

.control-summary-row.diff {
  background: rgba(244, 108, 64, 0.12);
}

.control-summary-row.is-balanced.diff {
  background: rgba(89, 102, 92, 0.14);
}

.control-confirm-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(251, 247, 240, 0.94);
  color: var(--muted);
}

.control-confirm-row .primary {
  min-height: 32px;
  border: 1px solid var(--chrome-hot);
  border-radius: 6px;
  background: var(--chrome-hot);
  color: #fff;
  font-weight: 800;
}

.control-confirm-row .primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.control-empty-note {
  margin: 0;
  padding: 18px 16px;
}

.control-summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 34px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.control-summary span {
  color: var(--muted);
}

.control-summary b {
  font-size: 16px;
}

.control-summary .is-balanced b {
  color: #235b31;
}

.control-summary .is-diff b {
  color: #a33b1a;
}

.funds-week-table tfoot td {
  border-top: 2px solid var(--line);
  background: #f8f2eb;
  font-weight: 800;
}

.income-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  overflow: visible;
  background: linear-gradient(180deg, #f7f2eb, #f2ebe2);
  border-color: rgba(89, 102, 92, 0.16);
}

.income-tabs button {
  min-height: 32px;
  border: 1px solid rgba(89, 102, 92, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0 12px;
  cursor: pointer;
  color: var(--muted);
  box-shadow: 0 1px 0 rgba(89, 102, 92, 0.04);
}

.income-tabs button.active {
  border-color: rgba(89, 102, 92, 0.34);
  background: linear-gradient(180deg, rgba(89, 102, 92, 0.96), rgba(72, 83, 74, 0.96));
  color: #fffdf8;
  font-weight: 800;
}

.income-tabs .ghost {
  margin-left: auto;
  background: transparent;
  color: #59665c;
}

.income-advanced {
  display: grid;
  gap: 8px;
}

.income-advanced[hidden] {
  display: none;
}

.income-rules-table th:nth-child(4),
.income-rules-table td:nth-child(4),
.income-rules-table th:nth-child(5),
.income-rules-table td:nth-child(5) {
  width: 120px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #f4fbf8;
}

.income-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.income-type-grid button {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.income-type-grid button:hover {
  border-color: var(--chrome-hot);
  background: #f4fbf8;
}

.income-type-grid strong,
.income-type-grid span {
  display: block;
}

.income-type-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.income-overview-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.income-type-list th:nth-child(1),
.income-type-list td:nth-child(1) {
  width: 72px;
  white-space: nowrap;
}

.income-type-list th:nth-child(3),
.income-type-list td:nth-child(3) {
  width: 110px;
}

.income-type-list th:nth-child(4),
.income-type-list td:nth-child(4) {
  width: 180px;
}

.income-types-panel {
  max-height: 360px;
}

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

.panel-title-row h2 {
  margin: 0;
}

.muted-note {
  margin: 6px 0 0;
  color: var(--muted);
}

.funds-surface {
  gap: 10px;
}

.funds-stage-panel .panel-title-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.funds-full-table th:nth-child(1),
.funds-full-table td:nth-child(1) {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
}

.funds-full-table th:nth-child(2),
.funds-full-table td:nth-child(2) {
  width: 72px;
  white-space: nowrap;
}

.funds-full-table th:nth-child(3),
.funds-full-table td:nth-child(3) {
  width: 84px;
  white-space: nowrap;
}

.funds-full-table th.actions-col,
.funds-full-table td.actions-col {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  overflow: visible;
}

.funds-full-table td:nth-child(3),
.funds-full-table td:nth-child(2) {
  white-space: nowrap;
  color: var(--muted);
  font-weight: 700;
}

.income-week-table th:nth-child(1),
.income-week-table td:nth-child(1) {
  width: 72px;
  white-space: nowrap;
}

.funds-inline-metrics {
  margin-top: 8px;
  border-radius: 6px;
  overflow: hidden;
}

.debt-cell.is-negative {
  color: #c64545;
}

.debt-cell.is-positive {
  color: #2d8b57;
}

.fund-stage-toggle {
  width: 34px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d8c9b8;
  border-radius: 7px;
  background: #fffaf3;
  color: #59665c;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(61, 51, 40, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fund-stage-chevron {
  display: inline-block;
}

.panel-title-row:hover .fund-stage-toggle {
  border-color: #bda98f;
  background: #fff6e9;
}

.funds-total-panel {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid #cdbda9;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.98);
  box-shadow: 0 -2px 10px rgba(61, 51, 40, 0.1);
  overflow-x: auto;
  white-space: nowrap;
}

.funds-total-panel strong {
  flex: 0 0 auto;
  min-width: 58px;
  color: #2c352f;
  font-size: 15px;
}

.funds-total-panel span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  flex: 0 0 auto;
  color: #59665c;
}

.funds-total-panel em {
  font-style: normal;
  font-size: 12px;
  color: #687469;
}

.funds-total-panel b {
  color: #20251f;
  font-size: 14px;
}

.income-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.income-stat-card {
  min-height: 152px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.income-stat-card span,
.income-stat-card b {
  display: block;
}

.income-stat-card span {
  color: var(--muted);
}

.income-stat-card b {
  margin-top: 6px;
  font-size: 22px;
}

.mini-chart {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 68px;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.mini-chart span {
  flex: 1;
  min-width: 5px;
  border-radius: 3px 3px 0 0;
  background: var(--chrome-hot);
}

.income-stat-card:nth-child(2) .mini-chart span {
  background: #79bc81;
}

.income-period-tabs {
  display: flex;
  gap: 8px;
}

.income-period-tabs button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

.income-period-tabs .active {
  border-color: var(--chrome-hot);
  background: var(--chrome-hot);
  color: #fff;
}

.income-rule-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid rgba(244, 108, 64, 0.25);
  border-radius: 6px;
  background: rgba(244, 108, 64, 0.08);
  color: var(--muted);
}

.income-rule-stage {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.income-rule-stage summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  background: #c6dbce;
  cursor: pointer;
  font-weight: 800;
}

.income-rule-edit-table input[type="number"] {
  width: 110px;
}

body[data-table="incomes"] .action-right .inline-search,
body[data-table="incomes"] #toolbarReset,
body[data-table="incomes"] [data-view-mode],
body[data-table="incomes"] #expandViewBtn {
  display: none;
}

body[data-table="orders"] #toggleFiltersBtn {
  display: none;
}

.work-toolbar {
  display: grid;
  grid-template-columns: 280px minmax(220px, 1fr) 150px;
  gap: 14px;
  align-items: end;
  min-width: 0;
}

.work-toolbar b {
  display: block;
  min-height: 34px;
  padding: 8px 0;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  min-width: 0;
}

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

.request-form h2,
.request-form .wide {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  resize: vertical;
}

.work-table,
.cash-table {
  min-width: 0;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.work-table th,
.cash-table th {
  position: static;
}

.work-table td,
.cash-table td {
  max-width: 360px;
}

.work-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #e8eef3;
  color: #35424e;
  font-size: 12px;
  white-space: nowrap;
}

.status-approved {
  background: #e5f5ed;
  color: #126044;
}

.status-partially_approved {
  background: #fff6db;
  color: #8a5b00;
}

.status-paid,
.status-closed {
  background: #e8f0ff;
  color: #244b90;
}

.status-rejected {
  background: #fde8e3;
  color: #9a3412;
}

.row-actions {
  min-width: 190px;
  white-space: nowrap;
}

.fund-link-button {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fund-link-button strong {
  color: var(--accent-deep, #3f5b40);
  text-decoration: underline;
  text-decoration-color: rgba(63, 91, 64, 0.35);
  text-underline-offset: 2px;
}

.fund-editor-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(63, 91, 64, 0.08);
  color: #435445;
  font-size: 13px;
  line-height: 1.45;
}

.row-actions button,
.save-cash,
.work-toolbar button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
  margin-right: 5px;
  cursor: pointer;
}

.empty {
  padding: 18px;
  color: var(--muted);
  background: #f8fafb;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #202720;
  color: #fff;
  box-shadow: 0 12px 28px rgb(0 0 0 / 24%);
  font-size: 13px;
}

@media print {
  .app-header,
  .topbar,
  .actionbar,
  .filters,
  .pager,
  .actions-col,
  .select-col {
    display: none !important;
  }

  html,
  body {
    height: auto;
    overflow: visible;
  }

  .workspace,
  .table-wrap {
    display: block;
    height: auto;
    overflow: visible;
    max-width: none;
  }

  table {
    min-width: 0;
    font-size: 10px;
  }
}

@media (max-width: 1180px) {
  .work-grid,
  .work-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .brand-row {
    grid-template-columns: minmax(118px, auto) minmax(0, 1fr);
    min-height: 46px;
    padding: 3px 6px;
  }

  .brand {
    gap: 7px;
  }

  .brand-logo {
    width: 23px;
    height: 32px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small,
  .top-status {
    display: none;
  }

  .icon-strip button,
  .week-arrow,
  .week-setup {
    width: 36px;
    height: 36px;
  }

  .icon-strip button svg {
    width: 22px;
    height: 22px;
  }

  .week-label {
    max-width: 116px;
    padding-right: 8px;
  }

  .tabs button {
    min-height: 32px;
    padding: 0 10px;
  }

  .topbar {
    gap: 10px;
    min-height: 38px;
  }

  .actionbar {
    gap: 6px;
  }

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

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 114px;
    overflow: auto;
  }

  .pager {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 8px;
  }

  .pager-actions {
    gap: 6px;
  }

  .work-surface {
    padding: 8px;
    gap: 8px;
  }

  .work-panel {
    padding: 10px;
    border-radius: 6px;
  }

  .module-grid,
  .request-form,
  .modal-form {
    grid-template-columns: 1fr;
  }

  .directive-section-title,
  .directive-fund-title {
    grid-template-columns: 18px minmax(0, 1fr);
    padding: 0 9px;
  }

  .directive-section-title b,
  .directive-fund-title b {
    grid-column: 2;
    font-size: 13px;
  }

  .directive-table {
    min-width: 720px;
  }

.work-table,
.cash-table {
  min-width: 720px;
}
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(118, 151, 95, 0.14);
  color: #45583b;
  font-size: 12px;
  margin: 0 6px 6px 0;
}

.muted {
  color: #7e7b73;
  font-size: 12px;
}

.checkbox-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(70, 92, 55, 0.18);
  border-radius: 10px;
  background: #fff;
}

.object-pick-block {
  display: grid;
  gap: 10px;
}

.object-pick-block.is-disabled {
  opacity: 0.6;
}

.object-pick-title {
  font-weight: 700;
  color: #2f352d;
}

.toggle-line.compact {
  font-size: 12px;
}

@media (max-width: 430px) {
  .brand-row {
    grid-template-columns: 1fr;
  }

  .icon-strip {
    grid-row: 2;
  }

  .finance-strip {
    min-height: 32px;
  }

  .week-label {
    display: none;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager-actions {
    justify-content: space-between;
    width: 100%;
  }
}
