/* ==========================================================================
 rechte-editor.css — LoD.RechteEditor Styles

 Konsument: web/js/components/extern/rechte-editor.js

 Aus web/styles/rechte-editor.css verschoben in
 die Mirror-Topologie zu web/js/components/extern/.

 Klassen-Hierarchie:
 * .lod-rechte-editor[data-layout="flat"|"accordion"]
 * .lod-rechte-editor__profile-row
 * .lod-rechte-editor__profile-label
 * .lod-rechte-editor__profile-select
 * .lod-rechte-editor__profile-desc
 * .lod-rechte-bereich (section ODER details)
 * .lod-rechte-bereich__hd (header ODER summary)
 * .lod-rechte-bereich__icon
 * .lod-rechte-bereich__title
 * .lod-rechte-bereich__count
 * .lod-rechte-bereich__alle (Toggle-Button)
 * .lod-rechte-bereich__body
 * .lod-rechte-list (ul)
 * .lod-rechte-checkbox (li)
 * .lod-rechte-checkbox__icon
 * .lod-rechte-checkbox__label
 * .lod-rechte-checkbox__implied-badge
 * .lod-rechte-checkbox__info
 * .lod-rechte-scope
 * .lod-rechte-scope__label
 * .lod-rechte-scope__help
 * ══════════════════════════════════════════════════════════════════════════ */

.lod-rechte-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-family: var(--lod-font-sans, sans-serif);
}

/* Profil-Row oben */
.lod-rechte-editor__profile-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-row-gap: var(--space-1);
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--lod-gray-100);
}
.lod-rechte-editor__profile-label {
  font-size: var(--font-size-sm);
  font-weight: var(--fw-medium);
  color: var(--lod-gray-700);
}
.lod-rechte-editor__profile-select {
  width: 100%;
}
.lod-rechte-editor__profile-desc {
  grid-column: 2;
  font-size: 11.5px;
  font-style: italic;
  min-height: 14px;
}

/* Bereich-Block */
.lod-rechte-bereich {
  border: 1px solid var(--lod-gray-200);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
}
.lod-rechte-bereich--flat {
  /* identisch wie default */
}
details.lod-rechte-bereich[open] {
  background: var(--lod-gray-50);
}

.lod-rechte-bereich__hd {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2-5) var(--space-3);
  font-size: var(--fs-body);
  cursor: default;
  user-select: none;
  list-style: none;
}
details.lod-rechte-bereich > summary.lod-rechte-bereich__hd {
  cursor: pointer;
}
details.lod-rechte-bereich > summary.lod-rechte-bereich__hd::-webkit-details-marker {
  display: none;
}
details.lod-rechte-bereich > summary.lod-rechte-bereich__hd::before {
  content: "▸";
  display: inline-block;
  width: 12px;
  font-size: var(--font-size-xs);
  color: var(--lod-gray-500);
  transition: transform var(--duration-quick) var(--ease-soft);
  margin-right: var(--space-xxs);
}
details.lod-rechte-bereich[open] > summary.lod-rechte-bereich__hd::before {
  transform: rotate(90deg);
}

.lod-rechte-bereich__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  opacity: 0.7;
}
.lod-rechte-bereich__icon img {
  width: 100%;
  height: 100%;
}
.lod-rechte-bereich__title {
  font-weight: var(--fw-semibold);
  color: var(--lod-darkblue-700);
  letter-spacing: 0.01em;
}
.lod-rechte-bereich__count {
  margin-left: var(--space-1-5);
  font-size: var(--fs-badge);
  color: var(--lod-gray-500);
  font-variant-numeric: tabular-nums;
}
.lod-rechte-bereich__alle {
  margin-left: auto;
  border: 1px solid var(--lod-gray-200);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-2-5);
  font-size: 11.5px;
  color: var(--lod-gray-700);
  cursor: pointer;
  transition: border-color var(--duration-quick), color var(--duration-quick), background var(--duration-quick);
}
.lod-rechte-bereich__alle:hover {
  border-color: var(--lod-darkblue-300);
  color: var(--lod-darkblue);
  background: var(--lod-gray-50);
}

.lod-rechte-bereich__body {
  padding: var(--space-1) var(--space-3) var(--space-3);
  border-top: 1px solid var(--lod-gray-100);
  background: var(--color-surface);
}
details.lod-rechte-bereich[open] > .lod-rechte-bereich__body {
  background: var(--color-surface);
}

/* Rechte-Liste */
.lod-rechte-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1-5) 12px;
}
.lod-rechte-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1-5) var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--duration-quick);
}
.lod-rechte-checkbox:hover {
  background: var(--lod-gray-50);
}
.lod-rechte-checkbox--readonly:hover {
  background: transparent;
}
.lod-rechte-checkbox input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--lod-darkblue);
}
.lod-rechte-checkbox--readonly input[type="checkbox"] {
  cursor: default;
}
.lod-rechte-checkbox label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.lod-rechte-checkbox--readonly label {
  cursor: default;
}
.lod-rechte-checkbox__icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.lod-rechte-checkbox__icon img {
  width: 100%;
  height: 100%;
}
.lod-rechte-checkbox__label {
  font-size: 12.5px;
  color: var(--lod-gray-900);
}

/* Implied-Badge: dezent gelblich, sagt "automatisch erforderlich" */
.lod-rechte-checkbox--implied .lod-rechte-checkbox__label {
  opacity: 0.85;
}
.lod-rechte-checkbox--implied input[type="checkbox"] {
  accent-color: var(--lod-amber-500);
  opacity: 0.85;
}
.lod-rechte-checkbox__implied-badge {
  flex: 0 0 auto;
  font-size: var(--font-size-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-xxs) var(--space-1-5);
  background: var(--lod-amber-50);
  color: var(--lod-amber-700);
  border-radius: var(--radius-sm);
}

/* Info-Icon mit Tooltip rechts */
.lod-rechte-checkbox__info {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  opacity: 0.4;
  cursor: help;
  transition: opacity var(--duration-quick);
}
.lod-rechte-checkbox__info:hover {
  opacity: 0.85;
}
.lod-rechte-checkbox__info img {
  width: 100%;
  height: 100%;
}

/* Scope-Row (Sichtbar: Nur eigene / Alle der Firma) */
.lod-rechte-scope {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2-5);
  padding-top: var(--space-2-5);
  border-top: 1px dashed var(--lod-gray-200);
}
.lod-rechte-scope__label {
  font-size: var(--font-size-sm);
  font-weight: var(--fw-medium);
  color: var(--lod-gray-700);
  flex: 0 0 auto;
}
/* Das Scope-Dropdown ist binaer ("Nur eigene" / "Alle der Firma") — der globale
   min-width:200px-Floor (admin.css .zeit-select--sm) ist hier massiv ueberdimensioniert
   und quetscht den Hilfetext. Im Rechte-Editor auf Inhaltsbreite reduzieren. */
.lod-rechte-scope .zeit-select--sm {
  min-width: 0;
  flex: 0 1 auto;
}
.lod-rechte-scope__help {
  font-size: var(--fs-badge);
  font-style: italic;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Container-Query: schmale Konsumenten (Sub-Drawer medium ~520px effektiv)
   reduzieren das 2-Spalten-Grid auf 1 Spalte. */
@container drawer (max-width: 560px) {
  .lod-rechte-list {
    grid-template-columns: 1fr;
  }
  .lod-rechte-editor__profile-row {
    grid-template-columns: 1fr;
  }
  .lod-rechte-editor__profile-desc {
    grid-column: 1;
  }
  .lod-rechte-bereich__alle {
    /* bei sehr schmalen Containern Schriftgroesse runter, Text wird nicht abgeschnitten */
    font-size: var(--fs-badge);
    padding: 3px var(--space-2);
  }
}
