:root {
  --bg: #07090d;
  --bg-elev: #0e1218;
  --bg-card: #121822;
  --ink: #e8edf5;
  --muted: #8b96a8;
  --line: rgba(232, 237, 245, 0.1);
  --accent: #d4a24a;
  --accent-2: #3db8a0;
  --danger: #e07a6a;
  --radius: 14px;
  --font: Manrope, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
}
body {
  background:
    radial-gradient(40% 30% at 15% 0%, rgba(61,184,160,.12), transparent),
    radial-gradient(35% 28% at 95% 5%, rgba(212,162,74,.1), transparent),
    var(--bg);
}

#app { max-width: 920px; margin: 0 auto; padding: 12px 14px 40px; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(212,162,74,.35);
  box-shadow: 0 0 0 3px rgba(212,162,74,.08);
}
.brand-name { font-weight: 700; letter-spacing: .06em; font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
  line-height: 1.2;
}
.tabs button.active {
  color: #1a1208;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.seg {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.2;
}
.seg button.active {
  background: rgba(212,162,74,.18);
  color: var(--accent);
  font-weight: 700;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.card h3 { margin: 0 0 8px; font-size: 15px; }
.meta { color: var(--muted); font-size: 12px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.stat b { display: block; font-size: 20px; color: var(--accent); line-height: 1.2; }
.stat span { color: var(--muted); font-size: 11px; }

/* Status chips — not overly round, text centered */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  background: rgba(212,162,74,.14);
  color: var(--accent);
  border: 1px solid rgba(212,162,74,.28);
}
.badge.teal {
  background: rgba(61,184,160,.14);
  color: var(--accent-2);
  border-color: rgba(61,184,160,.28);
}
.badge.muted {
  background: rgba(139,150,168,.12);
  color: var(--muted);
  border-color: var(--line);
}
.badge.danger {
  background: rgba(224,122,106,.12);
  color: var(--danger);
  border-color: rgba(224,122,106,.28);
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item .left { min-width: 0; flex: 1; }
.list-item .title { font-weight: 600; margin-bottom: 3px; }
.item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.item-actions button {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.item-actions button:hover { color: var(--ink); border-color: rgba(232,237,245,.25); }
.item-actions .del:hover { color: var(--danger); }

.empty {
  color: var(--muted);
  padding: 28px 12px;
  text-align: center;
}

button.primary, .primary {
  background: var(--accent);
  color: #1a1208;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}
button.ghost, .ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}
button.danger, .danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(224,122,106,.35);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  min-height: 36px;
}
.icon-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
}

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 40;
}
.modal.hidden { display: none; }
.sheet {
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 16px;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sheet-head h3 { margin: 0; }
.sheet-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.sheet-actions-right { display: flex; gap: 8px; margin-left: auto; }
.hidden { display: none !important; }

label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}
textarea { min-height: 84px; resize: vertical; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 50;
  max-width: 90%;
}
.toast.hidden { display: none; }

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 210px;
  padding: 10px;
}
.kanban-col h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.kanban-card:hover { border-color: rgba(212,162,74,.35); }
.kanban-card .title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }

/* Sprint lanes */
.sprint-week {
  margin-bottom: 14px;
}
.sprint-week h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--accent);
}

/* Calendar */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-nav h3 { margin: 0; font-size: 16px; text-transform: capitalize; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 0;
  font-weight: 600;
}
.cal-day {
  min-height: 74px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
}
.cal-day.out { opacity: .35; }
.cal-day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(212,162,74,.25);
}
.cal-day .num {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.cal-day.today .num { color: var(--accent); font-weight: 700; }
.cal-ev {
  display: block;
  font-size: 10px;
  line-height: 1.25;
  background: rgba(212,162,74,.16);
  color: var(--accent);
  border-radius: 5px;
  padding: 2px 4px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev.synced {
  background: rgba(61,184,160,.16);
  color: var(--accent-2);
}
.day-list { margin-top: 12px; }

@media (max-width: 720px) {
  .kanban { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .cal-day { min-height: 58px; padding: 4px; }
  .cal-ev { font-size: 9px; }
  .badge { min-width: 78px; padding: 4px 8px; font-size: 11px; }
}
