.ac-form {
  margin-top: 30px;
}

.ac-ip-title {
  margin-top: 10px;
  font-size: 20px;
  color: #e6e6e6;
  margin-bottom: 16px;
  font-weight: 600;
  background: #2a2e32;
  padding: 10px 12px;
  border: 1px solid #3a3d40;
  border-radius: 8px;
  text-align: center;
}

.ac-ip-value {
  color: #ffa500;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(255, 165, 0, 0.4);
}

/* Metro-Ribbon Tabs - Dark Theme */

body {
  background-color: #f4f6f8;
}

.ac-tab-container {
  margin-top: 20px;
  display: flex;
  gap: 6px;
  padding: 5px 5px 0;
  background: transparent;
  border-bottom: 1px solid #ccd0d4;
}

.ac-tab-container button {
  background: #f5f6f7;
  border: 1px solid #bbb;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  color: #2b2f33;
  margin-right: 5px;
  transition: background 0.2s ease, color 0.2s ease;
}

.ac-tab-container button:hover {
  background: #dce0e3;
}

.ac-tab-container button.active {
  background: #2b2f33;
  color: #ffffff;
  border-color: #2b2f33;
}

.ac-tab-content {
  display: none;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 20px;
  border-radius: 0;
  box-shadow: none;
}

.ac-tab-content.active-tab {
  display: block;
}

/* Metro-Ribbon Switch - Dark Theme */
.ac-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  margin: 8px;
}

.ac-switch-row {
  display: flex;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

.ac-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ac-switch-label {
  margin-left: 10px;
  background: transparent;
  color: #1a1c1f;
  font-size: 14px;
}

.ac-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #444;
  /* dunkler Hintergrund im Off-Zustand */
  transition: 0.3s;
  border-radius: 34px;
  box-shadow: inset 0 0 4px #000;
}

.ac-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ccc;
  /* heller Button im Off-Zustand */
  transition: 0.3s;
  border-radius: 50%;
}

.ac-switch input:checked+.ac-slider {
  background-color: #1a1c1f;
  /* dunkler Hintergrund im On-Zustand */
}

.ac-switch input:checked+.ac-slider:before {
  background-color: #ffffff;
  /* weißer Button im On-Zustand */
  transform: translateX(24px);
}

.ac-slider {
  background-image: linear-gradient(to right, #3a3d40, #2b2f33);
}

/* Metro-Ribbon Button - Dark Theme */
.ac-button {
  background-color: #2b2f33;
  color: #fff;
  border: 1px solid #1f2225;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 4px;
  margin-top: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  width: 210px;
  min-width: 210px;
  text-align: center;
  display: inline-block;
}

.ac-button:hover {
  background-color: #3a3f44;
}

.ac-button:active {
  transform: scale(0.97);
}

.ac-button:disabled {
  background-color: #999;
  border-color: #888;
  cursor: not-allowed;
}

/* Metro-Ribbon ListView - Dark Theme */
/* === ListView – Dark Theme, flexible Spalten === */
.ac-listview {
  width: 100%;
  border: 1px solid #2b2f33;
  border-radius: 6px;
  background: #2b2f33;
  color: #e6e6e6;
  font-size: 14px;
  overflow: hidden;
}

/* Kopf */
.ac-listview-header {
  display: grid;
  grid-template-columns: var(--ac-cols, 30% 1fr);
  /* Default 2 Spalten */
  align-items: center;
  padding: 10px 15px;
  background: #1a1c1f;
  color: #fff;
  font-weight: 600;
  border-bottom: 1px solid #2b2f33;
}

/* Zeilen */
.ac-listview-item {
  display: grid;
  grid-template-columns: var(--ac-cols, 30% 1fr);
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #3a3d40;
}

/* Zebra + Hover */
.ac-listview-item:nth-child(odd) {
  background: #2b2f33;
}

.ac-listview-item:nth-child(even) {
  background: #303338;
}

.ac-listview-item:hover {
  background: #35393d;
}

/* Zellen (neutrale Klasse) */
.ac-cell {
  padding: 0 12px;
  word-break: break-word;
}

/* Ausrichtung: 1. Spalte rechts, rest zentriert */
.ac-listview-header .ac-cell:nth-child(1),
.ac-listview-item .ac-cell:nth-child(1) {
  text-align: right;
}

.ac-listview-header .ac-cell:nth-child(n+2),
.ac-listview-item .ac-cell:nth-child(n+2) {
  text-align: center;
}

/* Mobile: Spalten untereinander */
@media (max-width: 782px) {

  .ac-listview-header,
  .ac-listview-item {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .ac-listview-header .ac-cell,
  .ac-listview-item .ac-cell {
    text-align: left;
  }
}

/* Metro-Ribbon Label - Dark Theme */
.ac-dark-hint {
  margin: 10px 0 14px;
  padding: 10px 12px;
  background: #2a2e32;
  color: #eef1f3;
  border: 1px solid #3a3d40;
  border-radius: 8px;
}

/* Footer-Additional ac-dark-hint */
.ac-dark-hint.ac-footer {
  text-align: center;
  font-size: 12px;
  margin-top: 20px;
}

.ac-dark-hint.ac-footer a {
  color: #cfd8dc;
  text-decoration: none;
}

.ac-copy-button {
  background-color: #2b2f33;
  border: 1px solid #1f2225;
  color: #f0f0f0;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 10px;
  vertical-align: middle;
  transition: background 0.2s ease, transform 0.1s ease, color 0.2s ease;
}

.ac-copy-button svg {
  width: 18px;
  height: 18px;
  stroke: #f0f0f0;
  transition: stroke 0.2s ease;
}

.ac-copy-button:hover {
  background-color: #3a3f44;
}

.ac-copy-button:active {
  background-color: #f0f0f0;
  color: #2b2f33;
  transform: scale(0.96);
}

.ac-copy-button:active svg {
  stroke: #2b2f33;
}

.ac-flag {
  width: 20px;
  height: auto;
  border-radius: 2px;
  vertical-align: middle;
}

.ac-dark-select {
  width: 100%;
  margin: 12px 0;
  padding: 10px 12px;
  background-color: #2a2e32;
  border: 1px solid #3a3d40;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #e6e6e6;
  width: 100%;
  box-sizing: border-box;
}

.ac-dark-select label {
  font-weight: 600;
  font-size: 13px;
  color: #cfd2d4;
}

/* Wrapper für optionales Icon + Select */
.ac-dark-select-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ac-dark-select-wrapper img {
  width: 20px;
  height: 14px;
  object-fit: contain;
  border-radius: 3px;
}

/* <select> mit Dark-Stil */
.ac-dark-select select {
  width: 100%;
  background-color: transparent !important;
  color: #eef1f3 !important;
  border: 1px solid #3a3d40;
  border-radius: 6px;
  padding: 8px 10px;
  appearance: none;
  outline: none;
}

/* Hover-Zustand für <select> */
.ac-dark-select select:hover {
  border-color: #4a4f55;
}

.ac-dark-select select:focus {
  border-color: #1e88e5;
  box-shadow: 0 0 0 2px rgba(30, 136, 229, .25);
}

/* Firefox + Standard-Dropdown Dark Fix */
.ac-dark-select select option {
  background: #2a2e32;
  color: #eef1f3;
}

.ac-dark-input {
  margin: 12px 0;
  padding: 10px 12px;
  background-color: #2a2e32;
  border: 1px solid #3a3d40;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ac-dark-input label {
  font-weight: 600;
  font-size: 13px;
  color: #cfd2d4;
}

/* Einheitliche, sichtbare Felder – auch leer */
.ac-dark-input input[type="text"],
.ac-dark-input input[type="password"],
.ac-dark-input input[type="email"],
.ac-dark-input input[type="number"],
.ac-dark-input select {
  width: 100%;
  box-sizing: border-box;
  background-color: #1f2225;
  /* nicht mehr transparent */
  color: #eef1f3;
  border: 1px solid #3a3d40;
  /* dünne sichtbare Kontur */
  border-radius: 6px;
  min-height: 38px;
  /* einheitliche Höhe */
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
}

/* Placeholder bleibt dezent sichtbar */
.ac-dark-input input::placeholder {
  color: #7e848a;
  opacity: 1;
  font-style: italic;
}

/* Fokuszustand */
.ac-dark-input input:focus,
.ac-dark-input select:focus {
  border-color: #1e88e5;
  box-shadow: 0 0 0 2px rgba(30, 136, 229, .25);
}

/* Nummern-Spinner in Chrome/Edge unauffällig */
.ac-dark-input input[type="number"]::-webkit-outer-spin-button,
.ac-dark-input input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ac-dark-input input[type="number"] {
  -moz-appearance: textfield;
  /* Firefox */
  appearance: textfield;
  /* Standard */
}

.ac-password-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.ac-password-wrap input {
  padding-right: 42px;
  /* etwas Luft für das Icon */
}

.ac-dark-groupbox {
  position: relative;
  margin: 20px 0 30px;
  padding: 20px 20px 18px;
  border: 1.5px solid #8a8f94;
  border-radius: 10px;
  background: transparent;
  color: #eef1f3;
  display: block;
  flex-direction: column;
  align-items: center;
}

/* Legend exakt mittig auf der Rahmenlinie */
.ac-dark-groupbox legend {
  align-self: center;
  display: inline-block;
  margin: 0 auto;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #8a8f94;
  background: transparent;
  text-align: center;
  position: relative;
  top: 0;
  left: 0;
}

.ac-dark-groupbox legend+* {
  clear: both;
}

/* === Treeview Dark: Kompat-Layer auf alte Klassen ================== */
/* Search */
.ac-tree-search {
  width: 100%;
  margin: 12px 0;
  padding: 10px 12px;
  background: #2a2e32;
  border: 1px solid #3a3d40;
  border-radius: 8px;
  color: #e6e6e6;
  box-sizing: border-box;
}

.ac-tree-search::placeholder {
  color: #777;
  opacity: 1;
  font-style: italic;
}

/* ===== AC Treeview – Dark Mode ===== */
:root {
  --ac-tree-bg: #2b2f33;
  --ac-tree-bg-2: #303338;
  --ac-tree-bg-3: #35393d;
  --ac-tree-panel: #2a2e32;
  --ac-tree-border: #3a3d40;
  --ac-tree-border-2: #2b2f33;
  --ac-tree-text: #e6e6e6;
  --ac-tree-muted: #cfd2d4;
  --ac-tree-accent: #1e88e5;
}

/* Container */
#roles-treeview.ac-tree {
  background: var(--ac-tree-bg) !important;
  color: var(--ac-tree-text) !important;
  border: 1px solid var(--ac-tree-border-2) !important;
  border-radius: 10px !important;
  padding: 12px !important;
}

/* Reset for UL structure */
#roles-treeview.ac-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Heading + Search */
#roles-treeview.ac-tree h2 {
  margin: 6px 0 12px;
  font-size: 16px;
  color: #eef1f3;
}

#roles-treeview.ac-tree .ac-tree-search {
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 12px;
  background: var(--ac-tree-panel);
  color: var(--ac-tree-text);
  border: 1px solid var(--ac-tree-border);
  border-radius: 8px;
  box-sizing: border-box;
}

#roles-treeview.ac-tree .ac-tree-search::placeholder {
  color: #777;
  opacity: 1;
  font-style: italic;
}

/* Items (root & sub) */
#roles-treeview.ac-tree .ac-tree-item {
  position: relative;
  border-bottom: 1px solid var(--ac-tree-border);
}

#roles-treeview.ac-tree .ac-tree-item:last-child {
  border-bottom: none;
}

/* Root-Zeile */
#roles-treeview.ac-tree .ac-tree-item.root {
  background: var(--ac-tree-bg);
  border-radius: 6px;
  margin: 0 0 6px;
}

/* Toggle-Zeile (Klickziel) */
#roles-treeview.ac-tree .ac-tree-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 10px 12px;
  font-weight: 700;
  border-radius: 6px;
  outline: 0;
}

#roles-treeview.ac-tree .ac-tree-toggle:hover {
  background: var(--ac-tree-bg-3);
}

#roles-treeview.ac-tree .ac-tree-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(30, 136, 229, .25);
}

#roles-treeview.ac-tree .ac-tree-toggle::before {
  content: '▸';
  display: inline-block;
  transform: translateY(1px);
  transition: transform .15s ease;
  color: var(--ac-tree-muted);
}

#roles-treeview.ac-tree .ac-tree-item.is-open>.ac-tree-toggle::before {
  transform: rotate(90deg) translateY(0);
}

/* Nested-Block */
#roles-treeview.ac-tree .ac-tree-nested {
  display: none;
  padding-left: 18px;
}

#roles-treeview.ac-tree .ac-tree-item.is-open>.ac-tree-nested {
  display: block;
}

/* Sub-Item (flex row) */
#roles-treeview.ac-tree .ac-tree-item.sub {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--ac-tree-bg);
}

#roles-treeview.ac-tree .ac-tree-nested>.ac-tree-item.sub:nth-child(even) {
  background: var(--ac-tree-bg-2);
}

#roles-treeview.ac-tree .ac-tree-item.sub:hover {
  background: var(--ac-tree-bg-3);
}

/* Name links, Switch rechts */
#roles-treeview.ac-tree .ac-perm-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  color: var(--ac-tree-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Optional: <select> Variante */
#roles-treeview.ac-tree .ac-perm-select {
  width: 160px;
  padding: 8px 10px;
  background: transparent !important;
  color: #eef1f3 !important;
  border: 1px solid var(--ac-tree-border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

#roles-treeview.ac-tree .ac-perm-select:hover {
  border-color: #4a4f55;
}

#roles-treeview.ac-tree .ac-perm-select:focus {
  border-color: var(--ac-tree-accent);
  box-shadow: 0 0 0 2px rgba(30, 136, 229, .25);
}

#roles-treeview.ac-tree .ac-perm-select option {
  background: var(--ac-tree-panel);
  color: #eef1f3;
}

/* Switch rechts ausrichten */
#roles-treeview.ac-tree .ac-tree-item.sub .ac-switch {
  margin-left: auto;
}

/* Disabled-State */
#roles-treeview.ac-tree input[disabled],
#roles-treeview.ac-tree .ac-switch input[disabled]+.ac-slider {
  opacity: .55;
  cursor: not-allowed;
}

/* Kompakter Modus */
#roles-treeview.ac-tree.ac-tree-compact .ac-tree-toggle {
  padding: 8px 10px;
}

#roles-treeview.ac-tree.ac-tree-compact .ac-tree-item.sub {
  padding: 6px 10px;
}

/* Scrollbarer Bereich */
#roles-treeview.ac-tree.ac-tree-scroll {
  max-height: 520px;
  overflow: auto;
  scrollbar-width: thin;
}

#roles-treeview.ac-tree.ac-tree-scroll::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

#roles-treeview.ac-tree.ac-tree-scroll::-webkit-scrollbar-thumb {
  background: var(--ac-tree-border);
  border-radius: 6px;
}