/* ============================================================
 *  elamon.css — Gestaltung der Oberflaeche
 *
 *  Bootstrap liefert nur den Unterbau (Normalisierung, Raster).
 *  Aussehen und Verhalten kommen von hier.
 *
 *  Leitfarbe: Petrol #0f766e. Flach, 2px Rundung, dicht gesetzt.
 *  Schrift: IBM Plex, offline aus fonts/ — kein Aufruf ins Netz.
 * ============================================================ */

/* ---------------- Schriften ---------------- */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------------- Farben und Masse ---------------- */
:root {
  --petrol:      #0f766e;
  --petrol-dkl:  #0b5a54;
  --petrol-hell: #e6f2f1;

  --ok:   #15803d;
  --warn: #b45309;
  --crit: #b91c1c;
  --unk:  #64748b;

  --text:    #16202a;
  --text-schwach: #5b6b7a;
  --linie:   #d6dde3;
  --flaeche: #ffffff;
  --grund:   #f4f6f8;

  --radius: 2px;
  --dicht:  6px;
}

html { font-size: 15px; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--grund);
  color: var(--text);
  margin: 0;
}

.mono, code, pre, textarea.mono, input.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.92em;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 22px 0 8px; }
h3 { font-size: 1rem; margin: 0 0 10px; }

a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; }

.klein  { font-size: 0.82rem; color: var(--text-schwach); }
.nowrap { white-space: nowrap; }
.rechts { text-align: right; }
.gekuerzt { max-width: 38ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leer, .leer-inline { color: var(--text-schwach); }
.leer { padding: 10px 0; }

/* ---------------- Kopfleiste ---------------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: var(--petrol);
  color: #fff;
  padding: 0 16px;
  height: 44px;
}
.topbar .brand { font-weight: 700; letter-spacing: 0.02em; }
.topbar .brand .ver { font-weight: 400; opacity: 0.75; font-size: 0.8rem; }

.mainnav { display: flex; gap: 2px; flex: 1; }
.mainnav a {
  color: #d8ecea; padding: 0 12px; line-height: 44px;
  border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: #fff; text-decoration: none; background: var(--petrol-dkl); }
.mainnav a.on { color: #fff; border-bottom-color: #fff; font-weight: 600; }

.whoami { font-size: 0.85rem; color: #d8ecea; }
.whoami .role { opacity: 0.7; }
.whoami .logout { color: #fff; margin-left: 8px; text-decoration: underline; }

.page { padding: 14px 16px 40px; max-width: 1500px; }
.pagetitle { font-size: 1.25rem; margin: 0 0 12px; }

.footbar {
  border-top: 1px solid var(--linie);
  padding: 8px 16px; font-size: 0.78rem; color: var(--text-schwach);
}

/* ---------------- Meldungen ---------------- */
.msg {
  border-left: 3px solid var(--unk);
  background: var(--flaeche);
  padding: 7px 10px; margin: 0 0 10px;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.msg-ok   { border-left-color: var(--ok);   background: #f0fdf4; }
.msg-warn { border-left-color: var(--warn); background: #fffbeb; }
.msg-err  { border-left-color: var(--crit); background: #fef2f2; }
.msg-info { border-left-color: var(--petrol); background: var(--petrol-hell); }

/* ---------------- Status ---------------- */
.state { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; white-space: nowrap; }
.state i { width: 8px; height: 8px; border-radius: 50%; background: var(--unk); display: inline-block; }
.state-ok   i { background: var(--ok); }
.state-warn i { background: var(--warn); }
.state-crit i { background: var(--crit); }
.state-unk  i { background: var(--unk); }
.state-ok   { color: var(--ok); }
.state-warn { color: var(--warn); }
.state-crit { color: var(--crit); }
.state-unk  { color: var(--unk); }

.marke {
  display: inline-block; font-size: 0.7rem; padding: 0 5px;
  border: 1px solid var(--linie); border-radius: var(--radius);
  color: var(--text-schwach); margin-left: 6px; vertical-align: middle;
}
.marke-warn { border-color: var(--warn); color: var(--warn); }

/* ---------------- Knoepfe ---------------- */
.btn {
  display: inline-block;
  font-family: inherit; font-size: 0.85rem; line-height: 1.4;
  padding: 4px 10px;
  border: 1px solid var(--linie); border-radius: var(--radius);
  background: var(--flaeche); color: var(--text);
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: #eef2f4; text-decoration: none; color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn-primary:hover { background: var(--petrol-dkl); border-color: var(--petrol-dkl); color: #fff; }
.btn-gefahr { color: var(--crit); border-color: #e6c3c3; }
.btn-gefahr:hover { background: #fef2f2; color: var(--crit); }
.btn-klein { font-size: 0.78rem; padding: 2px 7px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-leer { border-color: transparent; background: transparent; color: var(--text-schwach); }

.knopfleiste { display: flex; gap: 8px; align-items: center; margin: 14px 0; }
.blaettern { display: flex; gap: 10px; align-items: center; margin: 10px 0; }

/* ---------------- Formulare ---------------- */
label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 2px; }
label.inline { display: inline; margin: 0 4px 0 8px; font-weight: 400; color: var(--text-schwach); }

input[type=text], input[type=password], input[type=email], input[type=search],
input[type=number], input[type=file], select, textarea {
  font-family: inherit; font-size: 0.88rem;
  padding: 4px 7px;
  border: 1px solid var(--linie); border-radius: var(--radius);
  background: var(--flaeche); color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--petrol);
  box-shadow: 0 0 0 2px var(--petrol-hell);
}
textarea { line-height: 1.45; resize: vertical; }

.feld { margin-bottom: 10px; }
.feldpaar { display: flex; gap: 12px; }
.feldpaar > .feld { flex: 1; }
.feld-schmal { flex: 0 0 70px; }
.feld-schmal input[type=checkbox] { width: auto; }
.formular { max-width: 760px; }

.erweitert {
  border: 1px solid var(--linie); border-radius: var(--radius);
  background: var(--flaeche); padding: 0 10px; margin: 12px 0;
}
.erweitert > summary {
  cursor: pointer; padding: 7px 0; font-size: 0.85rem; font-weight: 500;
  list-style: none;
}
.erweitert > summary::before { content: '\25B8\00a0'; color: var(--text-schwach); }
.erweitert[open] > summary::before { content: '\25BE\00a0'; }
.erweitert[open] { padding-bottom: 10px; }

/* ---------------- Werkzeugleiste / Suche ---------------- */
.werkzeugleiste {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; margin-bottom: 12px;
}
.suchform { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.suchform input[type=search] { width: 280px; }
.suchform select { width: auto; }
.suchform input[type=number] { width: 70px; }

/* ---------------- Tabellen ---------------- */
.tabelle-huelle { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.tab { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.tab th {
  text-align: left; font-weight: 600; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-schwach);
  border-bottom: 1px solid var(--linie);
  padding: 6px 10px; white-space: nowrap; background: #fafbfc;
}
.tab td { padding: 5px 10px; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
.tab tbody tr:last-child td { border-bottom: none; }
.tab tbody tr:hover { background: #fafbfc; }
.tab th.rechts, .tab td.rechts { text-align: right; }

.minitab { width: 100%; font-size: 0.82rem; border-collapse: collapse; }
.minitab td { padding: 2px 0; }
.minitab td + td { padding-left: 8px; }

.gruppe { margin-bottom: 18px; }
.gruppe h2 { display: flex; align-items: baseline; gap: 8px; }
.gruppe .anzahl {
  font-size: 0.72rem; font-weight: 400; color: var(--text-schwach);
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 0 5px;
}

.aktionen { display: table-cell; }
.aktionen > * { margin-left: 4px; }
.inlineform, .gruppenform { display: inline-flex; gap: 4px; align-items: center; }
.gruppenform input[type=text] { width: 120px; }

/* Aufklappende Ergebniszeile */
.ergebniszeile > td { background: #fbfcfd; }
.ergebnis:empty { display: none; }
.ergebnis { padding: 6px 0; }
.erg-kopf { margin-bottom: 6px; font-size: 0.88rem; }

/* ---------------- Kacheln ---------------- */
.kacheln {
  display: grid; gap: 10px; margin-bottom: 6px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.kachel {
  background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 10px 12px;
}
.kachel-kopf {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-schwach); margin-bottom: 6px;
}
.kachel-wert { font-size: 1rem; font-weight: 600; }
.kachel-wert.gross { font-size: 1.7rem; line-height: 1.1; }
.kachel-zusatz { font-size: 0.8rem; color: var(--text-schwach); margin-top: 4px; }

/* ---------------- Zwei Spalten (Editor) ---------------- */
.zweispalt { display: flex; gap: 18px; align-items: flex-start; }
.spalte-links { flex: 1 1 auto; min-width: 0; max-width: 820px; }
.spalte-rechts { flex: 0 0 330px; }
.klebend { position: sticky; top: 12px; }

.panel {
  background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px;
}
.panel-kopf {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-schwach); margin-bottom: 8px;
}

@media (max-width: 1000px) {
  .zweispalt { flex-direction: column; }
  .spalte-rechts { flex: 1 1 auto; width: 100%; }
  .klebend { position: static; }
}

/* ---------------- Kopierfeld ---------------- */
.kopierfeld { display: flex; gap: 6px; align-items: center; }
.kopierfeld input { flex: 1; background: #f7f9fa; }

/* ---------------- Reiter ---------------- */
.reiter { display: flex; gap: 2px; border-bottom: 1px solid var(--linie); margin-bottom: 14px; }
.reiter a {
  padding: 6px 14px; font-size: 0.88rem; color: var(--text-schwach);
  border: 1px solid transparent; border-bottom: none; margin-bottom: -1px;
}
.reiter a:hover { color: var(--text); text-decoration: none; }
.reiter a.on {
  background: var(--flaeche); color: var(--petrol); font-weight: 600;
  border-color: var(--linie); border-bottom: 1px solid var(--flaeche);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ---------------- Tooltip ("?") ---------------- */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 4px;
  border: 1px solid var(--linie); border-radius: 50%;
  font-size: 0.68rem; font-weight: 600; color: var(--text-schwach);
  cursor: help; position: relative; vertical-align: middle;
  background: var(--flaeche);
}
.tip:hover, .tip:focus { border-color: var(--petrol); color: var(--petrol); outline: none; }
.tip:hover::after, .tip:focus::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: 130%;
  transform: translateX(-50%);
  width: max-content; max-width: 300px;
  background: #16202a; color: #fff;
  font-size: 0.78rem; font-weight: 400; line-height: 1.4;
  padding: 6px 8px; border-radius: var(--radius);
  white-space: normal; text-align: left; z-index: 50;
}

/* ---------------- Dialog ---------------- */
.dlg {
  border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 16px 18px; min-width: 480px; max-width: 90vw;
  background: var(--flaeche); color: var(--text);
}
.dlg::backdrop { background: rgba(22, 32, 42, 0.35); }
.dlg .schritte { font-size: 0.85rem; margin: 12px 0 0; padding-left: 20px; }
.dlg .schritte li { margin-bottom: 3px; }
.dlg-fuss { margin-top: 14px; text-align: right; }

/* ---------------- Anmeldung ---------------- */
body.bare { background: var(--grund); }
.bare-main {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 20px;
}
.loginbox {
  background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 24px; width: 320px;
}
.loginbrand {
  font-weight: 700; font-size: 1.3rem; color: var(--petrol);
  text-align: center; margin-bottom: 18px; letter-spacing: 0.02em;
}
.loginbox label { margin-top: 10px; }
.loginbox .btn { margin-top: 18px; }
.bare-main .msg { width: 320px; }
