/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  line-height: 1.6;
}
a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Navbar === */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
.nav-brand a { color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 1.2rem; }
.nav-links a { color: #8b949e; font-size: 0.9rem; }
.nav-links a:hover { color: #e1e4e8; text-decoration: none; }
.nav-user { color: #58a6ff; font-size: 0.85rem; }

/* === Layout === */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* === Alerts === */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.5rem; font-size: 0.9rem; }
.alert-success { background: #0d1f0d; border: 1px solid #238636; color: #3fb950; }
.alert-error { background: #1f0d0d; border: 1px solid #da3633; color: #f85149; }

/* === Cards === */
.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-header h2 { font-size: 1.1rem; color: #e1e4e8; }
.card-header h3 { font-size: 1rem; color: #e1e4e8; }

/* === Grid === */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* === Stat boxes === */
.stat-box { text-align: center; padding: 1.5rem; }
.stat-box .stat-value { font-size: 2rem; font-weight: 700; color: #58a6ff; }
.stat-box .stat-label { font-size: 0.85rem; color: #8b949e; margin-top: 0.25rem; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #21262d;
  color: #e1e4e8;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: #30363d; text-decoration: none; }
.btn-primary { background: #238636; border-color: #238636; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn-danger { background: #da3633; border-color: #da3633; color: #fff; }
.btn-danger:hover { background: #f85149; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* === Forms === */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; color: #8b949e; margin-bottom: 0.4rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #e1e4e8;
  font-size: 0.9rem;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #58a6ff;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group small { display: block; color: #8b949e; font-size: 0.8rem; margin-top: 0.3rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input { width: auto; }

/* === Tables === */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid #21262d; font-size: 0.875rem; }
th { color: #8b949e; font-weight: 600; background: #0d1117; }
td { color: #e1e4e8; }

/* === Code blocks === */
.code-block {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #79c0ff;
  overflow-x: auto;
  position: relative;
}
.code-block .copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  padding: 0.2rem 0.5rem; font-size: 0.75rem;
}

/* === Badge === */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green { background: #0d1f0d; color: #3fb950; border: 1px solid #238636; }
.badge-yellow { background: #1f1d0d; color: #d29922; border: 1px solid #9e6a03; }
.badge-red { background: #1f0d0d; color: #f85149; border: 1px solid #da3633; }

/* === Page header === */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; }

/* === Tabs (project sub-nav) === */
.sub-nav { display: flex; gap: 0; margin-bottom: 2rem; border-bottom: 1px solid #30363d; }
.sub-nav a {
  padding: 0.6rem 1.2rem;
  color: #8b949e;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}
.sub-nav a:hover { color: #e1e4e8; text-decoration: none; }
.sub-nav a.active { color: #e1e4e8; border-bottom-color: #58a6ff; }

/* === Auth pages === */
.auth-container {
  max-width: 420px;
  margin: 4rem auto;
}
.auth-container h1 { text-align: center; margin-bottom: 2rem; font-size: 1.5rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: #8b949e; }

/* === Misc === */
.text-muted { color: #8b949e; }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.inline-form { display: inline; }
