.tarefas-stats {
  margin-bottom: 20px;
}

.tarefas-lista {
  display: grid;
  gap: 10px;
}

.tarefas-week-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tarefas-week-days {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 18px;
}

.tarefas-day-tab {
  background: #fff !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  display: grid !important;
  gap: 2px;
  min-width: 0 !important;
  padding: 10px 8px !important;
}

.tarefas-day-tab span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tarefas-day-tab strong {
  font-size: 16px;
}

.tarefas-day-tab em {
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.tarefas-day-tab.active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(25, 115, 94, 0.12);
}

.tarefas-day-tab.is-today {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
}

.tarefas-day-tab.is-today span,
.tarefas-day-tab.is-today strong {
  color: var(--accent-strong) !important;
}

.tarefas-empty-day {
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 34px 16px;
  text-align: center;
}

.tarefas-empty-day i {
  color: var(--muted);
  font-size: 32px;
}

.tarefas-empty-day h2 {
  font-size: 18px;
  margin: 0;
}

.tarefa-item {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px;
}

.tarefa-icon-display {
  grid-column: 1;
  grid-row: 1;
}

.tarefa-conteudo {
  grid-column: 2;
  grid-row: 1;
}

.tarefa-check-form {
  grid-column: 3;
  grid-row: 1;
}

.tarefa-item.is-done {
  background: #f8fafc;
}

.tarefa-item.is-late {
  border-color: #fecaca;
}

.tarefa-check-form {
  display: block;
}

.tarefa-check {
  background: transparent !important;
  border: 0 !important;
  color: var(--accent) !important;
  font-size: 22px !important;
  min-height: auto !important;
  padding: 1px !important;
}

.tarefa-conteudo {
  min-width: 0;
}

.tarefa-topo {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.tarefa-topo h2 {
  font-size: 18px;
  margin: 0;
}

.is-done .tarefa-topo h2 {
  color: var(--muted);
  text-decoration: line-through;
}

.tarefa-badges,
.tarefa-meta,
.tarefa-tags {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tarefa-badges {
  justify-content: flex-end;
}

.tarefa-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.tarefa-descricao {
  margin: 8px 0 0;
}

.tarefa-tags {
  margin-top: 8px;
}

.tarefa-tags span {
  background: color-mix(in srgb, var(--tag-color) 13%, white);
  border: 1px solid color-mix(in srgb, var(--tag-color) 28%, white);
  border-radius: 999px;
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.tarefa-prioridade,
.tarefa-badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.tarefa-badge {
  background: #eef2ff;
  color: #3730a3;
}

.prioridade-baixa {
  background: #e2e8f0;
  color: #475569;
}

.prioridade-normal {
  background: #dcfce7;
  color: #166534;
}

.prioridade-alta {
  background: #fef3c7;
  color: #92400e;
}

.prioridade-urgente {
  background: #fee2e2;
  color: #991b1b;
}

.tarefa-acoes {
  align-items: center;
  display: none;
  grid-column: 1;
  grid-row: 1;
  justify-content: center;
  z-index: 2;
}

.tarefa-item.show-actions .tarefa-acoes {
  display: flex;
}

.tarefa-item.show-actions .tarefa-icon-display {
  opacity: 0;
  pointer-events: none;
}

.tarefa-item.show-actions .tarefa-acoes .icon-link {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  height: 56px;
  width: 56px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tarefa-item.show-actions .tarefa-acoes .icon-link i {
  line-height: 0;
  display: block;
}

.icon-link {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  text-decoration: none;
  width: 34px;
}

.danger-button {
  background: #fee2e2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

.tarefas-form legend {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  padding: 0 6px;
}

.tarefa-schedule-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-width: 660px;
}

.tarefa-date-control,
.tarefa-time-control,
.tarefa-reminder-control {
  display: grid;
  gap: 8px;
}

.tarefa-reminder-control {
  max-width: 320px;
}

.tarefa-control-label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.tarefa-picker-button {
  background: #fff !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  gap: 8px;
  justify-content: flex-start !important;
}

.tarefa-picker-button:hover {
  background: #f8fafc !important;
  border-color: rgba(25, 115, 94, 0.45) !important;
  color: var(--ink) !important;
}

.tarefa-picker-input {
  display: none;
}

.tarefa-picker-input.is-editing {
  display: block;
}

.tarefa-recurrence-fieldset {
  background: #f8fafc;
}

.tarefas-tags-admin {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.tarefas-tag-admin-item {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-top: 10px;
}

.tarefas-tag-admin-item .inline {
  flex: 1;
}

.tarefas-tag-admin-item input[name="nome"] {
  max-width: 260px;
}

.tarefa-tag-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.tarefa-tag-chips-row:empty {
  display: none;
}

.tarefa-tag-chip-selected {
  align-items: center;
  background: color-mix(in srgb, var(--tag-color) 13%, white);
  border: 1px solid color-mix(in srgb, var(--tag-color) 28%, white);
  border-radius: 999px;
  color: #1f2937;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
  padding: 3px 4px 3px 9px;
}

.tarefa-tag-chip-remove {
  align-items: center;
  background: transparent !important;
  border: none !important;
  border-radius: 999px !important;
  color: inherit !important;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  height: 18px !important;
  justify-content: center;
  line-height: 1;
  min-height: auto !important;
  opacity: 0.55;
  padding: 0 !important;
  width: 18px !important;
}

.tarefa-tag-chip-remove:hover {
  background: rgba(0,0,0,0.1) !important;
  opacity: 1;
}

.tarefa-tag-text-input {
  background: transparent;
  border: none;
  font-size: 14px;
  min-width: 120px;
  outline: none;
  padding: 0;
  width: 100%;
}

.tarefa-tag-chip-outline {
  background: transparent !important;
  border: 1px dashed color-mix(in srgb, var(--tag-color) 55%, var(--line)) !important;
  border-radius: 999px !important;
  color: color-mix(in srgb, var(--tag-color) 65%, var(--ink)) !important;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 700 !important;
  min-height: auto !important;
  padding: 3px 9px !important;
  transition: background 0.12s;
}

.tarefa-tag-chip-outline:hover {
  background: color-mix(in srgb, var(--tag-color) 10%, white) !important;
}

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

@media (max-width: 760px) {
  .tarefas-week-days {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .tarefas-day-tab {
    flex: 0 0 92px;
  }

  .tarefas-week-toolbar {
    justify-content: space-between;
  }
  .tarefas-week-toolbar .button.secondary span {
    display: none;
  }

  .tarefa-topo {
    display: grid;
  }

  .tarefa-badges {
    justify-content: flex-start;
  }

  .tarefas-header-container {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 4px 12px;
  }
  .tarefas-header-title {
    display: contents;
  }
  .tarefas-header-title h1 {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }
  .tarefas-header-title p {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 4px;
    margin-bottom: 0;
  }
  .tarefas-header-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .tarefas-header-actions .button.secondary {
    padding: 8px 12px;
  }
  .tarefas-header-actions .button.secondary .action-text {
    display: none;
  }
  .tarefas-header-actions .button.secondary .bi {
    margin-right: 0 !important;
  }

  /* Stats in a single line */
  .tarefas-stats {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
  }
  .tarefas-stats > a {
    flex: 1 1 0;
    min-width: 76px;
    padding: 12px 6px;
    text-align: center;
    font-size: 12px;
  }
  .tarefas-stats strong {
    font-size: 22px;
  }

  .tarefas-header-actions .button:not(.secondary) {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 25;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    border-radius: 999px;
    padding: 12px 20px;
  }
}
