/* =========================================================
   OPENCLAW VTIGER DASHBOARD
   Zentrales Design für Login und Verwaltungsoberfläche
   ========================================================= */


/* ---------------------------------------------------------
   FARBEN UND GRUNDEINSTELLUNGEN
   --------------------------------------------------------- */

:root {
  --bg-main: #07111b;
  --bg-sidebar: #091722;
  --bg-card: #0d1c29;
  --bg-card-light: #112332;
  --bg-input: #08141f;

  --border: #20384a;
  --border-soft: #172d3c;

  --text-main: #edf6ff;
  --text-secondary: #b6c8d5;
  --text-muted: #7f98aa;

  --blue: #2498ff;
  --blue-dark: #176ddd;
  --blue-soft: rgba(36, 152, 255, 0.13);

  --green: #31d17c;
  --yellow: #f6c85f;
  --red: #ff6875;

  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 20px;
}


/* ---------------------------------------------------------
   ALLGEMEINE HTML-EINSTELLUNGEN
   --------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg-main);
  color: var(--text-main);
}

button,
input {
  font: inherit;
}


/* ---------------------------------------------------------
   GEMEINSAME ELEMENTE
   --------------------------------------------------------- */

/* Kleine blaue Überschrift oberhalb größerer Titel */
.eyebrow {
  display: block;

  color: var(--blue);

  font-size: 11px;
  font-weight: 700;

  letter-spacing: 0.18em;
}

/* Gedämpfter Beschreibungstext */
.muted {
  color: var(--text-muted);
}

/* Grüner Statuspunkt für aktive Dienste */
.status-dot {
  display: inline-block;

  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: var(--green);

  box-shadow:
    0 0 12px rgba(49, 209, 124, 0.55);
}


/* =========================================================
   LOGIN-SEITE
   ========================================================= */


/* ---------------------------------------------------------
   LOGIN-HINTERGRUND
   --------------------------------------------------------- */

.login-body {
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(36, 152, 255, 0.15),
      transparent 32%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(32, 92, 140, 0.17),
      transparent 35%
    ),
    linear-gradient(
      135deg,
      #06101a,
      #091925 55%,
      #06101a
    );
}


/* ---------------------------------------------------------
   LOGIN-GESAMTLAYOUT
   --------------------------------------------------------- */

.login-shell {
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;

  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr 440px;

  gap: 90px;

  align-items: center;
}


/* ---------------------------------------------------------
   LINKE LOGIN-SEITE MIT BITEFEX-LOGO
   --------------------------------------------------------- */

.login-brand {
  max-width: 610px;
}

/* Originales BITEFEX-Logo */
.login-logo {
  display: block;

  width: min(420px, 100%);
  height: auto;

  margin-bottom: 48px;
}

.login-brand-text h1 {
  max-width: 580px;

  margin:
    12px 0
    16px;

  font-size: clamp(34px, 4vw, 55px);
  line-height: 1.08;

  letter-spacing: -0.03em;
}

.login-brand-text p {
  max-width: 550px;

  margin: 0;

  color: var(--text-muted);

  font-size: 16px;
  line-height: 1.7;
}


/* ---------------------------------------------------------
   LOGIN-KARTE
   --------------------------------------------------------- */

.login-card {
  padding: 38px;

  background:
    rgba(10, 24, 36, 0.90);

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-large);

  box-shadow:
    0 30px 100px
    rgba(0, 0, 0, 0.34);

  backdrop-filter:
    blur(18px);
}

.login-card-header h2 {
  margin:
    8px 0
    8px;

  font-size: 30px;
}

.login-card-header p {
  margin: 0;

  color: var(--text-muted);

  line-height: 1.6;
}


/* ---------------------------------------------------------
   LOGIN-FORMULAR
   --------------------------------------------------------- */

.login-form {
  margin-top: 30px;

  display: grid;

  gap: 10px;
}

.login-form label {
  margin-top: 8px;

  color: var(--text-secondary);

  font-size: 13px;
}

.login-form input {
  width: 100%;
  height: 48px;

  padding:
    0 14px;

  color: var(--text-main);

  background:
    var(--bg-input);

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-small);

  outline: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Hervorhebung des aktuell ausgewählten Eingabefelds */
.login-form input:focus {
  border-color:
    var(--blue);

  box-shadow:
    0 0 0 3px
    var(--blue-soft);
}


/* ---------------------------------------------------------
   PRIMÄRER BUTTON
   --------------------------------------------------------- */

.primary-button {
  height: 48px;

  margin-top: 15px;

  border: 0;

  border-radius:
    var(--radius-small);

  background:
    linear-gradient(
      135deg,
      var(--blue),
      var(--blue-dark)
    );

  color: white;

  font-weight: 700;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.primary-button:hover {
  filter: brightness(1.08);
}

.primary-button:active {
  transform: translateY(1px);
}


/* ---------------------------------------------------------
   LOGIN-FEHLERMELDUNG
   --------------------------------------------------------- */

.alert-error {
  margin-top: 22px;

  padding:
    12px 14px;

  border:
    1px solid
    rgba(255, 104, 117, 0.35);

  border-radius:
    var(--radius-small);

  background:
    rgba(255, 104, 117, 0.08);

  color: #ffadb4;

  font-size: 13px;
}


/* ---------------------------------------------------------
   SICHERHEITSHINWEIS UNTER DEM LOGIN
   --------------------------------------------------------- */

.login-security {
  margin-top: 25px;

  display: flex;

  align-items: center;

  gap: 9px;

  color: var(--text-muted);

  font-size: 12px;
}


/* =========================================================
   DASHBOARD
   ========================================================= */


/* ---------------------------------------------------------
   DASHBOARD-GRUNDAUFBAU
   --------------------------------------------------------- */

.dashboard-body {
  background:
    #061019;
}

.app-shell {
  min-height: 100vh;

  display: grid;

  grid-template-columns:
    255px 1fr;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
  min-height: 100vh;

  padding:
    24px 16px;

  display: flex;

  flex-direction: column;

  background:
    var(--bg-sidebar);

  border-right:
    1px solid
    var(--border-soft);
}


/* ---------------------------------------------------------
   LOGO IN DER SIDEBAR
   --------------------------------------------------------- */

.sidebar-brand {
  padding:
    0 9px
    28px;

  border-bottom:
    1px solid
    var(--border-soft);
}

.sidebar-logo {
  display: block;

  width: 175px;
  max-width: 100%;

  height: auto;
}

.sidebar-brand span {
  display: block;

  margin-top: 9px;

  color: var(--text-muted);

  font-size: 11px;

  letter-spacing: 0.08em;
}


/* ---------------------------------------------------------
   SIDEBAR-NAVIGATION
   --------------------------------------------------------- */

.sidebar-nav {
  margin-top: 24px;

  display: grid;

  gap: 5px;
}

.sidebar-nav a {
  position: relative;

  padding:
    11px 13px;

  border-radius:
    var(--radius-small);

  color:
    #a9bdcb;

  text-decoration: none;

  font-size: 13px;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.sidebar-nav a:hover {
  color: white;

  background:
    rgba(36, 152, 255, 0.08);
}

/* Aktuell ausgewählte Seite */
.sidebar-nav a.active {
  color: white;

  background:
    var(--blue-soft);
}

/* Blauer Balken für den aktiven Menüpunkt */
.sidebar-nav a.active::before {
  content: "";

  position: absolute;

  left: 0;
  top: 8px;
  bottom: 8px;

  width: 3px;

  border-radius:
    0 3px 3px 0;

  background:
    var(--blue);
}


/* ---------------------------------------------------------
   VERWALTUNGSBEREICH TRENNEN
   --------------------------------------------------------- */

.nav-divider {
  height: 1px;

  margin:
    18px 8px
    10px;

  background:
    var(--border-soft);
}

.nav-section {
  padding:
    6px 13px;

  color:
    #587386;

  font-size:
    9px;

  font-weight:
    700;

  letter-spacing:
    0.16em;
}


/* ---------------------------------------------------------
   BENUTZER UNTEN IN DER SIDEBAR
   --------------------------------------------------------- */

.sidebar-user {
  margin-top: auto;

  padding:
    18px 10px
    4px;

  border-top:
    1px solid
    var(--border);
}

.sidebar-user-info strong {
  display: block;

  font-size:
    13px;
}

.sidebar-user-info span {
  display: block;

  margin-top:
    4px;

  color:
    var(--text-muted);

  font-size:
    11px;
}


/* ---------------------------------------------------------
   LOGOUT-BUTTON
   --------------------------------------------------------- */

.logout-button {
  width: 100%;

  margin-top:
    15px;

  padding:
    9px;

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-small);

  background:
    transparent;

  color:
    var(--text-secondary);

  cursor:
    pointer;

  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.logout-button:hover {
  border-color:
    var(--red);

  color:
    #ffb0b7;

  background:
    rgba(255, 104, 117, 0.06);
}


/* =========================================================
   DASHBOARD-HAUPTINHALT
   ========================================================= */

.content {
  width: 100%;

  max-width: 1500px;

  padding:
    38px 42px;
}


/* ---------------------------------------------------------
   SEITENKOPF
   --------------------------------------------------------- */

.page-header {
  margin-bottom:
    30px;

  display:
    flex;

  justify-content:
    space-between;

  align-items:
    center;

  gap:
    25px;
}

.page-header h1 {
  margin:
    6px 0;

  font-size:
    31px;

  letter-spacing:
    -0.02em;
}

.page-header p {
  margin:
    0;
}


/* Rolle oben rechts */
.user-badge {
  padding:
    10px 14px;

  display:
    flex;

  align-items:
    center;

  gap:
    8px;

  border:
    1px solid
    var(--border);

  border-radius:
    20px;

  color:
    var(--text-secondary);

  background:
    rgba(13, 28, 41, 0.7);

  font-size:
    12px;
}


/* =========================================================
   STATUSKARTEN
   ========================================================= */

.status-grid {
  display:
    grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap:
    16px;
}

.status-card {
  min-height:
    135px;

  padding:
    20px;

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-medium);

  background:
    linear-gradient(
      145deg,
      #0d1c29,
      #0a1722
    );

  box-shadow:
    0 14px 35px
    rgba(0, 0, 0, 0.08);
}

.status-card-header {
  display:
    flex;

  justify-content:
    space-between;

  align-items:
    center;

  color:
    var(--text-muted);

  font-size:
    12px;
}

.status-card strong {
  display:
    block;

  margin-top:
    17px;

  font-size:
    21px;
}

.status-card small {
  display:
    block;

  margin-top:
    6px;

  color:
    var(--green);

  font-size:
    11px;
}


/* =========================================================
   PANELS
   ========================================================= */

.panel {
  margin-top:
    20px;

  min-height:
    290px;

  overflow:
    hidden;

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-medium);

  background:
    #0b1924;
}

.compact-panel {
  min-height:
    auto;
}


/* ---------------------------------------------------------
   PANEL-KOPF
   --------------------------------------------------------- */

.panel-header {
  padding:
    20px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    20px;

  border-bottom:
    1px solid
    var(--border);
}

.panel-header h2 {
  margin:
    0 0
    5px;

  font-size:
    17px;
}

.panel-header p {
  margin:
    0;

  color:
    var(--text-muted);

  font-size:
    12px;
}


/* ---------------------------------------------------------
   LINK RECHTS IM PANEL
   --------------------------------------------------------- */

.secondary-link {
  color:
    var(--blue);

  text-decoration:
    none;

  font-size:
    12px;
}

.secondary-link:hover {
  text-decoration:
    underline;
}


/* ---------------------------------------------------------
   LEERER BEREICH FÜR SPÄTERE OPENCLAW-AKTIVITÄTEN
   --------------------------------------------------------- */

.empty-state {
  min-height:
    210px;

  padding:
    25px;

  display:
    grid;

  place-items:
    center;

  text-align:
    center;

  color:
    #607c8e;
}

.empty-state strong {
  color:
    #8da5b5;

  font-size:
    14px;
}

.empty-state p {
  max-width:
    450px;

  margin:
    8px auto 0;

  font-size:
    12px;

  line-height:
    1.6;
}


/* =========================================================
   SICHERHEITSSTATUS
   ========================================================= */

.security-grid {
  padding:
    20px;

  display:
    grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap:
    14px;
}

.security-item {
  padding:
    15px;

  border:
    1px solid
    var(--border-soft);

  border-radius:
    var(--radius-small);

  background:
    rgba(8, 20, 31, 0.55);
}

.security-item span {
  display:
    block;

  margin-bottom:
    8px;

  color:
    var(--text-muted);

  font-size:
    11px;
}

.security-item strong {
  font-size:
    12px;
}

/* Erfolgreicher Sicherheitsstatus */
.status-ok {
  color:
    var(--green);
}

/* Noch nicht eingerichtete Funktion */
.status-pending {
  color:
    var(--yellow);
}


/* =========================================================
   RESPONSIVE DARSTELLUNG
   ========================================================= */


/* ---------------------------------------------------------
   KLEINERE NOTEBOOKS UND TABLETS
   --------------------------------------------------------- */

@media (max-width: 1100px) {

  .status-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .security-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


/* ---------------------------------------------------------
   MOBILE DARSTELLUNG
   --------------------------------------------------------- */

@media (max-width: 800px) {

  /* Login untereinander statt nebeneinander */
  .login-shell {
    grid-template-columns:
      1fr;

    gap:
      40px;

    padding:
      45px 0;
  }

  .login-brand {
    text-align:
      center;

    margin:
      0 auto;
  }

  .login-logo {
    margin:
      0 auto 35px;
  }

  .login-brand-text p {
    margin:
      0 auto;
  }


  /* Sidebar wird für die erste mobile Version ausgeblendet.
     Ein mobiles Menü ergänzen wir später bei Bedarf. */
  .app-shell {
    display:
      block;
  }

  .sidebar {
    display:
      none;
  }

  .content {
    padding:
      25px 20px;
  }

  .page-header {
    align-items:
      flex-start;

    flex-direction:
      column;
  }

  .status-grid,
  .security-grid {
    grid-template-columns:
      1fr;
  }

}


/* =========================================================
   BENUTZERVERWALTUNG
   Gestaltung des Benutzerformulars und der Benutzertabelle
   ========================================================= */


/* ---------------------------------------------------------
   FORMULAR ZUM ERSTELLEN EINES BENUTZERS
   --------------------------------------------------------- */

.user-create-form {
  padding: 24px;

  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 20px 24px;
}


/* Ein einzelnes Formularfeld */
.form-field {
  display: flex;

  flex-direction: column;

  gap: 8px;
}


/* Beschriftung über Eingabefeldern */
.form-field label {
  color: var(--text-secondary);

  font-size: 12px;
  font-weight: 600;
}


/* Gemeinsames Design für Eingabefelder und Auswahlfelder */
.form-field input,
.form-field select {
  width: 100%;
  height: 46px;

  padding: 0 14px;

  color: var(--text-main);

  background: var(--bg-input);

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-small);

  outline: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}


/* Auswahlfeld ebenfalls dunkel darstellen */
.form-field select {
  cursor: pointer;
}


/* Fokus eines Eingabefeldes hervorheben */
.form-field input:focus,
.form-field select:focus {
  border-color: var(--blue);

  box-shadow:
    0 0 0 3px
    var(--blue-soft);
}


/* Button-Bereich des Formulars */
.form-actions {
  grid-column: 1 / -1;

  display: flex;

  justify-content: flex-end;

  padding-top: 4px;
}


/* Button auf der Benutzerseite etwas kompakter */
.form-actions .primary-button {
  min-width: 190px;

  padding: 0 22px;
}


/* ---------------------------------------------------------
   BENUTZERTABELLE
   --------------------------------------------------------- */

/* Verhindert Layout-Probleme bei kleineren Bildschirmen */
.table-wrapper {
  width: 100%;

  overflow-x: auto;
}


/* Grundaufbau der Tabelle */
.data-table {
  width: 100%;

  border-collapse: collapse;

  font-size: 13px;
}


/* Tabellenkopf */
.data-table thead {
  background:
    rgba(17, 35, 50, 0.65);
}


/* Tabellenüberschriften */
.data-table th {
  padding: 14px 16px;

  text-align: left;

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.08em;

  text-transform: uppercase;

  border-bottom:
    1px solid
    var(--border);
}


/* Einzelne Tabellenzellen */
.data-table td {
  padding: 16px;

  color: var(--text-secondary);

  border-bottom:
    1px solid
    var(--border-soft);

  vertical-align: middle;
}


/* Benutzername etwas stärker hervorheben */
.data-table td strong {
  color: var(--text-main);

  font-weight: 600;
}


/* Zeile beim Überfahren hervorheben */
.data-table tbody tr {
  transition:
    background 0.15s ease;
}

.data-table tbody tr:hover {
  background:
    rgba(36, 152, 255, 0.04);
}


/* Bei der letzten Zeile keine unnötige Linie */
.data-table tbody tr:last-child td {
  border-bottom: 0;
}


/* ---------------------------------------------------------
   STATUS-BADGES
   --------------------------------------------------------- */

.status-label {
  display: inline-flex;

  align-items: center;

  padding:
    5px 9px;

  border-radius:
    20px;

  font-size:
    11px;

  font-weight:
    600;
}


/* Aktiver Benutzer */
.status-label-active {
  color:
    #62e69d;

  background:
    rgba(49, 209, 124, 0.11);

  border:
    1px solid
    rgba(49, 209, 124, 0.24);
}


/* Deaktivierter Benutzer */
.status-label-disabled {
  color:
    #ff9ba4;

  background:
    rgba(255, 104, 117, 0.09);

  border:
    1px solid
    rgba(255, 104, 117, 0.20);
}


/* ---------------------------------------------------------
   MOBILE / KLEINERE BILDSCHIRME
   --------------------------------------------------------- */

@media (max-width: 900px) {

  .user-create-form {
    grid-template-columns:
      1fr;
  }

  .form-actions {
    grid-column: auto;
  }

  .form-actions .primary-button {
    width: 100%;
  }

}


/* =========================================================
   BENUTZER-AKTIONEN UND BEARBEITUNGSSEITE
   ========================================================= */


/* Mehrere Aktionen innerhalb einer Tabellenzelle */
.table-actions {
  display: flex;

  align-items: center;

  gap: 8px;

  flex-wrap: wrap;
}


/* Formulare innerhalb der Aktionsleiste sollen
   keinen zusätzlichen Abstand erzeugen. */
.table-actions form {
  margin: 0;
}


/* Einheitlicher kleiner Aktionsbutton */
.table-action-button {
  min-height: 34px;

  padding:
    7px 11px;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  border:
    1px solid
    var(--border);

  border-radius:
    7px;

  background:
    rgba(36, 152, 255, 0.06);

  color:
    var(--text-secondary);

  text-decoration: none;

  font-size:
    11px;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}


.table-action-button:hover {
  border-color:
    var(--blue);

  color:
    white;

  background:
    var(--blue-soft);
}


/* Deaktivieren hervorheben */
.danger-action:hover {
  border-color:
    var(--red);

  color:
    #ffadb4;

  background:
    rgba(255, 104, 117, 0.08);
}


/* Aktivieren hervorheben */
.success-action:hover {
  border-color:
    var(--green);

  color:
    #78e9aa;

  background:
    rgba(49, 209, 124, 0.08);
}


/* Sekundärer Button z. B. für Abbrechen */
.secondary-button {
  min-height: 48px;

  padding:
    0 20px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-small);

  color:
    var(--text-secondary);

  text-decoration:
    none;

  background:
    transparent;
}


.secondary-button:hover {
  border-color:
    var(--blue);

  color:
    white;
}


/* Zurück-Link oben auf Bearbeitungsseiten */
.back-link {
  color:
    var(--blue);

  text-decoration:
    none;

  font-size:
    12px;
}


.back-link:hover {
  text-decoration:
    underline;
}


/* ---------------------------------------------------------
   VERKNÜPFUNGS-KARTEN
   --------------------------------------------------------- */

.integration-grid {
  padding:
    20px;

  display:
    grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap:
    14px;
}


.integration-card {
  padding:
    17px;

  border:
    1px solid
    var(--border-soft);

  border-radius:
    var(--radius-small);

  background:
    rgba(8, 20, 31, 0.55);
}


.integration-card span {
  display:
    block;

  margin-bottom:
    8px;

  color:
    var(--text-muted);

  font-size:
    11px;
}


.integration-card strong {
  font-size:
    13px;
}


@media (max-width: 900px) {

  .integration-grid {
    grid-template-columns:
      1fr;
  }

}

/* ---------------------------------------------------------
   ABSTAND ZWISCHEN FORMULAR-AKTIONEN
   --------------------------------------------------------- */

/*
  Buttons wie "Abbrechen" und "Änderungen speichern"
  werden rechts nebeneinander dargestellt.
  Der Abstand verhindert, dass beide Elemente zusammenkleben.
*/
.form-actions {
  gap: 14px;
}

/* ---------------------------------------------------------
   FORMULAR-AKTIONEN AUF BEARBEITUNGSSEITEN
   --------------------------------------------------------- */

/*
  Aktionen werden rechts ausgerichtet.
  Der Speichern-Button bleibt die primäre Aktion,
  während "Abbrechen" bewusst zurückhaltender dargestellt wird.
*/
.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;

  padding-top: 10px;
}


/*
  Der Speichern-Button soll nicht unnötig breit werden.
  Er erhält nur so viel Platz, wie der Text benötigt.
*/
.form-actions .primary-button {
  width: auto;
  min-width: 0;
  height: 42px;

  margin: 0;

  padding: 0 18px;

  font-size: 13px;
}


/*
  "Abbrechen" ist eine sekundäre Aktion.
  Deshalb kleiner und optisch deutlich zurückhaltender.
*/
.form-actions .secondary-button {
  width: auto;
  min-width: 0;
  min-height: 42px;

  padding: 0 15px;

  border-color: transparent;

  background: transparent;

  color: var(--text-muted);

  font-size: 13px;
}


/* Nur beim Überfahren bekommt Abbrechen eine sichtbare Fläche. */
.form-actions .secondary-button:hover {
  border-color: var(--border);

  background: rgba(255, 255, 255, 0.03);

  color: var(--text-main);
}

/* ---------------------------------------------------------
   FORMULAR-AKTIONEN AUF BEARBEITUNGSSEITEN
   --------------------------------------------------------- */

/*
  Aktionen werden rechts ausgerichtet.
  Der Speichern-Button bleibt die primäre Aktion,
  während "Abbrechen" bewusst zurückhaltender dargestellt wird.
*/
.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;

  padding-top: 10px;
}


/*
  Der Speichern-Button soll nicht unnötig breit werden.
  Er erhält nur so viel Platz, wie der Text benötigt.
*/
.form-actions .primary-button {
  width: auto;
  min-width: 0;
  height: 42px;

  margin: 0;

  padding: 0 18px;

  font-size: 13px;
}


/*
  "Abbrechen" ist eine sekundäre Aktion.
  Deshalb kleiner und optisch deutlich zurückhaltender.
*/
.form-actions .secondary-button {
  width: auto;
  min-width: 0;
  min-height: 42px;

  padding: 0 15px;

  border-color: transparent;

  background: transparent;

  color: var(--text-muted);

  font-size: 13px;
}


/* Nur beim Überfahren bekommt Abbrechen eine sichtbare Fläche. */
.form-actions .secondary-button:hover {
  border-color: var(--border);

  background: rgba(255, 255, 255, 0.03);

  color: var(--text-main);
}


/* =========================================================
   PASSWORTÄNDERUNG
   ========================================================= */

/*
  Passwortänderungen sind eine sicherheitsrelevante Aktion.
  Der Button wird deshalb bewusst anders dargestellt als
  normale Änderungen an Anzeigename oder Rolle.
*/
.password-button {
  min-height: 42px;

  padding: 0 18px;

  border:
    1px solid
    rgba(246, 200, 95, 0.35);

  border-radius:
    var(--radius-small);

  background:
    rgba(246, 200, 95, 0.08);

  color:
    var(--yellow);

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}


.password-button:hover {
  border-color:
    var(--yellow);

  background:
    rgba(246, 200, 95, 0.14);

  color:
    #ffe095;
}


/* =========================================================
   BENUTZER LÖSCHEN
   ========================================================= */

/*
  Dauerhaftes Löschen wird klar als gefährliche Aktion
  gekennzeichnet und unterscheidet sich dadurch von
  Bearbeiten oder Deaktivieren.
*/
.delete-action {
  color: #ff9ba4;

  border-color:
    rgba(255, 104, 117, 0.20);

  background:
    rgba(255, 104, 117, 0.04);
}


.delete-action:hover {
  color: #ffffff;

  border-color:
    var(--red);

  background:
    rgba(255, 104, 117, 0.18);
}


/* =========================================================
   VTIGER-BENUTZERVERKNÜPFUNG
   ========================================================= */

/*
  Zusätzliche Informationen wie Benutzername und
  Verknüpfungsformular bleiben innerhalb derselben
  dunklen Karte wie die übrigen Dienste.
*/
.integration-detail {
  display: block;

  margin-top: 7px;

  color: var(--text-muted);

  font-size: 11px;
}


/* Formular innerhalb einer Dienst-Verknüpfung */
.integration-form {
  margin-top: 18px;

  display: grid;

  gap: 8px;
}


/* Feldbeschriftung */
.integration-form label {
  color: var(--text-secondary);

  font-size: 11px;
  font-weight: 600;
}


/* Eingabefeld im bestehenden Dashboard-Stil */
.integration-form input {
  width: 100%;
  height: 40px;

  padding: 0 12px;

  color: var(--text-main);

  background: var(--bg-input);

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-small);

  outline: none;
}


.integration-form input:focus {
  border-color: var(--blue);

  box-shadow:
    0 0 0 3px
    var(--blue-soft);
}


/*
  Die vTiger-Karte darf mehr Platz verwenden,
  da sie zusätzlich das Zuordnungsformular enthält.
*/
.integration-card-wide {
  min-width: 0;
}


/* =========================================================
   VTIGER-ZUGANGSPRÜFUNG
   ========================================================= */

/*
  Das zweite Formular innerhalb der vTiger-Karte
  wird optisch vom Benutzernamen getrennt.
*/
.vtiger-verify-form {
  margin-top: 20px;

  padding-top: 18px;

  border-top:
    1px solid
    var(--border-soft);
}


/* Hauptaktion innerhalb einer Integrationskarte */
.integration-primary-button {
  width: fit-content;

  min-width: 130px;

  height: 40px;

  padding: 0 16px;
}


/* Rückmeldung einer Integrationsprüfung */
.integration-message {
  margin-top: 14px;

  padding: 10px 12px;

  border-radius:
    var(--radius-small);

  font-size: 11px;
}


/* Erfolgreiche Authentifizierung */
.integration-message-success {
  color: #62e69d;

  border:
    1px solid
    rgba(49, 209, 124, 0.25);

  background:
    rgba(49, 209, 124, 0.07);
}


/* Falsche Zugangsdaten oder technischer Fehler */
.integration-message-error {
  color: #ff9ba4;

  border:
    1px solid
    rgba(255, 104, 117, 0.22);

  background:
    rgba(255, 104, 117, 0.07);
}


/* Noch fehlende Eingaben */
.integration-message-warning {
  color: #f6c85f;

  border:
    1px solid
    rgba(246, 200, 95, 0.22);

  background:
    rgba(246, 200, 95, 0.06);
}


/* =========================================================
   GESPERRTE VTIGER-ZUORDNUNG
   ========================================================= */

/*
  Eine bereits erfolgreich verifizierte Zuordnung kann
  nicht versehentlich direkt überschrieben werden.
*/
.integration-form input:disabled {
  color: var(--text-muted);

  background:
    rgba(255, 255, 255, 0.025);

  border-color:
    var(--border-soft);

  cursor: not-allowed;

  opacity: 0.65;
}


/*
  Sobald "Zuordnung ändern" gewählt wurde,
  wird der Speichern-Button etwas deutlicher dargestellt.
*/
.assignment-editing {
  border-color:
    var(--blue);

  color:
    var(--text-main);

  background:
    var(--blue-soft);
}


/* =========================================================
   AUTHENTICATOR / TOTP
   ========================================================= */

.totp-actions {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;

  margin-top: 16px;
}


.totp-actions form {
  margin: 0;
}


/* Setup-Seite */
.totp-setup-panel {
  max-width: 980px;
}


.totp-setup-content {
  display: grid;

  grid-template-columns:
    320px minmax(0, 1fr);

  gap: 36px;

  padding: 28px;
}


/* QR-Code bekommt bewusst einen hellen Hintergrund,
   damit Authenticator-Apps ihn zuverlässig erkennen. */
.totp-qr-box {
  width: fit-content;

  padding: 16px;

  border-radius: 12px;

  background: #ffffff;
}


.totp-qr-box img {
  display: block;

  width: 260px;
  height: 260px;
}


.totp-qr-section .muted {
  margin-top: 12px;

  max-width: 270px;

  font-size: 11px;
}


.totp-confirm-section h3 {
  margin:
    0 0 8px;

  color: var(--text-main);

  font-size: 13px;
}


.totp-confirm-section h3:not(:first-child) {
  margin-top: 24px;
}


/* Manuelles Secret sichtbar, aber klar getrennt darstellen. */
.totp-secret-box {
  margin-top: 10px;

  padding: 12px 14px;

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-small);

  background:
    rgba(0, 0, 0, 0.18);

  overflow-wrap: anywhere;
}


.totp-secret-box code {
  color: var(--text-secondary);

  font-size: 13px;

  letter-spacing: 0.08em;
}


.totp-confirm-form {
  margin-top: 12px;

  display: grid;

  gap: 14px;
}


.totp-confirm-form .primary-button {
  width: fit-content;

  min-width: 190px;
}


@media (max-width: 900px) {

  .totp-setup-content {
    grid-template-columns: 1fr;
  }

}


/* =========================================================
   VERKNÜPFUNGEN: 2 x 2 DARSTELLUNG
   ========================================================= */

/*
  Mit Discord, Telegram, vTiger und Authenticator bestehen
  jetzt vier Integrationsbereiche.

  Zwei Karten pro Reihe geben den Formularen mehr Platz und
  halten die Benutzerverwaltung übersichtlich.
*/
.integration-grid {
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
}


@media (max-width: 900px) {

  .integration-grid {
    grid-template-columns:
      1fr;
  }

}


/* =========================================================
   AUDIT-LOG
   ========================================================= */

.audit-count {
  min-width: 105px;

  padding:
    12px 16px;

  border:
    1px solid
    var(--border);

  border-radius:
    var(--radius-small);

  background:
    rgba(8, 20, 31, 0.45);
}


.audit-count span {
  display: block;

  margin-bottom: 3px;

  color:
    var(--text-muted);

  font-size: 9px;

  font-weight: 700;

  letter-spacing: 0.08em;
}


.audit-count strong {
  color:
    var(--text-main);

  font-size: 20px;
}


/* Zeitstempel nicht umbrechen */
.audit-time {
  white-space: nowrap;

  color:
    var(--text-muted) !important;
}


/* Aktions-Badge */
.audit-action {
  display: inline-flex;

  padding:
    5px 8px;

  border:
    1px solid
    var(--border-soft);

  border-radius:
    6px;

  color:
    var(--text-secondary);

  background:
    rgba(255, 255, 255, 0.025);

  font-size: 11px;
}


/* Positive Sicherheitsereignisse */
.audit-action-success {
  color:
    #62e69d;

  border-color:
    rgba(49, 209, 124, 0.22);

  background:
    rgba(49, 209, 124, 0.06);
}


/* Fehlgeschlagene Anmeldung */
.audit-action-danger {
  color:
    #ff9ba4;

  border-color:
    rgba(255, 104, 117, 0.22);

  background:
    rgba(255, 104, 117, 0.06);
}


/* Technischer Ereignistyp */
.audit-type {
  color:
    var(--text-muted);

  font-size:
    10px;

  text-transform:
    uppercase;

  letter-spacing:
    0.05em;
}


.empty-table {
  padding:
    40px !important;

  text-align:
    center;

  color:
    var(--text-muted) !important;
}


/* =========================================================
   ROLLEN & RECHTE
   ========================================================= */

.roles-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 18px;
}


.role-card {
  min-width: 0;
}


.role-card-header {
  align-items: flex-start;
}


.role-protected-badge {
  display: inline-flex;

  padding:
    5px 9px;

  border:
    1px solid
    rgba(36, 152, 255, 0.25);

  border-radius:
    20px;

  color:
    var(--blue);

  background:
    rgba(36, 152, 255, 0.07);

  font-size:
    10px;

  font-weight:
    700;

  text-transform:
    uppercase;

  letter-spacing:
    0.05em;
}


.role-permissions-form {
  padding:
    8px 20px 20px;
}


.permission-list {
  display: grid;

  gap: 8px;
}


/*
  Eine Berechtigung wird als komplette anklickbare
  Zeile dargestellt und nicht als kleines Standard-
  Browser-Kontrollkästchen.
*/
.permission-item {
  position: relative;

  display: flex;

  align-items: center;

  gap: 12px;

  min-height: 56px;

  padding:
    10px 12px;

  border:
    1px solid
    var(--border-soft);

  border-radius:
    var(--radius-small);

  background:
    rgba(8, 20, 31, 0.30);

  cursor: pointer;

  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}


.permission-item:hover {
  border-color:
    var(--border);

  background:
    rgba(36, 152, 255, 0.035);
}


/* Native Checkbox ausblenden */
.permission-item input {
  position: absolute;

  opacity: 0;

  pointer-events: none;
}


/* Eigene Checkbox */
.permission-checkbox {
  width: 18px;
  height: 18px;

  flex: 0 0 18px;

  border:
    1px solid
    var(--border);

  border-radius:
    5px;

  background:
    var(--bg-input);

  position: relative;
}


/* Aktiviertes Recht */
.permission-item input:checked
  + .permission-checkbox {
  border-color:
    var(--blue);

  background:
    var(--blue);
}


/* Haken */
.permission-item input:checked
  + .permission-checkbox::after {
  content: "";

  position: absolute;

  left: 5px;
  top: 2px;

  width: 5px;
  height: 9px;

  border:
    solid #ffffff;

  border-width:
    0 2px 2px 0;

  transform:
    rotate(45deg);
}


.permission-content {
  display: grid;

  gap: 3px;
}


.permission-content strong {
  color:
    var(--text-secondary);

  font-size:
    12px;
}


.permission-content small {
  color:
    var(--text-muted);

  font-size:
    10px;

  font-family:
    monospace;
}


/* Geschützte Administratorrechte */
.permission-item-locked {
  cursor: default;

  opacity: 0.72;
}


.permission-item-locked:hover {
  border-color:
    var(--border-soft);

  background:
    rgba(8, 20, 31, 0.30);
}


.role-form-actions {
  display: flex;

  justify-content: flex-end;

  margin-top: 18px;
}


.role-form-actions .primary-button {
  width: auto;

  min-width: 170px;

  height: 42px;

  padding:
    0 16px;
}


.role-protection-note {
  margin-top: 18px;

  padding:
    11px 13px;

  border:
    1px solid
    rgba(36, 152, 255, 0.18);

  border-radius:
    var(--radius-small);

  color:
    var(--text-muted);

  background:
    rgba(36, 152, 255, 0.04);

  font-size:
    11px;

  line-height:
    1.5;
}


.role-message {
  margin-bottom:
    18px;
}


@media (max-width: 1200px) {

  .roles-grid {
    grid-template-columns:
      1fr;
  }

}


/* =========================================================
   LIVE-SYSTEMSTATUS
   ========================================================= */

.live-status-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 16px;

  margin-bottom: 18px;
}


.live-status-card {
  padding: 20px;
}


.live-status-head {
  display: flex;

  align-items: center;

  gap: 8px;

  margin-bottom: 16px;
}


.live-status-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;
}


.live-status-ok {
  background: #62e69d;

  box-shadow:
    0 0 10px
    rgba(98, 230, 157, 0.45);
}


.live-status-error {
  background: #ff6875;

  box-shadow:
    0 0 10px
    rgba(255, 104, 117, 0.4);
}


.live-status-label {
  color: var(--text-muted);

  font-size: 9px;

  font-weight: 700;

  letter-spacing: 0.08em;
}


.live-status-card h2 {
  margin: 0 0 7px;

  color: var(--text-main);

  font-size: 15px;
}


.live-status-card p {
  margin: 0;

  color: var(--text-muted);

  font-size: 11px;
}


.system-security-panel {
  margin-top: 18px;
}


.security-summary-value {
  padding: 20px;

  color: var(--text-secondary);

  font-family: monospace;

  font-size: 13px;
}


@media (max-width: 1000px) {

  .live-status-grid {
    grid-template-columns:
      1fr;
  }

}


/* =========================================================
   ANGEBUNDENE DIENSTE
   ========================================================= */

.services-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 16px;
}


.service-card {
  padding: 20px;

  min-height: 180px;
}


.service-card-top {
  display: flex;

  align-items: flex-start;

  justify-content: space-between;

  gap: 15px;
}


.service-type {
  display: block;

  margin-bottom: 8px;

  color: var(--text-muted);

  font-size: 9px;

  font-weight: 700;

  letter-spacing: 0.08em;

  text-transform: uppercase;
}


.service-card h2 {
  margin: 0;

  color: var(--text-main);

  font-size: 16px;
}


/* Statuspunkt rechts oben */
.service-indicator {
  width: 9px;
  height: 9px;

  flex: 0 0 9px;

  border-radius: 50%;
}


.service-indicator-ok {
  background: #62e69d;

  box-shadow:
    0 0 10px
    rgba(98, 230, 157, 0.45);
}


.service-indicator-pending {
  background: #f6c85f;

  box-shadow:
    0 0 10px
    rgba(246, 200, 95, 0.30);
}


.service-state {
  margin-top: 26px;
}


.service-state strong {
  font-size: 13px;
}


.service-state-ok {
  color: #62e69d;
}


.service-state-pending {
  color: #f6c85f;
}


.service-detail {
  margin-top: 9px;

  color: var(--text-muted);

  font-size: 11px;

  line-height: 1.5;
}


.service-info-panel {
  margin-top: 18px;
}


.service-info-text {
  padding: 20px;

  color: var(--text-secondary);

  font-size: 12px;

  line-height: 1.7;
}


@media (max-width: 1100px) {

  .services-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


@media (max-width: 750px) {

  .services-grid {
    grid-template-columns: 1fr;
  }

}


/* =========================================================
   OPENCLAW-AKTIONEN
   ========================================================= */

.action-ticket {
  color: var(--blue);

  font-weight: 600;
}


/* Quelle der Sprachinterpretation */
.action-source {
  display: inline-flex;

  padding: 4px 7px;

  border-radius: 6px;

  font-size: 10px;

  font-weight: 600;
}


.action-source-local {
  color: #62e69d;

  background:
    rgba(49, 209, 124, 0.07);

  border:
    1px solid
    rgba(49, 209, 124, 0.18);
}


.action-source-gemini {
  color: #8fc9ff;

  background:
    rgba(36, 152, 255, 0.07);

  border:
    1px solid
    rgba(36, 152, 255, 0.20);
}
