:root {
  --bg: #f3f3ef;
  --bg-soft: #fafaf8;
  --panel: #ffffff;
  --text: #28323a;
  --muted: #5f6b75;
  --nav-green: #5d7f2f;
  --nav-green-dark: #4f6d27;
  --accent: #4f6d27;
  --warn: #a4411c;
  --ok: #366d2a;
  --border: #d6ddd2;
  --shadow: 0 3px 10px rgba(28, 37, 28, 0.08);
  --topbar-sticky-offset: 90px;
  --drilldown-indent-step: 0.55rem;
  --drilldown-gap-y: 0.45rem;
  --action-n-bg: #2f6f3a;
  --action-n-border: #295f31;
  --action-n-text: #ffffff;
  --action-t-bg: #eaf3ff;
  --action-t-border: #8eb3da;
  --action-t-text: #1f4f78;
  --action-v-bg: #edf4fb;
  --action-v-border: #9bb6cf;
  --action-v-text: #234b6b;
  --action-k-bg: #e8f6f1;
  --action-k-border: #89c4b2;
  --action-k-text: #1f5f52;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fbfbf9 0%, var(--bg) 100%);
  min-height: 100vh;
}

html {
  scrollbar-gutter: stable;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(93, 127, 47, 0.04) 0, rgba(93, 127, 47, 0.04) 1px, transparent 1px, transparent 26px),
    linear-gradient(rgba(93, 127, 47, 0.04) 0, rgba(93, 127, 47, 0.04) 1px, transparent 1px, transparent 26px);
  pointer-events: none;
  z-index: -1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.95rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 3px solid var(--nav-green);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.env-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.35rem 1rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: repeating-linear-gradient(135deg, #b3261e 0, #b3261e 18px, #8f1d17 18px, #8f1d17 36px);
}

body.env-staging .topbar {
  top: 1.9rem;
  border-bottom-color: #b3261e;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  height: 56px;
  width: auto;
  max-width: 180px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(41, 63, 27, 0.18);
}

.topbar h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  color: #31411b;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.file-persist-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 600;
}

.file-persist-status-ok {
  background: #e9f6e8;
  border-color: #9ac59a;
  color: #275f2f;
}

.file-persist-status-pending {
  background: #fff7e2;
  border-color: #e7c67a;
  color: #8a6111;
}

.file-persist-status-warn {
  background: #fff1ec;
  border-color: #e3b7a7;
  color: #8e3a1f;
}

.file-persist-status-error {
  background: #ffe7e7;
  border-color: #df9c9c;
  color: #8f1f1f;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 90px);
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  background: linear-gradient(180deg, var(--nav-green) 0%, var(--nav-green-dark) 100%);
  border-right: 1px solid #466020;
  padding: 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  align-self: start;
  position: sticky;
  top: var(--topbar-sticky-offset);
  max-height: calc(100vh - var(--topbar-sticky-offset));
  overflow: auto;
  transition: padding 180ms ease, opacity 180ms ease;
}

.nav-toggle-button {
  min-height: 2rem;
}

body.sidebar-collapsed .layout {
  grid-template-columns: 0 minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  border-right: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.sidebar a {
  text-decoration: none;
  color: #eff4e8;
  padding: 0.6rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  transition: background 120ms ease, border-color 120ms ease;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.content {
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

[data-accounting-document],
[data-accounting-post] {
  white-space: nowrap;
}

[data-accounting-post] {
  min-width: max-content;
}

[data-accounting-period] {
  max-width: 100%;
}

.accounting-journal-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
}

.accounting-col-period { width: 7%; }
.accounting-col-date { width: 7%; }
.accounting-col-document { width: 11%; }
.accounting-col-description { width: 14%; }
.accounting-col-counterparty { width: 10%; }
.accounting-col-account { width: 10%; }
.accounting-col-cost-center { width: 6%; }
.accounting-col-money { width: 7%; }
.accounting-col-status { width: 6%; }
.accounting-col-actions { width: 15%; }

.accounting-entry-table .accounting-col-document { width: 16%; }
.accounting-entry-table .accounting-col-description { width: 23%; }

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

.accounting-chart-accounts {
  min-width: 880px;
}

.accounting-chart-cost-centers {
  min-width: 560px;
}

.accounting-chart-accounts .accounting-chart-col-number { width: 10%; }
.accounting-chart-accounts .accounting-chart-col-name { width: 22%; }
.accounting-chart-accounts .accounting-chart-col-type { width: 16%; }
.accounting-chart-accounts .accounting-chart-col-group { width: 20%; }
.accounting-chart-accounts .accounting-chart-col-order { width: 8%; }
.accounting-chart-accounts .accounting-chart-col-assignment { width: 16%; }
.accounting-chart-accounts .accounting-chart-col-action { width: 8%; }
.accounting-chart-cost-centers .accounting-chart-col-number { width: 20%; }
.accounting-chart-cost-centers .accounting-chart-col-name { width: 68%; }
.accounting-chart-cost-centers .accounting-chart-col-action { width: 12%; }

.accounting-chart-table input,
.accounting-chart-table select {
  width: 100%;
  min-width: 0;
}

.accounting-chart-table th:last-child,
.accounting-chart-action {
  text-align: center;
}

.accounting-import-panel {
  padding: 0;
  overflow: hidden;
}

.accounting-import-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 1.2rem 1rem;
  border-bottom: 1px solid #dce3d8;
  background: #fbfcf9;
}

.accounting-import-header > div:first-child {
  max-width: 46rem;
}

.accounting-import-kicker {
  display: block;
  margin-bottom: 0.2rem;
  color: #587339;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.accounting-import-header h3 {
  margin-bottom: 0.3rem;
  font-size: 1.45rem;
}

.accounting-import-header p {
  margin: 0;
  color: #5c6655;
  line-height: 1.45;
}

.accounting-import-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(6.4rem, 1fr));
  align-self: start;
  min-width: min(24rem, 42%);
}

.accounting-import-steps span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  color: #778071;
  font-size: 0.74rem;
  text-align: center;
}

.accounting-import-steps span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.85rem;
  left: calc(50% + 1.15rem);
  width: calc(100% - 2.3rem);
  height: 2px;
  background: #d7dfd0;
}

.accounting-import-steps b {
  position: relative;
  z-index: 1;
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border: 1px solid #c4cec0;
  border-radius: 50%;
  background: #fff;
  font-size: 0.75rem;
}

.accounting-import-steps .is-active {
  color: #33431e;
  font-weight: 700;
}

.accounting-import-steps .is-active b {
  border-color: #587339;
  background: #587339;
  color: #fff;
}

.accounting-import-warning {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0.9rem 1.2rem 0;
}

.accounting-import-upload {
  display: grid;
  grid-template-columns: minmax(14rem, 0.8fr) minmax(18rem, 1.4fr) auto;
  gap: 0.8rem;
  align-items: end;
  padding: 1rem 1.2rem;
  background: #f3f6ef;
}

.accounting-import-control,
.accounting-import-field {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.accounting-import-control > span,
.accounting-import-field > span {
  color: #4d5c41;
  font-size: 0.76rem;
  font-weight: 700;
}

.accounting-import-control select,
.accounting-import-control input,
.accounting-import-upload > button {
  width: 100%;
  min-height: 2.55rem;
}

.accounting-import-file input {
  padding: 0.35rem;
  border: 1px dashed #9cab91;
  background: #fff;
}

.accounting-import-file button {
  width: 100%;
  min-height: 2.55rem;
  border: 1px dashed #9cab91;
  background: #fff;
}

.accounting-import-file small {
  overflow: hidden;
  color: #687463;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-import-summary {
  display: grid;
  grid-template-columns: minmax(12rem, 1.6fr) minmax(11rem, 1.2fr) repeat(4, minmax(6.5rem, 0.55fr));
  border-top: 1px solid #dce3d8;
  border-bottom: 1px solid #dce3d8;
}

.accounting-import-summary > div {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 1rem;
  border-right: 1px solid #e1e7dd;
  min-width: 0;
}

.accounting-import-summary > div:last-child {
  border-right: 0;
}

.accounting-import-summary span {
  color: #6f7969;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.accounting-import-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-import-summary small {
  overflow: hidden;
  color: #737d6e;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-import-summary .has-duplicates {
  background: #fff5e7;
}

.accounting-import-selection-bar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #dce3d8;
  background: #fbfcf9;
}

.accounting-import-selection-bar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.accounting-import-selection-bar button {
  min-height: 1.9rem;
}

.accounting-import-quick-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.9rem;
  padding: 0 0.35rem;
  color: #4d5c41;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.accounting-import-quick-filter input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.accounting-import-selection-bar [data-accounting-import-apply] {
  margin-left: 0.35rem;
}

.accounting-import-empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 3.1rem 1.2rem 3.4rem;
  border-top: 1px solid #e1e7dd;
  color: #64705e;
  text-align: center;
}

.accounting-import-empty strong {
  color: #3f4f31;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
}

.accounting-import-empty span {
  max-width: 38rem;
  line-height: 1.45;
}

.accounting-import-table-wrap {
  border-bottom: 1px solid #dce3d8;
}

.accounting-import-table-controls {
  padding: 0.75rem 1.2rem;
  border-bottom: 1px solid #dce3d8;
  background: #f8faf6;
}

.accounting-import-table-controls .accounting-table-filter {
  max-width: 42rem;
}

.accounting-import-table {
  width: 100%;
  min-width: 1600px;
  table-layout: fixed;
  margin: 0;
}

.accounting-import-col-select { width: 5%; }
.accounting-import-col-date { width: 8%; }
.accounting-import-col-transaction { width: 17%; }
.accounting-import-col-amount { width: 8%; }
.accounting-import-col-open-item { width: 40%; }
.accounting-import-col-booking { width: 22%; }

.accounting-import-table th,
.accounting-import-table td {
  vertical-align: top;
}

.accounting-import-table th:first-child,
.accounting-import-select-cell {
  text-align: center;
}

.accounting-import-select-cell input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.45rem;
}

.accounting-import-row.is-selected td {
  background: #fbfcf9;
}

.accounting-import-row.is-duplicate td {
  background: #f4f4f1;
  color: #747b70;
}

.accounting-import-duplicate-badge {
  display: block;
  margin-top: 0.35rem;
  color: #8a6111;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
}

.accounting-import-transaction strong,
.accounting-import-transaction span {
  display: block;
  overflow-wrap: anywhere;
}

.accounting-import-transaction span {
  margin-top: 0.2rem;
  color: #687161;
  font-size: 0.78rem;
  line-height: 1.35;
}

.accounting-import-amount {
  font-weight: 700;
  white-space: nowrap;
}

.accounting-import-amount.is-positive {
  color: #35723f;
}

.accounting-import-amount.is-negative {
  color: #a34135;
}

.accounting-import-field select,
.accounting-import-field input {
  width: 100%;
  min-width: 0;
}

.accounting-import-field small {
  color: #798174;
  font-size: 0.7rem;
}

.accounting-import-open-item-picker {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.accounting-import-open-item-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
}

.accounting-import-open-item-picker-head label {
  display: grid;
  gap: 0.2rem;
}

.accounting-import-open-item-picker-head label > span {
  color: #4d5c41;
  font-size: 0.7rem;
  font-weight: 700;
}

.accounting-import-open-item-picker-head input {
  width: 100%;
  min-height: 2rem;
  padding: 0.35rem 0.5rem;
}

.accounting-import-open-item-picker-head > strong {
  padding-bottom: 0.45rem;
  color: #526247;
  font-size: 0.72rem;
  white-space: nowrap;
}

.accounting-import-open-item-options {
  max-height: 13rem;
  overflow: auto;
  border: 1px solid #cbd5c5;
  background: #fff;
}

.accounting-import-open-item-option {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  padding: 0.5rem;
  border-bottom: 1px solid #e3e8df;
  cursor: pointer;
}

.accounting-import-open-item-option[hidden],
.accounting-import-open-item-empty[hidden] {
  display: none;
}

.accounting-import-open-item-option:last-child {
  border-bottom: 0;
}

.accounting-import-open-item-option:hover,
.accounting-import-open-item-option.is-selected {
  background: #eef4e9;
}

.accounting-import-open-item-option input {
  width: 1rem;
  height: 1rem;
  margin: 0.15rem 0 0;
}

.accounting-import-open-item-option span,
.accounting-import-open-item-option small {
  display: block;
  min-width: 0;
}

.accounting-import-open-item-option strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.accounting-import-open-item-option small {
  margin-top: 0.15rem;
  color: #687161;
  font-size: 0.68rem;
  line-height: 1.3;
}

.accounting-import-open-item-empty {
  padding: 0.6rem;
  color: #737d6e;
  font-size: 0.72rem;
}

.accounting-import-no-match {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem;
  border-left: 3px solid #c4cec0;
  background: #f3f5f1;
}

.accounting-import-no-match span {
  color: #4d5c41;
  font-size: 0.78rem;
  font-weight: 700;
}

.accounting-import-no-match small {
  color: #737d6e;
  font-size: 0.7rem;
}

.accounting-import-booking-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.accounting-import-counter-field {
  grid-column: 1 / -1;
}

.accounting-import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.9rem 1.2rem;
  background: #fbfcf9;
}

.accounting-profit-loss-table,
.accounting-cost-center-result-table {
  width: 100%;
  table-layout: fixed;
}

.accounting-profit-loss-table {
  min-width: 680px;
}

.accounting-cost-center-result-table {
  min-width: 760px;
}

.accounting-profit-loss-col-group { width: 26%; }
.accounting-profit-loss-col-account { width: 42%; }
.accounting-profit-loss-col-amount { width: 16%; }

.accounting-profit-loss-table th:nth-child(n + 3),
.accounting-profit-loss-table td:nth-child(n + 3),
.accounting-cost-center-result-table th:nth-child(n + 3),
.accounting-cost-center-result-table td:nth-child(n + 3) {
  text-align: right;
}

.accounting-profit-loss-table td:nth-child(-n + 2),
.accounting-cost-center-result-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.accounting-cost-center-col-number { width: 16%; }
.accounting-cost-center-col-description { width: 42%; }
.accounting-cost-center-col-amount { width: 14%; }

.accounting-chart-assignment span {
  display: block;
  overflow-wrap: anywhere;
}

.accounting-ledger-table td:nth-child(8),
.accounting-ledger-table td:nth-child(9),
.accounting-ledger-table tfoot th:nth-child(8),
.accounting-ledger-table tfoot th:nth-child(9) {
  text-align: right;
}

.accounting-journal-table td:nth-child(3),
.accounting-journal-table td:nth-child(4),
.accounting-journal-table td:nth-child(5),
.accounting-journal-table td:nth-child(6) {
  overflow-wrap: anywhere;
}

.accounting-journal-table td:nth-child(4) {
  white-space: pre-line;
}

.accounting-open-items-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.accounting-open-items-controls .accounting-table-filter {
  flex: 1 1 28rem;
}

.accounting-open-items-quick-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  color: #4d5c41;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.accounting-open-items-quick-filter input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.accounting-row-actions {
  min-width: 0;
}

.accounting-bulk-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  min-height: 1.75rem;
  margin: 0;
}

.accounting-bulk-check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.accounting-bulk-check-all {
  display: inline-flex;
  vertical-align: middle;
}

.accounting-action-legend {
  flex-basis: auto;
  margin-left: auto;
  text-align: right;
}

.accounting-edit-panel {
  margin: 0.85rem 0;
  padding: 0.9rem;
  border: 2px solid #6f8f4e;
  border-radius: 6px;
  background: #f7faf3;
  scroll-margin-top: 1rem;
}

.accounting-edit-header h3 {
  margin: 0.35rem 0 0.15rem;
}

.accounting-edit-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: end;
}

.accounting-edit-text-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem;
  margin-top: 0.7rem;
  align-items: end;
}

.accounting-entry-row-editing td {
  background: #eef5e7;
  box-shadow: inset 0 1px 0 #9cb184, inset 0 -1px 0 #9cb184;
}

.accounting-table-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.45rem;
  margin: 0.55rem 0 0.7rem;
}

.accounting-table-filter .filter-control {
  display: grid;
  gap: 0.2rem;
  min-width: min(320px, 100%);
  flex: 1 1 280px;
}

.accounting-table-filter input,
.accounting-table-filter button {
  min-height: 2rem;
}

.accounting-special-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.accounting-special-grid > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem;
  border-left: 3px solid #6f8f4e;
  background: #f7faf3;
}

.accounting-special-grid strong {
  font-size: 1.15rem;
}

@media (max-width: 900px) {
  .accounting-edit-meta-grid,
  .accounting-edit-text-grid {
    grid-template-columns: 1fr;
  }

  .accounting-import-header {
    display: grid;
  }

  .accounting-import-steps {
    width: 100%;
    min-width: 0;
  }

  .accounting-import-upload {
    grid-template-columns: 1fr;
  }

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

  .accounting-import-summary > div:nth-child(even) {
    border-right: 0;
  }

  .accounting-import-summary > div:nth-child(-n + 4) {
    border-bottom: 1px solid #e1e7dd;
  }

  .accounting-import-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .accounting-import-selection-bar > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .accounting-table-filter button {
    flex: 1 1 auto;
  }

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card {
  padding: 0.9rem;
}

.card h3 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
}

.card p {
  margin: 0.3rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #364524;
}

.panel {
  padding: 0.95rem;
}

.warning-block {
  margin-top: 0.7rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2bf70;
  border-left: 4px solid #c28a1d;
  border-radius: 4px;
  background: #fff7df;
  color: #6d4a00;
}

.warning-block strong {
  color: #5d3f00;
}

.notice {
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--text);
}

.notice > :first-child {
  margin-top: 0;
}

.notice > :last-child {
  margin-bottom: 0;
}

.notice ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.notice-warning {
  border-color: #e2bf70;
  border-left-color: #c28a1d;
  background: #fff7df;
  color: #6d4a00;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.capture-row-protected {
  background: #f4f6f1;
  color: #55604c;
}

.capture-row-protected input,
.capture-row-protected select,
.capture-row-protected textarea {
  background: #eef1ea;
  color: #55604c;
}

.screen-help {
  margin: 0.55rem 0 0.2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--nav-green);
  border-radius: 4px;
  background: var(--bg-soft);
}

.screen-help > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.45rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #3c4f26;
}

.screen-help > summary::-webkit-details-marker {
  display: none;
}

.screen-help > summary:hover {
  color: #2b3b18;
}

.screen-help-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--nav-green);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1;
}

.screen-help-body {
  padding: 0 0.65rem 0.7rem;
  border-top: 1px solid var(--border);
}

.screen-help-purpose {
  margin: 0.55rem 0 0.6rem;
  font-size: 0.85rem;
  color: var(--text);
}

.screen-help-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: start;
}

.screen-help-block h4 {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  color: #46552d;
}

.screen-help-block ol {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.screen-help-block li {
  margin-bottom: 0.2rem;
}

.screen-help-cases {
  margin: 0;
  font-size: 0.82rem;
}

.screen-help-case {
  margin-bottom: 0.35rem;
}

.screen-help-case dt {
  font-weight: 600;
  color: #46552d;
}

.screen-help-case dd {
  margin: 0;
  color: var(--muted);
}

.screen-help-note {
  margin: 0.6rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.report-muted-cell {
  color: var(--muted);
  opacity: 0.6;
  display: inline-block;
  min-height: 1em;
}

.report-inactive-period-row td {
  color: #687069;
  background-color: #f1f3f0;
  background-image: repeating-linear-gradient(135deg, transparent 0, transparent 8px, rgba(87, 96, 88, 0.08) 8px, rgba(87, 96, 88, 0.08) 10px);
}

.report-inactive-period-row td:first-child {
  box-shadow: inset 3px 0 #89918a;
}

.report-period-label {
  display: inline-block;
  margin-right: 0.5rem;
  font-weight: 600;
}

.report-period-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0.1rem 0.38rem;
  border: 1px solid #aeb5af;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.78);
  color: #535b54;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.report-inactive-value {
  color: #707771;
  font-weight: 600;
}

.report-yearly-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.report-yearly-table {
  width: 100%;
}

.report-vacation-yearly-table {
  min-width: 38rem;
}

.report-overtime-yearly-table {
  min-width: 46rem;
}

.panel-spaced-top {
  margin-top: 0.8rem;
}

.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: center;
  justify-content: space-between;
}

.dashboard-hero-main h2 {
  margin-bottom: 0.25rem;
}

.dashboard-role-badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #e9f2dd;
  border: 1px solid #bcd09e;
  color: #3f5a1e;
  font-weight: 700;
  font-size: 0.8rem;
}

.dashboard-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.dashboard-quick-link {
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: #3f5a1e;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 120ms ease, border-color 120ms ease;
}

.dashboard-quick-link:hover {
  background: #eef4e6;
  border-color: #bcd09e;
}

.dashboard-metric-grid {
  align-items: stretch;
}

.dashboard-metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 100%;
}

.dashboard-metric-hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.dashboard-metric-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.dashboard-metric-link:hover {
  border-color: #bcd09e;
  box-shadow: 0 5px 14px rgba(28, 37, 28, 0.12);
  transform: translateY(-1px);
}

.dashboard-metric-link:focus-visible {
  outline: 2px solid var(--nav-green);
  outline-offset: 2px;
}

.dashboard-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.85rem;
}

.dashboard-primary-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

.dashboard-primary-panel-grid > .dashboard-panel {
  height: 30rem;
  min-height: 0;
}

.dashboard-finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.dashboard-subhead {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: #46552d;
}

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

.dashboard-suggestions-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.dashboard-suggestion-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.dashboard-suggestion-header h2,
.dashboard-suggestion-header p {
  margin: 0;
}

.dashboard-suggestion-form {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  border: 1px solid #dce3d8;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: #fbfdf9;
}

.dashboard-suggestion-form label {
  display: grid;
  gap: 0.3rem;
  color: #33461d;
  font-weight: 600;
}

.dashboard-suggestion-form textarea {
  resize: vertical;
  min-height: 6rem;
}

.dashboard-suggestion-limit {
  align-self: end;
  justify-self: end;
  padding-bottom: 0.55rem;
  color: var(--muted);
}

.dashboard-suggestion-form-actions,
.dashboard-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.dashboard-suggestion-filters {
  display: inline-flex;
  justify-self: start;
  border: 1px solid #95ab78;
  border-radius: 4px;
  overflow: hidden;
}

.dashboard-suggestion-filters button {
  border: 0;
  border-right: 1px solid #95ab78;
  border-radius: 0;
  background: #f6f9f2;
  color: #32471c;
}

.dashboard-suggestion-filters button:last-child {
  border-right: 0;
}

.dashboard-suggestion-filters button.is-active {
  background: var(--accent);
  color: #fff;
}

.dashboard-suggestion-list {
  display: grid;
  gap: 0.5rem;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
}

.dashboard-suggestion-entry {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.dashboard-suggestion-entry summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.7rem;
  align-items: center;
  padding: 0.7rem;
  cursor: pointer;
}

.dashboard-suggestion-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
  color: #364524;
}

.dashboard-suggestion-status {
  padding: 0.14rem 0.48rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.dashboard-suggestion-status.is-offen {
  border-color: #d4a845;
  background: #fff7df;
  color: #6d4a00;
}

.dashboard-suggestion-status.is-erledigt {
  border-color: #bcd09e;
  background: #e9f2dd;
  color: #3f5a1e;
}

.dashboard-suggestion-meta {
  grid-column: 1 / -1;
  color: var(--muted);
}

.dashboard-suggestion-description {
  margin: 0;
  padding: 0 0.7rem 0.7rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dashboard-suggestion-actions {
  padding: 0 0.7rem 0.7rem;
}

.dashboard-suggestion-actions button,
.dashboard-suggestion-more {
  font-size: 0.82rem;
}

.dashboard-suggestion-more {
  justify-self: start;
}

.dashboard-features-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.dashboard-feature-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.dashboard-feature-header h2,
.dashboard-feature-header p {
  margin: 0;
}

.dashboard-feature-count {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #9db77d;
  border-radius: 4px;
  background: #edf4e5;
  color: #3f5a1e;
  font-weight: 700;
}

.dashboard-feature-list {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
}

.dashboard-feature-entry {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.dashboard-feature-entry:first-child {
  border-top: 0;
  padding-top: 0;
}

.dashboard-feature-entry time {
  color: #52633a;
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-feature-entry h3 {
  margin: 0;
  color: #364524;
  font-size: 0.95rem;
}

.dashboard-feature-entry p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.section-content-block {
  margin-top: 0.75rem;
}

.master-section-content {
  display: flex;
  flex-direction: column;
}

.guv-kpi-grid {
  align-items: stretch;
}

.guv-kpi-grid .card {
  min-height: 100%;
}

.guv-kpi-grid-compact {
  margin-top: 0;
}

.guv-drilldown-stack {
  display: grid;
  gap: 0.7rem;
}

.guv-drilldown-stack h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: #46552d;
}

.guv-table {
  table-layout: fixed;
}

.guv-table th,
.guv-table td {
  word-break: break-word;
}

.guv-drilldown-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.guv-drilldown-table-scroll .guv-table {
  min-width: 860px;
  table-layout: auto;
}

.guv-drilldown-table-scroll .guv-table th,
.guv-drilldown-table-scroll .guv-table td {
  white-space: nowrap;
  word-break: normal;
}

/* Keep date columns compact and consistent in deep drilldown tables. */
.guv-drilldown-table-scroll .guv-table th:nth-child(1),
.guv-drilldown-table-scroll .guv-table td:nth-child(1),
.guv-drilldown-table-scroll .guv-table th:nth-child(5),
.guv-drilldown-table-scroll .guv-table td:nth-child(5),
.guv-drilldown-table-scroll .guv-table th:nth-child(6),
.guv-drilldown-table-scroll .guv-table td:nth-child(6) {
  width: 6.1rem;
  min-width: 6.1rem;
}

.member-fees-table-wrap {
  display: flex;
  flex-direction: column;
  max-height: clamp(22rem, 62vh, 44rem);
  border: 1px solid #d9e2d1;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.member-fees-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.member-fees-scroll table {
  margin: 0;
}

.member-fees-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7faf4;
}

.member-fees-scroll tbody tr:nth-child(even) td {
  background: #fafcf8;
}

.member-fees-total-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.8rem;
  border-top: 1px solid #cdd8c5;
  background: linear-gradient(180deg, rgba(247, 250, 244, 0.92), rgba(237, 243, 230, 1));
  box-shadow: 0 -2px 8px rgba(38, 58, 24, 0.06);
}

.member-fees-total-count {
  color: #4a5a2f;
  font-weight: 600;
}

.member-fees-total-value {
  color: #31411b;
  font-variant-numeric: tabular-nums;
}

.member-fees-total-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 1.5rem;
}

.housekeeping-metric-block > summary {
  align-items: flex-start;
}

.housekeeping-summary-stack {
  display: grid;
  gap: 0.08rem;
}

.finance-filter-stack-spaced {
  margin-bottom: 0.8rem;
}

.master-view-toolbar-spaced {
  margin-bottom: 0.6rem;
}

.billing-drilldown-scroll-spaced {
  margin-top: 0.35rem;
}

.billing-kpi-strip-spaced {
  margin-bottom: 0.6rem;
}

h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: #33431e;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.finance-filter-stack {
  display: grid;
  gap: 0.45rem;
}

.finance-period-toolbar,
.finance-quick-toolbar {
  align-items: end;
}

.finance-period-toolbar {
  gap: 0.75rem;
}

.finance-quick-toolbar {
  gap: 0.5rem;
}

.finance-period-control {
  min-width: 180px;
}

.finance-period-control select {
  min-height: 2rem;
}

.finance-quick-toolbar button,
.finance-period-toolbar button {
  min-height: 2rem;
}

.master-view-toolbar {
  align-items: flex-end;
}

.master-view-toolbar .filter-control {
  min-width: 230px;
}

.master-view-toolbar .finance-master-period-control {
  min-width: 140px;
}

.master-view-toolbar .filter-control span {
  line-height: 1.2;
}

.filter-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: max-content;
  max-width: 100%;
}

.filter-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid #95ab78;
  border-radius: 50%;
  background: #f6f9f2;
  color: #32471c;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.filter-help::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.45rem);
  left: 0;
  box-sizing: border-box;
  width: min(16rem, calc(100vw - 4rem));
  padding: 0.55rem 0.65rem;
  border: 1px solid #95ab78;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(28, 37, 28, 0.16);
  color: #263718;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.2rem);
  transition: opacity 120ms ease, transform 120ms ease;
}

.filter-help:hover::after,
.filter-help:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.filter-help:focus-visible {
  outline: 2px solid var(--nav-green);
  outline-offset: 2px;
}

.master-view-toolbar .filter-control input,
.master-view-toolbar .filter-control select,
.master-view-toolbar button {
  min-height: 2rem;
}

.master-view-toolbar .small {
  align-self: center;
}

.action-abbreviation-note {
  flex-basis: 100%;
  color: #5d6b52;
}

.billing-kpi-strip {
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  border: 1px solid #d0dbca;
  border-radius: 6px;
  background: linear-gradient(135deg, #f5f9f1 0%, #fbfdf8 100%);
}

.billing-kpi-strip .small {
  color: #41572a;
  font-weight: 600;
}

.billing-drilldown-group {
  margin-top: 0.6rem;
  border: 1px solid #d4dfcc;
  border-radius: 7px;
  background: #fbfdf9;
}

.billing-drilldown-scroll {
  max-height: clamp(18rem, 56vh, 44rem);
  overflow: auto;
  padding-right: 0.2rem;
}

.billing-drilldown-group > summary,
.billing-drilldown-year > summary,
.billing-drilldown-month > summary {
  cursor: pointer;
}

.billing-drilldown-group > summary {
  padding: 0.55rem 0.65rem;
  background: #f1f6eb;
  position: sticky;
  top: 0;
  z-index: 4;
}

.billing-drilldown-year {
  margin: var(--drilldown-gap-y) var(--drilldown-indent-step) 0 var(--drilldown-indent-step);
  border: 1px solid #dbe4d3;
  border-radius: 6px;
  background: #ffffff;
}

.billing-drilldown-year > summary {
  padding: 0.45rem 0.55rem;
  background: #f7faf4;
  position: sticky;
  top: 2.2rem;
  z-index: 3;
}

.billing-drilldown-month {
  margin: var(--drilldown-gap-y) var(--drilldown-indent-step) 0 calc(var(--drilldown-indent-step) * 2);
  border: 1px solid #e1e8da;
  border-radius: 6px;
  background: #ffffff;
}

.billing-drilldown-month > summary {
  padding: 0.45rem 0.55rem;
  background: #fafcf7;
  position: sticky;
  top: 4.1rem;
  z-index: 2;
}

.one-time-cost-drilldown-year > summary,
.one-time-cost-drilldown-month > summary {
  position: static;
  top: auto;
}

.guv-drilldown-table-scroll .finance-position-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.guv-drilldown-table-scroll .finance-position-table th:nth-child(1),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(1) {
  width: 10%;
}

.guv-drilldown-table-scroll .finance-position-table th:nth-child(2),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(2) {
  width: 19%;
}

.guv-drilldown-table-scroll .finance-position-table th:nth-child(3),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(3) {
  width: 11%;
  text-align: right;
}

.guv-drilldown-table-scroll .finance-position-table th:nth-child(4),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(4) {
  width: 26%;
}

.guv-drilldown-table-scroll .finance-position-table th:nth-child(5),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(5),
.guv-drilldown-table-scroll .finance-position-table th:nth-child(6),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(6) {
  width: 12%;
}

.guv-drilldown-table-scroll .finance-position-table th:nth-child(7),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(7) {
  width: 10%;
}

.guv-drilldown-table-scroll .finance-position-table th:nth-child(2),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(2),
.guv-drilldown-table-scroll .finance-position-table th:nth-child(4),
.guv-drilldown-table-scroll .finance-position-table td:nth-child(4) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.row-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.row-inline-actions-compact {
  gap: 0.28rem;
}

.row-inline-action-icon {
  min-width: 1.9rem;
  width: 1.9rem;
  min-height: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}

.row-inline-actions button {
  min-height: 1.8rem;
  padding: 0.28rem 0.5rem;
}

.inline-edit-compact-actions {
  justify-content: flex-end;
}

.inline-edit-compact-actions button {
  min-height: 1.7rem;
  padding: 0.22rem 0.45rem;
  font-size: 0.78rem;
}

.billing-drilldown-scroll.is-compact .toolbar {
  gap: 0.35rem;
}

.billing-drilldown-scroll.is-compact th,
.billing-drilldown-scroll.is-compact td {
  font-size: 0.82rem;
  padding: 0.3rem 0.34rem;
}

.billing-drilldown-scroll.is-compact .small {
  font-size: 0.76rem;
}

.section-tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
  border-bottom: 1px solid #d7dfd0;
  padding-bottom: 0.55rem;
}

.accounting-period-selector {
  min-height: 4.25rem;
  align-items: flex-end;
}

.accounting-period-panel {
  min-height: 6.2rem;
}

.accounting-period-detail-slot {
  min-width: 10rem;
}

.accounting-reversal-detail-slot {
  min-width: 11rem;
}

.accounting-period-detail-slot > label {
  width: 100%;
}

.accounting-reversal-detail-slot > label {
  width: 100%;
}

.accounting-period-detail-slot select {
  width: 100%;
}

.accounting-reversal-detail-slot input {
  width: 100%;
}

.accounting-period-detail-placeholder {
  visibility: hidden;
}

.accounting-section-tabs {
  align-items: center;
  min-height: 2.4rem;
}

.accounting-journal-subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 0.75rem;
}

.accounting-journal-subtabs .section-tab-button {
  padding: 0.34rem 0.6rem;
  font-size: 0.9rem;
}

.accounting-load-more-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.accounting-tab-content {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  min-width: 0;
  min-height: calc(100vh - 12rem);
}

.accounting-tab-content > .panel {
  box-shadow: none;
}

.master-data-tabs {
  position: sticky;
  top: 5.15rem;
  z-index: 12;
  background: var(--panel);
  padding-top: 0.35rem;
}

.master-records-scroll {
  max-height: clamp(18rem, 52vh, 38rem);
  overflow: auto;
  border: 1px solid #dce3d8;
  border-radius: 6px;
  background: #fff;
  padding-bottom: 0.3rem;
}

.master-records-scroll table {
  margin: 0;
}

.master-records-scroll th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.master-create-area {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.master-section-content .master-records-scroll {
  min-height: clamp(16rem, 40vh, 24rem);
  max-height: clamp(18rem, 58vh, 42rem);
}

.master-create-bar {
  position: sticky;
  bottom: 0;
  z-index: 9;
  background: linear-gradient(180deg, rgba(246, 249, 242, 0.5), rgba(246, 249, 242, 0.98) 28%, rgba(246, 249, 242, 1) 100%);
  border-top: 1px solid #d7dfd0;
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.master-create-bar .toolbar {
  margin-top: 0;
  justify-content: flex-end;
}

.master-create-hint {
  margin: 0;
}

.master-create-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
}

.nuz-master-grid {
  display: flex;
  flex-direction: column;
  min-height: min(72vh, 52rem);
  gap: 0.55rem;
}

.nuz-master-grid .master-create-bar {
  margin-top: auto;
}

.nuz-master-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.55rem;
}

.nuz-master-block-placeholder {
  border: 1px dashed transparent;
}

.nuz-list-container {
  display: grid;
  gap: 0.2rem;
}

.nuz-list-table {
  table-layout: fixed;
}

.nuz-list-table th,
.nuz-list-table td {
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.nuz-list-table input {
  width: 100%;
}

.nuz-list-table select {
  width: 100%;
}

col.nuz-list-col-main {
  width: 38%;
}

col.nuz-list-col {
  width: 21%;
}

col.nuz-list-col-actions {
  width: 20%;
}

.nuz-list-row-editing > td {
  background: #f7fbf3;
}

.nuz-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .master-section-content .master-records-scroll {
    max-height: clamp(16rem, 50vh, 34rem);
  }

  .master-create-form {
    max-height: min(42vh, 24rem);
  }

  .nuz-master-row {
    grid-template-columns: 1fr;
  }

  .nuz-master-block-placeholder {
    display: none;
  }
}

.section-tab-button {
  border: 1px solid #9cb184;
  background: #f6f9f2;
  color: #33471f;
  border-radius: 4px;
  padding: 0.44rem 0.75rem;
  font-weight: 600;
}

.section-tab-button:hover {
  background: #eef4e6;
}

.section-tab-button.is-active {
  background: #3f5f1f;
  border-color: #3f5f1f;
  color: #ffffff;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.18);
}

.section-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  border: 1px solid #7d945f;
  background: #eaf2e1;
  color: #2f4518;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.section-tab-button.is-active .section-tab-badge {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.care-budget-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0;
}

.care-budget-summary-card {
  border: 1px solid #d7dfd0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #f7faf4);
  padding: 0.7rem 0.8rem;
}

.care-budget-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.care-budget-summary-card strong {
  display: block;
  margin-top: 0.22rem;
  color: #2f4518;
  font-size: 1.35rem;
}

.care-budget-summary-alert {
  border-color: #d18b5a;
  background: linear-gradient(180deg, #fff8ed, #fbe9d8);
}

.care-budget-summary-alert strong {
  color: #8f3e10;
}

.care-budget-chip {
  border-radius: 999px;
  padding: 0.16rem 0.48rem;
  font-weight: 700;
  white-space: nowrap;
}

.datev-export-block {
  margin-top: 0.9rem;
}

.datev-export-warning {
  border: 1px solid #d18b5a;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8ed, #fbe9d8);
  color: #8f3e10;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}

.datev-export-warning ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.datev-export-warning li {
  margin-bottom: 0.2rem;
  overflow-wrap: anywhere;
}

.datev-export-table td {
  white-space: nowrap;
}

.datev-export-table td:last-child {
  white-space: normal;
  overflow-wrap: anywhere;
}

.datev-export-row-invalid td {
  background: #fbe9e4;
  color: #8f2f10;
}

.datev-export-warning-repeat {
  border-color: #b3452a;
  background: linear-gradient(180deg, #fdeee9, #f8ddd4);
  color: #8f2f10;
}

.datev-export-row-exported td {
  background: #f1f1ef;
  color: #5c5c56;
}

.datev-export-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.44rem;
  background: #e2e2dd;
  color: #4a4a44;
  font-size: 0.78rem;
  white-space: nowrap;
}

.datev-export-history {
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}

.datev-export-history summary {
  cursor: pointer;
}

.datev-export-history ul {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
}

.datev-export-history li {
  margin-bottom: 0.15rem;
  overflow-wrap: anywhere;
}

.care-budget-chip-ok {
  background: #e7f4df;
  color: #315818;
}

.care-budget-chip-watch {
  background: #fff3c4;
  color: #765600;
}

.care-budget-chip-over,
.care-budget-chip-missing {
  background: #fde2d6;
  color: #8f2f12;
}

.care-budget-chip-private {
  background: #edf1f5;
  color: #475767;
}

.care-budget-bar {
  width: 100%;
  min-width: 7rem;
  height: 0.48rem;
  margin-top: 0.25rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece2;
}

.care-budget-bar span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: #8ead6a;
}

.care-budget-bar-ok span {
  background: #6d9a3e;
}

.care-budget-bar-watch span {
  background: #d59c20;
}

.care-budget-bar-over span {
  background: #c5532f;
}

@media (max-width: 900px) {
  .care-budget-summary-grid {
    grid-template-columns: 1fr;
  }
}

.service-capture-rows {
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

.service-capture-row {
  display: grid;
  gap: 0.55rem;
  align-items: end;
  border: 1px solid #dce3d8;
  border-radius: 6px;
  padding: 0.55rem;
  background: #fbfdf9;
}

.service-capture-row-ehrenamt {
  grid-template-columns: minmax(220px, 1.8fr) minmax(170px, 1fr) minmax(140px, 0.8fr) auto;
}

.service-capture-row-hauswirtschaft {
  grid-template-columns: minmax(220px, 1.7fr) minmax(150px, 1fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(140px, 0.8fr) auto;
}

.verwaltung-day-list {
  display: grid;
  gap: 0;
}

.verwaltung-day-entry {
  padding: 0.35rem 0;
}

.verwaltung-day-entry.hw-day-weekend {
  background: #f6f6f4;
}

.verwaltung-day-entry.hw-day-weekend .verwaltung-day-label {
  color: #999;
  font-weight: normal;
}

.verwaltung-day-header {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(14rem, 2fr) minmax(7rem, 1fr) minmax(8rem, auto);
  align-items: end;
  gap: 0.55rem;
  padding: 0.35rem 0;
}

.verwaltung-day-label {
  align-self: center;
  white-space: nowrap;
}

.verwaltung-day-holiday {
  align-self: center;
  min-width: 0;
}

.verwaltung-day-total {
  align-self: center;
  justify-self: end;
  min-width: 5rem;
  text-align: right;
  white-space: nowrap;
}

.verwaltung-day-type {
  justify-self: end;
  width: 8rem;
}

.verwaltung-day-type select {
  width: 100%;
}

.verwaltung-day-body {
  padding-bottom: 0.35rem;
}

.verwaltung-day-main,
.verwaltung-pause-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(5rem, auto);
  gap: 0.55rem;
  align-items: end;
}

.verwaltung-day-main > label,
.verwaltung-pause-row > label {
  min-width: 0;
}

.verwaltung-day-main input,
.verwaltung-pause-row input {
  width: 100%;
}

.verwaltung-day-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: max-content;
}

.verwaltung-pause-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.verwaltung-day-separator {
  margin: 0.1rem 0;
  border: none;
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.verwaltung-correction-form .verwaltung-day-entry + .verwaltung-day-entry {
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.verwaltung-correction-form {
  display: grid;
  gap: 0.75rem;
}

.verwaltung-correction-selection {
  align-items: end;
}

.verwaltung-correction-selection > button {
  align-self: end;
}

.verwaltung-correction-actions {
  margin-top: 0.25rem;
}

.service-capture-row-senior-meta {
  grid-template-columns: minmax(220px, 1.6fr) minmax(150px, 0.9fr) minmax(220px, 1.4fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr);
}

.service-capture-row-senior-meta input,
.service-capture-row-senior-meta select {
  min-height: 2.2rem;
}

.service-capture-row-senior-participants {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  align-items: stretch;
}

.service-capture-row-senior-known-client {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.7fr) auto auto;
  align-items: center;
}

.service-capture-row-senior-known-client select,
.service-capture-row-senior-known-client button {
  min-height: 2.2rem;
}

.senior-group-payer {
  line-height: 1.25;
}

.senior-group-billing-choice {
  align-items: center;
  display: inline-flex;
  flex-direction: row;
  gap: 0.35rem;
  white-space: nowrap;
}

.senior-group-billing-choice input {
  margin: 0;
}

.service-capture-row-senior-participants-header {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  background: #eef4e7;
  border-color: #d5e0c8;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.service-capture-row-senior-participants-header .small {
  font-weight: 600;
  color: #4a5f33;
}

.service-capture-row-senior-participants select,
.service-capture-row-senior-participants textarea {
  min-height: 2.2rem;
}

.service-capture-row-ehrenamt-client {
  grid-template-columns: minmax(96px, 0.55fr) minmax(230px, 1.9fr) minmax(82px, 0.5fr) minmax(82px, 0.5fr) minmax(66px, 0.35fr) minmax(210px, 1.7fr) auto;
}

.service-capture-row-hauswirtschaft-client {
  grid-template-columns: minmax(92px, 0.45fr) minmax(230px, 1.9fr) minmax(82px, 0.5fr) minmax(82px, 0.5fr) minmax(62px, 0.35fr) auto;
}

.service-capture-row-hauswirtschaft-client [data-hw-client-field="entryType"],
.service-capture-row-hauswirtschaft-client [data-overview-hw-client-field="entryType"] {
  min-width: 0;
}

.service-capture-row-ehrenamt-client-header {
  background: #eef4e7;
  border-color: #d5e0c8;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.service-capture-row-hauswirtschaft-client-header {
  background: #eef4e7;
  border-color: #d5e0c8;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.service-capture-row-ehrenamt-client-header .small {
  font-weight: 600;
  color: #4a5f33;
}

.service-capture-row-hauswirtschaft-client-header .small {
  font-weight: 600;
  color: #4a5f33;
}

.ehrenamt-client-cell {
  min-width: 0;
}

.service-capture-row-ehrenamt-client .ehrenamt-client-cell > select,
.service-capture-row-ehrenamt-client .ehrenamt-client-cell > input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hauswirtschaft-client-cell {
  min-width: 0;
}

.service-capture-row-hauswirtschaft-client .hauswirtschaft-client-cell > select,
.service-capture-row-hauswirtschaft-client .hauswirtschaft-client-cell > input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.service-capture-row-ehrenamt-client input,
.service-capture-row-ehrenamt-client select,
.service-capture-row-ehrenamt-client button {
  min-height: 2.2rem;
}

.service-capture-row-hauswirtschaft-client input,
.service-capture-row-hauswirtschaft-client select,
.service-capture-row-hauswirtschaft-client button {
  min-height: 2.2rem;
}

.service-capture-row-ehrenamt-client .toolbar {
  align-self: end;
}

.service-capture-row-hauswirtschaft-client .toolbar {
  align-self: end;
}

[data-overview-hw-day-row].hw-day-weekend {
  background: #f6f6f4;
  border-color: #e0e0dc;
}

.hw-holiday-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hw-holiday-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #d7b36a;
  background: #fff4dc;
  color: #6a4a0a;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.hw-holiday-chip.is-active {
  border-color: #9f8a43;
  background: #f3ecd2;
  color: #4d3b0e;
}

form.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

form.inline#masterForm {
  width: 100%;
  max-width: none;
  flex-direction: column;
  align-items: stretch;
}

form.inline#masterForm button[type="submit"] {
  margin-left: auto;
}

form.inline#masterForm .inline-section {
  width: 100%;
  max-width: none;
}

.inline-section {
  border: 1px solid #dce3d8;
  border-radius: 6px;
  padding: 0.65rem;
  background: #fbfdf9;
  min-width: min(100%, 760px);
  display: grid;
  gap: 0.55rem;
}

.inline-section legend {
  padding: 0 0.35rem;
  color: #33461d;
  font-weight: 600;
  font-size: 0.88rem;
}

.inline-grid {
  display: grid;
  gap: 0.55rem;
}

.inline-grid-2 {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
}

.inline-grid-3 {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.inline-grid-4 {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.one-time-cost-inline-grid {
  align-items: end;
}

.one-time-cost-inline-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
}

.inline-edit-row > td {
  background: #f7fbf3;
  padding: 0.75rem;
}

.inline-edit-client-wrap {
  display: grid;
  gap: 0.65rem;
}

.inline-edit-group-flow-actions {
  align-items: flex-start;
}

.toolbar-meta-line {
  flex-basis: 100%;
}

.inline-edit-client-actions {
  justify-content: flex-end;
}

.service-tab-content-panel {
  min-height: 0;
}

.detail-block {
  display: grid;
  gap: 0.14rem;
  line-height: 1.28;
  min-width: 0;
}

.detail-title {
  font-weight: 600;
  color: #2f401b;
  margin-bottom: 0.06rem;
}

.detail-block .small {
  color: #6c7b61;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.master-cell-drilldown {
  border: 1px solid #dde5d8;
  border-radius: 6px;
  background: #fbfdf9;
  padding: 0;
}

:is(
  .master-cell-drilldown,
  .billing-drilldown-group,
  .billing-drilldown-year,
  .billing-drilldown-month,
  .service-overview-group-drilldown,
  .service-overview-drilldown-year,
  .service-overview-drilldown-month,
  .service-overview-drilldown-day
) > summary {
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

:is(
  .master-cell-drilldown,
  .billing-drilldown-group,
  .billing-drilldown-year,
  .billing-drilldown-month,
  .service-overview-group-drilldown,
  .service-overview-drilldown-year,
  .service-overview-drilldown-month,
  .service-overview-drilldown-day
) > summary::-webkit-details-marker {
  display: none;
}

:is(
  .master-cell-drilldown,
  .billing-drilldown-group,
  .billing-drilldown-year,
  .billing-drilldown-month,
  .service-overview-group-drilldown,
  .service-overview-drilldown-year,
  .service-overview-drilldown-month,
  .service-overview-drilldown-day
) > summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #587339;
  border-bottom: 2px solid #587339;
  transform: rotate(-45deg);
  transform-origin: 60% 60%;
  transition: transform 140ms ease, border-color 140ms ease;
  margin-top: -0.08rem;
  flex: 0 0 auto;
}

:is(
  .master-cell-drilldown,
  .billing-drilldown-group,
  .billing-drilldown-year,
  .billing-drilldown-month,
  .service-overview-group-drilldown,
  .service-overview-drilldown-year,
  .service-overview-drilldown-month,
  .service-overview-drilldown-day
)[open] > summary::before {
  transform: rotate(45deg);
}

:is(
  .master-cell-drilldown,
  .billing-drilldown-group,
  .billing-drilldown-year,
  .billing-drilldown-month,
  .service-overview-group-drilldown,
  .service-overview-drilldown-year,
  .service-overview-drilldown-month,
  .service-overview-drilldown-day
) > summary:hover::before {
  border-color: #2f4a16;
}

.master-cell-drilldown[open] > summary {
  border-bottom: 1px solid #e3e9de;
  background: #f4f8ef;
}

.master-cell-drilldown > .detail-block {
  padding: 0.45rem 0.55rem;
}

label {
  font-size: 0.82rem;
  color: var(--muted);
  display: grid;
  gap: 0.22rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.cell-ellipsis {
  display: inline-block;
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

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

input,
select,
textarea {
  border: 1px solid #c8d2c0;
  border-radius: 3px;
  padding: 0.46rem 0.55rem;
  background: #fff;
}

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 3px;
  padding: 0.46rem 0.72rem;
  cursor: pointer;
}

button.ghost {
  background: #f6f9f2;
  color: #32471c;
  border-color: #95ab78;
}

button.warn {
  border-color: var(--warn);
  background: var(--warn);
}

.capture-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.6rem;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.capture-source-badge-block {
  background: #eef4e6;
  color: #2f401b;
  border-color: #b9cba6;
}

.capture-source-badge-correction {
  background: #fff0f0;
  color: #8c2f2f;
  border-color: #e2b7b7;
}

.service-overview-correction-launcher {
  margin-top: 1rem;
}

.service-overview-correction-actions {
  margin-bottom: 0.8rem;
}

.service-overview-correction-form-wrap > .panel {
  margin-top: 0.3rem;
}

.service-overview-group-drilldown {
  border: 1px solid #d4dfcc;
  border-radius: 7px;
  background: #fbfdf9;
}

.service-overview-group-drilldown > summary {
  cursor: pointer;
  padding: 0.5rem 0.65rem;
  background: #f1f6eb;
}

.service-overview-drilldown-list {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.45rem;
}

.service-overview-drilldown-year,
.service-overview-drilldown-month {
  border: 1px solid #dbe4d3;
  border-radius: 6px;
  background: #ffffff;
}

.service-overview-drilldown-year {
  margin: var(--drilldown-gap-y) var(--drilldown-indent-step) 0 var(--drilldown-indent-step);
}

.service-overview-drilldown-month {
  margin: var(--drilldown-gap-y) var(--drilldown-indent-step) 0 calc(var(--drilldown-indent-step) * 2);
}

.service-overview-drilldown-day {
  margin: var(--drilldown-gap-y) var(--drilldown-indent-step) var(--drilldown-gap-y) calc(var(--drilldown-indent-step) * 3);
  border: 1px solid #e4ebde;
  border-radius: 6px;
  background: #ffffff;
}

.service-overview-drilldown-year > summary,
.service-overview-drilldown-month > summary {
  cursor: pointer;
  padding: 0.45rem 0.55rem;
}

.service-overview-drilldown-day > summary {
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  background: #fcfdf9;
}

.service-overview-drilldown-year > summary {
  background: #f7faf4;
}

.service-overview-drilldown-month > summary {
  background: #fafcf7;
}

button.ok {
  border-color: var(--ok);
  background: var(--ok);
}

button.row-inline-action-icon[title="Neuen Eintrag anlegen"],
button.row-inline-action-icon[aria-label="Neuen Eintrag anlegen"] {
  background: var(--action-n-bg);
  border-color: var(--action-n-border);
  color: var(--action-n-text);
}

button.row-inline-action-icon[title="Weiteren Tag hinzufügen"],
button.row-inline-action-icon[aria-label="Weiteren Tag hinzufügen"] {
  background: var(--action-t-bg);
  border-color: var(--action-t-border);
  color: var(--action-t-text);
}

button.row-inline-action-icon[title="Vortag kopieren"],
button.row-inline-action-icon[aria-label="Vortag kopieren"],
button.row-inline-action-icon[title="Tag kopieren"],
button.row-inline-action-icon[aria-label="Tag kopieren"] {
  background: var(--action-v-bg);
  border-color: var(--action-v-border);
  color: var(--action-v-text);
}

button.row-inline-action-icon[title="Klient hinzufügen"],
button.row-inline-action-icon[aria-label="Klient hinzufügen"] {
  background: var(--action-k-bg);
  border-color: var(--action-k-border);
  color: var(--action-k-text);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid #dce3d8;
  text-align: left !important;
  font-size: 0.88rem;
  padding: 0.4rem 0.44rem;
  vertical-align: top;
}

th {
  background: #eef4e7;
  color: #33461d;
  text-align: left !important;
}

table.table-soft-head th {
  background: #f5f8f1;
  color: #4b5f35;
}

table.table-soft-head .sort-header-btn {
  font-weight: 500;
}

table.service-overview-group-table {
  table-layout: fixed;
}

table.service-overview-group-table th:nth-child(1),
table.service-overview-group-table td:nth-child(1) {
  width: 30%;
}

table.service-overview-group-table th:nth-child(2),
table.service-overview-group-table td:nth-child(2) {
  width: 16%;
}

table.service-overview-group-table th:nth-child(3),
table.service-overview-group-table td:nth-child(3) {
  width: 14%;
}

table.service-overview-group-table th:nth-child(4),
table.service-overview-group-table td:nth-child(4) {
  width: 14%;
}

table.service-overview-group-table th:nth-child(5),
table.service-overview-group-table td:nth-child(5) {
  width: 26%;
}

table.service-overview-detail-table {
  table-layout: fixed;
}

table.service-overview-detail-table th:nth-child(1),
table.service-overview-detail-table td:nth-child(1) {
  width: 4%;
}

table.service-overview-detail-table th:nth-child(2),
table.service-overview-detail-table td:nth-child(2) {
  width: 8%;
}

table.service-overview-detail-table th:nth-child(3),
table.service-overview-detail-table td:nth-child(3) {
  width: 8%;
}

table.service-overview-detail-table th:nth-child(4),
table.service-overview-detail-table td:nth-child(4) {
  width: 10%;
}

table.service-overview-detail-table th:nth-child(5),
table.service-overview-detail-table td:nth-child(5) {
  width: 10%;
}

table.service-overview-detail-table th:nth-child(6),
table.service-overview-detail-table td:nth-child(6) {
  width: 7%;
}

table.service-overview-detail-table th:nth-child(7),
table.service-overview-detail-table td:nth-child(7) {
  width: 11%;
}

table.service-overview-detail-table th:nth-child(8),
table.service-overview-detail-table td:nth-child(8) {
  width: 18%;
}

table.service-overview-detail-table th:nth-child(9),
table.service-overview-detail-table td:nth-child(9) {
  width: 7%;
}

table.service-overview-detail-table th:nth-child(10),
table.service-overview-detail-table td:nth-child(10) {
  width: 8%;
}

table.service-overview-detail-table th:nth-child(11),
table.service-overview-detail-table td:nth-child(11) {
  width: 9%;
}

.sort-header-btn {
  all: unset;
  cursor: pointer;
  color: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  max-width: 100%;
}

.sort-header-btn:hover {
  text-decoration: underline;
}

.sort-header-btn:focus-visible {
  outline: 2px solid #466b2a;
  outline-offset: 2px;
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
}

.sort-priority {
  display: inline-grid;
  place-items: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.2rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

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

.status-chip {
  display: inline-block;
  padding: 0.13rem 0.42rem;
  border-radius: 999px;
  font-size: 0.74rem;
  border: 1px solid #c8d2c0;
  background: #f6f9f2;
}

.max-earnings-chip {
  font-weight: 700;
}
.max-earnings-chip-ok {
  background: #eaf7e8;
  border-color: #9ecb9a;
  color: #275f2f;
}
.max-earnings-chip-warn {
  background: #fff8e8;
  border-color: #e2c177;
  color: #725017;
}
.max-earnings-chip-over {
  background: #fdeaea;
  border-color: #de9b9b;
  color: #8a2626;
}
.max-earnings-chip-none {
  background: #f2f2f2;
  border-color: #cccccc;
  color: #5d5d5d;
}

.small {
  color: var(--muted);
  font-size: 0.81rem;
}

.login-wrap {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(460px, 96%);
}

.login-error {
  color: var(--color-danger, #b3261e);
  font-weight: 600;
}

.login-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.login-secret {
  margin: 0.8rem 0;
  padding: 0.7rem;
  border-radius: 6px;
  background: var(--surface-alt, #f5f5f5);
}

.login-secret-code {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  word-break: break-all;
  user-select: all;
}

.login-recovery {
  padding: 0.7rem;
  border-radius: 6px;
  background: var(--surface-alt, #f5f5f5);
  font-size: 1.05rem;
  line-height: 1.6;
  user-select: all;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.files-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.files-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.files-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
}

.files-crumb,
.files-folder-link {
  padding: 0.15rem 0.45rem;
  font-weight: 600;
}

.files-upload-label {
  display: inline-block;
  cursor: pointer;
  border: 1px solid #95ab78;
  background: #f6f9f2;
  color: #32471c;
  border-radius: 3px;
  padding: 0.46rem 0.72rem;
}

.files-table td:nth-child(2),
.files-table td:nth-child(3) {
  white-space: nowrap;
}

.role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}

.role-checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .brand-block {
    gap: 0.55rem;
  }

  .brand-logo {
    height: 44px;
    width: auto;
    max-width: 140px;
  }

  .topbar h1 {
    font-size: 1.2rem;
  }

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

  .inline-grid-2,
  .inline-grid-3,
  .inline-grid-4 {
    grid-template-columns: 1fr;
  }

  .dashboard-suggestion-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-primary-panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-feature-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }

  .dashboard-suggestion-header > button,
  .dashboard-suggestion-form-actions > button {
    width: 100%;
  }

  .dashboard-suggestion-limit {
    justify-self: start;
    padding-bottom: 0;
  }

  .dashboard-suggestion-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
  }

  .dashboard-suggestion-filters button {
    min-width: 0;
  }

  .dashboard-suggestion-entry summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-suggestion-status {
    justify-self: start;
  }

  .screen-help-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-capture-row-ehrenamt,
  .service-capture-row-ehrenamt-client,
  .service-capture-row-hauswirtschaft-client,
  .service-capture-row-hauswirtschaft,
  .service-capture-row-senior-meta,
  .service-capture-row-senior-participants,
  .service-capture-row-senior-known-client,
  .service-capture-row-senior-participants-header {
    grid-template-columns: 1fr;
  }

  .service-capture-row-senior-participants > div,
  .service-capture-row-senior-participants label,
  .service-capture-row-senior-participants select,
  .service-capture-row-senior-participants textarea {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .service-capture-row-ehrenamt-client-header,
  .service-capture-row-hauswirtschaft-client-header,
  .service-capture-row-senior-participants-header {
    display: none;
  }

  .service-tab-content-panel {
    min-height: auto;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid #466020;
    flex-direction: row;
    overflow-x: auto;
    padding: 0.6rem;
    position: static;
    top: auto;
    max-height: none;
  }

  body.sidebar-collapsed .sidebar {
    display: none;
  }

  body.sidebar-collapsed .layout {
    grid-template-columns: 1fr;
  }

  .sidebar a {
    white-space: nowrap;
  }

  .master-view-toolbar .small {
    width: 100%;
    align-self: auto;
  }

  .master-data-tabs {
    top: 4.2rem;
  }

  .master-records-scroll {
    max-height: 46vh;
  }

  .billing-kpi-strip {
    gap: 0.35rem;
  }

  .billing-kpi-strip .small {
    width: calc(50% - 0.4rem);
  }

  .billing-drilldown-scroll {
    max-height: 48vh;
  }

  .billing-drilldown-group > summary,
  .billing-drilldown-year > summary,
  .billing-drilldown-month > summary {
    position: static;
  }
}

@media (max-width: 680px) {
  .verwaltung-day-header {
    grid-template-columns: minmax(0, 1fr) minmax(8rem, auto);
  }

  .verwaltung-day-holiday {
    grid-column: 1;
  }

  .verwaltung-day-total {
    grid-column: 1;
    justify-self: start;
    text-align: left;
  }

  .verwaltung-day-type {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
  }

  .verwaltung-day-main,
  .verwaltung-pause-row {
    grid-template-columns: 1fr;
  }

  .verwaltung-pause-grid-spacer {
    display: none;
  }

  .verwaltung-day-actions {
    justify-content: flex-start;
  }
}
