:root {
  --bg: #f4f6fb; --card: #fff; --ink: #1c2433; --muted: #7a8699;
  --line: #e6e9f0; --brand: #2f6bff; --brand-dark: #1f4fd0;
  --ok: #18a957; --warn: #e6a700; --err: #e23a3a; --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--err); margin-top: 8px; font-size: 13px; }
a { color: var(--brand); }
button { cursor: pointer; border: none; border-radius: 8px; padding: 9px 14px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 13px; }
button:hover { background: var(--brand-dark); }
button.ghost { background: #eef2fc; color: var(--brand); }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 500; }
button.danger { background: #fde8e8; color: var(--err); }
button.sm { padding: 6px 10px; font-size: 12px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; }
label { display: block; margin: 10px 0; font-weight: 600; font-size: 12px; color: #54607a; }
label input, label select, label textarea { margin-top: 5px; font-weight: 400; color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 340px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card h1 span { color: var(--brand); }
.login-card button { width: 100%; margin-top: 12px; }

/* layout */
#app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #0f1b33; color: #c6d2ea; padding: 18px 14px; display: flex; flex-direction: column; }
.sidebar .brand { font-size: 16px; margin-bottom: 18px; color: #fff; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.sidebar nav a { color: #c6d2ea; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-size: 13px; }
.sidebar nav a:hover { background: #1b2a47; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .user { font-size: 12px; display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid #243149; padding-top: 12px; }
.sidebar .user button { color: #8fa1c4; }
#newProjectBtn { background: #1b2a47; color: #c6d2ea; }
main { padding: 28px 34px; overflow: auto; }

h2 { margin: 0 0 4px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; margin: 18px 0; border-bottom: 1px solid var(--line); }
.tabs button { background: none; color: var(--muted); border-radius: 0; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12px; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 600; }
code, pre { background: #0f1b33; color: #d7e3ff; border-radius: 8px; }
pre { padding: 14px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
code { padding: 2px 6px; font-size: 12px; }
.badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge.ok { background: #e3f7ec; color: var(--ok); }
.badge.fail { background: #fde8e8; color: var(--err); }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.copy { cursor: pointer; }
