/* ═══════════════════════════════════════════════════════════════════
   admin.jasonholweg.de · v1
   Dark dashboard themed after jasonholweg.de v2
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --c-cyan:    #4ecdc4;
  --c-purple:  #a855f7;
  --c-amber:   #fbbf24;
  --c-magenta: #f472b6;
  --c-green:   #10b981;
  --c-blue:    #3b82f6;
  --c-red:     #ff6b6b;

  --bg:           #06060f;
  --bg-2:         #0a0a18;
  --bg-3:         #0d0d1a;
  --surface:      rgba(255, 255, 255, 0.04);
  --surface-h:    rgba(255, 255, 255, 0.08);
  --border:       rgba(255, 255, 255, 0.10);
  --border-h:     rgba(255, 255, 255, 0.18);

  --text:         #f4f6ff;
  --text-muted:   rgba(244, 246, 255, 0.62);
  --text-dim:     rgba(244, 246, 255, 0.32);

  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;

  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 14px 40px rgba(0, 0, 0, 0.5);

  --side-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse at top left, rgba(168, 85, 247, 0.12), transparent 40%),
    radial-gradient(ellipse at bottom right, rgba(78, 205, 196, 0.10), transparent 45%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

/* ── KICKER / LABELS ───────────────────────────── */
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-cyan);
  display: inline-block;
}

/* ═══ AUTH PAGES (login + setup) ═══════════════ */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}
.auth { width: 100%; max-width: 460px; }
.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow);
  position: relative;
}
.auth-card::before, .auth-card::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 1px solid var(--c-cyan);
}
.auth-card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.auth-card::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.auth-head { margin-bottom: 1.75rem; }
.auth-title {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0.4rem 0 0.25rem;
  letter-spacing: -0.02em;
}
.auth-sub { color: var(--text-muted); font-family: var(--mono); font-size: 12px; margin: 0; }
.auth-form { display: grid; gap: 1rem; }
.auth-foot { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.auth-meta { color: var(--text-dim); font-family: var(--mono); font-size: 11px; }
.auth-text { color: var(--text-muted); font-size: 13px; }

.field { display: grid; gap: 0.4rem; }
.field-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus {
  outline: none;
  border-color: var(--c-cyan);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}
.field-input.mono { font-family: var(--mono); letter-spacing: 0.2em; font-size: 18px; text-align: center; }
.field-input[readonly] { color: var(--text-muted); }

.btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 0.6rem;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-h); background: var(--surface); }
.btn-solid {
  background: linear-gradient(135deg, var(--c-cyan), var(--c-purple));
  border-color: transparent;
  color: var(--bg);
  font-weight: 600;
}
.btn-solid:hover { filter: brightness(1.1); }
.arr { font-family: var(--mono); }

.alert { padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 1rem; border: 1px solid; }
.alert-err { background: rgba(255, 107, 107, 0.08); border-color: rgba(255, 107, 107, 0.4); color: #ffaaaa; }
.alert-ok  { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }

.totp-box { display: grid; gap: 1rem; }
.qr-wrap { display: grid; place-items: center; padding: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qr { display: block; border-radius: 6px; }
.manual { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.manual summary { cursor: pointer; padding: 0.4rem 0; }
.secret { display: block; padding: 0.6rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; font-size: 13px; word-break: break-all; }

/* ═══ APP SHELL ═══════════════════════════════════ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--side-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex; flex-direction: column;
  z-index: 10;
}
.brand {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex; align-items: center; gap: 0.35rem;
  margin-bottom: 1.75rem;
  letter-spacing: 0.04em;
}
.brand-bracket { color: var(--c-cyan); }
.brand-dim     { color: var(--text-muted); font-weight: 400; }
.nav-section {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--text-dim); margin-bottom: 0.6rem; padding: 0 0.5rem;
}
.nav { display: flex; flex-direction: column; gap: 0.15rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--mono); font-size: 13px;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.is-active {
  background: var(--surface-h);
  color: var(--text);
  border-color: var(--border);
}
.nav-item.is-active .nav-icon { color: var(--c-cyan); }
.nav-icon { color: var(--text-dim); width: 18px; text-align: center; font-size: 14px; transition: color 0.15s; }

.nav-item--ext { position: relative; }
.nav-item--ext .nav-icon { color: var(--c-magenta); }
.nav-item--ext:hover { background: rgba(244, 114, 182, 0.08); border-color: rgba(244, 114, 182, 0.25); color: var(--text); }
.nav-ext-arr { margin-left: auto; color: var(--text-dim); font-family: var(--mono); font-size: 12px; transition: transform 0.15s, color 0.15s; }
.nav-item--ext:hover .nav-ext-arr { color: var(--c-magenta); transform: translate(2px, -2px); }

.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px dashed var(--border); }
.user { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; font-family: var(--mono); font-size: 12px; }
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 8px var(--c-green); }
.user-mail { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.logout-form { margin: 0; }
.logout-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--mono); font-size: 11px; padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm); cursor: pointer; width: 100%; text-align: left;
  transition: border-color 0.15s, color 0.15s;
}
.logout-btn:hover { color: var(--c-red); border-color: rgba(255,107,107,0.4); }
.meta { color: var(--text-dim); font-family: var(--mono); font-size: 10px; margin-top: 0.65rem; }

.main { margin-left: var(--side-w); padding: 2rem 2.25rem 4rem; min-height: 100vh; }

@media (max-width: 880px) {
  .sidebar { position: static; width: auto; flex-direction: row; flex-wrap: wrap; padding: 1rem; }
  .brand { margin-bottom: 0; margin-right: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-section { display: none; }
  .sidebar-foot { width: 100%; margin-top: 0.75rem; padding-top: 0.75rem; }
  .main { margin-left: 0; padding: 1.25rem; }
}

/* ── PAGE HEAD ────────────────────────────────── */
.page-head { margin-bottom: 2rem; }
.page-title {
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.25rem;
}
.page-sub { color: var(--text-muted); font-family: var(--mono); font-size: 13px; margin: 0; }

/* ── KPI GRID ─────────────────────────────────── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem; margin-bottom: 2rem;
}
.kpi {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.kpi:hover { border-color: var(--border-h); transform: translateY(-2px); }
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--c-cyan);
}
.kpi[data-accent="purple"]::before  { background: var(--c-purple); }
.kpi[data-accent="amber"]::before   { background: var(--c-amber); }
.kpi[data-accent="magenta"]::before { background: var(--c-magenta); }
.kpi[data-accent="green"]::before   { background: var(--c-green); }
.kpi[data-accent="blue"]::before    { background: var(--c-blue); }
.kpi[data-accent="red"]::before     { background: var(--c-red); }

.kpi-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.kpi-value {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.kpi-sub {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 0.4rem;
}

/* ── CARD / PANEL ─────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
}
.card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
}
.card-title {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
}
.card-meta { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
@media (max-width: 980px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.chart-wrap { position: relative; height: 280px; }
.chart-wrap.tall { height: 340px; }

/* ── TABLE ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.table th, .table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); font-weight: 500;
}
.table td { font-family: var(--mono); color: var(--text); }
.table tr:hover td { background: var(--surface); }
.table .num { text-align: right; }
.table .dim { color: var(--text-muted); }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface);
}
.badge-cyan    { color: var(--c-cyan);    border-color: rgba(78,205,196,0.4);  background: rgba(78,205,196,0.08); }
.badge-purple  { color: var(--c-purple);  border-color: rgba(168,85,247,0.4);  background: rgba(168,85,247,0.08); }
.badge-amber   { color: var(--c-amber);   border-color: rgba(251,191,36,0.4);  background: rgba(251,191,36,0.08); }
.badge-magenta { color: var(--c-magenta); border-color: rgba(244,114,182,0.4); background: rgba(244,114,182,0.08); }
.badge-green   { color: var(--c-green);   border-color: rgba(16,185,129,0.4);  background: rgba(16,185,129,0.08); }
.badge-red     { color: var(--c-red);     border-color: rgba(255,107,107,0.4); background: rgba(255,107,107,0.08); }
.badge-dim     { color: var(--text-dim);  border-color: var(--border); }

/* ── ACTIVITY FEED ─────────────────────────────── */
.feed { display: grid; gap: 0.5rem; }
.feed-item {
  display: grid; grid-template-columns: 90px 80px 1fr; gap: 1rem;
  padding: 0.7rem 0.85rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 12px;
  align-items: baseline;
}
.feed-item:hover { border-color: var(--border-h); background: var(--bg-3); }
.feed-time { color: var(--text-dim); }
.feed-source { font-weight: 600; }
.feed-source.veblo { color: var(--c-cyan); }
.feed-source.ogf   { color: var(--c-magenta); }
.feed-source.crm   { color: var(--c-amber); }
.feed-text { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) {
  .feed-item { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ── EXT CARD (link out to studio etc.) ───────── */
.ext-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.1rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(244,114,182,0.08), rgba(168,85,247,0.05));
  border: 1px solid rgba(244,114,182,0.25);
  border-radius: var(--radius);
  color: var(--text);
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}
.ext-card:hover {
  transform: translateY(-2px);
  border-color: rgba(244,114,182,0.55);
  background: linear-gradient(135deg, rgba(244,114,182,0.14), rgba(168,85,247,0.08));
}
.ext-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(244,114,182,0.15);
  color: var(--c-magenta);
  font-size: 22px; font-family: var(--mono);
}
.ext-card-kicker {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--c-magenta); margin-bottom: 0.25rem;
}
.ext-card-title {
  font-family: var(--mono); font-size: 1rem; font-weight: 600; color: var(--text);
}
.ext-card-sub {
  font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-top: 0.2rem;
}
.ext-card-sub code { color: var(--c-cyan); background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.ext-card-arr {
  font-family: var(--mono); font-size: 1.4rem; color: var(--text-dim); transition: color 0.18s, transform 0.18s;
}
.ext-card:hover .ext-card-arr { color: var(--c-magenta); transform: translate(3px, -3px); }

/* ── EMPTY STATE ──────────────────────────────── */
.empty {
  padding: 2rem; text-align: center; color: var(--text-dim);
  font-family: var(--mono); font-size: 12px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
