:root {
  --bg-1: #f6efe6;
  --bg-2: #dce8e4;
  --ink: #1d2430;
  --muted: #4b5c62;
  --card: rgba(255, 255, 255, 0.75);
  --stroke: rgba(29, 36, 48, 0.14);
  --accent-green: #1f7a6a;
  --accent-green-2: #2ba48f;
  --shadow: 0 18px 50px rgba(23, 30, 44, 0.12);
  --ok: #1a8f58;
  --warn: #cc7f14;
  --danger: #cb3f4f;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  height: 100vh;
  color: var(--ink);
  font-family: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 125, 70, 0.22), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(25, 140, 130, 0.18), transparent 38%),
    radial-gradient(circle at 86% 72%, rgba(31, 122, 106, 0.2), transparent 36%),
    radial-gradient(circle at 50% 88%, rgba(38, 120, 197, 0.2), transparent 42%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
  overflow: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.15;
  pointer-events: none;
  background-image: radial-gradient(rgba(17, 17, 17, 0.25) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
}

.app {
  width: min(1180px, 93vw);
  margin: 0 auto;
  padding: 42px 0 56px;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  font-family: "Chakra Petch", "Verdana", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #2f5967;
}

h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.hub-link,
button {
  border-radius: 10px;
  border: 1px solid rgba(29, 36, 48, 0.18);
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.hub-link {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.68);
  color: #21313a;
  box-shadow: 0 10px 20px rgba(22, 31, 45, 0.1);
}

.primary-btn {
  border-color: rgba(20, 84, 73, 0.24);
  background: linear-gradient(140deg, var(--accent-green-2) 0%, var(--accent-green) 100%);
  color: #f8fffd;
  box-shadow: 0 8px 16px rgba(17, 67, 58, 0.2);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.66);
  color: #2f3f4b;
}

.sync-status {
  margin: 0;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(29, 36, 48, 0.16);
  background: rgba(255, 255, 255, 0.64);
  color: #4f5f68;
  font-size: 0.82rem;
}

.sync-status.ok {
  border-color: rgba(26, 143, 88, 0.34);
  color: var(--ok);
}

.sync-status.warn {
  border-color: rgba(204, 127, 20, 0.34);
  color: var(--warn);
}

.sync-status.error {
  border-color: rgba(203, 63, 79, 0.34);
  color: var(--danger);
}

.project-tabs {
  margin-top: 16px;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.project-tab {
  border: 1px solid rgba(29, 36, 48, 0.16);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.66);
  color: #2d3d47;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-tab.active {
  background: linear-gradient(140deg, var(--accent-green-2) 0%, var(--accent-green) 100%);
  color: #f8fffd;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(17, 67, 58, 0.2);
}

.project-tab strong {
  font-size: 0.96rem;
}

.project-tab span {
  font-size: 0.78rem;
  opacity: 0.9;
}

.board-head {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.project-stats {
  margin: 0;
  font-weight: 700;
  color: #2f3f4b;
}

.drag-hint {
  margin: 0;
  color: #4d5d65;
  font-size: 0.83rem;
}

.board-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.board {
  margin-top: 14px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--card);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(29, 36, 48, 0.11);
}

.column-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.column-title {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-family: "Chakra Petch", "Bricolage Grotesque", sans-serif;
  font-size: 1.06rem;
  font-weight: 700;
  color: #233744;
}

.column-title:focus {
  outline: 2px solid rgba(31, 122, 106, 0.26);
  outline-offset: 2px;
  border-radius: 8px;
}

.task-list {
  margin: 0;
  padding: 10px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.task-list.drop-target {
  outline: 2px dashed rgba(31, 122, 106, 0.42);
  outline-offset: -4px;
  border-radius: 10px;
  background: rgba(43, 164, 143, 0.08);
}

.task {
  display: grid;
  grid-template-columns: 22px 24px 1fr 22px;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(29, 36, 48, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.task-drag-handle {
  border: 1px solid rgba(29, 36, 48, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
  color: #2f3f4b;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 5px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.task-drag-handle:active {
  cursor: grabbing;
}

.task.dragging {
  opacity: 0.45;
}

.task input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-green);
}

.task-text {
  border: 0;
  background: transparent;
  color: #2d3d47;
  width: 100%;
  min-height: 24px;
  resize: none;
  overflow: hidden;
  font: inherit;
  line-height: 1.38;
}

.task-text:focus {
  outline: none;
}

.task.done .task-text {
  color: #687881;
  text-decoration: line-through;
}

.task-delete,
.column-delete,
.column-add-task {
  border: 1px solid rgba(29, 36, 48, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: #2f3f4b;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 5px 7px;
}

.column-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.column-drag-handle {
  border: 1px solid rgba(29, 36, 48, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: #2f3f4b;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 5px 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.column-drag-handle:active {
  cursor: grabbing;
}

.column.column-dragging {
  opacity: 0.46;
}

.board.column-drop-active {
  outline: 2px dashed rgba(31, 122, 106, 0.35);
  outline-offset: -3px;
  border-radius: 12px;
}

.column-foot {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid rgba(29, 36, 48, 0.11);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.column-count {
  margin: 0;
  color: #5d6d75;
  font-size: 0.82rem;
}

.empty-board {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(31, 29, 39, 0.3);
  background: rgba(255, 255, 255, 0.62);
  color: #4f5f67;
}

@media (max-width: 800px) {
  .app {
    width: min(1180px, 96vw);
    padding: 30px 0 34px;
    height: 100vh;
    max-height: 100vh;
  }

  .project-tabs {
    gap: 7px;
  }

  .project-tab {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-actions {
    width: 100%;
  }
}
