* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0d0f14; --panel: #171a22; --panel2: #1f2330; --line: #2a2f3d;
  --txt: #e8eaf0; --muted: #8a90a2; --accent: #5b8cff; --accent2: #7c5bff;
  --ok: #2ecc71; --warn: #f5a623; --bad: #ff4d5e;
}
html, body { background: var(--bg); color: var(--txt);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100%; }
body { padding-bottom: 50px; }

header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { height: 38px; filter: drop-shadow(0 0 8px rgba(91,140,255,.55)); }
.brand .brandtxt { font-size: 19px; }
.brand .brandtxt b { font-weight: 800; color: var(--accent);
  text-shadow: 0 0 10px rgba(91,140,255,.5); }
.summary { display: flex; gap: 14px; flex-wrap: wrap; }
.summary .s { font-size: 13px; color: var(--muted); }
.summary .s b { color: var(--txt); font-size: 15px; }
.upd { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.ro { background: rgba(91,140,255,.15); color: var(--accent); }

.tabs { display: flex; gap: 4px; padding: 10px 18px 0; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 63px; z-index: 9; }
.tabs button { background: transparent; color: var(--muted); border: 0;
  padding: 12px 20px; font-size: 15px; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.active { color: var(--txt); border-bottom-color: var(--accent); }

main { padding: 18px; max-width: 1200px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }
.sec { font-size: 15px; color: var(--muted); margin: 18px 4px 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; }
.sec:first-child { margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: border-color .15s; position: relative; }
.card:hover { border-color: var(--accent); }
.card .dot { width: 11px; height: 11px; border-radius: 50%; position: absolute;
  top: 16px; right: 14px; background: var(--muted); }
.card .dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.card .dot.off { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.card .dot.unknown { background: var(--warn); }
.card h3 { font-size: 15px; margin-bottom: 4px; padding-right: 18px; }
.card .meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.card .tag { display: inline-block; font-size: 11px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; margin-top: 6px; color: var(--muted); }
.card .tag.steuer { color: var(--accent2); border-color: var(--accent2); }

.statusline { font-size: 12px; margin-top: 8px; font-weight: 600; }
.statusline.on { color: var(--ok); } .statusline.off { color: var(--bad); }
.statusline.unknown { color: var(--warn); }

.doclist { display: flex; flex-direction: column; gap: 6px; }
.docrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--txt); }
.docrow:hover { border-color: var(--accent); }
.docrow .ic { font-size: 18px; } .docrow .nm { flex: 1; font-size: 14px; }
.docrow .sub { font-size: 11px; color: var(--muted); }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex;
  align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.overlay[hidden] { display: none; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; max-width: 540px; width: 100%; max-height: 85vh; overflow: auto; position: relative; }
.sheet .close { position: absolute; top: 14px; right: 14px; background: var(--panel2);
  border: 1px solid var(--line); color: var(--txt); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; font-size: 15px; }
.sheet h2 { font-size: 20px; margin-bottom: 4px; }
.sheet .row { display: flex; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sheet .row .k { width: 130px; color: var(--muted); flex-shrink: 0; }
.sheet .row .v { flex: 1; word-break: break-word; }
.sheet a.open, .sheet button.open { display: inline-block; margin-top: 14px; background: var(--accent);
  color: #fff; padding: 9px 16px; border-radius: 8px; text-decoration: none; font-weight: 600;
  border: 0; cursor: pointer; font-size: 14px; }
.sheet button.open2 { display: inline-block; margin: 14px 0 0 8px; background: var(--panel2);
  color: var(--txt); padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.sheet .fl { display: block; margin: 10px 0; font-size: 12px; color: var(--muted); }
.sheet .fl input, .sheet .fl textarea { width: 100%; margin-top: 4px; background: var(--panel2);
  border: 1px solid var(--line); color: var(--txt); padding: 9px 11px; border-radius: 8px; font-size: 14px; font-family: inherit; }

/* Minimale Kacheln */
.card.mini { min-height: 92px; }
.card.mini:has(.cardactions) { min-height: 132px; }
.card .infobtn { position: absolute; bottom: 10px; right: 12px; width: 26px; height: 26px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--accent);
  cursor: pointer; font-size: 13px; line-height: 1; }
.card .infobtn:hover { border-color: var(--accent); }
.card .bkline { font-size: 11px; color: var(--muted); margin-top: 8px; padding-right: 30px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Server-Verknüpfung im Software-Detail */
.serverbtn { display: inline-block; margin: 6px 0 4px; padding: 7px 14px; border-radius: 8px;
  background: var(--panel2); border: 1px solid var(--accent); color: var(--accent);
  font-size: 13px; font-weight: 600; cursor: pointer; }
.serverbtn:hover { background: var(--accent); color: #fff; }
.serverbtn.static { border-color: var(--line); color: var(--muted); cursor: default; }

/* Software-Liste im Host-Detail */
.sheet-sw { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.swrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 5px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.swrow:hover { border-color: var(--accent); }
.swdot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.swdot.on { background: var(--ok); } .swdot.off { background: var(--bad); } .swdot.unknown { background: var(--warn); }
.swrow .swname { flex: 1; font-size: 14px; }
.swrow .swstatus { font-size: 11px; font-weight: 600; }
.swstatus.on { color: var(--ok); } .swstatus.off { color: var(--bad); } .swstatus.unknown { color: var(--warn); }

.cmdlist { display: flex; flex-direction: column; gap: 6px; }
.cmdrow { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.cmdrow .cmdwas { font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.cmdrow .cmdcode { display: block; font-family: monospace; font-size: 13px; color: var(--accent);
  background: var(--panel2); border-radius: 6px; padding: 8px 10px; overflow-x: auto; white-space: pre; }
.hintlist { margin: 0 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.card .meta b { color: var(--txt); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.on { background: rgba(46,204,113,.18); color: var(--ok); }
.pill.off { background: rgba(255,77,94,.18); color: var(--bad); }
.pill.unknown { background: rgba(245,166,35,.18); color: var(--warn); }
