:root {
  --color-bg: #f3f2ed;
  --color-surface: #fffefa;
  --color-surface-raised: #ffffff;
  --color-surface-soft: #ebeae3;
  --color-text: #18213b;
  --color-text-secondary: #515b73;
  --color-text-muted: #6e768a;
  --color-border: #dad8cf;
  --color-border-strong: #c6c3b8;
  --color-primary: #4353cf;
  --color-primary-hover: #3442b4;
  --color-primary-soft: #e9eaff;
  --color-primary-faint: #f5f4ff;
  --color-accent: #db6d39;
  --color-accent-soft: #fff0e7;
  --color-success: #177a5c;
  --color-success-soft: #e2f4ed;
  --color-warning: #996408;
  --color-warning-soft: #fff2cf;
  --color-danger: #bb3f46;
  --color-danger-soft: #fde9eb;
  --color-white: #ffffff;
  --color-header: rgba(255, 254, 250, 0.92);
  --color-overlay: rgba(16, 22, 40, 0.58);
  --color-shadow: rgba(26, 32, 54, 0.12);
  --color-shadow-soft: rgba(26, 32, 54, 0.06);
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-display: "Newsreader", Georgia, serif;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --shadow-soft: 0 8px 24px var(--color-shadow-soft);
  --shadow-card: 0 12px 30px var(--color-shadow);
  --shadow-modal: 0 28px 80px var(--color-shadow);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
}

svg {
  display: block;
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--color-primary-soft);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-white);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 180ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-header);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  width: min(100%, 1240px);
  min-height: 76px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 7px 16px var(--color-shadow-soft);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-copy small {
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.view-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0 auto;
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
  transition: background 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
}

.nav-item:hover {
  color: var(--color-text);
}

.nav-item.is-active {
  background: var(--color-surface-raised);
  color: var(--color-primary);
  box-shadow: 0 3px 10px var(--color-shadow-soft);
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: background 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out, box-shadow 180ms ease-out;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 8px 18px var(--color-shadow-soft);
}

.button-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-soft);
}

.button-secondary {
  border-color: var(--color-border-strong);
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.button-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.button-danger:hover:not(:disabled) {
  background: var(--color-danger);
  color: var(--color-white);
}

.button-quiet {
  border-color: transparent;
  box-shadow: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  transition: color 180ms ease-out, border-color 180ms ease-out, background 180ms ease-out;
}

.icon-button:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-soft);
  color: var(--color-text);
}

.text-button {
  align-self: end;
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 750;
}

.text-button:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.main-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-12);
}

.workspace-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);
  padding: var(--space-12) 0 var(--space-8);
}

.intro-copy {
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.intro-description {
  max-width: 620px;
  margin: var(--space-3) 0 0;
  color: var(--color-text-secondary);
  font-size: 1.02rem;
  line-height: 1.7;
}

.work-pulse {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-3);
  min-width: 260px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.pulse-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-success-soft);
  color: var(--color-success);
}

.work-pulse > span:not(.pulse-icon, .pulse-separator) {
  display: grid;
  line-height: 1.25;
}

.work-pulse strong {
  font-size: 1.05rem;
}

.work-pulse small {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.pulse-separator {
  width: 1px;
  height: 32px;
  margin: 0 var(--space-1);
  background: var(--color-border);
}

.error-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  background: var(--color-danger-soft);
  color: var(--color-danger);
  font-size: 0.9rem;
  font-weight: 600;
}

.error-banner span {
  flex: 1;
}

.error-banner button {
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font-weight: 750;
}

.filter-bar {
  display: grid;
  grid-template-columns: auto minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.filter-heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding-right: var(--space-3);
}

.filter-heading > div {
  display: grid;
  line-height: 1.3;
}

.filter-heading strong {
  font-size: 0.86rem;
}

.filter-heading small {
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.filter-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.filter-control {
  display: grid;
  gap: 0.35rem;
}

.filter-control label {
  color: var(--color-text-secondary);
  font-size: 0.7rem;
  font-weight: 750;
}

.filter-control select,
.filter-control input,
.input-with-icon {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 600;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.filter-control select,
.filter-control input {
  padding: 0 var(--space-3);
}

.filter-control select:hover,
.filter-control input:hover,
.input-with-icon:hover {
  border-color: var(--color-border-strong);
}

.filter-control select:focus,
.filter-control input:focus,
.input-with-icon:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  outline: none;
}

.input-with-icon {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  color: var(--color-text-muted);
}

.input-with-icon svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.input-with-icon input {
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  box-shadow: none;
}

.input-with-icon input:focus-visible {
  outline: none;
}

.board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: var(--space-3) var(--space-1);
}

.board-meta p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.84rem;
}

.board-meta p strong {
  color: var(--color-text);
}

.drag-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.drag-hint svg {
  width: 15px;
  height: 15px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-4);
}

.board-column {
  min-width: 0;
  min-height: 520px;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-soft);
  transition: border-color 180ms ease-out, background 180ms ease-out, box-shadow 180ms ease-out;
}

.board-column.is-over {
  border-color: var(--color-primary);
  background: var(--color-primary-faint);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}

.column-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: 0 var(--space-2) var(--space-3);
}

.column-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.column-title h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.column-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-text-muted);
  box-shadow: 0 0 0 4px var(--color-surface-raised);
}

.status-progress .column-marker,
.status-marker.status-progress {
  background: var(--color-primary);
}

.status-done .column-marker,
.status-marker.status-done {
  background: var(--color-success);
}

.column-count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
}

.column-add-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  transition: background 180ms ease-out, color 180ms ease-out;
}

.column-add-button:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.column-add-button svg {
  width: 18px;
  height: 18px;
}

.column-body {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-height: 445px;
}

.column-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-2);
  min-height: 160px;
  padding: var(--space-6);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-align: center;
}

.column-empty svg {
  width: 24px;
  height: 24px;
  margin-bottom: var(--space-1);
}

.column-empty strong {
  color: var(--color-text-secondary);
  font-size: 0.82rem;
}

.column-empty span {
  max-width: 190px;
  font-size: 0.72rem;
  line-height: 1.5;
}

.task-card {
  position: relative;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  box-shadow: 0 4px 12px var(--color-shadow-soft);
  cursor: grab;
  transition: transform 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, opacity 180ms ease-out;
}

.task-card::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--project-color, var(--color-primary));
  content: "";
}

.task-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.task-card.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
  transform: rotate(1.5deg) scale(0.98);
}

.task-card.is-overdue {
  box-shadow: inset 3px 0 0 var(--color-danger), 0 4px 12px var(--color-shadow-soft);
}

.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.priority-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.priority-high {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.priority-medium {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.priority-low {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.card-move-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  transition: background 180ms ease-out, color 180ms ease-out;
}

.card-move-button:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.card-move-button svg {
  width: 17px;
  height: 17px;
}

.task-card h3 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.42;
}

.task-description {
  display: -webkit-box;
  margin: var(--space-2) 0 0;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 0.76rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-3);
  color: var(--color-text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
}

.project-tag::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--project-color, var(--color-primary));
  content: "";
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.assignee {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.assignee-name {
  max-width: 98px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.due-badge svg {
  width: 14px;
  height: 14px;
}

.due-badge.is-overdue {
  color: var(--color-danger);
}

.due-badge.is-today {
  color: var(--color-warning);
}

.due-badge.is-soon {
  color: var(--color-primary);
}

.skeleton-column {
  display: grid;
  align-content: start;
  gap: var(--space-3);
}

.skeleton-column span {
  display: block;
  height: 146px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, var(--color-surface-soft) 30%, var(--color-surface-raised) 50%, var(--color-surface-soft) 70%);
  background-size: 240% 100%;
  animation: shimmer 1.5s infinite linear;
}

.board-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 320px;
  padding: var(--space-8);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  text-align: center;
}

.board-state svg {
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-3);
  color: var(--color-primary);
}

.board-state h3 {
  margin: 0;
  font-size: 1.1rem;
}

.board-state p {
  max-width: 420px;
  margin: var(--space-2) 0 0;
  color: var(--color-text-secondary);
  font-size: 0.84rem;
}

.board-state button {
  margin-top: var(--space-4);
}

@keyframes shimmer {
  to {
    background-position: -240% 0;
  }
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.metric-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 136px;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
}

.metric-icon svg {
  width: 22px;
  height: 22px;
}

.metric-card > div:last-child {
  display: grid;
  line-height: 1.3;
}

.metric-card span {
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.metric-card strong {
  margin: var(--space-1) 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.metric-card small {
  color: var(--color-text-muted);
  font-size: 0.68rem;
}

.metric-primary .metric-icon {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.metric-warning .metric-icon {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.metric-danger .metric-icon {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.dashboard-grid,
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.dashboard-bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  margin-bottom: 0;
}

.panel {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.panel-heading .eyebrow {
  margin-bottom: var(--space-1);
  color: var(--color-text-muted);
  font-size: 0.65rem;
}

.panel-heading h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
}

.panel-total,
.attention-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  background: var(--color-surface-soft);
  color: var(--color-text-secondary);
  font-size: 0.7rem;
  font-weight: 800;
}

.attention-count {
  min-width: 30px;
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.status-count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.status-count {
  position: relative;
  display: grid;
  min-height: 132px;
  align-content: space-between;
  padding: var(--space-4);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-primary-faint);
}

.status-count::after {
  position: absolute;
  right: -20px;
  bottom: -35px;
  width: 100px;
  height: 100px;
  border: 18px solid var(--color-primary-soft);
  border-radius: 50%;
  content: "";
  opacity: 0.65;
}

.status-count.status-progress {
  background: var(--color-primary-soft);
}

.status-count.status-done {
  background: var(--color-success-soft);
}

.status-marker {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  margin-bottom: var(--space-5);
  border-radius: 50%;
  background: var(--color-text-muted);
}

.status-count small {
  position: relative;
  z-index: 1;
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.status-count strong {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
}

.completion-content {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--color-success) 0 var(--progress), var(--color-surface-soft) var(--progress) 100%);
}

.progress-ring > div {
  display: grid;
  place-content: center;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: var(--color-surface);
  text-align: center;
}

.progress-ring strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1;
}

.progress-ring small {
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 700;
}

.completion-content p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  line-height: 1.7;
}

.project-progress-list {
  display: grid;
  gap: var(--space-4);
}

.project-progress-empty,
.overdue-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: var(--space-6);
  color: var(--color-text-muted);
  text-align: center;
}

.project-progress-empty svg,
.overdue-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: var(--space-2);
  color: var(--color-success);
}

.project-progress-empty p,
.overdue-empty p {
  max-width: 260px;
  margin: 0;
  font-size: 0.78rem;
}

.project-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-4);
}

.project-progress-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  font-weight: 750;
}

.project-progress-title::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--project-color, var(--color-primary));
  content: "";
}

.project-progress-value {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.project-progress-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-surface-soft);
}

.project-progress-fill {
  display: block;
  width: var(--completion, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--project-color, var(--color-primary));
  transition: width 240ms ease-out;
}

.overdue-list {
  display: grid;
  max-height: 290px;
  overflow-y: auto;
}

.overdue-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 66px;
  padding: var(--space-2) 0;
  border: 0;
  border-top: 1px solid var(--color-border);
  background: transparent;
  text-align: left;
  transition: background 180ms ease-out;
}

.overdue-item:first-child {
  border-top: 0;
}

.overdue-item:hover {
  background: var(--color-danger-soft);
}

.overdue-date {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--color-danger-soft);
  color: var(--color-danger);
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.overdue-date strong {
  display: block;
  font-size: 0.8rem;
}

.overdue-copy {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}

.overdue-copy strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overdue-copy small {
  margin-top: 0.2rem;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overdue-item > svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

.modal {
  width: min(680px, calc(100% - 32px));
  max-height: min(90dvh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-modal);
}

.modal-small {
  width: min(500px, calc(100% - 32px));
}

.modal[open] {
  animation: modal-in 200ms ease-out;
}

.modal::backdrop {
  background: var(--color-overlay);
  backdrop-filter: blur(4px);
}

.modal form {
  display: flex;
  max-height: min(90dvh, 900px);
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-6);
  overflow-y: auto;
}

.field {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--color-text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
}

.field label span {
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 0.86rem;
  line-height: 1.5;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

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

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--color-text-muted);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  outline: none;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px var(--color-danger-soft);
}

.field-error {
  min-height: 0;
  color: var(--color-danger);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.4;
}

.field-error:empty {
  display: none;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.footer-spacer {
  flex: 1;
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
}

.color-input-wrap input {
  width: 44px;
  min-height: 40px;
  padding: 3px;
  cursor: pointer;
}

.color-input-wrap span {
  color: var(--color-text-secondary);
  font-size: 0.74rem;
  line-height: 1.45;
}

.toast-region {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 80;
  display: grid;
  width: min(360px, calc(100% - 32px));
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: var(--color-white);
  box-shadow: var(--shadow-modal);
  font-size: 0.8rem;
  font-weight: 700;
  animation: toast-in 200ms ease-out;
}

.toast.is-error {
  border-color: var(--color-danger);
  background: var(--color-danger);
}

.toast svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .header-inner {
    gap: var(--space-3);
  }

  .project-create-button span {
    display: none;
  }

  .project-create-button {
    width: 44px;
    padding: 0;
  }

  .filter-bar {
    grid-template-columns: auto repeat(2, minmax(150px, 1fr)) minmax(190px, 1.2fr) auto;
  }

  .filter-heading small {
    display: none;
  }
}

@media (max-width: 900px) {
  .workspace-intro {
    align-items: flex-start;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-heading {
    grid-column: 1 / -1;
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--color-border);
  }

  .filter-heading small {
    display: initial;
  }

  .search-control {
    grid-column: 1 / -1;
  }

  .filter-bar .text-button {
    justify-self: end;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .board-column {
    min-height: auto;
  }

  .column-body {
    min-height: 140px;
  }

  .column-empty {
    min-height: 120px;
  }

  .dashboard-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .header-inner {
    min-height: 68px;
    padding: 0 var(--space-4);
  }

  .brand-copy small {
    display: none;
  }

  .nav-item {
    padding: 0 var(--space-3);
  }

  .main-shell {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }

  .workspace-intro {
    padding: var(--space-8) 0 var(--space-6);
  }

  .work-pulse {
    min-width: 0;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 112px;
  }

  .status-count-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .workspace-intro {
    flex-direction: column;
    gap: var(--space-5);
  }

  .work-pulse {
    width: 100%;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-heading,
  .search-control {
    grid-column: auto;
  }

  .filter-bar .text-button {
    justify-self: start;
  }

  .board-meta {
    min-height: 52px;
  }

  .drag-hint {
    display: none;
  }

  .status-count-grid {
    grid-template-columns: 1fr;
  }

  .status-count {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: 72px;
  }

  .status-marker {
    margin-bottom: 0;
  }

  .status-count strong {
    font-size: 1.7rem;
  }

  .completion-content {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .modal {
    width: 100%;
    max-height: 94dvh;
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .modal form {
    max-height: 94dvh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .field-full {
    grid-column: auto;
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .delete-task-button {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .header-inner {
    gap: var(--space-2);
  }

  .brand-copy {
    display: none;
  }

  .view-nav {
    margin: 0;
  }

  .nav-item {
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .nav-item span,
  .header-actions .button span {
    display: none;
  }

  .header-actions .button {
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

  h1 {
    font-size: 2.45rem;
  }

  .panel {
    padding: var(--space-4);
  }

  .overdue-item {
    grid-template-columns: 34px minmax(0, 1fr) 24px;
  }

  .overdue-date {
    width: 34px;
    height: 34px;
  }

  .toast-region {
    right: var(--space-4);
    bottom: var(--space-4);
    left: var(--space-4);
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
