/* ==========================================================================
 * Benutzer-Menü (Kopfzeile, Präfix um-) + Meine Einstellungen (Präfix es-)
 * js/benutzer-menue.js · js/modules/einstellungen/*
 * ========================================================================== */

/* ---------- Knopf in der Kopfzeile ---------- */
.header .um-knopf,
.um-knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 260px;
  margin: 0;
  padding: 4px 12px 4px 4px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
}
.header .um-knopf:hover,
.um-knopf:hover,
.um-knopf[aria-expanded="true"] {
  background: rgba(255, 255, 255, .26);
  transform: none;
  box-shadow: none;
}
.um-knopf:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.um-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-pfeil { font-size: 11px; opacity: .8; }

.um-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #4f46e5;
  background: #fff;
  border-radius: 50%;
}
.um-avatar--gross { width: 42px; height: 42px; font-size: 16px; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.um-avatar--riesig { width: 72px; height: 72px; font-size: 26px; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); }

@media (max-width: 768px) {
  .um-name, .um-pfeil { display: none; }
  .header .um-knopf, .um-knopf { padding: 4px; }
}

/* ---------- Aufklappliste (am body, fixed) ---------- */
.um-menue {
  position: fixed;
  z-index: 10060;
  min-width: 260px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
  animation: um-auf .12s ease-out;
}
@keyframes um-auf { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.um-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}
.um-kopf-text { display: flex; flex-direction: column; min-width: 0; }
.um-kopf-text b { font-size: 14px; color: #1e293b; }
.um-kopf-text small { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-rolle { color: #4f46e5 !important; }
.um-menue .um-eintrag {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  color: #1e293b;
  background: none;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}
.um-menue .um-eintrag:hover,
.um-menue .um-eintrag:focus-visible {
  background: #eef2ff;
  color: #4f46e5;
  transform: none;
  box-shadow: none;
  outline: none;
}
.um-eintrag-icon { width: 20px; text-align: center; }
.um-trenner { height: 1px; margin: 4px 6px; background: #f1f5f9; }

/* ---------- Meine Einstellungen ---------- */
.es-seite { max-width: 1100px; margin: 0 auto; }
.es-kopf h2 { margin: 0; font-size: 24px; color: #1e293b; }
.es-kopf p { margin: 4px 0 18px; color: #64748b; font-size: 14px; }
.es-rahmen {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.es-reiter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  position: sticky;
  top: 12px;
}
.es-reiter .es-reiter-knopf {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  color: #334155;
  background: none;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
}
.es-reiter .es-reiter-knopf:hover { background: #f8fafc; color: #4f46e5; transform: none; box-shadow: none; }
.es-reiter .es-reiter-knopf.aktiv { background: #eef2ff; color: #4f46e5; }
.es-inhalt { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

@media (max-width: 800px) {
  .es-rahmen { grid-template-columns: 1fr; }
  .es-reiter { flex-direction: row; overflow-x: auto; position: static; }
  .es-reiter .es-reiter-knopf { white-space: nowrap; width: auto; }
}

.es-karte {
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
.es-karte h3 { margin: 0 0 8px; font-size: 16px; color: #1e293b; }
.es-karte p { margin: 0 0 8px; color: #334155; font-size: 14px; }
.es-hinweis { font-size: 13px !important; color: #64748b !important; }
.es-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.es-liste { margin: 0; padding-left: 18px; color: #334155; font-size: 14px; line-height: 1.7; }

.es-profil { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: center; }
.es-profil .es-hinweis, .es-profil .es-knoepfe { grid-column: 1 / -1; }
.es-felder { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.es-felder dt { color: #64748b; }
.es-felder dd { margin: 0; color: #1e293b; font-weight: 600; word-break: break-word; }

.es-rechte { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 20px; margin-top: 8px; }
.es-rechte-gruppe b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin-bottom: 4px; }
.es-rechte-gruppe ul { list-style: none; margin: 0; padding: 0; }
.es-rechte-gruppe li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 14px; border-bottom: 1px solid #f8fafc; }
.es-stufe { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.es-stufe--edit { color: #047857; background: #d1fae5; }
.es-stufe--view { color: #1d4ed8; background: #dbeafe; }

/* Benachrichtigungen: Matrix Thema × Kanal */
.es-matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.es-matrix th, .es-matrix td { padding: 9px 8px; border-bottom: 1px solid #f1f5f9; text-align: center; }
.es-matrix th:first-child, .es-matrix td:first-child { text-align: left; }
.es-matrix thead th { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; position: sticky; top: 0; }
.es-matrix .es-gruppe td { padding-top: 16px; font-size: 12px; font-weight: 700; color: #4f46e5; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid #e0e7ff; }
.es-matrix td small { display: block; color: #64748b; font-size: 12px; }
.es-matrix .es-nicht { color: #cbd5e1; }
.es-schalter { position: relative; display: inline-block; width: 38px; height: 22px; }
.es-schalter input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.es-schalter span {
  position: absolute; inset: 0; cursor: pointer; background: #cbd5e1; border-radius: 999px; transition: background .15s;
}
.es-schalter span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s;
}
.es-schalter input:checked + span { background: #4f46e5; }
.es-schalter input:checked + span::after { transform: translateX(16px); }
.es-schalter input:focus-visible + span { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.es-schalter input:disabled + span { opacity: .4; cursor: not-allowed; }

.es-zeile { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.es-zeile:last-child { border-bottom: 0; }
.es-zeile-text b { display: block; font-size: 14px; color: #1e293b; }
.es-zeile-text small { display: block; font-size: 12px; color: #64748b; }
.es-status { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.es-status--an { color: #047857; background: #d1fae5; }
.es-status--aus { color: #64748b; background: #f1f5f9; }
.es-status--warn { color: #92400e; background: #fef3c7; }
.es-seite select, .es-seite input[type="time"] { width: auto; margin: 0; padding: 6px 10px; font-size: 14px; border: 1px solid #e2e8f0; border-radius: 8px; }

/* Berichte: Teile (Schicht/Team) als Auswahl unter der Zeile */
.es-teile { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px; border-bottom: 1px solid #f1f5f9; }
.es-teil {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  cursor: pointer;
}
.es-teil input { width: auto; margin: 0; }
.es-teil:has(input:checked) { color: #4f46e5; background: #eef2ff; border-color: #c7d2fe; }

/* Kopfzeile: alle Knöpfe auf einer Linie und gleich hoch (style.css gibt jedem <button>
   margin-bottom:15px - beim Benutzer-Menü ist der Abstand 0, sonst sitzen die anderen höher) */
.header .btn,
.header .um-knopf {
  margin: 0 !important;
  height: 40px;
  box-sizing: border-box;
}
.header .btn { padding-top: 0; padding-bottom: 0; }
