/* RustHelper2 – Theme "Slate" (Entscheidung Bob 27.09.2026): ruhiges Dunkelgrau, ein Akzent (Stahlblau),
   Status-Punkt statt Volltext-Rot, eine Karte pro Gruppe mit gemeinsamem Spaltenraster. Bootstrap wird nur
   noch fuer Modals/Dropdowns/Collapse/Alerts genutzt und ueber seine CSS-Variablen an das Theme gehaengt. */

:root {
  --rh-bg: #0e1116; --rh-nav: #12161c; --rh-panel: #151a21; --rh-panel-2: #12161c; --rh-hover: #181e27;
  --rh-border: #222a34; --rh-border-2: #1a2029; --rh-field: #0f1319;
  --rh-text: #dbe2ea; --rh-text-2: #9aa5b2; --rh-muted: #7d8794; --rh-dim: #56606c;
  /* Akzent: accent = Buttons/Balken, accent-2 = Brand-Text auf dunkel, accent-3 = Links/Code, accent-rgb = Heatmap */
  --rh-accent: #3a66b8; --rh-accent-2: #4a78cc; --rh-accent-3: #7fa2dc; --rh-accent-rgb: 58, 102, 184; --rh-accent-soft: rgba(58, 102, 184, .25);
  --rh-on: #37cc7b; --rh-on-soft: rgba(55, 204, 123, .16); --rh-off: #d9737f; --rh-warn: #e5b04b;
  --rh-font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
/* Paletten-Vorschau (27.09.2026): ?palette=steel|cobalt|denim|ocean setzt <html data-palette> (head.ejs) und merkt
   sich die Wahl in localStorage. "steel" = die Standardwerte oben. Nach Bobs Entscheidung wird die Wahl zum Standard. */
:root[data-palette="cobalt"] { --rh-accent: #2f57c9; --rh-accent-2: #4b74e0; --rh-accent-3: #85a3ec; --rh-accent-rgb: 47, 87, 201; --rh-accent-soft: rgba(47, 87, 201, .28); }
:root[data-palette="denim"] { --rh-accent: #4f6f96; --rh-accent-2: #6a8bb5; --rh-accent-3: #97b0cf; --rh-accent-rgb: 79, 111, 150; --rh-accent-soft: rgba(79, 111, 150, .3); }
:root[data-palette="ocean"] { --rh-accent: #2a7a9b; --rh-accent-2: #3d97bb; --rh-accent-3: #78b9d3; --rh-accent-rgb: 42, 122, 155; --rh-accent-soft: rgba(42, 122, 155, .3); }

/* ---------- Bootstrap an das Theme haengen ---------- */
[data-bs-theme=dark] {
  --bs-body-bg: var(--rh-bg); --bs-body-color: var(--rh-text); --bs-body-font-family: var(--rh-font);
  --bs-border-color: var(--rh-border); --bs-secondary-color: var(--rh-muted); --bs-tertiary-bg: var(--rh-panel);
  --bs-link-color: var(--rh-accent-3); --bs-link-hover-color: #c9d8f5; --bs-emphasis-color: #fff; --bs-code-color: var(--rh-accent-3);
}
body { background: var(--rh-bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
b, strong { font-weight: 700; }

.btn { --bs-btn-font-weight: 700; --bs-btn-border-radius: 8px; --bs-btn-padding-y: .42rem; --bs-btn-padding-x: .85rem; --bs-btn-font-size: 13px; }
.btn-primary { --bs-btn-bg: var(--rh-accent); --bs-btn-border-color: var(--rh-accent); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--rh-accent-2); --bs-btn-hover-border-color: var(--rh-accent-2); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--rh-accent-2); --bs-btn-active-border-color: var(--rh-accent-2); --bs-btn-active-color: #fff; --bs-btn-focus-shadow-rgb: 58, 102, 184; }
.btn-secondary { --bs-btn-bg: #171d25; --bs-btn-border-color: #2a323d; --bs-btn-color: var(--rh-text); --bs-btn-hover-bg: #1f2733; --bs-btn-hover-border-color: #354050; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #1f2733; --bs-btn-active-border-color: #354050; --bs-btn-active-color: #fff; }
.btn-outline-secondary { --bs-btn-color: var(--rh-text-2); --bs-btn-border-color: #2a323d; --bs-btn-hover-bg: #1f2733; --bs-btn-hover-border-color: #354050; --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--rh-accent); --bs-btn-active-border-color: var(--rh-accent); --bs-btn-active-color: #fff; }
.btn-group-sm > .btn { --bs-btn-font-size: 12px; }

.form-control, .form-select { background: var(--rh-field); border-color: #2a323d; color: var(--rh-text); border-radius: 8px; }
.form-control:focus, .form-select:focus { background: var(--rh-field); border-color: var(--rh-accent); box-shadow: 0 0 0 3px var(--rh-accent-soft); color: var(--rh-text); }
.form-control::placeholder { color: var(--rh-dim); }
.form-select option.rh-opt-on { color: var(--rh-on); }
.form-label { font-size: 13px; font-weight: 600; color: var(--rh-text-2); }
.form-check-input { background-color: var(--rh-field); border-color: #2a323d; }
.form-check-input:checked { background-color: var(--rh-accent); border-color: var(--rh-accent); }

.modal-content { background: var(--rh-panel); border: 1px solid var(--rh-border); border-radius: 12px; }
.modal-header, .modal-footer { border-color: var(--rh-border); }
.modal-title { font-weight: 800; font-size: 16px; }
.dropdown-menu { --bs-dropdown-bg: var(--rh-panel); --bs-dropdown-border-color: var(--rh-border); --bs-dropdown-color: var(--rh-text); --bs-dropdown-link-color: var(--rh-text); --bs-dropdown-link-hover-bg: #1f2733; --bs-dropdown-link-hover-color: #fff; --bs-dropdown-border-radius: 10px; --bs-dropdown-padding-y: .35rem; --bs-dropdown-divider-bg: var(--rh-border); font-size: 13px; }
.card { --bs-card-bg: var(--rh-panel); --bs-card-border-color: var(--rh-border); --bs-card-border-radius: 12px; }
.alert-dark { --bs-alert-bg: var(--rh-panel); --bs-alert-border-color: var(--rh-border); --bs-alert-color: var(--rh-text); border-radius: 10px; }
.alert-success { --bs-alert-bg: #12331f; --bs-alert-border-color: #1d4d2f; --bs-alert-color: #9be7b9; }
.alert-danger { --bs-alert-bg: #3a1b21; --bs-alert-border-color: #5a2a33; --bs-alert-color: #f2a6b0; }
.badge { font-weight: 700; }
.badge.text-bg-success { background: #1d4d2f !important; color: #9be7b9 !important; }
.badge.text-bg-warning { background: #4a3a14 !important; color: #f2cf7a !important; }
.badge.text-bg-danger { background: #3a1b21 !important; color: #f2a6b0 !important; }
.text-secondary { color: var(--rh-muted) !important; }
.text-warning { color: var(--rh-warn) !important; }

.table-dark { --bs-table-bg: var(--rh-panel); --bs-table-color: var(--rh-text); --bs-table-border-color: var(--rh-border-2); --bs-table-striped-bg: #171d25; --bs-table-striped-color: var(--rh-text); --bs-table-hover-bg: #1b2230; --bs-table-hover-color: #fff; font-size: 13px; }
.table-dark th { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rh-muted); }
.table-dark td { vertical-align: middle; }
.table-dark.table-bordered { --bs-table-border-color: #1f262f; }
.table-dark img { vertical-align: -3px; margin-right: 2px; }
.table-dark tr.rh-on td:first-child { color: var(--rh-on); font-weight: 700; }
.table-dark tr.rh-off td:first-child { color: var(--rh-off); }
.rh-tbl { background: var(--rh-panel); border: 1px solid var(--rh-border); border-radius: 12px; overflow-x: auto; margin-bottom: 12px; }
.rh-tbl .table { margin-bottom: 0; }
.rh-brand-b { color: var(--rh-accent-2); }

/* ---------- Layout / Navbar ---------- */
.rh-wrap { max-width: 1600px; margin: 0 auto; padding: 0 32px; }
.rh-nav { background: var(--rh-nav); border-bottom: 1px solid var(--rh-border); min-height: 56px; padding: 0; }
.rh-nav .navbar-brand { font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: #fff; }
.rh-nav .navbar-brand b { color: var(--rh-accent-2); }
.rh-nav .nav-link { color: var(--rh-text-2); font-weight: 600; padding: 6px 12px; border-radius: 8px; }
.rh-nav .nav-link:hover { color: #fff; }
.rh-nav .nav-link.active { background: #1b2230; color: #fff; }
.rh-nav .navbar-toggler { border-color: #2a323d; padding: 4px 8px; }
.rh-status { color: var(--rh-muted); font-size: 13px; display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.rh-status b { color: var(--rh-text); font-weight: 700; }
.rh-live { font-size: .5rem; color: var(--rh-dim); vertical-align: middle; }
.rh-live.on { color: var(--rh-on); filter: drop-shadow(0 0 3px rgba(61, 220, 132, .7)); }
.rh-live.off { color: var(--rh-off); }
.rh-live-sm { margin-left: auto; margin-right: 12px; }
.rh-user { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--rh-text) !important; padding: 4px 6px !important; }
.rh-user::after { color: var(--rh-muted); }
.rh-avatar { width: 26px; height: 26px; border-radius: 50%; background: #2a3444; display: grid; place-items: center; font-size: 11px; color: #c9d3e0; }
.rh-flash { position: sticky; top: .5rem; z-index: 1030; }
footer.rh-foot { color: var(--rh-dim); font-size: 12px; padding-top: 8px; padding-bottom: 20px; }

/* ---------- Seiten-Titel, Textlinks ---------- */
.rh-page-title { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.01em; margin: 0; }
.rh-dim { color: var(--rh-muted); }
.rh-link { background: none; border: 0; padding: 0; color: var(--rh-text-2); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.rh-link:hover { color: #fff; }
.rh-link:disabled { color: var(--rh-dim); cursor: default; }
.rh-link.text-warning:hover { color: #f3cd7c !important; }
.rh-note { white-space: pre-wrap; }

/* ---------- Monitor: Toolbar ---------- */
.rh-toolbar { display: flex; align-items: center; gap: 10px; margin: 18px 0 16px; }
.rh-sum { color: var(--rh-muted); font-size: 13px; }
.rh-sum b { color: var(--rh-text); }
.rh-sum b.rh-sum-on { color: var(--rh-on); }
.rh-spacer { flex: 1; }

/* ---------- Monitor: Gruppen-Karten ---------- */
.rh-card { background: var(--rh-panel); border: 1px solid var(--rh-border); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.rh-card-h { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 18px; border-bottom: 1px solid var(--rh-border); min-height: 52px; }
.rh-gname { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: #fff; min-width: 0; }
.rh-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #1b2230; color: #8b96a3; white-space: nowrap; }
.rh-pill.on { background: var(--rh-on-soft); color: var(--rh-on); }
.rh-card .rh-note { padding: 8px 18px; font-size: 13px; color: #a7b1bd; background: var(--rh-panel-2); border-bottom: 1px solid var(--rh-border); margin: 0; }
.rh-empty { padding: 14px 18px; color: var(--rh-muted); font-size: 13px; }

/* Icon-Buttons (Gruppe + Zeile) */
.rh-ib { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 30px; height: 30px; border-radius: 7px; border: 0; background: transparent; color: var(--rh-muted); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; padding: 0; white-space: nowrap; }
.rh-ib:hover { background: #1f2733; color: #fff; }
.rh-ib:disabled { color: #3b4552; cursor: default; background: transparent; }
.rh-ib.rh-danger:hover { background: #3a1b21; color: #f2a6b0; }
.rh-ib.rh-warn { color: var(--rh-warn); }
.rh-ib .rh-txt { display: none; }
.rh-form { display: inline; margin: 0; }
.rh-gacts, .rh-acts { display: flex; align-items: center; gap: 2px; }
.rh-gacts { margin-left: auto; }
.rh-more { display: none; }

/* Zeilen-Raster: gilt fuer Kopfzeile und alle Zeilen aller Gruppen -> Spalten stehen ueberall gleich */
.rh-grid { display: grid; grid-template-columns: 18px minmax(0, 1fr) 230px 130px 170px; align-items: center; column-gap: 12px; padding: 0 10px 0 18px; }
.rh-thead { height: 34px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rh-dim); border-bottom: 1px solid #1d242d; }
.rh-row { min-height: 42px; border-bottom: 1px solid var(--rh-border-2); }
.rh-row:last-child { border-bottom: 0; }
.rh-row:hover { background: var(--rh-hover); }
.rh-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b4552; }
.rh-row.rh-on .rh-dot { background: var(--rh-on); box-shadow: 0 0 0 3px var(--rh-on-soft); }
.rh-row.rh-never .rh-dot { background: #2a323d; }
.rh-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; color: var(--rh-text-2); }
.rh-name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-row.rh-on .rh-name { color: #fff; }
.rh-row.rh-never .rh-name { color: var(--rh-muted); font-weight: 600; }
.rh-ico { color: var(--rh-dim); font-size: 12px; }
.rh-ext { display: inline-flex; gap: 4px; margin-left: 2px; }
.rh-ext a { font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 5px; border-radius: 4px; background: #1b2230; color: var(--rh-dim); text-decoration: none; line-height: 1.3; }
.rh-ext a:hover { background: #26303d; color: #fff; }
.rh-chips { display: inline-flex; gap: 8px; font-size: 12px; font-weight: 600; color: var(--rh-text-2); font-variant-numeric: tabular-nums; }
.rh-chips img { vertical-align: -3px; }
.rh-gt { display: flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; color: #c3ccd6; font-weight: 600; }
.rh-gt-n { width: 56px; text-align: right; white-space: nowrap; }
.rh-bar { width: 110px; height: 4px; border-radius: 2px; background: #1f2733; overflow: hidden; }
.rh-bar i { display: block; height: 100%; background: var(--rh-accent); border-radius: 2px; }
.rh-row.rh-never .rh-gt { color: var(--rh-dim); }
.rh-ls { font-variant-numeric: tabular-nums; color: var(--rh-text-2); font-weight: 600; white-space: nowrap; }
.rh-row.rh-on .rh-ls { color: var(--rh-on); font-weight: 800; }
.rh-row.rh-never .rh-ls { color: var(--rh-dim); }
.rh-acts { justify-content: flex-end; opacity: .6; }
.rh-row:hover .rh-acts { opacity: 1; }
.rh-acts .rh-ib { width: 28px; height: 28px; }

/* Desktop: das Aktionsmenue ist kein Dropdown, sondern eine Icon-Leiste */
@media (min-width: 768px) {
  /* z-index auto ist Pflicht: als Flex-Item wuerde Bootstraps z-index 1000 sonst ueber Navbar-Dropdowns liegen */
  .rh-menu.dropdown-menu { display: flex !important; position: static !important; z-index: auto !important; transform: none !important; inset: auto !important; background: none; border: 0; padding: 0; margin: 0; min-width: 0; gap: 2px; align-items: center; }
}

/* ---------- Visual: Heatmap ---------- */
.rh-heat td { text-align: center; font-size: .72rem; min-width: 1.9rem; color: var(--rh-text); }
.rh-heat td.rh-hot { background: rgba(var(--rh-accent-rgb), var(--rh-a, .5)); }
.rh-heat th { font-size: .72rem; text-align: center; color: var(--rh-muted); text-transform: none; letter-spacing: 0; }

/* ---------- Handy ---------- */
@media (max-width: 767.98px) {
  .rh-wrap { padding: 0 12px; }
  main.rh-wrap { padding-bottom: 88px !important; }
  .rh-nav .navbar-collapse { padding: 6px 0 10px; }
  .rh-status { padding: 8px 12px 0; white-space: normal; flex-wrap: wrap; gap: 4px 14px; }
  .rh-nav .navbar-nav .nav-link { padding: 8px 12px; }
  .rh-page-title { font-size: 19px; }
  .rh-toolbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020; margin: 0; padding: 10px 12px; background: rgba(14, 17, 22, .94); border-top: 1px solid var(--rh-border); backdrop-filter: blur(6px); }
  .rh-toolbar .btn { flex: 1; height: 46px; border-radius: 10px; font-size: 14px; }
  .rh-sum, .rh-spacer { display: none; }
  .rh-card { margin-bottom: 12px; }
  .rh-card-h { padding: 6px 4px 6px 14px; gap: 8px; }
  .rh-gname { font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rh-card .rh-note { padding: 8px 14px; font-size: 12px; }
  .rh-thead { display: none; }
  .rh-grid { grid-template-columns: 14px minmax(0, 1fr) auto 40px; grid-template-rows: auto auto; column-gap: 10px; row-gap: 0; padding: 7px 2px 7px 14px; }
  .rh-row { min-height: 54px; }
  .rh-dot { grid-row: 1 / 3; }
  .rh-name { grid-column: 2 / 4; }
  .rh-ext { display: none; }
  .rh-gt { grid-row: 2; grid-column: 2; font-size: 12px; color: var(--rh-muted); gap: 6px; }
  .rh-gt-n { width: auto; text-align: left; }
  .rh-gt-n::after { content: ' since wipe'; font-weight: 500; }
  .rh-bar { display: none; }
  .rh-ls { grid-row: 2; grid-column: 3; font-size: 12px; }
  .rh-row.rh-off .rh-ls::before { content: 'seen '; font-weight: 500; }
  .rh-row.rh-never .rh-ls::after { content: ' seen'; }
  .rh-row.rh-on .rh-ls::before { content: 'online '; }
  .rh-acts, .rh-gacts { grid-row: 1 / 3; grid-column: 4; opacity: 1; }
  .rh-more { display: inline-flex; width: 40px; height: 40px; }
  .rh-menu.dropdown-menu { min-width: 200px; }
  .rh-menu .rh-form { display: block; }
  .rh-menu .rh-ib { width: 100%; height: 40px; justify-content: flex-start; padding: 0 14px; border-radius: 0; color: var(--rh-text); gap: 12px; }
  .rh-menu .rh-ib i { width: 16px; text-align: center; color: var(--rh-muted); }
  .rh-menu .rh-ib .rh-txt { display: inline; }
  .rh-menu .rh-ib:disabled { color: var(--rh-dim); }
}
