:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-border: #272b35;
  --text: #e6e8ec;
  --text-dim: #9aa2b1;
  --accent: #4f8cff;
  --accent-dim: #2f5fb8;
  --danger: #e5484d;
  --danger-dim: #8c2e31;
  --ok: #3ecf8e;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

[hidden] { display: none !important; }

.centered-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 360px;
}

.auth-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.auth-card p.subtitle {
  color: var(--text-dim);
  margin: 0 0 20px;
  font-size: 13px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin: 12px 0 4px;
}

input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: #0c0e12;
  color: var(--text);
  font-size: 14px;
}

input:focus { outline: 1px solid var(--accent); }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 500;
  background: var(--accent);
  color: white;
}

button:hover { background: var(--accent-dim); }
button.secondary { background: #262a33; }
button.secondary:hover { background: #313642; }
button.danger { background: var(--danger); }
button.danger:hover { background: var(--danger-dim); }
button:disabled { opacity: .5; cursor: default; }

.full-width { width: 100%; margin-top: 16px; }

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  min-height: 0;
}

.app-shell {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  font-weight: 600;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 12px;
}

.sidebar nav a {
  display: block;
  padding: 10px 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}

.sidebar nav a.active {
  color: var(--text);
  background: #1f232c;
  border-right: 2px solid var(--accent);
}

.sidebar .spacer { flex: 1; }
.sidebar .logout { padding: 0 20px; }

.main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 32px;
  max-width: 1100px;
}

.main h2 { margin-top: 0; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--panel-border);
}

th { color: var(--text-dim); font-weight: 500; background: #1b1e26; }
tr:last-child td { border-bottom: none; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-dim); }

.repo-group { margin-bottom: 18px; }
.repo-group h3 { margin: 0 0 6px; font-size: 15px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #262a33;
  color: var(--text-dim);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 480px;
}

.modal h3 { margin-top: 0; }

.code-block {
  background: #0c0e12;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  word-break: break-all;
  margin: 8px 0;
  position: relative;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.empty-state {
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 20;
}
.toast.error { border-color: var(--danger); }
