/* 2.70.4: Rechte (Matrix, Rollen, Drawer) und Menue-Korrekturen */
.right-hidden { display: none !important; }

/* Menue: "Alles auf / alles zu" als kleines Symbol mit Abstand zur Scrollleiste; lange Punkte laufen nicht unter den Pfeil; Trennstrich vor Dunkelmodus/Logout */
.app-sidebar .sidebar-nav .sidebar-nav-head { padding-right: 14px; }
.app-sidebar .sidebar-nav .sidebar-nav-head .sidebar-nav-heading { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar .sidebar-nav button.sidebar-nav-all,
.app-sidebar .sidebar-nav button.sidebar-nav-all:not(.secondary):not(.danger):not(.modal-close):not(.sidebar-toggle) { flex: 0 0 auto; width: 24px !important; height: 24px !important; min-width: 24px !important; margin: 0 !important; padding: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; font-size: 12px !important; line-height: 1 !important; }
.app-sidebar .sidebar-nav button.sidebar-nav-parent { padding-right: 38px !important; }
.app-sidebar .sidebar-nav button.sidebar-nav-parent > span:first-child { display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.app-sidebar .sidebar-nav .sidebar-nav-chevron { right: 16px; }
.sidebar-nav-divider { height: 1px; margin: 8px 12px 6px; background: #dfe5db; }

/* Tabs der Benutzerverwaltung */
.rt-tabs { display: flex; gap: 6px; padding: 8px 12px; flex-wrap: wrap; }
.rt-tabs button { background: transparent; color: inherit; border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; font-weight: 600; box-shadow: none; }
.rt-tabs button.active { background: #eaf1e0; border-color: #cfdcc0; color: #24331f; }
.rt-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rt-filters input[type=search] { min-width: 220px; }
.rt-legend { margin-left: auto; font-size: 12px; color: #5d6b62; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rt-table-wrap { overflow: auto; max-height: 70vh; }
.rt-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rt-table th, .rt-table td { padding: 7px 8px; border-bottom: 1px solid #e7ece3; text-align: left; vertical-align: middle; }
.rt-table thead th { position: sticky; top: 0; background: #f6f8f3; z-index: 1; white-space: nowrap; font-size: 12px; }
.rt-table tbody tr[data-rt-user] { cursor: pointer; }
.rt-table tbody tr[data-rt-user]:hover { background: #f3f7ee; }
.rt-table td small { display: block; color: #6c7a70; }
.rt-cell { text-align: center; white-space: nowrap; }
.rt-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.rt-chip.lv0 { background: #f0f2ee; color: #8a948c; }
.rt-chip.lv1 { background: #fff3cf; color: #7a5a00; }
.rt-chip.lv2 { background: #dcf1dc; color: #1d6a2a; }
.rt-dev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d9622b; margin-left: 4px; vertical-align: middle; }

.rt-drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 28, 22, .35); z-index: 1000; display: flex; justify-content: flex-end; }
.rt-drawer { width: min(720px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,.18); }
.rt-drawer-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e7ece3; }
.rt-drawer-head h3 { margin: 0; }
.rt-eyebrow { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6c7a70; }
.rt-drawer-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 20px; border-bottom: 1px solid #e7ece3; }
.rt-drawer-tools label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #52605a; }
.rt-tree { flex: 1 1 auto; overflow: auto; padding: 8px 20px 20px; }
.rt-drawer-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid #e7ece3; }
.rt-drawer-foot .form-message { margin-right: auto; }
.rt-note { padding: 10px 20px; color: #52605a; }
.rt-area { border: 1px solid #e3e9de; border-radius: 10px; margin-top: 10px; }
.rt-area-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.rt-area-toggle { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: inherit; text-align: left; padding: 4px; box-shadow: none; }
.rt-summary { margin-left: auto; font-size: 12px; color: #5d6b62; }
.rt-chevron { width: 8px; height: 8px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.rt-area.is-open .rt-chevron { transform: rotate(45deg); }
.rt-area-all { display: inline-flex; gap: 4px; }
.rt-mini { min-width: 28px; padding: 3px 6px; font-size: 12px; background: #f6f8f3; color: #3a4a40; border: 1px solid #dfe5db; border-radius: 6px; box-shadow: none; }
.rt-area-body { padding: 4px 12px 10px; }
.rt-row { padding: 8px 0; border-top: 1px solid #eef1ea; }
.rt-row:first-child { border-top: 0; }
.rt-row.is-deviation { background: #fff7ef; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.rt-row-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rt-label { flex: 1 1 180px; font-weight: 600; }
.rt-seg { display: inline-flex; border: 1px solid #dfe5db; border-radius: 8px; overflow: hidden; }
.rt-seg-btn { background: #fff; color: #52605a; border: 0; border-right: 1px solid #dfe5db; padding: 5px 12px; font-size: 12px; font-weight: 600; box-shadow: none; border-radius: 0; }
.rt-seg-btn:last-child { border-right: 0; }
.rt-seg-btn.is-on.lv0 { background: #eceee9; color: #3a4a40; }
.rt-seg-btn.is-on.lv1 { background: #fff0bd; color: #6c5000; }
.rt-seg-btn.is-on.lv2 { background: #cdeccd; color: #17602a; }
.rt-dev { font-size: 12px; color: #b4521c; }
.rt-link { background: transparent; border: 0; color: #2a6fb3; text-decoration: underline; padding: 0 2px; font-size: 12px; cursor: pointer; box-shadow: none; }
.rt-actions { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 6px 0 0 12px; font-size: 13px; }
.rt-actions.is-off { opacity: .55; }
.rt-action { display: inline-flex; align-items: center; gap: 6px; }
.rt-hint { font-size: 12px; color: #6c7a70; }
.rt-roles { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.rt-role-list { display: flex; flex-direction: column; gap: 6px; }
.rt-role-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rt-role-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: #fff; color: inherit; border: 1px solid #e3e9de; border-radius: 8px; padding: 8px 10px; box-shadow: none; }
.rt-role-item.is-on { background: #eaf1e0; border-color: #cfdcc0; }
.rt-role-item em { font-size: 11px; color: #2a6fb3; font-style: normal; }
.rt-role-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rt-role-tools h3 { margin: 0 auto 0 0; }
@media (max-width: 900px) { .rt-roles { grid-template-columns: 1fr; } }

/* Aktive Nutzer (Teil B) und Hinweise an alle */
.au-card .au-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.au-card .au-head small { display: block; color: #6c7a70; }
.au-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.au-message { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #52605a; }
.au-message textarea { width: 100%; resize: vertical; }
.au-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.au-live { color: #1d8a3a; font-size: 11px; }
.hub-message-stack { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.hub-message-card { background: #fff8e1; border: 1px solid #f0cf6b; border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); color: #3d3200; }
.hub-message-card > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.hub-message-card p { margin: 6px 0 10px; font-size: 15px; font-weight: 600; }

/* ---- Korrektur (nach Sichtung der Benutzerverwaltung): eigene Knoepfe gegen die globale Regel button { width: 100%; margin-top: 16px; Gruen } absichern ---- */
#usersView .rt-tabs button, #usersView #usersPanelMatrix button, #usersView #usersPanelRoles button, #usersView #usersPanelSessions button, #usersView #usersPanelLog button,
.rt-drawer button, .hub-message-card button {
  width: auto !important; margin-top: 0 !important; box-shadow: none !important; text-transform: none !important; letter-spacing: normal !important; transform: none !important; font-weight: 600;
}

/* Reiter: schmale Auswahlleiste statt gruener Balken */
#usersView .rt-tabs.box { display: flex !important; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; width: fit-content; max-width: 100%; padding: 4px !important; border-radius: 12px; }
#usersView .rt-tabs button { background: transparent !important; color: inherit !important; border: 1px solid transparent !important; border-radius: 9px !important; padding: 7px 16px !important; font-size: 14px; min-height: 0; }
#usersView .rt-tabs button:hover { background: #eef3e6 !important; }
#usersView .rt-tabs button.active { background: #e3edd4 !important; border-color: #c9dbb2 !important; color: #24331f !important; }
#usersView .users-management-page { gap: 12px; }

/* Wartungshinweis: eine kompakte Zeile */
#maintenanceNoticeAdmin.box { padding: 12px 16px !important; }
#maintenanceNoticeAdmin h3 { margin: 0 0 8px; font-size: 15px; }
#maintenanceNoticeAdmin .maintenance-notice-form { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; }
#maintenanceNoticeAdmin .maintenance-notice-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #52605a; margin: 0; }
#maintenanceNoticeAdmin .maintenance-notice-form textarea { min-height: 38px; height: 38px; resize: vertical; padding: 8px 10px; }
#maintenanceNoticeAdmin .maintenance-notice-form input[type=time] { padding: 8px 10px; }
#maintenanceNoticeAdmin .maintenance-notice-form-actions { display: flex; gap: 8px; }
#maintenanceNoticeAdmin .maintenance-notice-form-actions button { width: auto !important; margin: 0 !important; padding: 9px 14px !important; white-space: nowrap; font-size: 13px; text-transform: none !important; letter-spacing: normal !important; }
#maintenanceNoticeAdmin .maintenance-notice-status { margin: 6px 0 0; min-height: 0; }
@media (max-width: 900px) { #maintenanceNoticeAdmin .maintenance-notice-form { grid-template-columns: 1fr; } }

/* Matrix, Rollen, Aktive Nutzer, Protokoll: Knoepfe in normaler Groesse */
#usersView .rt-filters select, #usersView .rt-filters input { width: auto; margin: 0; }
#usersView .rt-role-list-head button { padding: 7px 12px !important; font-size: 13px; }
#usersView .rt-role-item { width: 100% !important; text-align: left; padding: 8px 10px !important; background: #fff !important; color: inherit !important; border: 1px solid #e3e9de !important; border-radius: 8px !important; font-weight: 500; }
#usersView .rt-role-item.is-on { background: #eaf1e0 !important; border-color: #cfdcc0 !important; }
#usersView .rt-role-tools button, #usersView .au-buttons button, #usersView #auRefresh, #usersView .rt-drawer-foot button { padding: 8px 14px !important; font-size: 13px; }
#usersView .rt-role-tools button.secondary, #usersView .au-buttons button.secondary { background: #f6f7f5 !important; color: #394039 !important; border: 1px solid #dfe5db !important; }
#usersView .rt-role-tools button.danger, #usersView .au-buttons button.danger { color: #9a2a1a !important; }

/* Rechte-Maske (Schublade, haengt am body): Auswahl Kein/Lesen/Bearbeiten, Bereichs-Knoepfe, Textlinks */
.rt-drawer .rt-seg-btn { background: #fff !important; color: #52605a !important; border: 0 !important; border-right: 1px solid #dfe5db !important; border-radius: 0 !important; padding: 6px 12px !important; font-size: 12px; }
.rt-drawer .rt-seg-btn:last-child { border-right: 0 !important; }
.rt-drawer .rt-seg-btn.is-on.lv0 { background: #eceee9 !important; color: #3a4a40 !important; }
.rt-drawer .rt-seg-btn.is-on.lv1 { background: #fff0bd !important; color: #6c5000 !important; }
.rt-drawer .rt-seg-btn.is-on.lv2 { background: #cdeccd !important; color: #17602a !important; }
.rt-drawer .rt-mini { background: #f6f8f3 !important; color: #3a4a40 !important; border: 1px solid #dfe5db !important; border-radius: 6px !important; min-width: 28px; padding: 3px 7px !important; font-size: 12px; }
.rt-drawer .rt-area-toggle { background: transparent !important; color: inherit !important; border: 0 !important; padding: 4px !important; text-align: left; width: auto !important; flex: 1 1 auto; font-weight: 600; }
.rt-drawer .rt-link { background: transparent !important; color: #2a6fb3 !important; border: 0 !important; padding: 0 2px !important; text-decoration: underline; font-size: 12px; font-weight: 500; }
.rt-drawer .rt-drawer-head button, .rt-drawer .rt-drawer-tools button, .rt-drawer .rt-drawer-foot button { padding: 8px 14px !important; font-size: 13px; border-radius: 9px !important; }
.rt-drawer .rt-drawer-head button.secondary, .rt-drawer .rt-drawer-tools button.secondary, .rt-drawer .rt-drawer-foot button.secondary { background: #f6f7f5 !important; color: #394039 !important; border: 1px solid #dfe5db !important; }
.hub-message-card button { padding: 7px 14px !important; font-size: 13px; background: #f6f7f5 !important; color: #394039 !important; border: 1px solid #dfe5db !important; }

/* Rollen-Seite: dieselbe Baumansicht wie in der Rechte-Maske */
#usersView .rt-tree button { width: auto !important; margin-top: 0 !important; box-shadow: none !important; text-transform: none !important; letter-spacing: normal !important; transform: none !important; font-weight: 600; }
#usersView .rt-tree .rt-seg-btn { background: #fff !important; color: #52605a !important; border: 0 !important; border-right: 1px solid #dfe5db !important; border-radius: 0 !important; padding: 6px 12px !important; font-size: 12px; }
#usersView .rt-tree .rt-seg-btn:last-child { border-right: 0 !important; }
#usersView .rt-tree .rt-seg-btn.is-on.lv0 { background: #eceee9 !important; color: #3a4a40 !important; }
#usersView .rt-tree .rt-seg-btn.is-on.lv1 { background: #fff0bd !important; color: #6c5000 !important; }
#usersView .rt-tree .rt-seg-btn.is-on.lv2 { background: #cdeccd !important; color: #17602a !important; }
#usersView .rt-tree .rt-mini { background: #f6f8f3 !important; color: #3a4a40 !important; border: 1px solid #dfe5db !important; border-radius: 6px !important; min-width: 28px; padding: 3px 7px !important; font-size: 12px; }
#usersView .rt-tree .rt-area-toggle { background: transparent !important; color: inherit !important; border: 0 !important; padding: 4px !important; text-align: left; flex: 1 1 auto; }
#usersView .rt-tree .rt-link { background: transparent !important; color: #2a6fb3 !important; border: 0 !important; padding: 0 2px !important; text-decoration: underline; font-size: 12px; font-weight: 500; }
#usersView .rt-tree .rt-area-head { padding: 6px 10px; }

/* 2.70.5: Benutzer dieser Rolle (Rollen-Seite) */
#usersView .rt-members { margin: 4px 0 12px; }
#usersView .rt-members ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
#usersView .rt-members .rt-member { display: inline-flex !important; align-items: baseline; gap: 8px; width: auto !important; margin-top: 0 !important; padding: 6px 12px !important; background: #f6f8f3 !important; color: inherit !important; border: 1px solid #dfe5db !important; border-radius: 9px !important; box-shadow: none !important; font-weight: 600; font-size: 13px; text-transform: none !important; letter-spacing: normal !important; }
#usersView .rt-members .rt-member:hover { background: #e9f1db !important; border-color: #c9dbb2 !important; }
#usersView .rt-members .rt-member small { color: #6c7a70; font-weight: 400; }
