/*
GridSense Dashboard CSS v2.1.2
Bearbeitet: 2026-01-22 13:10
Aenderungen:
- Added Details Styles fuer Node Card: details, kv, k, v, rawbox
*/

:root {
  color-scheme: dark;
  --bg0: #070a12;
  --bg1: #0b1020;
  --bg2: #1f2a44;

  --text: #e8eefc;
  --muted: rgba(232, 238, 252, 0.70);

  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.10);

  --ok: #22c55e;
  --alarm: #ef4444;
  --offline: #64748b;
  --test: #38bdf8;
  --restore: #a78bfa;
  --hello: #f59e0b;

  --shadow: 0 12px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: var(--bg0);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(1200px 800px at 30% 10%, var(--bg2) 0%, var(--bg1) 55%, var(--bg0) 100%);
}

.wrap {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand img {
  height: 28px;
  width: auto;
  display: block;
}

.title {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
}

.sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.stats {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1400px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1120px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .grid { grid-template-columns: repeat(1, minmax(0, 1fr)); } }

.card {
  border-radius: 14px;
  background: var(--card);
  border: 2px solid rgba(255,255,255,0.16);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.10s ease, background 0.10s ease, border-color 0.10s ease;
  position: relative;
  overflow: hidden;
  min-height: 104px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);
}

.card:hover {
  transform: translateY(-1px);
  background: var(--card2);
}

.card.offline {
  filter: saturate(0.35);
  opacity: 0.78;
}

.card.ok      { border-color: rgba(34, 197, 94, 0.95); }
.card.alarm   { border-color: rgba(239, 68, 68, 0.95); }
.card.test    { border-color: rgba(56, 189, 248, 0.95); }
.card.restore { border-color: rgba(167, 139, 250, 0.95); }
.card.hello   { border-color: rgba(245, 158, 11, 0.95); }

.card.alarm::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 50%, rgba(239,68,68,0.18) 0%, rgba(239,68,68,0.00) 55%);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.90); opacity: 0.35; }
  50%  { transform: scale(1.00); opacity: 0.85; }
  100% { transform: scale(0.90); opacity: 0.35; }
}

.row1 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.name {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.id {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.mode {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.2px;
  text-transform: lowercase;
}

.pill {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  opacity: 0.95;
  white-space: nowrap;
}

.meta {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.sigRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.bars8 {
  display: grid;
  grid-auto-flow: column;
  gap: 3px;
  align-items: end;
}

.bars8 span {
  width: 4px;
  border-radius: 2px;
  background: rgba(232,238,252,0.25);
  height: 6px;
}

.bars8 span:nth-child(1) { height: 5px; }
.bars8 span:nth-child(2) { height: 6px; }
.bars8 span:nth-child(3) { height: 7px; }
.bars8 span:nth-child(4) { height: 8px; }
.bars8 span:nth-child(5) { height: 9px; }
.bars8 span:nth-child(6) { height: 10px; }
.bars8 span:nth-child(7) { height: 11px; }
.bars8 span:nth-child(8) { height: 12px; }

.q0 span { opacity: 0.20; }
.q1 span:nth-child(-n+2),
.q2 span:nth-child(-n+3),
.q3 span:nth-child(-n+4),
.q4 span:nth-child(-n+5),
.q5 span:nth-child(-n+6),
.q6 span:nth-child(-n+7),
.q7 span:nth-child(-n+8) {
  background: rgba(232,238,252,0.95);
}

.time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.activity {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.barWrap {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}

.barFill {
  height: 100%;
  width: 0%;
  background: rgba(34, 197, 94, 0.95);
}

.card.alarm .barFill { background: rgba(239, 68, 68, 0.95); }
.card.offline .barFill { background: rgba(100, 116, 139, 0.95); }
.card.test .barFill { background: rgba(56, 189, 248, 0.95); }
.card.restore .barFill { background: rgba(167, 139, 250, 0.95); }
.card.hello .barFill { background: rgba(245, 158, 11, 0.95); }

.actText {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ===== Node/Hub pages additions ===== */

.linkbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  user-select: none;
}
.linkbtn:hover{ background: rgba(255,255,255,0.10); }

.layout{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  align-items: start;
}
.layout > *{
  min-width: 0;
}
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
}

.panel{
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);
}

.panel h3{ margin:0; font-size:14px; }
.subline{ font-size:12px; color: var(--muted); margin-top:4px; }

.tableScroll{ width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }

table{ width:100%; border-collapse: collapse; margin-top: 12px; }
th,td{
  border-bottom: 1px solid rgba(255,255,255,0.10);
  padding: 10px 8px;
  font-size: 12px;
  text-align: left;
  vertical-align: top;
}
th{ opacity: .85; }

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.btnrow{ display:flex; gap:10px; flex-wrap: wrap; }
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}
.btn:hover{ background: rgba(255,255,255,0.10); }

.err{ margin-top:10px; font-size:12px; color: #fecaca; display:none; }

.tiny{ font-size:11px; color: var(--muted); }

.st { font-weight: 800; }
.st-alarm   { color: rgba(239,68,68,0.95); }
.st-ping    { color: rgba(34,197,94,0.95); }
.st-hello   { color: rgba(245,158,11,0.95); }
.st-test    { color: rgba(56,189,248,0.95); }
.st-restore { color: rgba(167,139,250,0.95); }

/* ===== Details Block (Node Card) ===== */

.details{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.kv{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.k{
  font-size: 12px;
  color: var(--muted);
}

.v{
  font-size: 12px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.modeForm{
  display: grid;
  gap: 6px;
}

.modeRow{
  display:flex;
  gap: 8px;
  align-items:center;
}

.modeRow select{
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}

.modeRow button{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

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

.rawbox{
  margin-top: 6px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.10);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  opacity: 0.95;
}
