:root {
  color-scheme: dark;
  --bg: #0c1018;
  --panel: #151c28;
  --panel-soft: #1b2432;
  --line: #2a3546;
  --text: #edf2f8;
  --muted: #9aa8ba;
  --blue: #77a8ff;
  --red: #ff6b73;
  --orange: #ffad5c;
  --yellow: #e8c85b;
  --green: #63d5a5;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 15% -15%, #24375766, transparent 70%),
    var(--bg);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid #ffffff12;
  background: #0c1018d9;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #77a8ff55;
  border-radius: 12px;
  color: var(--blue);
  background: #77a8ff14;
  font-size: 19px;
  font-weight: 800;
}
.brand-name { font-size: 15px; font-weight: 750; letter-spacing: -.02em; }
.brand-sub { margin-top: 3px; color: var(--muted); font-size: 11px; }
.topbar-meta { color: var(--muted); font-size: 12px; }

main { max-width: 1480px; margin: 0 auto; padding: 38px clamp(18px, 4vw, 56px) 56px; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(29px, 4vw, 42px); letter-spacing: -.045em; }
.lede { max-width: 620px; margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.primary-button, .toolbar button {
  border: 1px solid #77a8ff;
  border-radius: 9px;
  padding: 11px 15px;
  background: var(--blue);
  color: #0c1525;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: filter .15s, transform .15s;
}
.primary-button:hover, .toolbar button:hover { filter: brightness(1.1); }
.primary-button:active, .toolbar button:active { transform: translateY(1px); }
.primary-button:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #a7c7ff;
  outline-offset: 2px;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 22px;
}
.summary-item {
  min-width: 112px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #121925;
}
.summary-value { display: block; font-size: 18px; font-weight: 800; }
.summary-label { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.search {
  width: min(390px, 100%);
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
}
.toolbar-note { color: var(--muted); font-size: 12px; }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(245px, 1fr));
  align-items: start;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.column {
  min-width: 245px;
  min-height: 230px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111823cc;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.column.is-drop-target { border-color: var(--priority); background: color-mix(in srgb, var(--priority) 8%, #111823); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--priority) 35%, transparent); }
.column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 2px 12px; }
.column-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; }
.column-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--priority); box-shadow: 0 0 12px color-mix(in srgb, var(--priority) 40%, transparent); }
.column-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.card-list { display: grid; gap: 10px; }
.bug-card {
  padding: 13px;
  border: 1px solid #344052;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 18px #00000018;
  cursor: grab;
  transition: opacity .15s, border-color .15s, transform .15s;
}
.bug-card:active { cursor: grabbing; }
.bug-card.is-dragging { opacity: .4; transform: scale(.98); }
.bug-card.is-completed { cursor: default; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.category {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 20px;
  background: #ffffff0b;
  color: #c1ccda;
  font-size: 10px;
  font-weight: 700;
}
.bug-id { color: #708099; font-family: ui-monospace, monospace; font-size: 10px; }
.bug-card h3 { margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.bug-description { margin: 7px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.status-control { display: flex; align-items: center; gap: 8px; margin: 3px 0 8px; color: var(--muted); font-size: 11px; }
.status-control select {
  min-width: 116px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 11px;
}
.priority-tag { display: inline-flex; padding: 4px 8px; border-radius: 20px; background: #ffffff0b; color: var(--muted); font-size: 10px; font-weight: 700; }
.card-date { margin-top: 10px; color: #77869a; font-size: 10px; }
.empty-column { padding: 19px 8px; color: #77869a; font-size: 12px; text-align: center; }
.empty-board { grid-column: 1 / -1; padding: 50px 20px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.completed-section { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.completed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.completed-head h2 { margin: 0; font-size: 17px; }
.completed-count { display: inline-flex; min-width: 23px; height: 23px; align-items: center; justify-content: center; border-radius: 20px; background: #63d5a51a; color: var(--green); font-size: 11px; font-weight: 750; }
.completed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.empty-completed { grid-column: 1 / -1; padding: 22px 14px; border: 1px dashed var(--line); border-radius: 10px; color: #77869a; font-size: 12px; text-align: center; }

dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 1px solid #35445a;
  border-radius: 15px;
  background: #141c28;
  color: var(--text);
  box-shadow: 0 24px 80px #000a;
}
dialog::backdrop { background: #05080dcc; backdrop-filter: blur(3px); }
.dialog-inner { padding: 23px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 19px; }
.dialog-head h2 { margin: 0; font-size: 19px; }
.close-button { border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.form-grid { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; color: #c7d1df; font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1520;
  color: var(--text);
  font-size: 13px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.form-error { margin: 12px 0 0; color: #ff8e94; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 19px; }
.secondary-button { border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; background: transparent; cursor: pointer; }
.dialog-actions .primary-button { padding: 10px 13px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 3; max-width: min(420px, calc(100% - 40px)); padding: 12px 15px; border: 1px solid #42536b; border-radius: 9px; background: #1b2635; box-shadow: 0 12px 30px #0007; font-size: 13px; }
.toast[hidden] { display: none; }
.toast.is-error { border-color: #a64e58; color: #ffb1b5; }

@media (max-width: 760px) {
  .topbar { min-height: 66px; padding-inline: 16px; }
  .topbar-meta { display: none; }
  main { padding-top: 27px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .board { grid-template-columns: repeat(4, minmax(270px, 1fr)); margin-right: -18px; padding-right: 18px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
}
