:root {
  color-scheme: dark;
  --bg: #101312;
  --surface: #171c1a;
  --surface-2: #202724;
  --surface-3: #29312e;
  --border: #38433f;
  --text: #eff4ef;
  --muted: #aab6ae;
  --accent: #2dd4bf;
  --accent-strong: #f6c85f;
  --danger: #f87171;
  --ok: #4ade80;
  --shadow: 0 18px 40px rgba(0, 0, 0, .28);
  --radius: 8px;
  --col-backlog: #94a3b8;
  --col-todo: #38bdf8;
  --col-doing: #f59e0b;
  --col-review: #e879f9;
  --col-done: #22c55e;
  --prio-high: #fb7185;
  --prio-med: #facc15;
  --prio-low: #4ade80;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(45, 212, 191, .10), transparent 34%),
    linear-gradient(340deg, rgba(246, 200, 95, .10), transparent 28%),
    var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-block,
.brand,
.toolbar,
.team,
.chip,
.status-line,
.modal-head,
.modal-actions,
.card-top,
.card-foot,
.assignee {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #111411;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
}

h1,
h2,
p {
  margin: 0;
}

.brand-block h1,
.brand h1 {
  font-size: 20px;
  line-height: 1.2;
}

.brand-block p,
.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0e1110;
  color: var(--text);
  outline: none;
  padding: 9px 11px;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, .16);
}

.form-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.btn {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #101312;
}

.btn.subtle {
  background: transparent;
}

.btn.wide {
  width: 100%;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 19, 18, .94);
  backdrop-filter: blur(8px);
}

.brand {
  min-width: 240px;
  gap: 12px;
}

.toolbar {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.team {
  gap: 7px;
  flex-wrap: wrap;
}

.team-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chip {
  gap: 7px;
  min-height: 30px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

.avatar {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.status-line {
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px 0;
  color: var(--muted);
  font-size: 12px;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(228px, 1fr));
  gap: 14px;
  align-items: start;
  padding: 18px 24px 48px;
}

.column {
  min-height: 240px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.col-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.col-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 900;
}

.count {
  margin-left: auto;
  min-width: 26px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.col-body {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 190px;
  padding: 12px;
}

.col-body.drag-over {
  outline: 2px solid rgba(45, 212, 191, .45);
  outline-offset: -6px;
}

.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 18px 10px;
  text-align: center;
  font-size: 12px;
}

.card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 11px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  cursor: grab;
}

.card:hover {
  border-color: var(--accent);
}

.card.dragging {
  opacity: .55;
}

.card-top {
  align-items: flex-start;
  gap: 8px;
}

.card-title {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-size: 13px;
  font-weight: 800;
}

.card-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.icon-btn:hover {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface-3);
}

.card-desc {
  margin-top: 7px;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.4;
  font-size: 12px;
}

.labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  border: 1px solid rgba(45, 212, 191, .30);
  border-radius: 6px;
  background: rgba(45, 212, 191, .10);
  color: #a7fff0;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
}

.card-foot {
  gap: 8px;
  margin-top: 12px;
}

.prio {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 900;
}

.assignee {
  margin-left: auto;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.add-card {
  min-height: 36px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.add-card:hover {
  border-color: var(--accent);
  color: var(--text);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 5, .72);
}

.overlay.open {
  display: flex;
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal.compact {
  width: min(430px, 100%);
}

.modal-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal h2 {
  font-size: 17px;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .board {
    grid-auto-flow: column;
    grid-auto-columns: 280px;
    grid-template-columns: none;
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  .app-header {
    position: static;
    flex-direction: column;
    padding: 16px;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .status-line,
  .board {
    padding-left: 16px;
    padding-right: 16px;
  }

  .row2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
