/* MENSIO Corporate Design – identisch zu "MENSIO Lager & Disposition":
   dunkle Kopfleiste (#0f172a), Teal-Akzent (#0d9488 / #14b8a6), Slate-Grautöne, Inter, 13px. */
:root {
  --navy: #0f172a; --navy-2: #1e293b; --navy-3: #334155;
  --teal: #0d9488; --teal-light: #14b8a6; --teal-dark: #0f766e; --teal-bg: #f0fdf9; --teal-line: #ccfbef;
  --bg: #f8fafc; --surface: #ffffff; --text: #1e293b; --strong: #0f172a; --muted: #64748b;
  --line: #e2e8f0; --line-soft: #f1f5f9; --input: #cbd5e1;
  --ok: #047857; --okbg: #d1fae5; --warn: #b45309; --warnbg: #fef3c7; --bad: #be123c; --badbg: #ffe4e6;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-dark); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

/* Zählernummern, DevEUIs, Stände: Tabellenziffern, offene Null ohne Punkt (wie Lager-App) */
.mono, .num, td.num, .stat .v {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "zero" 0, "cv05" 1; letter-spacing: 0.02em;
}
.mono { word-break: break-all; }

/* --- Kopfleiste -------------------------------------------------------- */
header {
  background: var(--navy); color: #fff; padding: 8px 18px; height: 52px; border-bottom: 1px solid var(--navy-2);
  display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .title { font-weight: 700; font-size: 14px; }
.brand .sub { font-size: 10.5px; color: #94a3b8; font-weight: 400; line-height: 1.2; }
.logo-badge {
  width: 32px; height: 32px; border-radius: 8px; background: var(--teal-light); color: #042f2e;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0;
}
header nav {
  display: flex; align-items: center; gap: 4px; background: var(--navy-2); padding: 3px; border-radius: 9px;
  border: 1px solid var(--navy-3); margin-left: 6px; overflow-x: auto;
}
header nav a {
  padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; color: #cbd5e1; white-space: nowrap;
  border: 1px solid transparent; transition: all .15s;
}
header nav a:hover { background: var(--navy-3); color: #fff; text-decoration: none; }
header nav a.active { background: var(--teal); color: #fff; border-color: var(--teal-light); }
.nav-count { background: #dc2626; color: #fff; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700;
             margin-left: 4px; font-variant-numeric: tabular-nums; }
header .user { margin-left: auto; color: #94a3b8; font-size: 12px; white-space: nowrap; }
header .user a { color: #5eead4; }
@media (max-width: 1100px) { .brand .sub { display: none; } }

/* --- Inhalt ------------------------------------------------------------ */
main { padding: 20px 22px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 18px; font-weight: 700; color: var(--strong); margin: 0 0 14px; }
h2 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--teal-dark);
     margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 1px 2px rgba(0,0,0,.03);
  padding: 14px 16px; margin-bottom: 14px;
}
.card h2:first-child { margin-top: 0; border-bottom: 1px solid var(--teal-line); padding-bottom: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03); color: var(--text); font-weight: 400; transition: border-color .15s;
}
a.stat:hover { border-color: var(--teal-light); text-decoration: none; }
.stat .v { font-size: 24px; font-weight: 700; color: var(--strong); }
.stat .l { color: var(--muted); font-size: 12px; }

/* --- Tabellen ----------------------------------------------------------- */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; overflow: auto; max-height: 75vh;
             box-shadow: 0 1px 2px rgba(0,0,0,.03); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
     padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 1; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12px; vertical-align: middle; background: var(--surface); }
tr:hover td { background: var(--teal-bg); }
td.num, th.num { text-align: right; }

/* --- Status-Badges -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 11px;
         font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.ok { background: var(--okbg); color: var(--ok); border-color: #a7f3d0; }
.badge.warn { background: var(--warnbg); color: var(--warn); border-color: #fde68a; }
.badge.bad { background: var(--badbg); color: var(--bad); border-color: #fecdd3; }
.badge.muted { background: var(--line-soft); color: var(--muted); border-color: var(--line); }
.muted { color: var(--muted); }
.crit { display: inline-flex; width: 20px; height: 20px; border-radius: 6px; align-items: center; justify-content: center;
        font-weight: 700; font-size: 12px; }
.crit.ok { background: var(--okbg); color: var(--ok); }
.crit.bad { background: var(--badbg); color: var(--bad); }
.crit.muted { background: var(--line-soft); color: var(--muted); }
.crit-text { font-size: 11px; color: var(--bad); }
.error { color: var(--bad); }

/* --- Formulare & Buttons ----------------------------------------------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
input, select, textarea {
  font: inherit; font-size: 12px; height: 36px; padding: 6px 11px; background: var(--bg); color: var(--strong);
  border: 1px solid var(--input); border-radius: 7px; outline: none; transition: all .15s;
}
input[type=file] { height: auto; padding: 6px; }
textarea { width: 100%; height: auto; min-height: 84px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 2px rgba(20,184,166,.18); }
button, .btn {
  font: inherit; font-size: 12px; font-weight: 600; height: 36px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--teal);
  background: var(--teal); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; white-space: nowrap; transition: background-color .15s;
}
button:hover, .btn:hover { background: var(--teal-light); text-decoration: none; }
.btn.secondary, button.secondary { background: #fff; color: #334155; border-color: var(--input); height: 34px; padding: 0 12px; }
.btn.secondary:hover, button.secondary:hover { background: var(--line-soft); }

/* --- Detailansichten ------------------------------------------------------ */
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0; font-size: 12px; }
dl.kv dt { color: var(--muted); font-weight: 500; }
dl.kv dd { margin: 0; color: var(--strong); font-weight: 600; min-width: 0; word-break: break-word; }
pre { background: var(--navy); color: #e2e8f0; padding: 12px 14px; border-radius: 11px; overflow: auto; font-size: 11.5px;
      max-height: 60vh; border: 1px solid var(--navy-2); }
.back { display: inline-block; margin-bottom: 8px; font-size: 12px; }

/* --- Anmeldung (wie Login-Overlay der Lager-App) ------------------------- */
body.login-page { min-height: 100vh; background: #020617; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #fff; border-radius: 14px; border: 1px solid var(--line); max-width: 420px; width: 100%; overflow: hidden;
              box-shadow: 0 25px 50px -12px rgba(0,0,0,.35); }
.login-head { background: var(--navy); color: #fff; padding: 20px 24px; display: flex; align-items: center; gap: 14px; }
.login-card form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.login-card input { width: 100%; }
.login-card button { width: 100%; font-size: 13px; }
.login-error { padding: 10px 12px; background: #fff1f2; border: 1px solid #fecdd3; color: var(--bad); border-radius: 8px; font-weight: 500; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--line-soft); }
::-webkit-scrollbar-thumb { background: var(--input); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
