:root {
  --bg: #0b0f14;
  --surface: #121820;
  --surface-2: #182028;
  --surface-hover: #1c2530;
  --border: #232e3a;

  --text: #e9eef3;
  --text-dim: #92a0af;
  --text-faint: #5b6b7b;

  --gold: #e8b93f;
  --green: #4cc38a;
  --green-dim: #2f7a56;
  --red: #e2564f;
  --red-dim: #8f3733;
  --blue: #4f8fe2;

  --body: "Segoe UI", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: "Bahnschrift", "SF Pro Display", "Segoe UI Semibold", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  min-height: 100%;
}

button, input, select, textarea { font-family: inherit; color: inherit; }

a { color: var(--blue); }

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-mark { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.04em; }
.brand-mark-sub { color: var(--gold); }

.topbar-spacer { flex: 1; }
.topbar-user { color: var(--text-dim); font-size: 13px; margin-right: 14px; }

.page { max-width: 1080px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card h2 { margin-top: 0; font-size: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--surface-hover); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #1b1400; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-small { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--red); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.table tr:hover td { background: var(--surface-2); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.badge-green { color: var(--green); border-color: var(--green-dim); }
.badge-red { color: var(--red); border-color: var(--red-dim); }

.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row label { font-size: 12px; color: var(--text-dim); }
.form-row input, .form-row select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 22px; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.hidden { display: none !important; }

.empty-state { color: var(--text-faint); padding: 30px 0; text-align: center; }
.text-dim { color: var(--text-dim); }
.error-text { color: var(--red); font-size: 13px; margin-top: 6px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; width: 100%; max-width: 360px; text-align: center; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 18px; }

.diff-added { color: var(--green); }
.diff-dropped { color: var(--red); text-decoration: line-through; }
