/*
 * This is a manifest file that'll be compiled into application.css.
 */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #0a0a0a;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { color: #93c5fd; text-decoration: underline; }

/* ── Nav ─────────────────────────────────────────────────── */

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 3.25rem;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav__brand {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.app-nav__brand:hover { color: #f1f5f9; text-decoration: none; }

/* ── Flash ───────────────────────────────────────────────── */

.flash {
  padding: 0.6rem 1.5rem;
  font-size: 0.875rem;
}
.flash--notice { background: #14532d; color: #86efac; border-bottom: 1px solid #166534; }
.flash--alert  { background: #7f1d1d; color: #fca5a5; border-bottom: 1px solid #991b1b; }

/* ── Main ────────────────────────────────────────────────── */

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

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn--primary  { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.btn--primary:hover { background: #2563eb; border-color: #2563eb; color: #fff; text-decoration: none; }
.btn--secondary { background: #1e293b; color: #94a3b8; border-color: #334155; }
.btn--secondary:hover { background: #263548; color: #e2e8f0; border-color: #475569; text-decoration: none; }
.btn--ghost    { background: transparent; color: #64748b; border-color: transparent; }
.btn--ghost:hover { background: #1e293b; color: #94a3b8; text-decoration: none; }
.btn--danger   { background: transparent; color: #f87171; border-color: #7f1d1d; }
.btn--danger:hover { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; text-decoration: none; }
.btn--sm       { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn--xs       { padding: 0.2rem 0.5rem; font-size: 0.75rem; }

/* ── Badges ──────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge--active      { background: #1e3a5f; color: #60a5fa; }
.badge--completed   { background: #14532d; color: #4ade80; }
.badge--archived    { background: #1c1917; color: #78716c; }
.badge--pending     { background: #292524; color: #78716c; }
.badge--in_progress { background: #1e3a5f; color: #60a5fa; }
.badge--open        { background: #292524; color: #78716c; }
.badge--done        { background: #14532d; color: #4ade80; }
/* dependency statuses */
.badge--dep-pending  { background: #292524; color: #78716c; }
.badge--dep-resolved { background: #14532d; color: #4ade80; }
.badge--dep-blocked  { background: #450a0a; color: #f87171; }
/* task statuses */
.badge--task-todo        { background: #292524; color: #78716c; }
.badge--task-in_progress { background: #1e3a5f; color: #60a5fa; }
.badge--task-done        { background: #14532d; color: #4ade80; }

/* ── Stat chips ──────────────────────────────────────────── */

.stat-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}
.stat-chip--progress { background: #1e3a5f; border-color: #2563eb; color: #93c5fd; }

/* ── Page header ─────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

/* ── Empty state ─────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #475569;
}
.empty-state__text { margin-bottom: 1rem; font-size: 1rem; }

/* ── Project grid ────────────────────────────────────────── */

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

.project-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s;
}
.project-card:hover { border-color: #334155; }

.project-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.project-card__name {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  text-decoration: none;
  line-height: 1.3;
}
.project-card__name:hover { color: #60a5fa; text-decoration: none; }
.project-card__desc { margin: 0; font-size: 0.85rem; color: #64748b; line-height: 1.5; }
.project-card__stats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }

/* ── Project show ────────────────────────────────────────── */

.project-show { display: flex; flex-direction: column; gap: 2rem; }

.project-header { display: flex; flex-direction: column; gap: 0.5rem; }
.project-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.project-header__actions { display: flex; gap: 0.5rem; align-items: center; }
.project-header__body    { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.project-header__name {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f1f5f9;
  line-height: 1.2;
}
.project-header__desc { margin: 0; color: #94a3b8; font-size: 0.95rem; line-height: 1.6; max-width: 700px; }

.project-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 10px;
}
.project-stat { display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.project-stat__value { font-size: 1.5rem; font-weight: 700; color: #f1f5f9; letter-spacing: -0.02em; line-height: 1; }
.project-stat__label { font-size: 0.72rem; color: #64748b; margin-top: 0.25rem; text-align: center; }

/* ── PM Section ──────────────────────────────────────────── */

.project-body { display: flex; flex-direction: column; gap: 2rem; }

.pm-section {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 10px;
  overflow: hidden;
}

.pm-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid #1e293b;
}
.pm-section__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-empty {
  padding: 1.5rem 1.25rem;
  color: #475569;
  font-size: 0.875rem;
  margin: 0;
}

.section-add-row { padding: 0.75rem 1.25rem; border-top: 1px solid #1e293b; }

/* ── Milestone card ──────────────────────────────────────── */

.milestone-list { display: flex; flex-direction: column; }

.milestone-card {
  border-bottom: 1px solid #1e293b;
}
.milestone-card:last-child { border-bottom: none; }
.milestone-card--backlog > .milestone-card__header { background: #0f172a; }

.milestone-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  list-style: none;
  gap: 1rem;
  user-select: none;
}
.milestone-card__header::-webkit-details-marker { display: none; }
.milestone-card__header::marker { content: none; }

.milestone-card__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.milestone-card__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.milestone-card__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}
.milestone-card__due { font-size: 0.8rem; color: #64748b; }
.milestone-card__due.overdue { color: #f87171; }

.milestone-card__body { padding: 0.5rem 1.25rem 1.25rem; }
.milestone-card__desc { color: #94a3b8; font-size: 0.875rem; margin: 0 0 1rem; }

/* ── Story rows ──────────────────────────────────────────── */

.story-list { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }

.story-row {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 6px;
  overflow: hidden;
}
.story-row__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  list-style: none;
  gap: 1rem;
  user-select: none;
}
.story-row__header::-webkit-details-marker { display: none; }
.story-row__header::marker { content: none; }

.story-row__left { flex: 1; min-width: 0; }
.story-row__right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.story-row__title { font-size: 0.875rem; font-weight: 500; color: #e2e8f0; }

.story-row__body { padding: 0.25rem 0.9rem 0.9rem; }
.story-row__desc { color: #94a3b8; font-size: 0.825rem; margin: 0 0 0.75rem; }

/* ── Task rows ───────────────────────────────────────────── */

.task-list { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }

.task-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #0a0a0a;
  border: 1px solid #1e293b;
  border-radius: 5px;
  gap: 1rem;
}
.task-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.task-row__right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.task-row__title { font-size: 0.825rem; color: #cbd5e1; }
.task-row__meta { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* ── Item rows (action items, dependencies) ──────────────── */

.item-list { display: flex; flex-direction: column; }

.item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #1e293b;
  gap: 1rem;
}
.item-row:last-child { border-bottom: none; }
.item-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.item-row__top  { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.item-row__title { font-size: 0.9rem; font-weight: 500; color: #e2e8f0; }
.item-row__meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.item-row__desc { color: #64748b; font-size: 0.825rem; margin: 0; }

/* ── Blockers ─────────────────────────────────────────────── */

.blocker-list { margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.25rem; }
.blocker-list__label { font-size: 0.75rem; color: #64748b; font-weight: 600; margin-bottom: 0.2rem; }
.blocker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  background: #1a0a0a;
  border: 1px solid #450a0a;
  border-radius: 4px;
  font-size: 0.825rem;
}
.blocker-icon { font-size: 0.75rem; }
.blocker-icon--resolved { opacity: 0.4; }
.blocker-row__title { flex: 1; color: #fca5a5; }

/* ── Meta chip ───────────────────────────────────────────── */

.meta-chip {
  font-size: 0.75rem;
  color: #64748b;
  background: #1e293b;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.meta-chip.overdue { background: #450a0a; color: #f87171; }

/* ── Row actions ─────────────────────────────────────────── */

.row-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-shrink: 0;
}
.row-action {
  font-size: 0.72rem;
  color: #475569;
  background: none;
  border: none;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: color 0.1s, background 0.1s;
}
.row-action:hover { color: #94a3b8; background: #1e293b; text-decoration: none; }
.row-action--danger { color: #6b2222; }
.row-action--danger:hover { color: #f87171; background: #1a0a0a; }

/* ── Utility ─────────────────────────────────────────────── */

.back-link { font-size: 0.825rem; color: #64748b; text-decoration: none; }
.back-link:hover { color: #94a3b8; }
.line-through { text-decoration: line-through; opacity: 0.5; }

/* ── Forms ───────────────────────────────────────────────── */

.form-page {
  max-width: 600px;
}
.form-page__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.form-page__title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.form { display: flex; flex-direction: column; gap: 1rem; }

.form__errors {
  background: #450a0a;
  border: 1px solid #7f1d1d;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: #fca5a5;
  font-size: 0.875rem;
}
.form__errors p { margin: 0 0 0.25rem; }
.form__errors p:last-child { margin-bottom: 0; }

.form__context {
  margin: 0;
  font-size: 0.825rem;
  color: #64748b;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  border-radius: 5px;
}

.form__field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.form__row   { display: flex; gap: 1rem; flex-wrap: wrap; }
.form__label { font-size: 0.8rem; font-weight: 600; color: #94a3b8; letter-spacing: 0.03em; }

.form__input,
.form__textarea,
.form__select {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.form__input:focus,
.form__textarea:focus,
.form__select:focus { border-color: #3b82f6; }

.form__input::placeholder,
.form__textarea::placeholder { color: #475569; }

.form__textarea { resize: vertical; min-height: 80px; }
.form__select { appearance: none; cursor: pointer; }

.form__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.5rem;
}
