/* Zorvex Command Center: eigenstaendiges CSS, kein Build-Schritt, kein
   Framework -- gleiche Designsprache wie /var/www/lagersystem (Industrial
   Dark/Orange), aber standardmaessig dunkel (Command-Center-Charakter statt
   Buero-App), keine 1:1-Kopie der Tokens/Datei. */

:root {
  --background: #0a0a0c;
  --card: #16161a;
  --foreground: #f1f5f9;
  --muted-foreground: #8f8f99;
  --border: #2a2a30;
  --ring: #52525b;
  --radius: 10px;

  --slate-bg: #232328; --slate-fg: #cbd5e1; --slate-bd: #3f3f46;
  --amber-bg: #3a2504; --amber-fg: #fcd34d; --amber-bd: #92400e;
  --sky-bg: #082f49; --sky-fg: #7dd3fc; --sky-bd: #075985;
  --emerald-bg: #052e1f; --emerald-fg: #6ee7b7; --emerald-bd: #065f46;
  --red-bg: #2a0e0e; --red-fg: #fca5a5; --red-bd: #b91c1c;

  /* Orange-Akzent -- die Markenfarbe des Command Centers. */
  --accent: #f97316; --accent-fg: #2a0e02; --accent-bg: #3a1a06; --accent-bd: #c2410c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 22px; font-weight: 700; margin: 0; }
h2 { font-size: 14px; font-weight: 600; color: var(--muted-foreground); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .02em; }
p { margin: 0; }
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { padding: 16px; font-size: 17px; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-brand.row-between { justify-content: space-between; }
.version-pill { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; color: var(--muted-foreground); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--foreground);
}
.sidebar-link:hover { background: var(--slate-bg); }
.sidebar-link.active { background: var(--accent); color: var(--accent-fg); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.avatar {
  width: 32px; height: 32px; border-radius: 999px; background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.sidebar-footer { padding: 8px 16px; border-top: 1px solid var(--border); }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--card); }
.main-content { flex: 1; padding: 24px; }

.admin-nav-toggle { display: none; background: transparent; border: 1px solid var(--border); border-radius: 8px; width: 40px; height: 40px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--foreground); align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-backdrop { display: none; }
@media (max-width: 860px) {
  .admin-nav-toggle { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  .sidebar.sidebar-open { transform: translateX(0); }
  .sidebar-backdrop.sidebar-open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 59; }
  .main-content { padding: 16px; }
  .topbar { padding: 10px 14px; }
}
@media (max-width: 480px) {
  .main-content { padding: 12px; }
  h1 { font-size: 19px; }
}

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.card-header { padding: 16px 16px 0; }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px; }
.card-body-flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid-3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge-slate { background: var(--slate-bg); color: var(--slate-fg); border-color: var(--slate-bd); }
.badge-amber { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-bd); }
.badge-sky { background: var(--sky-bg); color: var(--sky-fg); border-color: var(--sky-bd); }
.badge-emerald { background: var(--emerald-bg); color: var(--emerald-fg); border-color: var(--emerald-bd); }
.badge-red { background: var(--red-bg); color: var(--red-fg); border-color: var(--red-bd); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; border: 1px solid transparent; font-size: 13px; font-weight: 600;
  padding: 8px 14px; cursor: pointer; background: var(--accent); color: var(--accent-fg);
  min-height: 40px;
}
.btn:hover { opacity: .85; }
.btn-ghost { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 12px; }
.btn-lg { padding: 12px 18px; min-height: 48px; font-size: 15px; }
.btn-block { width: 100%; }

/* Forms */
label, .label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 15px; background: #0f0f12; color: var(--foreground); font-family: inherit;
  min-height: 44px; /* Touch-Target */
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { margin-bottom: 14px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }

table { font-size: 13px; }

/* ---- Overview-Dashboard: System Pulse, Stat-Kacheln, Sentinel, Kategorien ---- */

.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.pulse-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.pulse-gauge {
  --pulse-color: var(--emerald-fg);
  width: 110px; height: 110px; border-radius: 999px; flex-shrink: 0;
  background: conic-gradient(var(--pulse-color) calc(var(--pulse-pct, 100) * 1%), var(--slate-bg) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.pulse-gauge::before {
  content: ""; position: absolute; inset: 8px; border-radius: 999px; background: var(--card);
}
.pulse-gauge-label { position: relative; z-index: 1; text-align: center; }
.pulse-gauge-pct { font-size: 22px; font-weight: 800; line-height: 1; }
.pulse-gauge-sub { font-size: 10px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

.pulse-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); font-weight: 700; }
.pulse-status { font-size: 26px; font-weight: 800; margin-top: 2px; }
.pulse-status.is-healthy { color: var(--emerald-fg); }
.pulse-status.is-warning { color: var(--amber-fg); }
.pulse-status.is-critical { color: var(--red-fg); }

.stat-row { display: flex; gap: 28px; flex-wrap: wrap; margin-left: auto; }
.stat-tile { text-align: center; min-width: 64px; }
.stat-tile-value { font-size: 22px; font-weight: 800; line-height: 1; }
.stat-tile-value.is-critical { color: var(--red-fg); }
.stat-tile-value.is-warning { color: var(--amber-fg); }
.stat-tile-label { font-size: 11px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; white-space: nowrap; }

.category-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 960px) { .category-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .category-tiles { grid-template-columns: repeat(2, 1fr); } }
.category-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; text-align: center; border-top: 3px solid var(--slate-bd);
}
.category-tile.is-ok { border-top-color: var(--emerald-bd); }
.category-tile.is-warning { border-top-color: var(--amber-bd); }
.category-tile.is-critical { border-top-color: var(--red-bd); }
.category-tile-icon { font-size: 22px; }
.category-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted-foreground); margin-top: 6px; }
.category-tile-status { font-size: 13px; font-weight: 700; margin-top: 4px; }

.sentinel-item { display: flex; gap: 12px; padding: 12px; border-radius: 8px; border: 1px solid var(--border); border-left-width: 4px; align-items: flex-start; }
.sentinel-item.sev-critical { border-left-color: var(--red-bd); background: rgba(185,28,28,.08); }
.sentinel-item.sev-warning { border-left-color: var(--amber-bd); background: rgba(146,64,14,.08); }
.sentinel-item-body { flex: 1; min-width: 0; }
.sentinel-item-title { font-weight: 700; font-size: 13px; }
.sentinel-item-meta { font-size: 11px; color: var(--muted-foreground); margin-top: 1px; }
.sentinel-item-msg { font-size: 13px; margin-top: 4px; }
.sentinel-item-time { font-size: 11px; color: var(--muted-foreground); white-space: nowrap; }

.coming-soon-tile {
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 16px; text-align: center; color: var(--muted-foreground);
}
.coming-soon-tile .icon { font-size: 20px; display: block; margin-bottom: 6px; }
