:root {
  --bg: #0f1419;
  --bg-elevated: #171e26;
  --bg-soft: #1e2833;
  --border: #2a3644;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #e8a54b;
  --accent-dim: #c4862f;
  --teal: #3d9b8f;
  --green: #4caf7a;
  --yellow: #d4a017;
  --red: #d45b5b;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 10px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 155, 143, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(232, 165, 75, 0.12), transparent 50%),
    linear-gradient(180deg, #12181f 0%, var(--bg) 40%, #0c1014 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #f0bf74;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.35rem;
}

.muted {
  color: var(--muted);
}

.hero-line {
  max-width: 42rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.stat .label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat .value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  font-family: var(--font-body);
  font-weight: 650;
  font-size: 0.92rem;
  cursor: pointer;
  background: var(--accent);
  color: #1a1208;
}

.btn:hover {
  background: #f0bf74;
  color: #1a1208;
}

.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.secondary:hover {
  border-color: var(--muted);
  background: var(--bg-soft);
}

.btn.danger {
  background: transparent;
  border-color: var(--red);
  color: #f0a0a0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 0.7rem 0.45rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg-soft);
}

.badge.health-green {
  color: #9de0ba;
  border-color: rgba(76, 175, 122, 0.45);
  background: rgba(76, 175, 122, 0.12);
}

.badge.health-yellow {
  color: #f0d58a;
  border-color: rgba(212, 160, 23, 0.45);
  background: rgba(212, 160, 23, 0.12);
}

.badge.health-red {
  color: #f0a8a8;
  border-color: rgba(212, 91, 91, 0.45);
  background: rgba(212, 91, 91, 0.12);
}

.badge.priority-critical,
.badge.priority-high {
  color: #f0c28a;
  border-color: rgba(232, 165, 75, 0.4);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--accent));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  font: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(232, 165, 75, 0.35);
  border-color: var(--accent-dim);
}

.nav-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
}

.flash-warn {
  border: 1px solid rgba(232, 165, 75, 0.45);
  background: rgba(232, 165, 75, 0.1);
  color: #f0d5a0;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
}

.flash-ok {
  border: 1px solid rgba(90, 180, 120, 0.45);
  background: rgba(90, 180, 120, 0.1);
  color: #b8e0c4;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.empty {
  color: var(--muted);
  padding: 1rem 0;
}

.inline-form {
  display: inline;
}

.inline-form select {
  width: auto;
  padding: 0.25rem 0.4rem;
  font-size: 0.85rem;
}

.task-name {
  font-weight: 650;
}

.task-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.subtask-list {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.35rem 0.75rem;
}

.check-item {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.matrix-wrap {
  overflow-x: auto;
}

.matrix th,
.matrix td {
  text-align: center;
  white-space: nowrap;
}

.matrix th:first-child,
.matrix td:first-child,
.matrix tbody th {
  text-align: left;
  min-width: 180px;
}

.matrix-cell.linked {
  color: var(--accent);
  font-size: 1.1rem;
}

.matrix-cell.self {
  color: var(--border);
}

.matrix tr.critical {
  background: rgba(232, 165, 75, 0.08);
}

.dep-edit {
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  align-items: start;
}

.kanban-col h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem;
  margin-bottom: 0.55rem;
}

.kanban-card select {
  margin-top: 0.45rem;
}

.gantt-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.gantt-row.critical .gantt-bar {
  background: linear-gradient(90deg, var(--accent), #f0bf74);
}

.gantt-track {
  position: relative;
  height: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.gantt-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), #5bb8ac);
}

.nav {
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chart-row {
  display: grid;
  grid-template-columns: 90px 1fr 70px;
  gap: 0.6rem;
  align-items: center;
}

.chart-track {
  height: 14px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.chart-fill {
  height: 100%;
  background: var(--teal);
}

.chart-fill.sched {
  background: var(--accent);
}

.chart-fill.actual {
  background: #7eb8e8;
}

.chart-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.code-block {
  margin: 0;
  padding: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  color: var(--text);
}

