/* === CUSTOM DATA GRID === */
.bgs-data-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0.25rem 0;
}
.bgs-data-grid dt {
  font-weight: 600;
  white-space: normal;
}
.bgs-data-grid dd {
  font-size: 1.125rem;
  margin: 0;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bgs-data-grid dd a,
.bgs-data-grid dd .ui-link,
.bgs-data-grid dd .ui-commandlink {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bgs-data-grid--stacked {
  grid-template-columns: 1fr;
  gap: 0.2rem 0;
}

.bgs-data-grid--stacked dt {
  font-weight: 600;
  white-space: normal;
  font-size: 0.9rem;
}
.bgs-data-grid--stacked dd {
  margin-bottom: 1rem;
}

.bgs-data-grid--stacked.bgs-data-grid--2col {
  grid-template-columns: repeat(2, 1fr);
  column-gap: 2rem;
}

.bgs-data-grid--stacked.bgs-data-grid--2col > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 500px;
}

.bgs-data-grid--stacked.bgs-data-grid--2col > div.bgs-data-grid__item--full-width {
  grid-column: 1 / -1;
  max-width: none;
}

.bgs-data-grid--stacked.bgs-data-grid--2col > div > dd {
  margin-bottom: 1rem;
}

@media (max-width: 720px) {
  .bgs-data-grid {
    grid-template-columns: 1fr;
    gap: 0.25rem 0;
  }

  .bgs-data-grid dd {
    margin-bottom: 0.75rem;
  }

  .bgs-data-grid dd:last-child {
    margin-bottom: 0;
  }
}

/* === TABLES === */

body .bgs-table-header {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-weight: 600;
}
/*
body .table-header .table-header-buttons {
  display: flex;
  gap: 1rem;
} */

body .bgs-table-header-buttons,
body .bgs-panel-header-buttons,
body .bgs-table-footer-buttons {
  display: flex;
  gap: 0.5rem;
}

body .ui-datatable,
body .dashboard .ui-datatable {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: none;
}

body .ui-datatable table {
  table-layout: auto;
}

body .ui-datatable .ui-datatable-header,
body .ui-datatable .ui-datatable-header .table-header,
body .ui-treetable .ui-treetable-header,
body .ui-treetable .ui-treetable-header .table-header {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: none;
}

body .ui-datatable thead th,
body .ui-datatable thead th.ui-state-active {
  background-color: white;
  vertical-align: top;
  padding: 1rem 1rem 0.5rem;
}

body .ui-datatable thead th:has(> .ui-column-title:empty) {
  vertical-align: bottom;
}

body .ui-datatable thead th:not(.ui-state-active) .ui-sortable-column-icon {
  display: none;
}

body .ui-datatable th.ui-selection-column,
body .ui-datatable td.ui-selection-column {
  width: 2.5rem !important;
  min-width: 2.5rem;
  max-width: 2.5rem;
  text-align: center;
}

th.shrink,
td.shrink {
  white-space: nowrap;
  width: 1%;
}

body .ui-datatable thead th.ui-sortable-column.ui-state-focus {
  box-shadow: none;
}

body .ui-datatable .ui-datatable-data > tr > td {
  vertical-align: top;
}

body .ui-datatable .ui-datatable-data > tr:last-child > td {
  border-bottom-width: 0;
}

body .ui-datatable td.shrink .bi:not(.ui-button-icon-left)::before {
  font-size: 1.5rem;
}

body .ui-datatable .ui-datatable-data .ui-commandlink {
  font-weight: 500;
}

body .ui-datatable .ui-datatable-data > tr.ui-state-highlight,
body .ui-datatable.ui-datatable-striped .ui-datatable-data > tr.ui-datatable-odd.ui-state-highlight {
  background: #f2f7fb;
  color: #191818;
}

body .ui-datatable .ui-datatable-data > tr.ui-state-hover {
  background: #f1f2f5;
}

/*
body .ui-datatable-data .ui-button.ui-button-icon-only {
  background-color: unset;
  color: black;
  border: none;
}

body .ui-datatable-data .ui-button.ui-button.ui-button-icon-only.ui-state-hover {
  background-color: var(--primary-color);
  color: white;
  border: none;
}
*/

body .ui-paginator .ui-paginator-pages .ui-paginator-page.ui-state-active {
  background-color: #f9fafb;
  font-weight: 700;
  color: #191818;
}

body .ui-datatable .ui-paginator.ui-paginator-bottom {
  border: 0;
}

@keyframes row-click-flash {
  from {
    background-color: #d4e8f7;
  }
  to {
    background-color: transparent;
  }
}

/* === UI PANEL === */

body .ui-panel .ui-panel-titlebar,
body .ui-datatable .ui-datatable-header {
  background-color: white;
  font-weight: 400;
  font-size: 1.25rem;
}

body .bgs-icon-and-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* =============================================================
 * Generische Chip-Farben
 * ============================================================= */

/* STATUS CHIPS */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 10rem;
  white-space: nowrap;
}

/* Detail-view variant – more padding, uniform dark-grey text */
.chip.chip--lg {
  padding: 0.375rem 0.625rem;
}

/* Grün */
.chip--green {
  background-color: #ecfdf5;
  color: #047857;
}

/* Rot */
.chip--red {
  background-color: #fef2f2;
  color: #991b1b;
}

/* Orange */
.chip--orange {
  background-color: #fff7ed;
  color: #c2410c;
}

/* Yellow */
.chip--yellow {
  background-color: #fef3c7;
  color: #92400e;
}

/* Blau */
.chip--blue {
  background-color: #eff6ff;
  color: #1e40af;
}

/* Grau */
.chip--grey {
  background-color: #f9fafb;
  color: #6a7282;
}

/* =============================================================
 * Colored Icons
 * ============================================================= */

body .bgs-colored-icon {
  width: calc(1em + 20px);
  height: calc(1em + 20px);
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

body .bgs-colored-icon.icon--green {
  background-color: #e1f8e9;
  color: #006a1d;
}

body .bgs-colored-icon.icon--blue {
  background-color: #e8effc;
  color: #004f88;
}

body .bgs-colored-icon.icon--rose {
  background-color: #f7edf2;
  color: #9d4266;
}

body .bgs-colored-icon.icon--teal {
  background-color: #e6f7f5;
  color: #00601b;
}

body .bgs-colored-icon.icon--slate {
  background-color: #f1f5f9;
  color: #2a4162;
}

body .bgs-colored-icon.icon--indigo {
  background-color: #efeff8;
  color: #5f5b9a;
}

body .bgs-colored-icon.icon--cyan {
  background-color: #e1f3f4;
  color: #005b71;
}

body .bgs-colored-icon.icon--purple {
  background-color: #f1eef7;
  color: #6b5a8f;
}

body .bgs-colored-icon.icon--brown {
  background-color: #faf1ef;
  color: #a86354;
}

body .bgs-colored-icon.icon--orange {
  background-color: #fff4e5;
  color: #a85500;
}

body .bgs-colored-icon.icon--red {
  background-color: #fdecec;
  color: #d13a3a;
}
