:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #242836;
  --border: #2e3348;
  --text: #e8eaed;
  --text-muted: #9aa0b0;
  --accent: #6c8cff;
  --accent-hover: #8aa4ff;
  --danger: #ff6b6b;
  --success: #51cf66;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.15rem;
  cursor: pointer;
  user-select: none;
}

.logo { font-size: 1.4rem; }

nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}
nav a:hover { color: var(--text); }

.user {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hidden { display: none !important; }

/* Cards & lists */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.card:hover { border-color: #3a4058; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.project-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: rgba(255,107,107,0.15); }

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { min-height: 100px; resize: vertical; }

/* Login */
.login-wrap {
  max-width: 380px;
  margin: 4rem auto;
}
.login-wrap h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
}
.page-header .actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tr:hover td { background: rgba(255,255,255,0.02); }

/* Release list */
.release-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.release-item:last-child { border-bottom: none; }
.release-item:hover .version { color: var(--accent); }
.version {
  font-weight: 600;
  font-size: 1.05rem;
  font-family: ui-monospace, monospace;
}
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--surface2);
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 {
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  animation: slideIn 0.25s ease;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Empty state */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty p { margin-bottom: 1rem; }

/* Artifact row */
.artifact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.artifact-row:last-child { border-bottom: none; }
.artifact-name {
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
}
.sha {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  word-break: break-all;
}

/* Breadcrumb */
.breadcrumb {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* Notes */
.notes {
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  white-space: pre-wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

code {
  font-family: ui-monospace, monospace;
  background: var(--surface2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.token-value {
  font-family: ui-monospace, monospace;
  background: var(--bg);
  padding: 0.75rem;
  border-radius: 8px;
  word-break: break-all;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
