/* glance-gate admin — terminal-themed, shares the landing's palette */

:root {
  --bg: #06090a;
  --bg-pane: #0b1114;
  --bg-elev: #0f1719;
  --bg-card: #0a1214;
  --bar-edge: #212a2e;
  --rule: #1a2226;
  --fg: #d6dde1;
  --fg-soft: #adb5ba;
  --fg-muted: #6f7a80;
  --fg-dim: #4d575b;
  --accent: #4ade80;
  --accent-2: #22d3ee;
  --accent-3: #a78bfa;
  --warn: #fbbf24;
  --err: #f87171;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Monaco,
    Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
/* hidden must beat display rules like .login{display:flex} / .badge{display:inline-block} */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #1f4d3a; color: #e5fbef; }

.muted { color: var(--fg-muted); }
.small { font-size: 12px; }
.err { color: var(--err); }
.ok { color: var(--accent); }
.warn { color: var(--warn); }
code {
  background: #111819;
  border: 1px solid var(--rule);
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ── top bar ── */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(to bottom, #1a2125, #11171a);
  border-bottom: 1px solid var(--bar-edge);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.bar-title { margin-left: 6px; font-size: 13px; font-weight: 600; }
.health {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.health b { color: var(--accent); font-weight: 600; }
.health.bad b { color: var(--err); }

/* ── buttons ── */
button { font: inherit; cursor: pointer; }
.btn {
  background: linear-gradient(135deg, rgba(74,222,128,0.18), rgba(34,211,238,0.14));
  border: 1px solid rgba(74,222,128,0.4);
  color: var(--accent);
  padding: 7px 14px;
  border-radius: 6px;
  transition: border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}
.btn:hover { border-color: var(--accent); color: #d2ffe2; }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--bar-edge);
  color: var(--fg-soft);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  transition: border-color 120ms ease, color 120ms ease;
}
.btn-ghost:hover { border-color: var(--rule); color: var(--fg); }

/* ── inputs ── */
input, select {
  font: inherit;
  font-size: 13px;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 7px 10px;
}
input:focus, select:focus { outline: none; border-color: var(--accent-2); }
input::placeholder { color: var(--fg-dim); }

.screen { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }

/* ── login ── */
.login { display: flex; justify-content: center; padding-top: 8vh; }
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-pane);
  border: 1px solid var(--bar-edge);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 { margin: 0; font-size: 17px; color: var(--accent); }
.login-card p { margin: 0; font-size: 12.5px; }
.login-card input { width: 100%; }
.login-card .btn { width: 100%; padding: 9px; }

/* ── tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--fg-muted);
  padding: 9px 16px;
  border-radius: 7px 7px 0 0;
  font-size: 13px;
}
.tab:hover { color: var(--fg-soft); }
.tab.active {
  color: var(--accent);
  background: var(--bg-elev);
  border-color: var(--rule);
}
.badge {
  display: inline-block;
  margin-left: 7px;
  background: var(--warn);
  color: #1a1205;
  font-size: 10.5px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 999px;
}

/* ── panels ── */
.panel { display: none; }
.panel.active { display: block; animation: fade 200ms ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.panel-hint {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--fg-muted);
  line-height: 1.6;
}
.panel-hint b { color: var(--fg-soft); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.toolbar label, .learn-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.toolbar input, .toolbar select { min-width: 130px; }

/* ── learn form ── */
.learn-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin-bottom: 16px;
}
.learn-form label.full input { width: 100%; }
.learn-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.learn-row input, .learn-row select { width: 100%; }
.learn-form .btn { align-self: flex-start; padding: 9px 20px; }

/* ── output / cards ── */
.out { display: flex; flex-direction: column; gap: 12px; }
.count-row {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-elev);
}
.card-actions { margin-left: auto; display: flex; gap: 8px; }
.tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--fg-soft);
  text-transform: lowercase;
  letter-spacing: 0.03em;
}
.tag-scope { color: var(--accent-2); border-color: rgba(34,211,238,0.35); }
.tag-active { color: var(--accent); border-color: rgba(74,222,128,0.4); }
.tag-pending { color: var(--warn); border-color: rgba(251,191,36,0.4); }
.tag-raw { color: var(--fg-muted); }
.card-meta { font-size: 11px; color: var(--fg-dim); }
.card pre {
  margin: 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fg-soft);
  max-height: 420px;
  overflow: auto;
}
.empty {
  padding: 28px;
  text-align: center;
  color: var(--fg-dim);
  border: 1px dashed var(--rule);
  border-radius: 8px;
}

/* ── toast ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--bar-edge);
  border-left: 3px solid var(--accent);
  color: var(--fg);
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 13px;
  max-width: 90vw;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
.toast.err { border-left-color: var(--err); }
.toast.work { border-left-color: var(--accent-2); }

.spin { display: inline-block; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
