body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 240px, #f5f6f8 240px);
  color: #1a1a1a;
  margin: 0;
}

.wrap {
  max-width: 560px;
  margin: 4rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.wrap.wrap-wide {
  max-width: 1100px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 1.1rem;
}

h1 {
  font-size: 1.35rem;
  margin: 0;
}

h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.subtitle {
  color: #444;
  margin: 0.5rem 0;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

form {
  margin: 1rem 0;
}

input[type="email"],
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  box-sizing: border-box;
  margin-bottom: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

button {
  padding: 0.65rem 1.3rem;
  border: none;
  border-radius: 6px;
  background: #d97706;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}

button:hover {
  background: #b45309;
}

button.link,
a.link {
  background: none;
  color: #d97706;
  padding: 0;
  text-decoration: underline;
  font-size: 0.88rem;
}

.flashes {
  list-style: none;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.hint {
  font-size: 0.85rem;
  color: #777;
  margin: 1rem 0 0;
}

.status {
  font-size: 0.9rem;
  color: #555;
}

/* Dashboard header: welcome (left) + leaderboard (top-right corner) */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.welcome {
  flex: 1 1 auto;
  min-width: 200px;
}

.leaderboard-card {
  flex: 0 0 auto;
  width: 280px;
  border: 1px solid #f3e3c4;
  background: #fffbeb;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.my-stats-card {
  flex: 0 0 auto;
  width: 280px;
  border: 1px solid #dbeafe;
  background: #f0f7ff;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.my-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.my-stats-grid .stat {
  padding: 0.5rem 0.6rem;
  background: #fff;
  border: 1px solid #e2ecfb;
  border-radius: 6px;
}

.my-stats-grid .stat-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1d4ed8;
}

.my-stats-grid .stat-label {
  display: block;
  font-size: 0.7rem;
  color: #555;
  margin-top: 0.15rem;
}

.leaderboard-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.leaderboard-tabs .tab-btn {
  flex: 1 1 auto;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #92650a;
  background: #fff;
  border: 1px solid #f3e3c4;
  border-radius: 5px;
  cursor: pointer;
}

.leaderboard-tabs .tab-btn.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f6ecd4;
  font-size: 0.85rem;
}

.leaderboard-list li:last-child {
  border-bottom: none;
}

.leaderboard-list .rank {
  width: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.leaderboard-list .who {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-list .pts {
  font-weight: 700;
}

.leaderboard-list li.top-1 { background: rgba(250, 204, 21, 0.18); }
.leaderboard-list li.top-2 { background: rgba(148, 163, 184, 0.18); }
.leaderboard-list li.top-3 { background: rgba(217, 119, 6, 0.12); }

.leaderboard-list li.me {
  font-weight: 700;
}

.you-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #92650a;
  background: #fde68a;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}

/* Tasks (Gitea issues) */
.tasks-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 1.25rem;
}

.filter-bar select,
.filter-bar input[type="text"] {
  width: auto;
  margin: 0;
  padding: 0.5rem 0.6rem;
  font-size: 0.88rem;
}

.filter-bar input[name="q"] {
  min-width: 180px;
}

.filter-bar input[name="issue_id"] {
  width: 6rem;
}

.filter-bar button {
  padding: 0.5rem 1rem;
}

.task-rows {
  display: flex;
  flex-direction: column;
}

.task-row {
  display: grid;
  grid-template-columns: 2.1fr 0.9fr 1.1fr 0.7fr 1.1fr 0.9fr 0.8fr 1.7fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

.task-row:last-child {
  border-bottom: none;
}

.task-row-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
}

.task-title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  overflow: hidden;
}

.task-title a {
  color: #1a1a1a;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title a:hover {
  text-decoration: underline;
  color: #d97706;
}

.task-id {
  color: #999;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.task-state {
  display: inline-block;
  width: fit-content;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.task-state.state-open {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}

.task-state.state-closed {
  background: rgba(107, 114, 128, 0.16);
  color: #4b5563;
}

.task-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.label-chip {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
}

.task-repo, .task-lead, .task-assignee, .task-updated {
  color: #444;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
  text-align: right;
}

.assign-form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

.assign-form input[type="number"] {
  width: 3.5rem;
  margin: 0;
  padding: 0.35rem 0.4rem;
  font-size: 0.85rem;
}

.assign-form button {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.assignment-status {
  font-size: 0.78rem;
  color: #555;
  line-height: 1.3;
}

.time-tracker {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #92650a;
}

.assignment-actions {
  display: flex;
  gap: 0.6rem;
}

.assignment-actions form {
  margin: 0;
}

.branch-cmds {
  margin-top: 0.4rem;
}

.branch-cmds summary {
  font-size: 0.75rem;
  color: #92650a;
  cursor: pointer;
}

.branch-cmds pre {
  margin: 0.4rem 0 0;
  padding: 0.6rem 0.75rem;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

.branch-cmds .hint {
  font-size: 0.72rem;
  margin: 0.35rem 0 0;
}
