* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
}

.shell { display: flex; min-height: 100vh; }
.side {
  width: 220px;
  flex-shrink: 0;
  background: var(--side);
  color: var(--side-text);
  padding: 1.15rem 0.9rem;
}
.side h1 {
  margin: 0 0 1.2rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.side a {
  display: block;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 0.25rem;
  color: #d5ccbe;
}
.side a.on, .side a:hover { background: #3a342c; color: #fff; }

.column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.top h2 { margin: 0; font-size: 1.15rem; flex: 1; font-weight: 600; }

.btn {
  background: var(--rust);
  color: #fff;
  border: 0;
  padding: 0.5rem 0.8rem;
  border-radius: 3px;
}
.btn:hover { background: var(--rust-hover); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.45rem 0.7rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: #ebe4d7;
  border-bottom: 1px solid var(--line);
}
.filters input, .filters select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
}
.filters input[type="search"] { min-width: 12rem; }

#view { flex: 1; min-height: 0; overflow: auto; }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(12rem, 1fr));
  gap: 0.7rem;
  padding: 0.85rem;
  align-items: start;
}
.col {
  background: #e6dfd2;
  border: 1px solid var(--line);
  min-height: 12rem;
  padding: 0.55rem;
}
.col h3 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.col.over { outline: 2px dashed var(--rust); }
.col-todo { background: #e0e6dc; }
.col-in_progress { background: #eadfce; }
.col-done { background: #dce6e1; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.5rem;
  cursor: grab;
}
.card:active { cursor: grabbing; }
.card h4 { margin: 0 0 0.4rem; font-size: 0.86rem; font-weight: 600; }
.card .meta {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.list { padding-bottom: 2rem; }
.row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 7rem 6rem 7rem;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}
.row:hover { background: #f6f0e6; }
.rowhead {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #ebe4d7;
  cursor: default;
}

.detail { max-width: 44rem; padding: 1.25rem; }
.detail .title {
  width: 100%;
  font-size: 1.35rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0;
  background: transparent;
}
.detail textarea {
  width: 100%;
  min-height: 8rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  margin-top: 0.75rem;
}
.detail .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0.85rem 0;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(22, 20, 16, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-bg[hidden] { display: none; }
.modal {
  background: var(--panel);
  padding: 1.15rem;
  width: min(30rem, 92vw);
  border: 1px solid var(--line);
}
.modal h3 { margin-top: 0; }
.modal input, .modal textarea, .modal select {
  width: 100%;
  margin: 0.35rem 0 0.7rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
}

.pill {
  font-size: 0.65rem;
  padding: 0.12rem 0.4rem;
  border-radius: 99px;
  background: #ece6da;
}
.pill-bug { background: #f3d0c8; }
.pill-feature { background: #d5e4f2; }
.pill-design { background: #eadcf3; }
.pill-infra { background: #dce8d8; }
.pill-docs { background: #efe6c8; }
.pill-perf { background: #d8e8ea; }
.pri-urgent { color: #9b1c1c; font-weight: 700; }
.pri-high { color: var(--rust); }
.pri-medium { color: #6b5a2a; }
.pri-low { color: var(--muted); }

.av {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #3a342c;
  color: #fff;
  font-size: 0.62rem;
  align-items: center;
  justify-content: center;
}

.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: auto; display: flex; gap: 0.5rem; align-items: center; }
  .side h1 { margin: 0 0.5rem 0 0; }
  .side a { display: inline-block; margin: 0; }
  .board { grid-template-columns: 1fr; }
  .row { grid-template-columns: 4rem 1fr; }
  .row span:nth-child(n+3) { display: none; }
}
