table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.76rem;
}

.dataset-table td {
  background: rgba(255, 255, 255, 0.98);
}

.lite-table {
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(20, 83, 45, 0.05);
}

.lite-table th,
.lite-table td {
  padding: 8px 10px;
}

.dataset-table tbody tr:hover td {
  background: rgba(244, 249, 244, 0.96);
}

.row-muted td {
  opacity: 0.68;
}

th {
  background: var(--background-muted);
  color: var(--muted-soft);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lite-table thead th {
  background: rgba(247, 251, 247, 0.98);
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(217, 231, 218, 0.96);
  text-align: left;
}

.column-sort-button {
  width: 100%;
  min-height: auto;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  box-shadow: none;
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.column-sort-button:hover {
  background: transparent;
  color: var(--text);
  transform: none;
}

.column-sort-indicator {
  color: var(--accent-dark);
  font-size: 0.86rem;
  line-height: 1;
  margin-left: auto;
}

.table-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.table-cell-stack {
  display: grid;
  gap: 4px;
}

.table-inline-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.table-inline-metrics.is-loading {
  color: var(--muted-soft);
}

.investment-year-summary-table th,
.investment-year-summary-table td {
  text-align: left;
}

.field-map-table tbody tr {
  cursor: pointer;
}

.field-map-table tbody tr.is-selected td {
  background: rgba(232, 245, 235, 0.98);
}

.field-map-table tbody tr.is-selected:hover td {
  background: rgba(223, 240, 228, 0.98);
}

.field-map-table .number-cell {
  white-space: nowrap;
}

.table-toolbar-inline {
  align-items: center;
  justify-content: flex-end;
}

.table-search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 340px);
}

.table-sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-sort-label {
  color: var(--muted-soft);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table-sort-select {
  min-width: 172px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.table-search-icon {
  position: absolute;
  color: var(--muted-soft);
  font-size: 0.92rem;
  line-height: 1;
  pointer-events: none;
}

.table-search-icon {
  left: 12px;
}

.table-search-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.table-search-input {
  min-height: 36px;
  padding: 8px 34px 8px 34px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(247, 251, 247, 0.96);
}

.table-empty-row td {
  padding: 18px 14px;
  background: rgba(250, 252, 250, 0.96);
}

.excel-like-table thead th,
.kennzahlen-table thead th {
  background: var(--background-muted);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 3;
}

.fullcost-table-wrapper {
  max-height: min(58vh, 640px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.fullcost-table-wrapper .excel-like-table {
  width: max-content;
  min-width: 100%;
  overflow: visible;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
  border-collapse: separate;
  border-spacing: 0;
}

.fullcost-table-wrapper .excel-like-table thead {
  position: static;
  background: transparent;
}

.fullcost-table-wrapper .excel-like-table thead tr {
  background: #eef4ef !important;
}

.fullcost-table-wrapper .excel-like-table > thead > tr > th {
  background: #eef4ef !important;
  position: sticky;
  top: 0;
  z-index: 20;
  vertical-align: middle;
  box-shadow: inset 0 -1px 0 rgba(189, 208, 191, 0.96);
  white-space: normal;
}

.fullcost-table-wrapper .excel-like-table > thead > tr > th:first-child {
  left: 0;
  z-index: 30;
  background: #ffffff !important;
}

.fullcost-table-wrapper .excel-like-table tbody th:first-child,
.fullcost-table-wrapper .excel-like-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #ffffff !important;
  box-shadow: 1px 0 0 rgba(189, 208, 191, 0.9);
}

.fullcost-table-wrapper .excel-like-table .table-section-row th:first-child {
  background: #eaf2ec !important;
  z-index: 10;
}

.fullcost-table-wrapper .excel-like-table .table-section-row th,
.fullcost-table-wrapper .excel-like-table .table-section-row td {
  background: #eaf2ec !important;
}

.fullcost-table-wrapper .excel-like-table tbody tr:nth-child(even) td {
  background: #f5f9f5;
}

.fullcost-table-wrapper .excel-like-table tbody tr:hover td {
  background: #edf5ee;
}

.fullcost-table-wrapper .excel-like-table .important-output-row th,
.fullcost-table-wrapper .excel-like-table .important-output-row td {
  background: #e3f3e8 !important;
}

.fullcost-table-wrapper .excel-like-table .important-result-row th,
.fullcost-table-wrapper .excel-like-table .important-result-row td {
  background: #edf7ef !important;
}

.fullcost-table-wrapper .excel-like-table .important-cost-row th,
.fullcost-table-wrapper .excel-like-table .important-cost-row td {
  background: #fef2f2 !important;
}

.fullcost-table-wrapper .excel-like-table .important-rent-row th,
.fullcost-table-wrapper .excel-like-table .important-rent-row td {
  background: #f1f5f9 !important;
}

tbody tr:nth-child(even) td {
  background: rgba(245, 249, 245, 0.76);
}

tbody tr:hover td {
  background: rgba(237, 245, 238, 0.92);
}

tbody tr.selected-row td {
  background: rgba(226, 241, 227, 0.9);
}

tr:last-child td {
  border-bottom: none;
}

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

th.number-cell {
  text-align: left;
}

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

.selection-cell {
  width: 42px;
  text-align: center;
}

.selection-cell input {
  width: auto;
  min-height: auto;
}

.master-table input,
.master-table select {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
}

.editable-lite-table input,
.editable-lite-table select {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 0.76rem;
  box-shadow: none;
}

.editable-lite-table tbody td {
  background: rgba(255, 255, 255, 0.94);
}

.master-table .checkbox-field {
  justify-content: center;
}

.table-action-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}

.table-icon-button {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(189, 208, 191, 0.92);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: none;
}

.table-icon-button:hover {
  background: rgba(243, 248, 243, 0.98);
  border-color: rgba(120, 150, 126, 0.34);
}

.table-icon-button svg {
  width: 17px;
  height: 17px;
  display: block;
}

.table-icon-button-danger {
  color: var(--danger);
  border-color: rgba(185, 28, 28, 0.16);
}

.table-icon-button-danger:hover {
  background: rgba(254, 242, 242, 0.98);
  border-color: rgba(185, 28, 28, 0.24);
}

.table-select-all-row {
  display: flex;
  justify-content: flex-end;
}

.search-hidden {
  display: none !important;
}

.total-row td {
  font-weight: 700;
  background: rgba(226, 241, 227, 0.78) !important;
}

.table-section-row th {
  background: #eaf2ec;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
  padding-top: 2px;
  padding-bottom: 2px;
  text-align: left;
}

.investment-year-row td {
  background: rgba(245, 249, 245, 0.96) !important;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 600;
  border-top: 1px solid rgba(189, 208, 191, 0.9);
}

.excel-like-table tbody > tr:not(.table-section-row) > th {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.76rem;
  color: var(--text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.98);
}

.excel-like-table th:first-child,
.excel-like-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.98);
}

.excel-like-table .table-section-row th:first-child {
  z-index: 2;
}

.excel-like-table th,
.excel-like-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.excel-like-table .important-output-row th,
.excel-like-table .important-output-row td {
  background: rgba(22, 101, 52, 0.12);
  color: #14532d;
  font-weight: 700;
}

.excel-like-table .important-result-row th,
.excel-like-table .important-result-row td {
  background: rgba(22, 101, 52, 0.08);
  font-weight: 700;
}

.excel-like-table .important-cost-row th,
.excel-like-table .important-cost-row td {
  background: rgba(254, 242, 242, 0.96);
  color: #b91c1c;
  font-weight: 700;
}

.excel-like-table .important-rent-row th,
.excel-like-table .important-rent-row td {
  background: rgba(241, 245, 249, 0.96);
  color: #475569;
  font-weight: 700;
}

.excel-like-table .muted-reference-row th,
.excel-like-table .muted-reference-row td {
  color: var(--muted);
  background: rgba(245, 249, 245, 0.82);
}

.user-management-table {
  table-layout: fixed;
}

.user-management-table th,
.user-management-table td {
  overflow-wrap: anywhere;
}

.user-management-table th:first-child,
.user-management-table td:first-child {
  position: static;
  left: auto;
  z-index: auto;
}

.user-management-table th:nth-child(1),
.user-management-table td:nth-child(1) {
  width: 36%;
}

.user-management-table th:nth-child(2),
.user-management-table td:nth-child(2) {
  width: 11%;
}

.user-management-table th:nth-child(3),
.user-management-table td:nth-child(3) {
  width: 18%;
}

.user-management-table th:nth-child(4),
.user-management-table td:nth-child(4) {
  width: 15%;
}

.user-management-table th:nth-child(5),
.user-management-table td:nth-child(5) {
  width: 20%;
}

.user-management-table .secondary-button {
  min-width: 0;
  width: 100%;
}

.results-table-wrapper .table-subtitle {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--muted-soft);
  font-weight: 700;
}

.table-overview-block + .table-overview-block {
  margin-top: 10px;
}

.table-overview-details {
  padding: 8px;
  border: 1px solid rgba(217, 231, 218, 0.96);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.table-overview-details + .table-overview-details {
  margin-top: 16px;
}

.table-overview-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
  font-weight: 700;
  justify-content: flex-start;
  padding: 2px 4px;
}

.table-overview-summary::-webkit-details-marker {
  display: none;
}

.table-overview-details:not([open]) .table-section-arrow {
  transform: rotate(-90deg);
}

.table-overview-details[open] .table-section-arrow {
  transform: rotate(0deg);
}

.table-overview-details[open] .table-overview-summary {
  margin-bottom: 8px;
}

.excel-like-table .always-visible-summary-row th,
.excel-like-table .always-visible-summary-row td {
  border-top: 2px solid rgba(120, 150, 126, 0.28);
  font-weight: 700;
}

.metric-highlight-cell.positive-value {
  background: rgba(22, 101, 52, 0.12) !important;
}

.metric-highlight-cell.negative-value {
  background: rgba(185, 28, 28, 0.1) !important;
}

.table-section-row.section-output th {
  background: rgba(22, 101, 52, 0.1);
}

.table-section-row.section-cost th {
  background: rgba(180, 83, 9, 0.1);
}

.table-section-row.section-result th {
  background: rgba(34, 139, 34, 0.1);
}

.table-section-toggle {
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  box-shadow: none;
  border-radius: 0;
  text-align: left;
  line-height: 1.2;
}

.table-section-toggle:hover {
  background: transparent;
  transform: none;
}

.table-section-arrow {
  font-size: 0.78rem;
  line-height: 1;
  color: var(--accent-dark);
}

.scenario-override-table td:first-child {
  color: var(--muted-soft);
  font-weight: 700;
  white-space: nowrap;
}

.override-input-stack {
  display: grid;
  gap: 4px;
}

.override-input-stack .muted {
  font-size: 0.7rem;
}

.kennzahlen-table .muted-row td {
  color: var(--muted);
  font-style: italic;
  background: rgba(248, 250, 252, 0.88);
}

.kennzahlen-table .scenario-subrow td {
  font-size: 0.94rem;
  background: rgba(248, 250, 252, 0.72);
}

.kennzahlen-table .scenario-subrow td:first-child {
  padding-left: 26px;
  color: var(--muted);
}

.kennzahlen-table .scenario-subrow .number-cell {
  color: var(--muted);
}

.kennzahlen-table .strong-separator-row td {
  padding: 0;
  height: 8px;
  border-bottom: 2px solid rgba(148, 163, 184, 0.24);
  background: transparent !important;
}

.lite-table .table-cell-stack strong,
.lite-table .table-cell-stack span,
.lite-table td,
.lite-table input,
.lite-table select {
  font-size: 0.76rem;
}

.table-slot-heading {
  display: grid;
  gap: 2px;
  min-height: 0;
  align-content: start;
  line-height: 1.1;
}

.table-slot-year {
  color: var(--muted-soft);
  font-size: 0.72rem;
  font-weight: 700;
  display: block;
}

.table-slot-crop {
  font-size: 0.8rem;
  font-weight: 700;
  display: block;
  line-height: 1.1;
}

.table-export-row {
  justify-content: flex-end;
  margin-top: 10px;
}

.contract-work-master-table input[type="text"],
.contract-work-master-table input[type="number"] {
  min-height: 32px;
  padding: 6px 8px;
}

.empty-state-panel {
  padding: 16px 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(244, 248, 244, 0.92);
  color: var(--muted);
}

.field-allocation-toolbar .scenario-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-pill {
  min-width: 160px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.summary-pill .summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.field-allocation-table td,
.field-allocation-table th {
  vertical-align: top;
}

.field-allocation-table tbody tr {
  cursor: pointer;
}

.field-allocation-table tbody tr.is-map-selected td {
  background: rgba(254, 242, 242, 0.96);
}

.field-allocation-table tbody tr.is-map-selected:hover td {
  background: rgba(254, 226, 226, 0.98);
}

.field-allocation-year-summary {
  margin-top: 14px;
}

.field-allocation-year-summary th.number-cell,
.field-allocation-year-summary td.number-cell {
  text-align: left;
}

.field-map-canvas .ol-zoom {
  top: 14px;
  left: 14px;
}

.field-map-canvas .ol-control button {
  min-height: auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  border: 1px solid rgba(217, 231, 218, 0.96);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.field-map-canvas .ol-control button:hover {
  background: rgba(247, 251, 247, 0.98);
}

.field-allocation-field {
  display: grid;
  gap: 4px;
}

.field-allocation-status {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
}

.field-allocation-status.is-success {
  color: #166534;
  background: rgba(220, 252, 231, 0.9);
  border-color: rgba(22, 101, 52, 0.18);
}

.field-allocation-status.is-warning {
  color: #92400e;
  background: rgba(254, 243, 199, 0.92);
  border-color: rgba(146, 64, 14, 0.16);
}

.field-allocation-status.is-danger {
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.92);
  border-color: rgba(185, 28, 28, 0.14);
}

.field-allocation-status.is-empty {
  color: var(--muted-soft);
  background: rgba(248, 250, 252, 0.92);
}

.table-row-warning td {
  background: rgba(254, 249, 195, 0.55);
}

.table-inline-message {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #b45309;
  text-align: left;
}

.table-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.danger-text {
  color: #b91c1c;
}
