/* Extracted from dokumente.html inline <style> blocks */
/* === AGGRESSIVE RESET FOR DOKUMENTE PAGE === */
.dokumente-page,
.dokumente-page * {
  box-sizing: border-box !important;
}

/* Block all table-related CSS */
.dokumente-page table,
.dokumente-page table td,
.dokumente-page table th,
.dokumente-page table tr {
  width: auto !important;
  height: auto !important;
  display: unset !important;
  margin-left: 0 !important;
  position: static !important;
}

.dokumente-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto !important;
  padding: 0 12px;
}

.dokumente-page .ke-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto !important;
}

.dokumente-page form {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.dokumente-page button {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  position: static !important;
  font: inherit !important;
  font-variant: normal !important;
}

.dokumente-page .dokument-inline-form {
  display: inline-flex;
  align-items: center;
}

.dokumente-page .dokument-inline-form button {
  width: auto !important;
  min-width: 0 !important;
  margin-bottom: 0 !important;
}

.dokumente-page form input,
.dokumente-page form select,
.dokumente-page form textarea {
  max-width: 100% !important;
  font: inherit !important;
}

.dokumente-page .dokument-search-input {
  width: 100% !important;
  border: 1px solid var(--ke-border) !important;
  border-radius: 12px !important;
  background: var(--ke-bg) !important;
  color: var(--ke-text) !important;
  padding: 10px 12px !important;
  outline: none !important;
}

.dokumente-page .dokument-search-input::placeholder {
  color: #999;
}

/* Core list layout */
.dokumente-page #dokument-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center !important;
}

.dokumente-page #dokument-list > .dokument-card,
.dokumente-page #dokument-list > #dokument-filter-empty,
.dokumente-page #dokument-list > div:not(.dokument-card) {
  width: min(920px, 100%) !important;
  margin: 0 auto !important;
}

/* Document card styling */
.dokumente-page .dokument-card {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 14px !important;
  overflow: visible !important;
  background: var(--ke-surface) !important;
  border: 1px solid var(--ke-border) !important;
  border-radius: 14px !important;
  gap: 10px;
  box-shadow: none !important;
}

.dokumente-page .dokument-card a,
.dokumente-page .dokument-card span,
.dokumente-page .dokument-card div {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dokumente-page .dokument-card-head {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  align-items: center !important;
  justify-items: center !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dokumente-page .dokument-title-row {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  margin-bottom: 6px !important;
}

.dokumente-page .dokument-description {
  font-size: 0.85rem !important;
  color: var(--ke-text-muted) !important;
  line-height: 1.5 !important;
  max-width: 70ch !important;
  margin: 0 auto !important;
}

.dokumente-page .dokument-card-head > div:first-child {
  min-width: 0 !important;
  width: 100%;
}

.dokumente-page .dokument-card-head > div:last-child {
  justify-self: center !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  align-items: center !important;
  min-width: 0 !important;
  width: 100%;
}

.dokumente-page .dokument-card-head > div:last-child > div {
  justify-content: center !important;
  text-align: center !important;
}

.dokumente-page .dokument-actions {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

.dokumente-page .dokument-actions a,
.dokumente-page .dokument-actions button,
.dokumente-page .dokument-actions form {
  margin: 0 !important;
}

.dokumente-page .dokument-meta {
  color: var(--ke-text-muted) !important;
  font-size: 0.74rem !important;
  text-align: center !important;
  line-height: 1.4 !important;
}

.dokumente-page .dokument-attachment-row,
.dokumente-page .dokument-link-row {
  justify-content: center !important;
  margin-top: 2px !important;
}

.dokumente-page .dokument-attachment-chip,
.dokumente-page .dokument-link-chip {
  border-color: var(--ke-border) !important;
  background: var(--ke-surface) !important;
  border-radius: 999px !important;
}

.dokumente-page #dokument-list > #dokument-filter-empty,
.dokumente-page #dokument-list > div:not(.dokument-card) {
  border-radius: 14px !important;
}

@media (max-width: 768px) {
  .dokumente-page .dokument-card {
    padding: 10px !important;
  }

  .dokumente-page .dokument-card-head {
    grid-template-columns: 1fr !important;
  }

  .dokumente-page .dokument-card-head > div:last-child {
    justify-self: stretch !important;
    align-items: flex-start !important;
    min-width: auto !important;
    width: 100%;
  }
}

/* Compact overview cards: two columns on wide screens, one on mobile. */
.dokumente-page #dokument-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
}

.dokumente-page #dokument-list > .dokument-card {
  width: 100% !important;
  margin: 0 !important;
  min-width: 0 !important;
  min-height: 188px;
  justify-content: space-between;
  padding: 15px !important;
  border-color: color-mix(in srgb, var(--ke-border) 86%, var(--ke-primary)) !important;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.dokumente-page #dokument-list > .dokument-card:hover {
  border-color: var(--ke-primary) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .08) !important;
  transform: translateY(-1px);
}

.dokumente-page .dokument-card-head {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  justify-items: stretch !important;
  text-align: left !important;
  gap: 14px !important;
}

.dokumente-page .dokument-title-row {
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

.dokumente-page .dokument-card-head > div:first-child {
  width: auto !important;
}

.dokumente-page .dokument-card-head > div:last-child {
  justify-self: end !important;
  align-items: flex-end !important;
  width: auto !important;
  min-width: 0 !important;
}

.dokumente-page .dokument-actions {
  width: auto !important;
  justify-content: flex-end !important;
}

.dokumente-page .dokument-meta {
  text-align: right !important;
  white-space: nowrap;
}

.dokumente-page .dokument-attachment-row,
.dokumente-page .dokument-link-row {
  justify-content: flex-start !important;
  width: 100%;
}

.dokumente-page #dokument-list > #dokument-filter-empty,
.dokumente-page #dokument-list > div:not(.dokument-card) {
  grid-column: 1 / -1;
  width: 100% !important;
}

@media (max-width: 820px) {
  .dokumente-page #dokument-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .dokumente-page .dokument-card-head {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .dokumente-page .dokument-card-head > div:last-child {
    justify-self: stretch !important;
    align-items: flex-start !important;
  }

  .dokumente-page .dokument-actions {
    justify-content: flex-start !important;
  }

  .dokumente-page .dokument-meta {
    text-align: left !important;
    white-space: normal;
  }
}
