/* Google Fonts einbinden */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* Allgemein */
body {
    margin: 0;
    font-family: 'Inter', Arial, sans-serif;
    background: #1f1f2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background-color: #1a1a2a;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.header .server-name {
    font-size: 1.4rem;
}

/* Logout Button im Header */
.header .logout-btn {
    color: #fff;
    background: #e74c3c;
    padding: 10px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    text-decoration: none;
}

.header .logout-btn:hover {
    background: #c0392b;
}

.header .logout-btn i {
    font-size: 16px;
}

/* Widgets */
.widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.widget {
    background: #2a2a3d;
    flex: 1 1 200px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
}

/* Login Seite Anpassung */
.login-container {
    max-width: 350px;
    margin: 100px auto;
    background: #2a2a3d;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.login-container input,
.login-container button {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    border: none;
    font-size: 1rem;
    box-sizing: border-box; /* sorgt für gleiche Breite bei Inputs + Button */
}

.login-container button {
    background: #4a90e2;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.login-container button:hover {
    background: #357ab8;
}

.login-container .alert {
    background: #e74c3c;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Footer */
.footer {
  background-color: #1a1a2a;
  color: #fff;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.9rem;

  margin-top: 0;                  /* drückt Footer nach unten */
  margin-left: calc(var(--sb-w) + var(--sb-border));            /* <— angepasst */
  width: calc(100% - (var(--sb-w) + var(--sb-border))); 
  transition: margin-left var(--transition-fast) ease, 
              width var(--transition-fast) ease;
}

body.sidebar-collapsed .footer{
  margin-left: calc(var(--sb-w-collapsed) + var(--sb-border));
  width: calc(100% - (var(--sb-w-collapsed) + var(--sb-border)));
}

/* Mobile */
@media (max-width: 1024px){
  .footer{
    margin-left: 0;
    width: 100%;
  }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        width: 60px;
        height: 100vh;
        top: 0;
    }
    .navbar ul li a {
        justify-content: center;
        padding: 12px;
    }
    .navbar ul li a span {
        display: none; /* nur Icons */
    }
    .content {
        margin-left: 60px;
        margin-top: 60px;
    }
    .footer {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
    .header {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 15px;
    }
}

/* ===== Sidebar Layout ===== */
:root{
  --header-h: 64px;
  --sb-w: 260px;         /* expanded width */
  --sb-w-collapsed: 72px;
  --sb-border: 1px;
  --sb-bg: #161a20;
  --sb-hover: #1e242c;
  --sb-active: #0ea5e9;  /* cyan-ish accent */
  --tx: #e5e7eb;
  --tx-dim: #9ca3af;
  --transition-fast: 160ms;
}

/* Ensure header height variable if dein Header anders ist */
.header{
  box-sizing: border-box;          /* <— wichtig */
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 100;
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 16px;
  backdrop-filter: blur(6px);
  background: color-mix(in sRGB, #0f1318 85%, transparent);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.header{ height: var(--header-h); display:flex; align-items:center; justify-content:space-between; padding:0 16px; }
.header .icon-btn{ background:none; border:0; cursor:pointer; font-size:1.1rem; color:var(--tx); padding:8px; border-radius:10px; }
.header .icon-btn:hover{ background:#2a3340; }

/* Page layout */
html, body { height: 100%; }   /* optional */
body{
  display: flex;
  flex-direction: column;
  min-height: 100dvh;          /* oder 100vh */
  background:#0f1318;
  color:var(--tx);
}

.sidebar{
  position: fixed;
  top: var(--header-h);
  height: calc(100dvh - var(--header-h));
  width: var(--sb-w);
  border-right: var(--sb-border) solid rgba(255,255,255,0.06);  /* <— nutzt var */
  background: var(--sb-bg);
  transition: width var(--transition-fast) ease;
  overflow-x: hidden;
  overflow-y: auto;
  will-change: width;
  z-index: 20;
}

/* Collapsed state toggled via body class */
body.sidebar-collapsed .sidebar{ width: var(--sb-w-collapsed); }

.sidebar-nav{ padding: 12px 8px; }
.sidebar-nav ul{ list-style:none; margin:0; padding:0; }
.sidebar-nav li{ margin: 4px 0; }

.sidebar-link{
  display:flex; align-items:center; gap:12px;
  padding: 12px 12px;
  border-radius: 12px;
  color: var(--tx);
  text-decoration:none;
  white-space:nowrap;
  overflow:hidden;
  position: relative;
  transition: background var(--transition-fast) ease, color var(--transition-fast) ease;
}
.sidebar-link .icon{
  min-width: 24px; text-align:center; font-size:1rem;
}
.sidebar-link .label{
  flex:1 1 auto; opacity:1; transition: opacity var(--transition-fast) ease;
}

.sidebar-link:hover{ background: var(--sb-hover); }
.sidebar li.active .sidebar-link{
  position:relative;
  background: linear-gradient(90deg, rgba(14,165,233,.18), rgba(14,165,233,0));
  color: #e6f7ff;
  box-shadow: inset 0 0 0 1px rgba(14,165,233,.25);
}
.sidebar li.active .sidebar-link::before{
  content:"";
  position:absolute; left: 6px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px;
  background: var(--sb-active);
}

/* Hide labels in collapsed */
body.sidebar-collapsed .sidebar-link .label{ opacity:0; }

/* Tooltip on collapsed (desktop) */
body.sidebar-collapsed .sidebar-link[data-tooltip]::after{
  content: attr(data-tooltip);
  position: fixed;
  left: calc(var(--sb-w-collapsed) + 12px);
  background:#0b0f14;
  color: var(--tx);
  padding:6px 10px;
  border-radius:8px;
  font-size:.85rem;
  line-height:1;
  box-shadow: 0 6px 28px rgba(0,0,0,.45);
  opacity:0;
  transform: translateY(-50%) translateX(6px);
  pointer-events:none;
  transition: opacity var(--transition-fast) ease, transform var(--transition-fast) ease;
}
body.sidebar-collapsed .sidebar-link:hover::after{
  opacity:1; transform: translateY(-50%) translateX(0);
}

/* Content wrapper should respect sidebar width */
.main-content{
  flex: 1 0 auto;                          /* <— wichtig */
  margin-left: calc(var(--sb-w) + var(--sb-border));
  width: auto;
  padding: 16px 20px;
  transition: margin-left var(--transition-fast) ease;
  min-height: 0;                            /* verhindert „Überlauf“-Effekte */
}
body.sidebar-collapsed .main-content{
  margin-left: calc(var(--sb-w-collapsed) + var(--sb-border));
}

/* ===== Mobile (<= 1024px): off-canvas ===== */
@media (max-width: 1024px){
  .sidebar{
    position: fixed;
    left:0; top: var(--header-h);
    height: calc(100dvh - var(--header-h));
    transform: translateX(-100%);
    width: min(80vw, 320px);
    transition: transform var(--transition-fast) ease;
  }
  body.sidebar-open .sidebar{ transform: translateX(0); }
  .main-content{ margin-left: 0 !important; }
  body.sidebar-collapsed .sidebar-link .label{ opacity:1; } /* Collapse ist Desktop-Konzept */
  /* backdrop */
  .sidebar-backdrop{
    position: fixed; inset: var(--header-h) 0 0 0;
    background: rgba(0,0,0,.45); opacity:0; pointer-events:none;
    transition: opacity var(--transition-fast) ease;
    z-index: 15;
  }
  body.sidebar-open .sidebar-backdrop{ opacity:1; pointer-events:auto; }
}

/* Toolbar oben in der Sidebar */
.sidebar-toolbar{
  position: sticky; top: 0;
  display:flex; justify-content:flex-end; align-items:center;
  padding: 10px 10px 6px;
  background: linear-gradient(#161a20, rgba(22,26,32,0.6));
  border-bottom: 1px solid rgba(255,255,255,.06);
  z-index: 5;
}

/* Button-Styles */
.icon-btn{
  background:none; border:0; cursor:pointer; color:var(--tx);
  padding:8px; border-radius:10px; font-size:1.05rem;
  transition: transform var(--transition-fast) ease, background var(--transition-fast) ease, opacity var(--transition-fast) ease;
}
.icon-btn:hover{ background:#2a3340; }
.icon-btn.ghost{ opacity:.85; }
.icon-btn[aria-pressed="true"]{ background: rgba(14,165,233,.16); box-shadow: inset 0 0 0 1px rgba(14,165,233,.25); }

/* nur auf Mobil anzeigen */
.only-mobile{ display:none; }
@media (max-width:1024px){
  .only-mobile{ display:inline-flex; }
  /* Desktop-Toolbar-Button bleibt; passt auch mobil, aber der Header-Button ist bequemer */
}

#sidebarCollapse .chevron{
  display:inline-block;
  transform-origin: 50% 50%;
  transition: transform var(--transition-fast) ease;
  transform: rotate(0deg);
}
body.sidebar-collapsed #sidebarCollapse .chevron{
  transform: rotate(180deg);
}

.flag-switch {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    opacity: .95;
  }
.flag-btn {
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.12);
    font-size: 14px;
    line-height: 1;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.flag-btn span {
    color: #fff; /* Falls du separate Spans für den Text hast */
}
.flag-btn:hover { transform: translateY(-1px); background: rgba(0,0,0,.18); border-color: rgba(255,255,255,.15); }
.flag-btn.active { outline: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.24); }
.flag-icon { width: 20px; height: 14px; display: inline-block; border-radius: 2px; overflow: hidden; }
/* Dark/light agnostisch, passe bei Bedarf an dein Theme an */

  /* Sprach-Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 15px;
}

.lang-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 14px;
    padding: 5px 8px;
}

.lang-toggle .flag-icon {
    width: 20px;
    height: 14px;
    margin-right: 6px;
    border-radius: 2px;
}

.lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #2a2a3d;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    min-width: 140px;
    z-index: 1000;
}

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #fff;
    font-size: 14px;
    transition: background 0.2s;
}

.lang-menu a:hover {
    background: #4a90e2;
}

.lang-menu .flag-icon {
    width: 18px;
    height: 12px;
    border-radius: 2px;
}

/* Dropdown sichtbar, wenn aktiv */
.lang-dropdown.open .lang-menu {
    display: block;
}

html, body { overflow-x: hidden; }

.btn { background:#3b3b52; color:#fff; border:none; border-radius:8px; padding:8px 12px; cursor:pointer; }
.btn:hover { filter:brightness(1.1); }
.btn-primary { background:#4a90e2; }
.btn-danger { background:#e74c3c; }
.table input[type="checkbox"] { width:18px; height:18px; cursor:pointer; }

.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:.75rem; margin-left:8px; }
.badge-danger { background:#e74c3c; color:#fff; }
input[type="checkbox"][disabled] { opacity:.5; cursor:not-allowed; }

.dropdown-results .result-row { padding:8px 10px; cursor:pointer; display:flex; justify-content:space-between; gap:12px; }
.dropdown-results .result-row:hover { background: rgba(255,255,255,.06); }

/* Wenn Such-Dropdown offen ist, keine Hover-Animationen der Widgets */
body.dropdown-open .widget:hover {
  transform: none !important;
}

#accountResults {
  position: fixed;
  z-index: 2147482000; /* unter Toasts, über Content */
  display: none;
  background: #2a2a3d;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  overflow: auto;
}

/* Account-Picker optimieren */
.account-picker {
  align-items: center !important; /* Button & Input mittig ausrichten */
}

/* Suchfeld kompakter machen */
.account-search-wrap input {
  padding: 6px 10px;    /* etwas weniger Höhe */
  font-size: 0.95rem;   /* leicht kleiner */
  height: 36px;         /* feste Höhe für sauberen Align mit Button */
  box-sizing: border-box;
}

/* Button angleichen */
#grantBtn {
  height: 36px;         /* gleiche Höhe wie Input */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;      /* seitlich genug Platz, oben/unten via height geregelt */
}

/* Settings: kompakte Eingabefelder */
.input-compact,
.select-compact {
  height: 36px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  box-sizing: border-box;
}

/* Breitenbegrenzung für "Servername" & Default-Select */
.input-compact--md { max-width: 360px; width: 100%; }
.select-compact--md { max-width: 320px; width: 100%; }

/* Label-Spalte konsistent */
.form-label {
  min-width: 220px;
}

.form-row {
  display: flex;
  flex-direction: column; /* Labels immer oben */
  gap: 6px;
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-weight: 600;
}

/* --- Serverstats (Dashboard) --- */
.card.server-stats {
  padding: 16px;
  background: #23233a;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  margin-top: 20px;
}

.card.server-stats h2 {
  margin: 6px 4px 16px;
  font-size: 1.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  background: #1a1a2a;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 8px;
  gap: 8px;
}

.stat-header .title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stat-header .title .fa-solid {
  opacity: .9;
}

.badge {
  background: #2f2f47;
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
  line-height: 1;
}

.subline {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #cfd3e1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kv .label {
  opacity: .9;
}

.chips {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  background: #2f2f47;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .8rem;
  line-height: 1.4;
}

.help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: .85;
}

.help .fa-circle-info {
  opacity: .9;
}

/* Responsive */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* --- Logs page --- */
.log-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.log-toolbar .spacer { flex: 1; }
.log-toolbar label { opacity: .95; }
.log-toolbar select,
.log-toolbar input[type="text"] {
  background: #1a1a2a;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 8px 10px;
}
.log-toolbar .btn {
  background: #2f2f47;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.log-toolbar .btn:hover { background: #3a3a5a; }

.log-container { border: 1px solid rgba(255,255,255,.08); border-radius: 12px; overflow: hidden; }
.log-viewer {
  width: 100%;
  min-height: 460px;
  background: #0f0f19;
  color: #dfe6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.38;
  padding: 14px;
  border: none;
  resize: vertical;
}
.log-footer { margin-top: 8px; opacity: .85; font-size: 0.9rem; }

/* ============ Toggle Switch ============ */
.switch{
  position:relative;
  display:inline-flex;
  align-items:center;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  user-select:none;
}
.switch input{
  position:absolute;
  opacity:0;
  inset:0;
  margin:0;
}
.switch span{
  --h:28px;          /* Höhe */
  --w:52px;          /* Breite */
  --p:3px;           /* Innenabstand für den Knopf */
  position:relative;
  width:var(--w);
  height:var(--h);
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  display:inline-block;
}

/* Knopf */
.switch span::before{
  content:"";
  position:absolute;
  top:var(--p);
  left:var(--p);
  width:calc(var(--h) - var(--p)*2);
  height:calc(var(--h) - var(--p)*2);
  border-radius:50%;
  background:#fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
  transition: transform .18s ease;
}

/* Zustand: ON */
.switch input:checked + span{
  background:#22c55e;                 /* grün wie im Screen */
  border-color:#22c55e;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.switch input:checked + span::before{
  transform: translateX(calc(var(--w) - var(--h)));
}

/* Disabled */
.switch input:disabled + span{
  opacity:.6;
  cursor:not-allowed;
}

/* Größenvarianten */
.switch--sm span{ --h:20px; --w:36px; --p:2px; }
.switch--md span{ --h:28px; --w:52px; --p:3px; } /* default */
.switch--lg span{ --h:34px; --w:64px; --p:4px; }

/* Outline-Variante (heller Rand, transparenter Track) */
.switch--outline span{
  background:transparent;
  border:2px solid rgba(255,255,255,.85);
  box-shadow:none;
}
.switch--outline input:checked + span{
  background:transparent;
  border-color:rgba(255,255,255,.95);
}
.switch--outline input:checked + span::before{
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.25);
}

/* Beschriftete Variante: ON/OFF im Track anzeigen */
.switch--labeled span::after{
  content: attr(data-off);
  position:absolute;
  top:50%;
  right:10px;
  transform: translateY(-50%);
  font-weight:700;
  font-size:12px;
  letter-spacing:.02em;
  color:rgba(255,255,255,.8);
  text-shadow: 0 1px 0 rgba(0,0,0,.3);
  pointer-events:none;
}
.switch--labeled input:checked + span::after{
  content: attr(data-on);
  right:auto;
  left:12px;
  color:#0e1b12; /* gut lesbar auf grün */
  text-shadow:none;
}

/* Kein Hover-Glow (du wolltest keine hovernden Cards/Controls) */
.switch:hover span{ box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* Softere Inputs im Bot-Config Editor */
#cfgRoot .input-compact,
#cfgRoot textarea.input-compact,
#cfgRoot select.select-compact {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  color: #e7e7e7;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.25);
}

#cfgRoot .input-compact::placeholder,
#cfgRoot textarea.input-compact::placeholder {
  color: rgba(255,255,255,.45);
}

/* Focus – dezent, aber sichtbar */
#cfgRoot .input-compact:focus,
#cfgRoot textarea.input-compact:focus,
#cfgRoot select.select-compact:focus {
  outline: none;
  border-color: rgba(94,234,212,.55);      /* türkisgrün wie UI-Akzent */
  box-shadow: 0 0 0 2px rgba(94,234,212,.15), inset 0 1px 0 rgba(0,0,0,.25);
}

/* Disabled im Editor etwas ausgegraut */
#cfgRoot .input-compact:disabled,
#cfgRoot textarea.input-compact:disabled,
#cfgRoot select.select-compact:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Number-Spinner unauffällig halten (WebKit) */
#cfgRoot input[type="number"]::-webkit-outer-spin-button,
#cfgRoot input[type="number"]::-webkit-inner-spin-button {
  opacity: .4;
}

.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tags-input__list{
  display:flex; flex-wrap:wrap; gap:8px;
  align-items:center;
}
.tags-input__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  /* verhindert, dass die Liste das Input komplett verdrängt */
  flex: 1 1 auto;
  min-width: 0;
}

/* Das Eingabefeld für neue Chips */
.tags-input__input {
  /* bleibt immer “greifbar”, auch wenn viele Chips da sind */
  flex: 1 0 160px;     /* wächst mit, hat aber mind. ~160px */
  min-width: 140px;    /* notfalls etwas kleiner, wenn’s eng wird */
}

.tags-input__input::placeholder{ color:rgba(255,255,255,.4); }
.tags-input__input:focus{
  border-color:rgba(99,102,241,.55); /* Indigo */
  box-shadow:0 0 0 3px rgba(99,102,241,.15);
}

/* Der Chip selbst */
.tag-chip{
  display:inline-flex; align-items:center; gap:6px;          /* 8px → 6px */
  padding:4px 8px;                                           /* 6px 10px → 4px 8px */
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  color:#eaeaea;
  line-height:1;
  white-space:nowrap;
  transition:background .15s ease,border-color .15s ease,transform .05s ease;
  font-size:12.5px;                                          /* neu: leicht kleinere Schrift */
}
.tag-chip:hover{
  background:rgba(255,255,255,.1);
  border-color:rgba(255,255,255,.2);
}

/* Remove-Button (x) */
.tag-chip__x{
  appearance:none; border:0; background:transparent; cursor:pointer;
  color:rgba(255,255,255,.7);
  font-size:14px; line-height:1;                             /* 16px → 14px */
  padding:0 1px; margin:0;                                   /* 0 2px → 0 1px */
}
.tag-chip__x:hover{ color:#fff; transform:scale(1.06); }

/* Kompaktere Variante, falls mal gebraucht */
.tags-input--sm .tag-chip{ padding:3px 7px; font-size:11.5px; }
.tags-input--sm .tags-input__input{ height:28px; min-width:160px; }  /* 32px → 28px */

/* Gilt für alle direkten Kinder von .main-content (Sections, Cards, etc.) */
.main-content{
  padding-inline: var(--content-pad);              /* gleicher Innenabstand */
}

/* Alle Sections auf gleiche Breite bringen und zentrieren */
.main-content > *{
  width: min(100%, var(--content-max));
  margin-inline: auto;                              /* mittig ausrichten */
  box-sizing: border-box;                           /* inkl. Border ins Maß einrechnen */
}

/* Konkreter Fix: Bot-Config-Editor (#cfgRoot) bewusst einfangen */
#cfgRoot{
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  box-sizing: border-box;
}

/* Falls irgendwo „volle Breite“ gewünscht ist, explizit opt-out: */
.main-content > .full-bleed{
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

/* Sicherheitsnetz gegen ungewollte horizontale Überläufe durch Kinder */
.main-content *{
  box-sizing: border-box;
}

:root{
  --content-max: 1600px;
  --content-pad: 20px;
}
.main-content{ padding-inline: var(--content-pad); }
.main-content > *{
  width: min(100%, var(--content-max));
  margin-inline: auto;
  box-sizing: border-box;
}

/* Ticket-Block bündig + nichts ragt über die Karte hinaus */
.tickets-section, [data-section="tickets"]{
  width: min(100%, var(--content-max));
  margin-inline: auto;
  margin-bottom: 28px;
  position: relative;
}
.tickets-section .widget{ overflow: hidden; }

/* Chip-Listen sauber umbrechen, Input behält Platz */
.tags-input{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.tags-input__list{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; flex:1 1 auto; min-width:0; }
.tags-input__input{ flex:1 0 160px; min-width:140px; }

.color-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.color-inline__picker{
  width:38px;
  height:28px;
  padding:0;
  border:none;
  background:none;
}
.color-inline__label{
  opacity:.7;
  font-size:12px;
  letter-spacing:.02em;
}
.color-inline__hex{ width:96px; text-transform:uppercase; }
.color-inline__rgb{ width:72px; }
