.anerk-inhalte-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.anerk-inhalte-page.anerk-pfk-focus .anerk-inhalte-hero,
.anerk-inhalte-page.anerk-pfk-focus .anerk-secondary-card {
  display: none;
}

.anerk-inhalte-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border: 1px solid #e6e8ef;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.05);
}

.anerk-inhalte-title {
  margin: 0;
  font-size: 30px;
  color: #101828;
}

.anerk-inhalte-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #475467;
}

.anerk-inhalte-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.anerk-module-card {
  --module-accent: #2563eb;
  --module-accent-soft: rgba(37, 99, 235, 0.2);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #d9e2f1;
  border-radius: 18px;
  background:
    radial-gradient(140% 120% at 100% 0%, var(--module-accent-soft), transparent 62%),
    linear-gradient(165deg, #ffffff 0%, #f8fbff 60%, #edf4ff 100%);
  box-shadow:
    0 16px 30px rgba(15, 23, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  padding: 20px 20px 22px;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.anerk-module-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  right: -44px;
  top: -68px;
  background: radial-gradient(circle, var(--module-accent-soft) 0%, rgba(255, 255, 255, 0) 72%);
}

.anerk-module-card::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px 12px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(148, 163, 184, 0.45),
    rgba(255, 255, 255, 0)
  );
}

.anerk-module-card:hover {
  transform: translateY(-6px) rotateX(1deg);
  border-color: #b7c8e6;
  box-shadow:
    0 26px 40px rgba(15, 23, 42, 0.14),
    0 8px 18px rgba(15, 23, 42, 0.08);
}

.anerk-module-card:nth-child(2) {
  --module-accent: #0f766e;
  --module-accent-soft: rgba(15, 118, 110, 0.22);
}

.anerk-module-card:nth-child(3) {
  --module-accent: #15803d;
  --module-accent-soft: rgba(21, 128, 61, 0.22);
}

.anerk-module-card:nth-child(4) {
  --module-accent: #dc2626;
  --module-accent-soft: rgba(220, 38, 38, 0.2);
}

.anerk-module-card-large {
  --module-accent: #1d4ed8;
  --module-accent-soft: rgba(29, 78, 216, 0.2);
}

.anerk-module-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.anerk-module-toggle-chevron {
  width: 24px;
  height: 24px;
  color: #475569;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.anerk-module-card.open .anerk-module-toggle-chevron {
  transform: rotate(180deg);
}

.anerk-module-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d9e4ef;
}

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

.anerk-module-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--module-accent);
}

.anerk-module-title {
  display: block;
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.anerk-module-text {
  display: block;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
}

.anerk-head-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.anerk-export-row {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.anerk-action-row {
  width: auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.anerk-action-btn {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.anerk-action-btn.is-add {
  border: 1px solid #166534;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
}

.anerk-action-btn.is-add:hover {
  background: linear-gradient(180deg, #16a34a 0%, #166534 100%);
}

.anerk-action-btn.is-move {
  border: 1px solid #854d0e;
  background: linear-gradient(180deg, #d97706 0%, #a16207 100%);
  color: #ffffff;
}

.anerk-action-btn.is-move:hover {
  background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
  color: #ffffff;
}

.anerk-action-btn.is-delete {
  border: 1px solid #b91c1c;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.anerk-action-btn.is-delete:hover {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
}

.anerk-export-btn {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 14px;
  border: 1px solid #1e40af;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.anerk-export-btn:hover {
  background: linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%);
}

.anerk-import-btn {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 14px;
  border: 1px solid #1d4ed8;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.anerk-import-btn:hover {
  background: #eff6ff;
  border-color: #1e40af;
  color: #1e40af;
}

.anerk-perm-locked {
  position: relative;
  border-color: #cbd5e1 !important;
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%) !important;
  color: #475569 !important;
  box-shadow: none !important;
  filter: saturate(0.35);
  cursor: not-allowed !important;
}

.anerk-perm-locked::after {
  content: "\26A0  Keine Rechte";
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translate(-6px, -50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}

.anerk-perm-locked:hover::after,
.anerk-perm-locked:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.anerk-pfk-tables {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.anerk-loading-inline {
  padding: 18px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
}

.anerk-table-accordion {
  border: 1px solid #d9e4ef;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.anerk-table-toggle {
  width: 100%;
  border: 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #f3f8ff);
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.anerk-table-toggle:hover {
  background: linear-gradient(180deg, #ffffff, #eaf3ff);
}

.anerk-table-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.anerk-table-title {
  font-size: 15px;
  font-weight: 800;
}

.anerk-table-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  background: #e2e8f0;
  color: #1e293b;
}

.anerk-table-chevron {
  width: 20px;
  height: 20px;
  color: #475569;
  transition: transform 0.2s ease;
}

.anerk-table-accordion.open .anerk-table-chevron {
  transform: rotate(180deg);
}

.anerk-table-body {
  padding: 12px 12px 14px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.anerk-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 58vh;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.anerk-table {
  width: auto;
  min-width: 0;
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.anerk-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #f8fbff 0%, #dbeafe 100%);
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  text-align: center;
  padding: 11px 8px;
  border-right: 1px solid #d7e3ef;
  border-bottom: 1px solid #c5d2e1;
  position: relative;
}

.anerk-table td {
  padding: 8px 8px;
  border-right: 1px solid #eef3f8;
  border-bottom: 1px solid #e8eef5;
  background: #ffffff;
  font-size: 13px;
  color: #111827;
  vertical-align: middle;
}

.anerk-table th,
.anerk-table td {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.anerk-table th:last-child,
.anerk-table td:last-child {
  border-right: 0;
}

.anerk-table tbody tr:nth-child(even) td {
  background: #f6faff;
}

.anerk-table tbody tr:hover td {
  background: #dbeafe;
}

.anerk-cell-button {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anerk-cell-button.has-value {
  background: #eef6ff;
  border-color: #bfd8ff;
  color: #1d4ed8;
}

.anerk-cell-clickable {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.anerk-cell-clickable:hover {
  background: #bfdbfe !important;
}

.anerk-cell-clickable:hover::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 6px;
  z-index: 0;
  box-shadow:
    inset 0 0 0 2px rgba(29, 78, 216, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.anerk-cell-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anerk-cell-empty {
  color: #94a3b8;
}

.anerk-th-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 10px;
  min-height: 14px;
  min-width: 0;
}

.anerk-th-inner > span:first-child {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anerk-col-resize-handle {
  position: absolute;
  top: -9px;
  right: -8px;
  width: 14px;
  height: calc(100% + 18px);
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}

.anerk-col-resize-handle::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 20%;
  bottom: 20%;
  width: 2px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.35);
  transition: background 0.16s ease;
}

.anerk-col-resize-handle:hover::after {
  background: rgba(37, 99, 235, 0.8);
}

body.anerk-col-resizing,
body.anerk-col-resizing * {
  user-select: none !important;
  cursor: col-resize !important;
}

.anerk-empty-table {
  padding: 18px;
  color: #64748b;
  text-align: center;
  font-size: 14px;
}

.anerk-modal-box {
  width: min(640px, 92vw);
}

#anerkAddModal {
  align-items: flex-start;
  padding: 26px;
}

#anerkAddModal .anerk-modal-box {
  width: min(980px, calc(100vw - 52px));
  max-height: calc(100vh - 52px);
  margin-top: 58px;
  border: 1px solid #dbe5ef;
}

#anerkAddModal .modal-body {
  overflow-y: auto;
}

#anerkAddModal .anerk-dynamic-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#anerkAddModal .anerk-address-form-group {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.anerk-dynamic-form {
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.anerk-dynamic-form .form-group {
  margin-bottom: 0;
}

.anerk-dynamic-form .full-span {
  grid-column: 1 / -1;
}

.anerk-address-form-group {
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.anerk-address-form-group legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
}

.anerk-dynamic-form textarea {
  min-height: 64px !important;
  max-height: 140px;
  resize: vertical;
}

#anerkAddTableSelect,
#anerkMoveSourceTable,
#anerkMoveTargetTable,
#anerkMoveRowSelect,
#anerkDeleteTableSelect,
#anerkDeleteRowSelect,
.anerk-dynamic-form input,
.anerk-dynamic-form select,
.anerk-dynamic-form textarea,
.anerk-address-form-group input {
  border-radius: 10px;
  border: 1px solid #d6e2ef;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

@media (max-width: 900px) {
  .anerk-module-head {
    flex-direction: column;
    align-items: stretch;
  }

  .anerk-head-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .anerk-export-row,
  .anerk-action-row {
    width: 100%;
    justify-content: flex-start;
    margin-right: 0;
  }

  .anerk-simple-grid,
  .anerk-dynamic-form,
  .anerk-address-form-group {
    grid-template-columns: 1fr;
  }

  #anerkAddModal .anerk-dynamic-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #anerkAddModal .anerk-address-form-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #anerkAddModal {
    padding: 14px;
  }

  #anerkAddModal .anerk-modal-box {
    width: min(980px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    margin-top: 4px;
  }

  .anerk-address-grid {
    grid-template-columns: 1fr;
  }

  #anerkAddModal .anerk-dynamic-form,
  #anerkAddModal .anerk-address-form-group {
    grid-template-columns: 1fr;
  }
}
