:root{
  --bg:#0b1020;
  --panel:#0f1830;
  --panel2:#101d3a;
  --text:#e8f0ff;
  --muted:#97a8cc;
  --border:rgba(255,255,255,.08);
  --accent:#4aa3ff;
  --accent2:#7c3aed;
  --danger:#ff4a4a;
  --ok:#2dd4bf;
  --warn:#fbbf24;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:18px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
 background: var(--bg);
  color:var(--text);
}
a{color:var(--accent);text-decoration:none}
.muted{color:var(--muted)}
.small{font-size:12px}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}
.sp8{height:8px}
.sp12{height:12px}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px;
  background: rgba(7,11,20,.75);
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(10px);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:34px;height:34px;border-radius:12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 25px rgba(74,163,255,.25);
}
.logo.big{width:42px;height:42px;border-radius:14px}
.brand-title{font-weight:800;letter-spacing:.3px}
.brand-sub{font-size:12px;color:var(--muted)}
.top-actions{display:flex;gap:10px;align-items:center}
.pill{
  padding:8px 10px;border-radius:999px;border:1px solid var(--border);
  background: rgba(255,255,255,.03); color:var(--muted); font-size:12px;
}

.shell{display:flex; min-height: calc(100% - 70px);}
.sidebar{
  width:260px; padding:16px;
  border-right:1px solid var(--border);
  background: rgba(10,14,25,.35);
  backdrop-filter: blur(8px);
}
.nav{display:flex;flex-direction:column;gap:8px}
.navlink{
  padding:11px 12px;border-radius:14px;border:1px solid transparent;
  color:var(--muted); background: rgba(255,255,255,.02);
}
.navlink:hover{border-color:var(--border); color:var(--text)}
.navlink.active{
  background: linear-gradient(135deg, rgba(74,163,255,.18), rgba(124,58,237,.10));
  border-color: rgba(74,163,255,.35);
  color:var(--text);
}
.sidebar-card{
  margin-top:14px; padding:12px;border-radius:16px;
  border:1px solid var(--border); background: rgba(255,255,255,.02);
}

.content{flex:1; padding:18px; width:100%; max-width:none;}
.pagehead{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;margin-bottom:14px}
h1{margin:0;font-size:26px}
h2{margin:0 0 10px; font-size:16px; color:#d8e6ff}
.card{
  border:1px solid var(--border);
  background: var(--panel2); /* komplett solid */
  border-radius: var(--radius);
  padding:14px;
  box-shadow: var(--shadow);
}
.cardhead{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:8px}
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}
.span-12{grid-column:span 12}
.span-6{grid-column:span 6}

@media (max-width: 980px){
  .sidebar{display:none}
  .content{padding:14px}
  .span-6{grid-column:span 12}
  .pagehead{flex-direction:column;align-items:flex-start}
}

.row{display:flex;gap:10px;align-items:center}
.row.wrap{flex-wrap:wrap}
.grow{flex:1}

.field label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
input,select,button,textarea{
  width:100%;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(8,12,22,.72);
  color:var(--text);
  outline:none;
}
textarea{min-height:90px}
input:focus,select:focus,textarea:focus{border-color: rgba(74,163,255,.45)}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; cursor:pointer;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color:var(--text);
  text-decoration:none;
}
.btn:hover{filter:brightness(1.08)}
.btn.primary{background: rgba(74,163,255,.18); border-color: rgba(74,163,255,.38)}
.btn.danger{background: rgba(255,74,74,.14); border-color: rgba(255,74,74,.38)}
.btn.ok{background: rgba(45,212,191,.14); border-color: rgba(45,212,191,.38)}
.btn.ghost{background: rgba(255,255,255,.02)}
.kpi{padding:16px}
.kpi-label{font-size:12px;color:var(--muted)}
.kpi-value{font-size:26px;font-weight:850;margin-top:6px}

.tablewrap{overflow:auto}
.table{width:100%; border-collapse:separate; border-spacing: 0 10px}
.table th{
  font-size:12px; color:var(--muted); font-weight:650;
  text-align:left; padding:0 10px;
}
.table td{
  background: rgba(8,12,22,.72);
  border:1px solid rgba(255,255,255,.08);
  padding:10px;
  border-left:none;border-right:none;
}
.table tr td:first-child{border-left:1px solid rgba(255,255,255,.08); border-top-left-radius:14px; border-bottom-left-radius:14px}
.table tr td:last-child{border-right:1px solid rgba(255,255,255,.08); border-top-right-radius:14px; border-bottom-right-radius:14px}
.badge{
  padding:4px 8px;border-radius:999px;border:1px solid var(--border);
  font-size:12px;color:var(--muted)
}
.badge.danger{border-color:rgba(255,74,74,.35); color:#ffd1d1; background: rgba(255,74,74,.10)}
.badge.ok{border-color:rgba(45,212,191,.35); color:#bff5ed; background: rgba(45,212,191,.08)}

.toast{
  position:fixed; right:16px; bottom:16px; z-index:50;
  max-width: 520px;
  padding:12px 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(8,12,22,.88);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display:none;
}
.toast.show{display:block}

.alert{
  padding:10px 12px; border-radius:16px; border:1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.alert.error{border-color: rgba(255,74,74,.35); background: rgba(255,74,74,.10)}
.alert.warn{border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.10)}

.chartwrap{margin-top:12px}
.pre{
  white-space: pre-wrap;
  word-break: break-word;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(8,12,22,.72);
}

.modal{
  position:fixed; inset:0; z-index:60;
  display:none;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}
.modal.show{display:flex; align-items:center; justify-content:center; padding:16px;}
.modal-card{
  width:min(980px, 100%);
  border-radius: 20px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(16,29,58,.85);
  box-shadow: var(--shadow);
  padding:14px;
}
.modal-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.modal-title{font-weight:850;font-size:18px}
.modalgrid{grid-template-columns: repeat(12, 1fr);}
.kv > div{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px dashed rgba(255,255,255,.10)}
.kv > div:last-child{border-bottom:none}
.k{color:var(--muted); font-size:12px}
.v{font-size:13px}


/* === Dashboard KPI layout fixes === */
.grid > .card.kpi{ grid-column: span 3; }
@media (max-width: 1200px){
  .grid > .card.kpi{ grid-column: span 6; }
}
@media (max-width: 700px){
  .grid > .card.kpi{ grid-column: span 12; }
}
.span-3{grid-column:span 3}
.span-4{grid-column:span 4}
.span-8{grid-column:span 8}

/* make big numbers readable */
.kpi-value{
  font-variant-numeric: tabular-nums;
  letter-spacing:.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Sidebar status widget (safe additions) === */
.statuscard{ margin-top: 14px; }
.sidecard-title{
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: .2px;
}
.status-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.status-row:first-of-type{ border-top:0; padding-top:0; }
.status-right{
  text-align:right;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148,163,184,.85);
  flex: 0 0 auto;
}
.dot.ok{
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(45,212,191,.45);
  animation: dashPulse 1.4s ease-out infinite;
}
.dot.bad{ background: var(--danger); }

@keyframes dashPulse{
  0%{ box-shadow: 0 0 0 0 rgba(45,212,191,.45); }
  100%{ box-shadow: 0 0 0 14px rgba(45,212,191,0); }
}

.kpi-ico{
  width:36px;height:36px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  color: rgba(232,240,255,.9);
}
.login-status{
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; border-radius:12px;
  margin-top:14px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  font-size:14px;
}
.login-status .dot{ width:10px; height:10px; border-radius:999px; background:#94a3b8; }
.login-status.ok .dot{ background:#2dd4bf; box-shadow:0 0 10px rgba(45,212,191,.55); }
.login-status.bad .dot{ background:#ff4a4a; box-shadow:0 0 10px rgba(255,74,74,.55); }

/* =========================================================
   AUTH / LOGIN (Webmin-ish) — scoped, won't affect dashboard
   ========================================================= */

/* background wrapper */
body.authbg{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

/* center shell */
.auth-shell{
  width: min(460px, 100%);
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* card */
.auth-card{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(16,29,58,.62);
  box-shadow: var(--shadow);
  overflow:hidden;
}

/* "webmin-like" header block */
.auth-head{
  display:flex;
  align-items:center;
  gap:14px;
  padding:18px 18px 14px 18px;
  background: linear-gradient(135deg, rgba(74,163,255,.18), rgba(124,58,237,.10));
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* logo size on login */
.auth-head .logo.big{
  width:48px;
  height:48px;
  border-radius:16px;
}

/* title */
.auth-head .brand-title{
  font-size:18px;
  font-weight:900;
  margin:0;
}
.auth-head .muted{
  margin-top:2px;
}

/* form area */
.auth-card .form{
  padding:16px 18px 18px 18px;
}

/* inputs: add icon spacing style like webmin (optional) */
.auth-card .field{
  margin-bottom:12px;
}
.auth-card .field input{
  padding:12px 12px;
  border-radius: 12px;
}

/* button big */
.auth-card .btn.primary{
  width:100%;
  padding:12px 14px;
  border-radius: 12px;
  font-weight:800;
}

/* error banner inside card */
.auth-card .alert{
  margin:14px 18px 0 18px;
}

/* footer text */
.auth-foot{
  text-align:center;
  opacity:.9;
}

/* backend status on login – compact chip */
.auth-status{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(8,12,22,.55);
}

/* reuse dot classes */
.auth-status .dot{
  width:10px;height:10px;border-radius:999px;background:#94a3b8;
}
.auth-status.ok .dot{
  background: var(--ok);
  box-shadow:0 0 12px rgba(45,212,191,.45);
}
.auth-status.bad .dot{
  background: var(--danger);
  box-shadow:0 0 12px rgba(255,74,74,.35);
}

/* small helper line under inputs */
.auth-hint{
  margin-top:10px;
  font-size:12px;
  color: var(--muted);
  text-align:center;
}


/* Community Teams: Untermenü im bestehenden Sidebar-Stil */
.navsection{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:2px 0;
}
.navsection-title{
  padding:4px 12px 1px;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  opacity:.8;
}
.navlink.navlink-sub{
  margin-left:10px;
  width:calc(100% - 10px);
  padding:9px 12px;
  border-radius:12px;
  font-size:13px;
  background:rgba(255,255,255,.015);
}
.navlink.navlink-sub.active{
  background:linear-gradient(135deg, rgba(74,163,255,.18), rgba(124,58,237,.10));
  border-color:rgba(74,163,255,.35);
  color:var(--text);
}


