/* OpenPipe dashboard — dark modern theme, no external assets */
:root {
  --bg: #070b14;
  --bg-soft: #0c1220;
  --panel: rgba(148, 163, 210, 0.05);
  --panel-solid: #0e1526;
  --border: rgba(148, 163, 210, 0.14);
  --border-strong: rgba(148, 163, 210, 0.28);
  --text: #e7ebf6;
  --muted: #8b94ab;
  --accent: #7c6cff;
  --accent-2: #22d3ee;
  --grad: linear-gradient(135deg, #7c6cff 0%, #22d3ee 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(124, 108, 255, 0.14), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(34, 211, 238, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent-2); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(124, 108, 255, 0.35); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 210, 0.25); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Layout ─────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(14, 21, 38, 0.9), rgba(10, 15, 28, 0.95));
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(124, 108, 255, 0.45);
}
.brand-logo svg { width: 20px; height: 20px; color: #fff; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500;
  border: none; background: none; width: 100%; text-align: left;
  transition: all 0.15s ease; font-size: 13.5px;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: rgba(148, 163, 210, 0.08); }
.nav-item.active { color: #fff; background: rgba(124, 108, 255, 0.16); box-shadow: inset 2px 0 0 var(--accent); }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.nav-foot { margin-top: auto; padding: 10px 12px; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--border); }
.main { flex: 1; padding: 26px 30px 60px; max-width: 1240px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 700; letter-spacing: 0.2px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ── Cards & panels ─────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 16px; height: 16px; color: var(--accent); }

/* ── Forms ──────────────────────────────────────────────── */
label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 6px; font-weight: 500; }
label:first-child { margin-top: 0; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  background: rgba(10, 15, 28, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 110px; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.18); }
select option { background: var(--panel-solid); }
input[type="range"] { accent-color: var(--accent); padding: 0; border: none; background: none; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.form-row .grow-2 { flex: 2; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 210, 0.08);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  transition: all 0.15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: rgba(148, 163, 210, 0.16); border-color: var(--border-strong); }
.btn.primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 4px 18px rgba(124, 108, 255, 0.35); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { border-color: rgba(248, 113, 113, 0.4); color: var(--err); background: rgba(248, 113, 113, 0.08); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.16); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ── Login ──────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 380px; max-width: 100%;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.login-logo { width: 52px; height: 52px; border-radius: 14px; background: var(--grad); display: grid; place-items: center; margin: 0 auto 16px; box-shadow: 0 8px 26px rgba(124, 108, 255, 0.5); }
.login-logo svg { width: 28px; height: 28px; color: #fff; }
.login-card h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }

/* ── Status badges / chips ──────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); }
.chip.ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.chip.err { color: var(--err); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.chip.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.chip.muted { color: var(--muted); }

/* ── Stats ──────────────────────────────────────────────── */
.stat-card { padding: 16px 18px; }
.stat-card .num { font-size: 26px; font-weight: 700; letter-spacing: 0.3px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-card .lbl { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin-top: 12px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--accent), rgba(124, 108, 255, 0.25)); border-radius: 5px 5px 0 0; min-height: 3px; position: relative; transition: height 0.4s; }
.bar:hover::after { content: attr(data-tip); position: absolute; top: -26px; left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; z-index: 5; }
.bar-labels { display: flex; gap: 6px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }

/* ── Tables ─────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 9px 10px; border-bottom: 1px solid rgba(148, 163, 210, 0.07); vertical-align: middle; }
tr:hover td { background: rgba(148, 163, 210, 0.04); }
.mono { font-family: var(--mono); font-size: 12px; }
.tbl-wrap { overflow-x: auto; }
.preview { color: var(--muted); font-size: 12.5px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Keys ───────────────────────────────────────────────── */
.key-box {
  background: rgba(10, 15, 28, 0.9);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 0 24px rgba(124, 108, 255, 0.25);
}
.check-list { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.check-list label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--text); cursor: pointer; }
.check-list input { accent-color: var(--accent); width: 15px; height: 15px; }
.key-cell { min-width: 300px; }
.key-line { display: flex; align-items: center; gap: 8px; }
.keyval { font-size: 12px; word-break: break-all; }
.key-btns { display: inline-flex; gap: 4px; flex-shrink: 0; }
.btn.icon { padding: 5px; line-height: 0; }
.btn.icon svg { width: 15px; height: 15px; }

/* ── Result blocks ──────────────────────────────────────── */
.result-box {
  margin-top: 16px;
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.result-box .rb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.result-box .rb-head .t { font-weight: 600; font-size: 13.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
audio, video { width: 100%; margin-top: 10px; border-radius: 10px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.img-grid figure { margin: 0; }
.img-grid img { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; }
.img-grid figcaption { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.txt-out { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; max-height: 300px; overflow-y: auto; background: rgba(0,0,0,0.25); border-radius: 8px; padding: 12px; border: 1px solid var(--border); }

/* ── Drop zone ──────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 10px;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--text); background: rgba(124, 108, 255, 0.06); }
.dropzone .fname { color: var(--accent-2); font-family: var(--mono); font-size: 12.5px; }

/* ── Toasts ─────────────────────────────────────────────── */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  max-width: 380px;
  animation: slideIn 0.2s ease;
}
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--ok); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Misc ──────────────────────────────────────────────── */
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: rot 0.7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.flex { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
code, .code { font-family: var(--mono); font-size: 12.5px; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
pre { font-family: var(--mono); font-size: 12.5px; background: rgba(0,0,0,0.35); border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow-x: auto; line-height: 1.55; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 13.5px; }
.tag { display: inline-block; background: rgba(124, 108, 255, 0.14); color: #b8aeff; border-radius: 6px; padding: 1px 8px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.warnbox { background: rgba(255, 176, 32, 0.08); border: 1px solid rgba(255, 176, 32, 0.35); color: #ffc94d; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }

@media (max-width: 860px) {
  .sidebar { width: 60px; padding: 12px 8px; }
  .sidebar .brand-name, .sidebar .brand-sub, .sidebar .nav-item span, .sidebar .nav-foot { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .main { padding: 18px 14px 50px; }
}
