body[data-bs-anlagen] [hidden] {
  display: none !important;
}

#anlagenArbeitsbereich,
#anlagenErfassung,
#anlagenPlan {
  scroll-margin-top: 110px;
}

.an-panel {
  background: var(--white, #ffffff);
  border: 1px solid var(--line, #dce5e9);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 36px);
  margin: 24px 0;
  box-shadow: 0 8px 30px rgba(16, 43, 59, .04);
}

.an-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

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

.an-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.an-field label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy, #102b3b);
}

.an-field input,
.an-field select,
.an-field textarea,
.an-field output {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--line, #dce5e9);
  border-radius: 8px;
  background: var(--white, #ffffff);
  color: var(--ink, #20313d);
  font: inherit;
}

.an-field textarea {
  resize: vertical;
}

.an-field input:focus,
.an-field select:focus,
.an-field textarea:focus {
  outline: 2px solid var(--teal, #39a69a);
  outline-offset: 2px;
}

.an-field input:disabled {
  background: var(--soft, #f3f7f8);
  opacity: .7;
}

.an-field output {
  display: flex;
  align-items: center;
  font-weight: 700;
  background: var(--soft, #f3f7f8);
}

.an-field small {
  color: var(--muted, #647580);
  font-size: .82rem;
  line-height: 1.6;
}

.an-filter {
  padding: 20px;
  background: var(--soft, #f3f7f8);
  border-radius: 12px;
}

.an-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.an-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 125px;
  padding: 24px;
  background: var(--white, #ffffff);
  border: 1px solid var(--line, #dce5e9);
  border-top: 4px solid var(--blue, #287ca4);
  border-radius: 14px;
}

.an-stat span {
  color: var(--muted, #647580);
  font-size: .9rem;
}

.an-stat strong {
  color: var(--navy, #102b3b);
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.an-stat-primary {
  background: var(--navy, #102b3b);
  border-color: var(--navy, #102b3b);
  border-top-color: var(--teal, #39a69a);
}

.an-stat-primary span {
  color: #dce5e9;
}

.an-stat-primary strong {
  color: #ffffff;
}

body[data-bs-anlagen] .table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
  overflow-x: auto;
}

.an-journal {
  min-width: 1200px;
}

.an-journal td {
  vertical-align: middle;
}

.an-journal td:nth-child(2) {
  min-width: 200px;
  overflow-wrap: anywhere;
}

.an-journal td:nth-child(4),
.an-journal td:nth-child(6),
.an-journal td:nth-child(7),
.an-journal td:nth-child(8) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.an-row-open td {
  background: #fff8eb;
}

.an-total td {
  font-weight: 700;
  background: var(--soft, #f3f7f8);
  color: var(--navy, #102b3b);
}

.an-current-year td {
  background: #e8f4f1;
  font-weight: 700;
}

.an-action {
  display: block;
  width: 100%;
  margin: 4px 0;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--line, #dce5e9);
  border-radius: 6px;
  color: var(--blue, #287ca4);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}

.an-action:hover {
  background: var(--soft, #f3f7f8);
}

.an-action-delete {
  color: #a63d3d;
}

.an-status {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--blue, #287ca4);
  border-radius: 6px;
  background: var(--soft, #f3f7f8);
  font-size: .9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.an-status:empty {
  display: none;
}

.an-status-success {
  border-left-color: #267c71;
  color: #205e56;
}

.an-status-warning {
  background: #fff8eb;
  border-left-color: #bc8733;
  color: #79561f;
}

.an-status-error {
  background: #fff0f0;
  border-left-color: #b94a48;
  color: #8e2929;
}

.an-check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  margin-bottom: 18px;
  border-top: 1px solid var(--line, #dce5e9);
  border-bottom: 1px solid var(--line, #dce5e9);
  line-height: 1.6;
  cursor: pointer;
}

.an-check input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--teal-dark, #267c71);
}

.an-check span {
  flex: 1;
}

.an-danger {
  background: #a63d3d;
  border-color: #a63d3d;
  color: #ffffff;
}

.an-danger:hover {
  background: #843030;
  border-color: #843030;
}

#anDruckbereich {
  display: none;
}

@media (max-width: 1000px) {

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

}

@media (max-width: 650px) {

  .an-grid,
  .an-dashboard {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .an-panel {
    padding: 18px;
  }

  .an-stat {
    min-height: 95px;
    padding: 18px;
  }

  body[data-bs-anlagen] .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-bs-anlagen] .button-row .button {
    width: 100%;
    text-align: center;
  }

}

@media print {

  body[data-bs-anlagen] {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body[data-bs-anlagen] > * {
    display: none !important;
  }

  body[data-bs-anlagen] > #anDruckbereich {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
  }

  #anDruckbereich h1 {
    font-size: 18pt;
    color: #000000;
  }

  #anDruckbereich h2 {
    margin-top: 22px;
    font-size: 13pt;
    color: #000000;
    break-after: avoid;
  }

  #anDruckbereich h3 {
    font-size: 11pt;
    color: #000000;
    break-after: avoid;
  }

  #anDruckbereich table {
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: collapse;
    font-size: 8.5pt;
  }

  #anDruckbereich th,
  #anDruckbereich td {
    border: 1px solid #cccccc;
    padding: 6px;
    color: #000000;
    background: #ffffff;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  #anDruckbereich thead {
    display: table-header-group;
  }

  #anDruckbereich tr {
    break-inside: avoid;
  }

}