:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5b6778;
  --surface: #ffffff;
  --soft: #f5f7fb;
  --line: #d9e0ea;
  --brand: #0f766e;
  --brand-dark: #0b5f59;
  --todo: #2563eb;
  --doing: #b45309;
  --done: #15803d;
  --low: #0f766e;
  --medium: #b45309;
  --high: #b91c1c;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #edf2f7;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.site-header,
.site-footer {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 850;
  line-height: 1;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.08rem;
  font-weight: 800;
}

h3 {
  margin-bottom: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 18px;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.control-panel,
.board-area,
.panel-section,
.kanban-column,
.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.control-panel {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-section {
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 18px;
}

.panel-section:last-child {
  border-bottom: 0;
}

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

label {
  color: #344054;
  font-size: 0.83rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c9d3e2;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-actions,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 13px;
  font-weight: 800;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  border-color: #c9d3e2;
  background: #fff;
  color: #243447;
}

.secondary-button:hover {
  background: #f6f8fb;
}

.danger-button {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

.danger-button:hover {
  background: #fee2e2;
}

.hidden {
  display: none;
}

.error-message {
  min-height: 18px;
  margin: 0;
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.stats-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.stats-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.stats-grid dd {
  margin: 2px 0 0;
  font-size: 1.55rem;
  font-weight: 850;
}

.wide-stat {
  grid-column: 1 / -1;
}

.board-area {
  min-width: 0;
  padding: 18px;
  box-shadow: var(--shadow);
}

.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.board-heading h2,
.board-heading p {
  margin-bottom: 0;
}

.board-heading p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.kanban-column {
  display: flex;
  min-height: 500px;
  flex-direction: column;
  background: #f8fafc;
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
}

.kanban-column[data-status="perFer"] header {
  border-top: 4px solid var(--todo);
}

.kanban-column[data-status="enCurs"] header {
  border-top: 4px solid var(--doing);
}

.kanban-column[data-status="fet"] header {
  border-top: 4px solid var(--done);
}

.column-count {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #e8eef8;
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 850;
}

.task-list {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
}

.task-card {
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.task-card.priority-baixa {
  border-left: 6px solid var(--low);
}

.task-card.priority-mitjana {
  border-left: 6px solid var(--medium);
}

.task-card.priority-alta {
  border-left: 6px solid var(--high);
}

.task-card h4 {
  overflow-wrap: anywhere;
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 850;
}

.task-card p {
  overflow-wrap: anywhere;
  margin-bottom: 12px;
  color: #475467;
  font-size: 0.9rem;
  line-height: 1.45;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.tag {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.74rem;
  font-weight: 850;
}

.tag.baixa {
  background: #ccfbf1;
  color: #115e59;
}

.tag.mitjana {
  background: #fef3c7;
  color: #92400e;
}

.tag.alta {
  background: #fee2e2;
  color: #991b1b;
}

.due-date {
  background: #e0f2fe;
  color: #075985;
}

.card-status {
  margin-bottom: 10px;
}

.empty-state {
  border: 1px dashed #c4cedc;
  border-radius: 8px;
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.site-footer {
  padding: 22px 0 30px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .panel-section {
    border-width: 0 1px 0 0;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-panel,
  .kanban-board,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel-section {
    border-width: 0 0 1px;
  }

  .board-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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