/* Spikes Dashboard — minimal vanilla styles */

:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1f2630;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #4493f8;
  --accent-fg: #ffffff;
  --danger: #f85149;
  --warn: #d29922;
  --ok: #3fb950;
  --love: #db61a2;
  --like: #3fb950;
  --meh: #d29922;
  --no: #f85149;
  --null: #6e7681;
  --shadow: 0 1px 0 rgba(255,255,255,0.04);
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}
.brand-mark { color: var(--accent); }
.topbar-nav { display: flex; gap: 12px; align-items: center; }
.user-email { color: var(--muted); font-size: 13px; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }

.loading { color: var(--muted); }

.btn {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
}
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:hover:not([disabled]) { filter: brightness(1.1); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

input[type="text"], input[type="email"], select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius);
}

.login-card {
  max-width: 480px;
  margin: 48px auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}
.login-card h1 { margin-top: 0; }
.login-card p { color: var(--muted); }
.login-card .btn { margin-top: 8px; }
.user-code {
  font-size: 32px;
  letter-spacing: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2);
  padding: 16px 24px;
  border-radius: var(--radius);
  display: inline-block;
  margin: 16px 0;
  border: 1px solid var(--border);
}

.projects-list, .spikes-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.projects-list th, .projects-list td,
.spikes-table th, .spikes-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.projects-list th, .spikes-table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.projects-list tr:last-child td,
.spikes-table tr:last-child td { border-bottom: none; }
.projects-list tr.clickable { cursor: pointer; }
.projects-list tr.clickable:hover { background: var(--surface-2); }

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state h2 { color: var(--text); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 12px 0 16px;
}

.crumbs { color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.rating-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.rating-love .dot { background: var(--love); }
.rating-like .dot { background: var(--like); }
.rating-meh  .dot { background: var(--meh);  }
.rating-no   .dot { background: var(--no);   }
.rating-null .dot { background: var(--null); }
.rating-love { color: var(--love); }
.rating-like { color: var(--like); }
.rating-meh  { color: var(--meh);  }
.rating-no   { color: var(--no);   }
.rating-null { color: var(--null); }

.cell-comments {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spike-selector {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 4px;
  word-break: break-all;
}

.banner-region {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.banner {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.banner-error { border-color: var(--danger); color: var(--danger); }
.banner-info { border-color: var(--accent); color: var(--accent); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
}
.modal h2 { margin-top: 0; }
.modal label { display: block; margin: 12px 0 4px; color: var(--muted); }
.modal input { width: 100%; }
.modal-actions { margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }

.toggle-resolved {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}
.toggle-resolved.is-resolved {
  background: var(--ok);
  color: var(--accent-fg);
  border-color: var(--ok);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
  color: var(--muted);
}

.muted { color: var(--muted); }
