@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* Farben wie auf lcarsnet.cloud */
:root {
  --orange:  #FF9900;
  --amber:   #FFCC44;
  --blue:    #88BBFF;
  --blue2:   #4477CC;
  --red:     #CC3344;
  --red-hi:  #FF4455;
  --purple:  #9955CC;
  --tan:     #FFCC99;
  --bg:      #000000;
  --panel:   #111111;
  --track:   #262626;
  --line:    #222222;
  /* Textfarben */
  --ink:     #FFCC99;
  --ink-2:   #FF9900;
  --muted:   #997755;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── TOP BAR ── */
.top-bar {
  display: flex;
  align-items: stretch;
  height: 72px;
  gap: 6px;
  padding: 8px 8px 0;
}
.top-pill { background: var(--orange); border-radius: 40px 40px 0 0; width: 140px; flex-shrink: 0; transition: background .3s; }
.top-pill.red    { background: var(--red); width: 60px; }
.top-pill.purple { background: var(--purple); width: 80px; }
.top-pill.amber  { background: var(--amber); width: 160px; }
.top-pill.blue   { background: var(--blue2); width: 90px; }
.top-title {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 6px 16px;
  min-width: 0;
}
.top-title h1 {
  font-size: clamp(1rem, 2.6vw, 1.6rem);
  color: var(--orange);
  letter-spacing: .15em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-meta { font-size: .7rem; color: var(--muted); letter-spacing: .1em; text-align: right; white-space: nowrap; }

.h-divider { height: 6px; margin: 0 8px; display: flex; gap: 6px; }
.h-divider div { height: 100%; transition: background .3s; }
.hd-orange  { background: var(--orange); flex: 1; }
.hd-orange2 { background: var(--orange); width: 140px; }
.hd-red     { background: var(--red); width: 60px; }
.hd-purple  { background: var(--purple); width: 80px; }
.hd-amber   { background: var(--amber); width: 160px; }
.hd-blue    { background: var(--blue2); width: 90px; }

/* ── LAYOUT ── */
.main { display: flex; gap: 6px; padding: 6px 8px 8px; min-height: calc(100vh - 86px); }

.sidebar { display: flex; flex-direction: column; gap: 6px; width: 140px; flex-shrink: 0; }
.side-block {
  background: var(--orange);
  border: 0;
  border-radius: 40px 0 0 40px;
  padding: 12px 16px;
  color: #000;
  font: inherit;
  font-size: .68rem;
  font-weight: bold;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: right;
  text-decoration: none;
  display: block;
  transition: background .2s;
}
a.side-block:hover, button.side-block:hover { background: var(--amber); cursor: pointer; }
.side-block.red    { background: var(--red); color: #fff; }
.side-block.blue   { background: var(--blue2); color: #fff; }
.side-block.purple { background: var(--purple); color: #fff; }
.side-block.tan    { background: var(--tan); }
.side-block.tall   { flex: 1; display: flex; align-items: flex-end; justify-content: flex-end; }
.side-sep { background: var(--orange); height: 6px; border-radius: 3px 0 0 3px; }
.side-sep.amber { background: var(--amber); }
.side-sep.blue  { background: var(--blue2); }

.content { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* ── PANELS ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 6px;
}
.panel { background: var(--panel); border: 1px solid var(--line); padding: 16px 20px; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.panel-head::before {
  content: '';
  width: 28px; height: 14px;
  border-radius: 7px;
  background: var(--accent, var(--orange));
  flex-shrink: 0;
}
.panel-head h2 {
  font-size: .8rem;
  font-weight: normal;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.panel-head .sub { margin-left: auto; font-size: .65rem; color: var(--muted); letter-spacing: .1em; }

/* ── KENNZAHLEN ── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; }
.stat .label { font-size: .6rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.stat .value { font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .value small { font-size: .7rem; color: var(--muted); margin-left: 3px; }

/* ── METER (Auslastungsbalken) ── */
.meter { margin-bottom: 14px; }
.meter:last-child { margin-bottom: 0; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; gap: 8px; }
.meter-top .label { font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.meter-top .value { font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-top .value small { font-size: .65rem; color: var(--muted); margin-left: 6px; }
.meter-track { height: 12px; background: var(--track); border-radius: 6px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 6px; background: var(--orange); width: 0; transition: width .6s ease, background .3s; }
.meter-fill.warn { background: var(--amber); }
.meter-fill.crit { background: var(--red-hi); }

/* ── SPARKLINE ── */
.spark { position: relative; margin-top: 16px; }
.spark-head { display: flex; justify-content: space-between; font-size: .6rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.spark-head .now { color: var(--ink); font-size: .8rem; letter-spacing: .05em; text-transform: none; }
.spark svg { display: block; width: 100%; height: 56px; overflow: visible; }
.spark .base { stroke: var(--line); stroke-width: 1; }
.spark .area { fill: currentColor; opacity: .12; }
.spark .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .cross { stroke: var(--muted); stroke-width: 1; }
.spark .dot { fill: currentColor; stroke: var(--panel); stroke-width: 2; }
.spark .hit { fill: transparent; cursor: crosshair; }
.spark.orange { color: var(--orange); }
.spark.blue { color: var(--blue); }
.spark.purple { color: #BB88EE; }
.tooltip {
  position: absolute;
  top: 0;
  pointer-events: none;
  background: #000;
  border: 1px solid var(--muted);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: .7rem;
  color: var(--ink);
  white-space: nowrap;
  transform: translate(-50%, -110%);
  opacity: 0;
  transition: opacity .1s;
}
.tooltip.show { opacity: 1; }

/* ── LISTEN ── */
.list { list-style: none; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
  min-width: 0;
}
.list li:last-child { border-bottom: 0; }
.list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.list .meta { color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }

/* Container-Zeilen */
.ctr-list li { flex-wrap: wrap; row-gap: 4px; }
.ctr-list .name { flex: 1 1 200px; }
.ctr-list .name small { display: block; color: var(--muted); font-size: .65rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.ctr-list .meta { min-width: 64px; text-align: right; }
.ctr-list .meta b { display: block; font-weight: normal; font-size: .55rem; letter-spacing: .15em; text-transform: uppercase; }
.ctr-list .pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 170px; }
.empty { color: var(--muted); font-size: .75rem; padding: 6px 0; }

/* Status-Pille: immer Symbol + Text, nie nur Farbe */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 10px;
  padding: 2px 10px;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #000;
  white-space: nowrap;
}
.pill.ok   { background: var(--blue); }
.pill.warn { background: var(--amber); }
.pill.crit { background: var(--red-hi); color: #fff; }
.pill.off  { background: #555; color: #ddd; }

/* ── ALARM-LEISTE ── */
.alertbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 10px solid var(--blue2);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}
.alertbar.yellow { border-left-color: var(--amber); }
.alertbar.red { border-left-color: var(--red-hi); animation: pulse 1.2s ease-in-out infinite; }
.alertbar ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; text-transform: none; letter-spacing: .03em; }
.alertbar .level { font-weight: bold; white-space: nowrap; }

body.red-alert .top-pill:not(.purple),
body.red-alert .hd-orange,
body.red-alert .hd-orange2 { background: var(--red-hi); }
body.red-alert #sideAlert { animation: blink 1s steps(2) infinite; }

@keyframes pulse { 50% { background: #2a0a0e; } }
@keyframes blink { 50% { background: #550000; } }

/* Fußleiste wie auf der Startseite */
.bottom-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: .65rem;
  letter-spacing: .12em;
  color: #444;
  text-transform: uppercase;
}
.bottom-panel .stardate { color: var(--orange); font-size: .75rem; }

/* Bausteine der Startseite (Login) */
.panel-label { font-size: .6rem; letter-spacing: .2em; color: var(--blue); text-transform: uppercase; margin-bottom: 4px; }
.panel-title { font-size: clamp(1.4rem, 4vw, 2.4rem); color: var(--orange); letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; margin-bottom: 16px; }
.panel-title span { color: var(--amber); }
.divider-line { height: 2px; background: linear-gradient(to right, var(--orange), transparent); margin: 16px 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 12px; }
.info-block .label { font-size: .6rem; letter-spacing: .15em; color: var(--blue); text-transform: uppercase; margin-bottom: 4px; }
.info-block .value { font-size: .9rem; color: var(--amber); }
.readout { margin-top: 20px; font-size: .72rem; color: #555; line-height: 1.9; letter-spacing: .05em; }
.readout span { color: var(--blue); }

.error-banner { color: var(--red-hi); font-size: .75rem; letter-spacing: .1em; }

/* ── MOBIL ── */
@media (max-width: 700px) {
  .main { flex-direction: column; }
  .sidebar { flex-direction: row; width: auto; flex-wrap: wrap; }
  .sidebar .side-sep, .sidebar .tall { display: none; }
  .side-block { border-radius: 20px; padding: 8px 14px; flex: 1; text-align: center; }
  .top-pill.amber, .hd-amber, .top-pill.purple, .hd-purple, .top-pill.blue, .hd-blue { display: none; }
  .top-pill { width: 60px; }
  .hd-orange2 { width: 60px; }
  .top-meta { display: none; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* hidden-Attribut auch bei Elementen mit eigenem display respektieren */
[hidden] { display: none !important; }
